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.xmlpage.service;
35  
36  import fr.paris.lutece.portal.service.resource.Resource;
37  
38  import org.apache.commons.lang.builder.ToStringBuilder;
39  
40  import java.util.Map;
41  
42  
43  /**
44   * This class represents one XML Page element managed by this plugin
45   */
46  public final class XmlPageElement implements Resource
47  {
48      private String _strName;
49      private String _strTitle;
50      private String _strXmlFileName;
51      private String _strXmlFilesDirectoryPath;
52      private String _strXslFilesDirectoryPath;
53      private String _strResourceFilesDirectoryPath;
54      private String _strDisplayLink;
55      private Map _listXslContent;
56      private Boolean _bIsValidationRequired;
57      private String _strXsdSchema;
58  
59      /**
60       * @return Returns the _bIsValidationRequired.
61       */
62      public Boolean getIsValidationRequired(  )
63      {
64          return _bIsValidationRequired;
65      }
66  
67      /**
68       * @param bIsValidationRequired The _bIsValidationRequired to set.
69       */
70      public void setIsValidationRequired( Boolean bIsValidationRequired )
71      {
72          _bIsValidationRequired = ( bIsValidationRequired == null ) ? Boolean.FALSE : bIsValidationRequired;
73      }
74  
75      /**
76       * @return Returns the _strName.
77       */
78      public String getName(  )
79      {
80          return _strName;
81      }
82  
83      /**
84       * @param strName The _strName to set.
85       */
86      public void setName( String strName )
87      {
88          _strName = strName;
89      }
90  
91      /**
92       * @return Returns the _strTitle.
93       */
94      public String getTitle(  )
95      {
96          return _strTitle;
97      }
98  
99      /**
100      * @param strTitle The _strTitle to set.
101      */
102     public void setTitle( String strTitle )
103     {
104         _strTitle = strTitle;
105     }
106 
107     /**
108      * @return Returns the _strXmlFileName.
109      */
110     public String getXmlFileName(  )
111     {
112         return _strXmlFileName;
113     }
114 
115     /**
116      * @param strXmlFileName The _strXmlFileName to set.
117      */
118     public void setXmlFileName( String strXmlFileName )
119     {
120         _strXmlFileName = strXmlFileName;
121     }
122 
123     /**
124      * @return Returns the _strXsdSchema.
125      */
126     public String getXsdSchema(  )
127     {
128         return _strXsdSchema;
129     }
130 
131     /**
132      * @param strXsdSchema The _strXsdSchema to set.
133      */
134     public void setXsdSchema( String strXsdSchema )
135     {
136         _strXsdSchema = strXsdSchema;
137     }
138 
139     /**
140      * @return Returns the _strXmlFilesDirectoryPath.
141      */
142     public String getXmlFilesDirectoryPath(  )
143     {
144         return _strXmlFilesDirectoryPath;
145     }
146 
147     /**
148      * @param strXmlFilesDirectoryPath The _strXmlFilesDirectoryPath to set.
149      */
150     public void setXmlFilesDirectoryPath( String strXmlFilesDirectoryPath )
151     {
152         _strXmlFilesDirectoryPath = strXmlFilesDirectoryPath;
153     }
154 
155     /**
156      * @return Returns the _strXslFilesDirectoryPath.
157      */
158     public String getXslFilesDirectoryPath(  )
159     {
160         return _strXslFilesDirectoryPath;
161     }
162 
163     /**
164      * @param strXslFilesDirectoryPath The _strXslFilesDirectoryPath to set.
165      */
166     public void setXslFilesDirectoryPath( String strXslFilesDirectoryPath )
167     {
168         _strXslFilesDirectoryPath = strXslFilesDirectoryPath;
169     }
170 
171     /**
172      * @return Returns the _strResourceFilesDirectoryPath.
173      */
174     public String getResourceFilesDirectoryPath(  )
175     {
176         return _strResourceFilesDirectoryPath;
177     }
178 
179     /**
180      * @param strResourceFilesDirectoryPath The _strResourceFilesDirectoryPath to set.
181      */
182     public void setResourceFilesDirectoryPath( String strResourceFilesDirectoryPath )
183     {
184         _strResourceFilesDirectoryPath = strResourceFilesDirectoryPath;
185     }
186 
187     /**
188      * @return Returns the _strDisplayLink.
189      */
190     public String getDisplayLink(  )
191     {
192         return _strDisplayLink;
193     }
194 
195     /**
196      * @param strDisplayLink The _strDisplayLink to set.
197      */
198     public void setDisplayLink( String strDisplayLink )
199     {
200         _strDisplayLink = strDisplayLink;
201     }
202 
203     /**
204      * @return Returns the _listXslContent.
205      */
206     public Map getListXslContent(  )
207     {
208         return _listXslContent;
209     }
210 
211     /**
212      * @param listXslContent The _listXslContent to set.
213      */
214     public void setListXslContent( Map listXslContent )
215     {
216         _listXslContent = listXslContent;
217     }
218 
219     /**
220      * @param strStyleKey the output for which to retrieve the xslContent
221      * @return Returns the XslContent for a given style
222      */
223     public XmlPageXslContent getXslContent( String strStyleKey )
224     {
225         return (XmlPageXslContent) _listXslContent.get( strStyleKey );
226     }
227 
228     /**
229      * toString method
230      * @return String including all data of this bean
231      */
232     public String toString(  )
233     {
234         return new ToStringBuilder( this ).append( "_strName", _strName ).append( "_strTitle", _strTitle )
235                                           .append( "_strXmlFileName", _strXmlFileName )
236                                           .append( "_strXmlFilesDirectoryPath", _strXmlFilesDirectoryPath )
237                                           .append( "_strXslFilesDirectoryPath", _strXslFilesDirectoryPath )
238                                           .append( "_strResourceFilesDirectoryPath", _strResourceFilesDirectoryPath )
239                                           .append( "_strDisplayLink", _strDisplayLink )
240                                           .append( "_bIsValidationRequired", _bIsValidationRequired )
241                                           .append( "_strXsdSchema", _strXsdSchema )
242                                           .append( "_listXslContent", _listXslContent ).toString(  );
243     }
244 }