View Javadoc
1   /*
2    * Copyright (c) 2002-2017, Mairie de 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.plugins.myapps.service;
35  
36  import fr.paris.lutece.plugins.myapps.business.MyApps;
37  import fr.paris.lutece.portal.service.security.LuteceUser;
38  
39  import java.util.List;
40  import java.util.Locale;
41  
42  
43  /**
44   *
45   * MyAppsResourceProvider
46   *
47   */
48  public interface MyAppsProvider
49  {
50      /**
51       * Get the plugin name
52       *
53       * @return the plugin name
54       */
55      String getPluginName(  );
56  
57      /**
58       * Get the name of the provider
59       *
60       * @return the name of the provider
61       */
62      String getProviderName(  );
63  
64      /**
65       * Get the name of the provider
66       *
67       * @param locale {@link Locale}
68       * @return the name of the provider
69       */
70      String getProviderName( Locale locale );
71  
72      /**
73       * Get the list of myapps that are enabled.
74       *
75       * @param strUserName the user name
76       * @param bIsAscSort true if it is sorted ascendly, false otherwise
77       * @return a list of {@link MyApps}
78       */
79      List<MyApps> getMyAppsListByUserName( String strUserName, boolean bIsAscSort );
80      /**
81       * Get the list of myapps that are enabled by category
82       *
83       * @param strCodeCategory the category
84       * @param bIsAscSort true if it is sorted ascendly, false otherwise
85       * @return a list of {@link MyApps}
86       */
87      List<MyApps> getMyAppsListByCategory( String strCodeCategory, boolean bIsAscSort );
88      /**
89       * Get the list of myapps that are enabled by user and category
90       *
91       * @param strUserName the user name
92       * @param strCodeCategory the category
93       * @param bIsAscSort true if it is sorted ascendly, false otherwise
94       * @return a list of {@link MyApps}
95       */
96      List<MyApps> getMyAppsListByUserNameAndCategory( String strUserName,String strCodeCategory, boolean bIsAscSort );
97      
98  
99      /**
100      * Get the resource image
101      *
102      * @param strMyAppsId the MyApps ID
103      * @return the resource image
104      */
105     String getResourceImage( String strMyAppsId );
106 
107     /**
108      * Get the label for the button ManageMyApps.
109      * <br />
110      * Return an <b>EMPTY STRING</b> if you do not want to have a button.
111      *
112      * @param locale {@link Locale}
113      * @return the label
114      */
115     String getLabelManageMyApps( Locale locale );
116 
117     /**
118      * Get the url for opening a myapps
119      *
120      * @param nMyAppId the myapp id
121      * @param user the current {@link LuteceUser}
122      * @return an url
123      */
124     String getUrlOpenMyApps( int nMyAppId, LuteceUser user );
125 }