View Javadoc
1   /*
2    * Copyright (c) 2002-2022, City of Paris
3    * All rights reserved.
4    *
5    * Redistribution and use in source and binary forms, with or without
6    * modification, are permitted provided that the following conditions
7    * are met:
8    *
9    *  1. Redistributions of source code must retain the above copyright notice
10   *     and the following disclaimer.
11   *
12   *  2. Redistributions in binary form must reproduce the above copyright notice
13   *     and the following disclaimer in the documentation and/or other materials
14   *     provided with the distribution.
15   *
16   *  3. Neither the name of 'Mairie de Paris' nor 'Lutece' nor the names of its
17   *     contributors may be used to endorse or promote products derived from
18   *     this software without specific prior written permission.
19   *
20   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23   * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
24   * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25   * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26   * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27   * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28   * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30   * POSSIBILITY OF SUCH DAMAGE.
31   *
32   * License 1.0
33   */
34  package fr.paris.lutece.portal.service.plugin;
35  
36  import java.io.FileInputStream;
37  import java.io.IOException;
38  import java.io.InputStream;
39  import java.util.ArrayList;
40  import java.util.Collections;
41  import java.util.HashMap;
42  import java.util.List;
43  import java.util.Map;
44  
45  import javax.validation.constraints.NotNull;
46  
47  import org.apache.commons.digester3.Digester;
48  import org.apache.commons.digester3.Substitutor;
49  import org.apache.commons.digester3.binder.DigesterLoader;
50  import org.apache.commons.digester3.substitution.MultiVariableExpander;
51  import org.apache.commons.digester3.substitution.VariableSubstitutor;
52  import org.apache.commons.digester3.xmlrules.FromXmlRulesModule;
53  import org.xml.sax.SAXException;
54  
55  import fr.paris.lutece.portal.business.portlet.PortletType;
56  import fr.paris.lutece.portal.business.right.Right;
57  import fr.paris.lutece.portal.service.content.ContentServiceEntry;
58  import fr.paris.lutece.portal.service.daemon.DaemonEntry;
59  import fr.paris.lutece.portal.service.dashboard.DashboardComponentEntry;
60  import fr.paris.lutece.portal.service.filter.FilterEntry;
61  import fr.paris.lutece.portal.service.includes.PageIncludeEntry;
62  import fr.paris.lutece.portal.service.init.LuteceInitException;
63  import fr.paris.lutece.portal.service.insert.InsertService;
64  import fr.paris.lutece.portal.service.rbac.RBACResourceTypeEntry;
65  import fr.paris.lutece.portal.service.search.SearchIndexerEntry;
66  import fr.paris.lutece.portal.service.servlet.ServletEntry;
67  import fr.paris.lutece.portal.service.sessionlistener.HttpSessionListenerEntry;
68  import fr.paris.lutece.portal.service.util.AppPropertiesService;
69  import fr.paris.lutece.portal.web.xpages.XPageApplicationEntry;
70  
71  /**
72   * This class is the plugin file element
73   */
74  public class PluginFile
75  {
76      private static final String FILE_RULES = "/fr/paris/lutece/portal/service/plugin/plugin-digester-rules.xml";
77  
78      // Variables
79      private String _strName;
80      private String _strVersion;
81      private String _strDescription;
82      private String _strProvider;
83      private String _strProviderUrl;
84      private String _strCopyright;
85      private String _strPluginClass;
86      private String _strIconUrl;
87      private String _strDocumentationUrl;
88      private String _strMinCoreVersion;
89      private String _strMaxCoreVersion;
90      private boolean _bIsInstalled;
91      private boolean _bDbPoolRequired;
92      private Map<Integer, List<String>> _listCssStyleSheets = new HashMap<>( );
93      private Map<Integer, List<String>> _listJavascriptFiles = new HashMap<>( );
94      private List<String> _listAdminCssStyleSheets = new ArrayList<>( );
95      private List<String> _listAdminJavascriptFiles = new ArrayList<>( );
96      private List<String> _listFreemarkerMacrosFiles = new ArrayList<>( );
97      private List<Right> _listRights = new ArrayList<>( );
98      private List<PortletType> _listPortletTypes = new ArrayList<>( );
99      private List<DaemonEntry> _listDaemons = new ArrayList<>( );
100     private List<XPageApplicationEntry> _listApplications = new ArrayList<>( );
101     private List<FilterEntry> _listFilters = new ArrayList<>( );
102     private List<ServletEntry> _listServlets = new ArrayList<>( );
103     private List<HttpSessionListenerEntry> _listListeners = new ArrayList<>( );
104     private List<ContentServiceEntry> _listContentServices = new ArrayList<>( );
105     private List<SearchIndexerEntry> _listSearchIndexers = new ArrayList<>( );
106     private List<InsertService> _listInsertServices = new ArrayList<>( );
107     private List<RBACResourceTypeEntry> _listRBACResourceTypes = new ArrayList<>( );
108     private List<PageIncludeEntry> _listPageIncludes = new ArrayList<>( );
109     private List<DashboardComponentEntry> _listDashboardComponents = new ArrayList<>( );
110     private List<DashboardComponentEntry> _listAdminDashboardComponents = new ArrayList<>( );
111     private Map<String, String> _mapParams = new HashMap<>( );
112     private String _strSearchIndexerClass;
113     private String _strCssStylesheetsScope;
114     private String _strJavascriptFilesScope;
115 
116     /**
117      * Load plugin data from the XML file using Jakarta Commons Digester
118      * 
119      * @param strFilename
120      *            The XML plugin filename
121      * @throws fr.paris.lutece.portal.service.init.LuteceInitException
122      *             If a problem occured during the loading
123      */
124     public void load( String strFilename ) throws LuteceInitException
125     {
126         // Configure Digester from XML ruleset
127         DigesterLoader digesterLoader = DigesterLoader.newLoader( new FromXmlRulesModule( )
128         {
129             @Override
130             protected void loadRules( )
131             {
132                 loadXMLRules( getClass( ).getResource( FILE_RULES ) );
133             }
134         } );
135 
136         Digester digester = digesterLoader.newDigester( );
137 
138         // Allow variables in plugin files
139         MultiVariableExpander expander = new MultiVariableExpander( );
140         expander.addSource( "$", ( (Map) AppPropertiesService.getPropertiesAsMap( ) ) );
141 
142         Substitutor substitutor = new VariableSubstitutor( expander );
143         digester.setSubstitutor( substitutor );
144 
145         // Push empty List onto Digester's Stack
146         digester.push( this );
147         digester.setValidating( false );
148 
149         try
150         {
151             InputStream input = new FileInputStream( strFilename );
152             digester.parse( input );
153         }
154         catch( IOException | IllegalArgumentException | SAXException e )
155         {
156             throw new LuteceInitException( "Error loading plugin file : " + strFilename, e );
157         }
158     }
159 
160     /**
161      * Returns the name of the plugin
162      *
163      * @return the plugin name as a String
164      */
165     public String getName( )
166     {
167         return _strName;
168     }
169 
170     /**
171      * Sets the name of the plugin to the specified string.
172      *
173      * @param strName
174      *            The name of the plugin
175      */
176     public void setName( String strName )
177     {
178         _strName = strName;
179     }
180 
181     /**
182      * Returns the version of the plugin
183      *
184      * @return the plugin version as a String
185      */
186     public String getVersion( )
187     {
188         return _strVersion;
189     }
190 
191     /**
192      * Sets the version of the plugin to the specified string.
193      *
194      * @param strVersion
195      *            The version of the plugin
196      */
197     public void setVersion( String strVersion )
198     {
199         _strVersion = strVersion;
200     }
201 
202     /**
203      * Returns the description of the plugin
204      *
205      * @return the plugin description as a String
206      */
207     public String getDescription( )
208     {
209         return _strDescription;
210     }
211 
212     /**
213      * Sets the description of the plugin to the specified string.
214      *
215      * @param strDescription
216      *            The description
217      */
218     public void setDescription( String strDescription )
219     {
220         _strDescription = strDescription;
221     }
222 
223     /**
224      * Returns the Provider of the plugin
225      *
226      * @return the plugin Provider as a String
227      */
228     public String getProvider( )
229     {
230         return _strProvider;
231     }
232 
233     /**
234      * Sets the provider of the plugin to the specified string.
235      *
236      * @param strProvider
237      *            The provider
238      */
239     public void setProvider( String strProvider )
240     {
241         _strProvider = strProvider;
242     }
243 
244     /**
245      * Returns the Provider's URL of the plugin
246      *
247      * @return the plugin Provider's URL as a String
248      */
249     public String getProviderUrl( )
250     {
251         return _strProviderUrl;
252     }
253 
254     /**
255      * Sets the provider url to the specified string.
256      *
257      * @param strProviderUrl
258      *            The url of the provider
259      */
260     public void setProviderUrl( String strProviderUrl )
261     {
262         _strProviderUrl = strProviderUrl;
263     }
264 
265     /**
266      * Returns the Icon's URL of the plugin
267      *
268      * @return the plugin Icon's URL as a String
269      */
270     public String getIconUrl( )
271     {
272         return _strIconUrl;
273     }
274 
275     /**
276      * Sets the url of the icon of the plugin to the specified string.
277      *
278      * @param strIconUrl
279      *            The url of the icon
280      */
281     public void setIconUrl( String strIconUrl )
282     {
283         _strIconUrl = strIconUrl;
284     }
285 
286     /**
287      * Returns the Documentation's URL of the plugin
288      *
289      * @return the plugin Documentation's URL as a String
290      */
291     public String getDocumentationUrl( )
292     {
293         return _strDocumentationUrl;
294     }
295 
296     /**
297      * Sets the url of the Documentation of the plugin to the specified string.
298      *
299      * @param strDocumentationUrl
300      *            the url of the documentation
301      */
302     public void setDocumentationUrl( String strDocumentationUrl )
303     {
304         _strDocumentationUrl = strDocumentationUrl;
305     }
306 
307     /**
308      * Returns the Copyright of the plugin
309      *
310      * @return the plugin Copyright as a String
311      */
312     public String getCopyright( )
313     {
314         return _strCopyright;
315     }
316 
317     /**
318      * Sets the copyright of the plugin to the specified string.
319      *
320      * @param strCopyright
321      *            The copyright
322      */
323     public void setCopyright( String strCopyright )
324     {
325         _strCopyright = strCopyright;
326     }
327 
328     /**
329      * Returns the main Class of the plugin
330      *
331      * @return the Class as a String
332      */
333     public String getPluginClass( )
334     {
335         return _strPluginClass;
336     }
337 
338     /**
339      * Sets the class name of the plugin to the specified string.
340      *
341      * @param strPluginClass
342      *            The name of the class
343      */
344     public void setPluginClass( String strPluginClass )
345     {
346         _strPluginClass = strPluginClass;
347     }
348 
349     /**
350      * Returns the installation status of the plugin
351      *
352      * @return the installation status as an int
353      */
354     public boolean isInstalled( )
355     {
356         return _bIsInstalled;
357     }
358 
359     /**
360      * Sets the boolean wich shows if the plugin is installed
361      *
362      * @param bIsInstalled
363      *            The installed boolean
364      */
365     public void setIsInstalled( boolean bIsInstalled )
366     {
367         _bIsInstalled = bIsInstalled;
368     }
369 
370     /**
371      * Returns the min core version compatibility for the plugin
372      *
373      * @return the min core version as a String
374      */
375     public String getMinCoreVersion( )
376     {
377         return _strMinCoreVersion;
378     }
379 
380     /**
381      * Sets the the min core version compatibility for the plugin
382      *
383      * @param strMinCoreVersion
384      *            The min core version
385      */
386     public void setMinCoreVersion( String strMinCoreVersion )
387     {
388         _strMinCoreVersion = strMinCoreVersion;
389     }
390 
391     /**
392      * Returns the max core version compatibility for the plugin
393      *
394      * @return the max core version as a String
395      */
396     public String getMaxCoreVersion( )
397     {
398         return _strMaxCoreVersion;
399     }
400 
401     /**
402      * Sets the the max core version compatibility for the plugin
403      *
404      * @param strMaxCoreVersion
405      *            The max core version
406      */
407     public void setMaxCoreVersion( String strMaxCoreVersion )
408     {
409         _strMaxCoreVersion = strMaxCoreVersion;
410     }
411 
412     /**
413      * convert a mode as a string into an integer
414      * 
415      * @param mode
416      *            the mode to convert
417      * @return the mode as an {@link java.lang.Integer} or <code>null</code> if mode is <code>null</code>
418      */
419     private Integer getMode( String mode )
420     {
421         Integer nMode = null;
422 
423         if ( mode != null )
424         {
425             nMode = Integer.valueOf( mode );
426         }
427 
428         return nMode;
429     }
430 
431     /**
432      * Add an CSS stylesheet to the plugin definition with no mode associated
433      * 
434      * @param strStyleSheet
435      *            The StyleSheet path
436      */
437     public void addCssStyleSheet( String strStyleSheet )
438     {
439         addCssStyleSheet( strStyleSheet, null );
440     }
441 
442     /**
443      * Add an CSS stylesheet to the plugin definition
444      * 
445      * @param strStyleSheet
446      *            The StyleSheet path
447      * @param mode
448      *            mode associated with the stylesheet. Can be <code>null</code>, must be an integer
449      */
450     public void addCssStyleSheet( String strStyleSheet, String mode )
451     {
452         Integer nMode = getMode( mode );
453         List<String> cssStyleSheets = _listCssStyleSheets.computeIfAbsent( nMode, s -> new ArrayList<>( ) );
454         cssStyleSheets.add( strStyleSheet );
455     }
456 
457     /**
458      * Add an CSS stylesheet to the plugin
459      * 
460      * @param strStyleSheet
461      *            The StyleSheet path
462      * @since 5.1
463      */
464     public void addAdminCssStyleSheet( String strStyleSheet )
465     {
466         _listAdminCssStyleSheets.add( strStyleSheet );
467     }
468 
469     /**
470      * Add an Javascript File to the plugin
471      * 
472      * @param strJavascriptFile
473      *            The Javascript File path
474      * @since 5.1
475      */
476     public void addAdminJavascriptFile( String strJavascriptFile )
477     {
478         _listAdminJavascriptFiles.add( strJavascriptFile );
479     }
480 
481     /**
482      * Returns all CSS Style Sheets of the plugin not associated with a mode
483      * 
484      * @return The list of CSS Style Sheets not associated with a mode
485      */
486     @NotNull
487     public List<String> getCssStyleSheets( )
488     {
489         List<String> res = _listCssStyleSheets.get( null );
490 
491         if ( res == null )
492         {
493             return Collections.emptyList( );
494         }
495 
496         return res;
497     }
498 
499     /**
500      * Return all CSS Style Sheets of the plugin for all modes
501      * 
502      * @return the list of CSS style Sheets for all modes
503      * @since 5.1.0
504      */
505     @NotNull
506     public Map<Integer, List<String>> getCssStyleSheetsForAllModes( )
507     {
508         return _listCssStyleSheets;
509     }
510 
511     /**
512      * Add an Javascript File to the plugin definition with no mode associated
513      * 
514      * @param strJavascriptFile
515      *            The Javascript File path
516      */
517     public void addJavascriptFile( String strJavascriptFile )
518     {
519         addJavascriptFile( strJavascriptFile, null );
520     }
521 
522     /**
523      * Add an Javascript File to the plugin definition
524      * 
525      * @param strJavascriptFile
526      *            The Javascript File path
527      * @param mode
528      *            mode associated with the Javascript file. Can be <code>null</code>, must be an integer
529      */
530     public void addJavascriptFile( String strJavascriptFile, String mode )
531     {
532         Integer nMode = getMode( mode );
533         List<String> javascriptFiles = _listJavascriptFiles.computeIfAbsent( nMode, s -> new ArrayList<>( ) );
534         javascriptFiles.add( strJavascriptFile );
535     }
536 
537     /**
538      * Returns all Javascript File of the plugin not associated with a mode
539      * 
540      * @return The list of Javascript File not associated with a mode
541      */
542     @NotNull
543     public List<String> getJavascriptFiles( )
544     {
545         List<String> res = _listJavascriptFiles.get( null );
546 
547         if ( res == null )
548         {
549             return Collections.emptyList( );
550         }
551 
552         return res;
553     }
554 
555     /**
556      * Return all CSS Style Sheets of the plugin for all modes
557      * 
558      * @return the list of CSS style Sheets for all modes
559      * @since 5.1.0
560      */
561     @NotNull
562     public Map<Integer, List<String>> getJavascriptFilesForAllModes( )
563     {
564         return _listJavascriptFiles;
565     }
566 
567     /**
568      * Adds the file to freemarker autoinclude configuration
569      * 
570      * @param strFileName
571      *            the file
572      */
573     public void addFreemarkerMacrosFile( String strFileName )
574     {
575         _listFreemarkerMacrosFiles.add( strFileName );
576     }
577 
578     /**
579      * Gets the freemarker macros files.
580      *
581      * @return the freemarker macros files
582      */
583     public List<String> getFreemarkerMacrosFiles( )
584     {
585         return _listFreemarkerMacrosFiles;
586     }
587 
588     /**
589      * Add an AdminFeature Right to the plugin definition
590      * 
591      * @param right
592      *            The Right to Add
593      */
594     public void addRight( Right right )
595     {
596         _listRights.add( right );
597     }
598 
599     /**
600      * Returns right list of the plugin
601      *
602      * @return the list of rights
603      */
604     public List<Right> getRights( )
605     {
606         // Initialize plugin name attribute of all rights (not made by digester)
607         for ( Right right : _listRights )
608         {
609             right.setPluginName( _strName );
610         }
611 
612         return _listRights;
613     }
614 
615     /**
616      * Add an Application to the plugin definition
617      * 
618      * @param application
619      *            The application to Add
620      */
621     public void addXPageApplication( XPageApplicationEntry application )
622     {
623         _listApplications.add( application );
624     }
625 
626     /**
627      * Returns application list of the plugin
628      *
629      * @return the list of applications
630      */
631     public List<XPageApplicationEntry> getXPageApplications( )
632     {
633         return _listApplications;
634     }
635 
636     /**
637      * Add a filter to the plugin definition
638      * 
639      * @param entry
640      *            The filter entry
641      */
642     public void addFilter( FilterEntry entry )
643     {
644         _listFilters.add( entry );
645     }
646 
647     /**
648      * Returns filter list of the plugin
649      *
650      * @return the list of filters
651      */
652     public List<FilterEntry> getFilters( )
653     {
654         return _listFilters;
655     }
656 
657     /**
658      * Add a servlet to the plugin definition
659      * 
660      * @param entry
661      *            The servlet entry
662      */
663     public void addServlet( ServletEntry entry )
664     {
665         _listServlets.add( entry );
666     }
667 
668     /**
669      * Returns servlet list of the plugin
670      *
671      * @return the list of servlets
672      */
673     public List<ServletEntry> getServlets( )
674     {
675         return _listServlets;
676     }
677 
678     /**
679      * Add a listener to the plugin definition
680      * 
681      * @param entry
682      *            The listener entry
683      */
684     public void addListener( HttpSessionListenerEntry entry )
685     {
686         _listListeners.add( entry );
687     }
688 
689     /**
690      * Returns listener list of the plugin
691      * 
692      * @return the list of listeners
693      */
694     public List<HttpSessionListenerEntry> getListeners( )
695     {
696         return _listListeners;
697     }
698 
699     /**
700      * Add a portlet type to the plugin definition
701      * 
702      * @param portletType
703      *            a portlet type to the plugin definition
704      */
705     public void addPortletType( PortletType portletType )
706     {
707         _listPortletTypes.add( portletType );
708     }
709 
710     /**
711      * Returns the portlet types list of the plugin
712      * 
713      * @return the portlet types list
714      */
715     public List<PortletType> getPortletTypes( )
716     {
717         // Initialize plugin name attribute of all rights (not made by digester)
718         for ( PortletType portletType : _listPortletTypes )
719         {
720             portletType.setPluginName( _strName );
721         }
722 
723         return _listPortletTypes;
724     }
725 
726     /**
727      * Add an Content Service to the plugin definition
728      * 
729      * @param entry
730      *            The entry
731      */
732     public void addContentService( ContentServiceEntry entry )
733     {
734         _listContentServices.add( entry );
735     }
736 
737     /**
738      * Returns all Content Services of the plugin
739      * 
740      * @return The list of Content Services
741      */
742     public List<ContentServiceEntry> getContentServices( )
743     {
744         return _listContentServices;
745     }
746 
747     /**
748      * Add an Insert Service to the plugin definition
749      * 
750      * @param is
751      *            The Insert Service
752      */
753     public void addInsertService( InsertService is )
754     {
755         _listInsertServices.add( is );
756     }
757 
758     /**
759      * Returns all Insert Services of the plugin
760      * 
761      * @return The list of Insert Services
762      */
763     public List<InsertService> getInsertServices( )
764     {
765         return _listInsertServices;
766     }
767 
768     /**
769      * Add a SearchIndexer to the plugin definition
770      * 
771      * @param entry
772      *            The Search Indexer Entry
773      */
774     public void addSearchIndexer( SearchIndexerEntry entry )
775     {
776         _listSearchIndexers.add( entry );
777     }
778 
779     /**
780      * Returns all Search Indexer of the plugin
781      * 
782      * @return The list of Search Indexers
783      */
784     public List<SearchIndexerEntry> getSearchIndexers( )
785     {
786         return _listSearchIndexers;
787     }
788 
789     /**
790      * Add an Page Include to the plugin definition
791      * 
792      * @param entry
793      *            The Page Include Entry
794      */
795     public void addPageInclude( PageIncludeEntry entry )
796     {
797         _listPageIncludes.add( entry );
798     }
799 
800     /**
801      * Returns all Page Include Services of the plugin
802      * 
803      * @return The list of Page Include Services
804      */
805     public List<PageIncludeEntry> getPageIncludes( )
806     {
807         return _listPageIncludes;
808     }
809 
810     /**
811      * Add an Dashboard Component to the plugin definition
812      * 
813      * @param entry
814      *            The Dashboard Component Entry
815      */
816     public void addDashboardComponent( DashboardComponentEntry entry )
817     {
818         _listDashboardComponents.add( entry );
819     }
820 
821     /**
822      * Returns all Dashboard Component Services of the plugin
823      * 
824      * @return The list of Dashboard Component Services
825      */
826     public List<DashboardComponentEntry> getDashboardComponents( )
827     {
828         return _listDashboardComponents;
829     }
830 
831     /**
832      * Add a {@link DashboardComponentEntry} to the plugin definition
833      * 
834      * @param dashboardComponent
835      *            the admin dashboard component
836      */
837     public void addAdminDashboardComponent( DashboardComponentEntry dashboardComponent )
838     {
839         _listAdminDashboardComponents.add( dashboardComponent );
840     }
841 
842     /**
843      * Returns all admin dashbaord compopents of the plugin
844      * 
845      * @return the list of admin dashbaord components
846      */
847     public List<DashboardComponentEntry> getAdminDashboardComponents( )
848     {
849         return _listAdminDashboardComponents;
850     }
851 
852     /**
853      * Add an RBAC Resource Type to the plugin definition
854      * 
855      * @param entry
856      *            The RBACResourceType
857      */
858     public void addRBACResourceType( RBACResourceTypeEntry entry )
859     {
860         _listRBACResourceTypes.add( entry );
861     }
862 
863     /**
864      * Returns all RBAC Resource Types of the plugin
865      * 
866      * @return The list of RBACResourceType
867      */
868     public List<RBACResourceTypeEntry> getRBACResourceTypes( )
869     {
870         return _listRBACResourceTypes;
871     }
872 
873     /**
874      * Add a Daemon to the plugin definition
875      * 
876      * @param daemonEntry
877      *            The daemon entry to add
878      */
879     public void addDaemon( DaemonEntry daemonEntry )
880     {
881         _listDaemons.add( daemonEntry );
882     }
883 
884     /**
885      * Returns all Daemons of the plugin
886      * 
887      * @return The list of Daemons
888      */
889     public List<DaemonEntry> getDaemons( )
890     {
891         return _listDaemons;
892     }
893 
894     /**
895      * Returns if the plugin needs a database connection pool
896      *
897      * @return <b>true</b> if the plugin needs a database connection pool, otherwise <b>false</b>
898      */
899     public boolean isDbPoolRequired( )
900     {
901         return _bDbPoolRequired;
902     }
903 
904     /**
905      * Sets the boolean which shows if a pool is required for the plugin
906      *
907      * @param bDbPoolRequired
908      *            The required boolean
909      */
910     public void setIsDbPoolRequired( boolean bDbPoolRequired )
911     {
912         _bDbPoolRequired = bDbPoolRequired;
913     }
914 
915     /**
916      * Gets plugin parameters defined in the XML file
917      * 
918      * @return The hashtable of the parameters
919      */
920     public Map<String, String> getParams( )
921     {
922         return _mapParams;
923     }
924 
925     /**
926      * Add a parameter to the plugin definition
927      * 
928      * @param strName
929      *            The parameter name
930      * @param strValue
931      *            The parameter value
932      */
933     public void addParameter( String strName, String strValue )
934     {
935         _mapParams.put( strName, strValue );
936     }
937 
938     /**
939      * Returns the SearchIndexer Class of the plugin
940      *
941      * @return the Class as a String
942      * @since 2.0.0
943      */
944     public String getSearchIndexerClass( )
945     {
946         return _strSearchIndexerClass;
947     }
948 
949     /**
950      * Sets the class service of plugin
951      * 
952      * @since 2.0.0
953      * @param strSearchIndexerClass
954      *            The Class name
955      */
956     public void setSearchIndexerClass( String strSearchIndexerClass )
957     {
958         _strSearchIndexerClass = strSearchIndexerClass;
959     }
960 
961     /**
962      * Returns the Css Stylesheet Scope
963      *
964      * @return the scope
965      * @since 3.0.0
966      */
967     public String getCssStylesheetsScope( )
968     {
969         return _strCssStylesheetsScope;
970     }
971 
972     /**
973      * Sets the css stylesheets scope
974      * 
975      * @since 3.0.0
976      * @param strCssStylesheetScope
977      *            The scope
978      */
979     public void setCssStylesheetsScope( String strCssStylesheetScope )
980     {
981         _strCssStylesheetsScope = strCssStylesheetScope;
982     }
983 
984     /**
985      * Returns the javascripts Scope
986      *
987      * @return the scope
988      * @since 3.0.0
989      */
990     public String getJavascriptFilesScope( )
991     {
992         return _strJavascriptFilesScope;
993     }
994 
995     /**
996      * Sets the javascripts scope
997      * 
998      * @since 3.0.0
999      * @param strJavascriptFilescope
1000      *            The scope
1001      */
1002     public void setJavascriptFilesScope( String strJavascriptFilescope )
1003     {
1004         _strJavascriptFilesScope = strJavascriptFilescope;
1005     }
1006 
1007     /**
1008      * Get the list of CSS stylesheets for the admin
1009      * 
1010      * @return list of CSS stylesheets for the admin
1011      * @since 5.1
1012      */
1013     public List<String> getAdminCssStyleSheets( )
1014     {
1015         return _listAdminCssStyleSheets;
1016     }
1017 
1018     /**
1019      * Get the list of Javascript Files for the admin
1020      * 
1021      * @return the list of Javascript Files for the admin
1022      * @since 5.1
1023      */
1024     public List<String> getAdminJavascriptFiles( )
1025     {
1026         return _listAdminJavascriptFiles;
1027     }
1028 }