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