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