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.directory.business;
35  
36  import javax.servlet.http.HttpServletRequest;
37  import javax.servlet.http.HttpSession;
38  
39  import fr.paris.lutece.util.ReferenceItem;
40  
41  /**
42   *
43   * MapProvider
44   *
45   */
46  public class MapProvider implements IMapProvider
47  {
48      private String _strKey;
49      private String _strDisplayedName;
50      private String _strHtmlCode;
51      private String _strFrontHtmlCode;
52      private String _strFrontListHtmlCode;
53      private String _strBackListHtmlCode;
54      private boolean _bMapListSupported;
55  
56      /**
57       * {@inheritDoc}
58       */
59      @Override
60      public String getKey( )
61      {
62          return _strKey;
63      }
64  
65      /**
66       * Sets the key
67       * 
68       * @param key
69       *            the key
70       */
71      public void setKey( String key )
72      {
73          this._strKey = key;
74      }
75  
76      /**
77       * {@inheritDoc}
78       */
79      @Override
80      public String getDisplayedName( )
81      {
82          return _strDisplayedName;
83      }
84  
85      /**
86       * Set the displayed name
87       * 
88       * @param displayedName
89       *            the displayed name
90       */
91      public void setDisplayedName( String displayedName )
92      {
93          this._strDisplayedName = displayedName;
94      }
95  
96      /**
97       * {@inheritDoc}
98       */
99      @Override
100     public String getHtmlCode( )
101     {
102         return _strHtmlCode;
103     }
104 
105     /**
106      * Sets the html code
107      * 
108      * @param htmlCode
109      *            the html code
110      */
111     public void setHtmlCode( String htmlCode )
112     {
113         this._strHtmlCode = htmlCode;
114     }
115 
116     /**
117      * {@inheritDoc}
118      */
119     @Override
120     public ReferenceItem toRefItem( )
121     {
122         ReferenceItem refItem = new ReferenceItem( );
123 
124         refItem.setCode( getKey( ) );
125         refItem.setName( getDisplayedName( ) );
126 
127         return refItem;
128     }
129 
130     /**
131      * {@inheritDoc}
132      */
133     @Override
134     public String getFrontHtmlCode( )
135     {
136         return _strFrontHtmlCode;
137     }
138 
139     /**
140      * {@inheritDoc}
141      */
142     @Override
143     public String getFrontListHtmlCode( )
144     {
145         return _strFrontListHtmlCode;
146     }
147 
148     /**
149      * Sets the front list html code
150      * 
151      * @param strFrontListHtmlCode
152      *            the front list template
153      */
154     public void setFrontListHtmlCode( String strFrontListHtmlCode )
155     {
156         _strFrontListHtmlCode = strFrontListHtmlCode;
157     }
158 
159     /**
160      * Sets the front html
161      * 
162      * @param strFrontHtmlCode
163      *            the front template
164      */
165     public void setFrontHtmlCode( String strFrontHtmlCode )
166     {
167         _strFrontHtmlCode = strFrontHtmlCode;
168     }
169 
170     /**
171      * Set back list html code
172      * 
173      * @param strBackListHtmlCode
174      *            the back list template
175      */
176     public void setBackListHtmlCode( String strBackListHtmlCode )
177     {
178         _strBackListHtmlCode = strBackListHtmlCode;
179     }
180 
181     /**
182      * {@inheritDoc}
183      */
184     @Override
185     public String getBackListHtmlCode( )
186     {
187         return _strBackListHtmlCode;
188     }
189 
190     /**
191      * {@inheritDoc}
192      */
193     @Override
194     public boolean isMapListSupported( )
195     {
196         return _bMapListSupported;
197     }
198 
199     /**
200      * Set to <code>true</code> if map list is supported, <code>false</code> otherwise
201      * 
202      * @param bMapListSupported
203      *            the new value
204      */
205     public void setMapListSupported( boolean bMapListSupported )
206     {
207         _bMapListSupported = bMapListSupported;
208     }
209 
210     @Override
211     public Object getParameter( int nKey )
212     {
213         // TODO Auto-generated method stub
214         return null;
215     }
216 }