1 /* 2 * Copyright (c) 2002-2014, 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.dila.business.fichelocale.dto; 35 36 import java.io.Serializable; 37 38 import java.util.Date; 39 40 41 /** 42 * DTO for Local object 43 */ 44 public class LocalDTO implements Serializable 45 { 46 /** Serial ID */ 47 private static final long serialVersionUID = -1191940287861319929L; 48 49 /** 50 * The id 51 */ 52 private Long _lId; 53 54 /** 55 * Title of resource 56 */ 57 private String _strTitle; 58 59 /** 60 * Name of author 61 */ 62 private String _strAuthor; 63 64 /** 65 * The breadcrumb of resource 66 */ 67 private String _strBreadCrumb; 68 69 /** 70 * The breadcrumb of resource 71 */ 72 private String _strDisplayPath; 73 74 /** 75 * The xml content 76 */ 77 private String _strXml; 78 79 /** 80 * The id of audience 81 */ 82 private Long _lIdAudience; 83 84 /** 85 * The type of resource (Card or Folder) 86 */ 87 private LocalTypeDTO _type; 88 89 /** 90 * The creation date 91 */ 92 private Date _creationDate; 93 94 /** 95 * Default constructor 96 */ 97 public LocalDTO( ) 98 { 99 } 100 101 /** 102 * Create a local resource by init its _type 103 * @param type the type of resource 104 */ 105 public LocalDTO( LocalTypeDTO type ) 106 { 107 _type = type; 108 } 109 110 /** 111 * @return the _lId 112 */ 113 public Long getId( ) 114 { 115 return _lId; 116 } 117 118 /** 119 * @param lId the _lId to set 120 */ 121 public void setId( Long lId ) 122 { 123 this._lId = lId; 124 } 125 126 /** 127 * @return the _strTitle 128 */ 129 public String getTitle( ) 130 { 131 return _strTitle; 132 } 133 134 /** 135 * @param strTitle the _strTitle to set 136 */ 137 public void setTitle( String strTitle ) 138 { 139 this._strTitle = strTitle; 140 } 141 142 /** 143 * @return the _strAuthor 144 */ 145 public String getAuthor( ) 146 { 147 return _strAuthor; 148 } 149 150 /** 151 * @param strAuthor the _strAuthor to set 152 */ 153 public void setAuthor( String strAuthor ) 154 { 155 this._strAuthor = strAuthor; 156 } 157 158 /** 159 * @return the _strXml 160 */ 161 public String getXml( ) 162 { 163 return _strXml; 164 } 165 166 /** 167 * @param strXml the _strXml to set 168 */ 169 public void setXml( String strXml ) 170 { 171 this._strXml = strXml; 172 } 173 174 /** 175 * @return the _lIdAudience 176 */ 177 public Long getIdAudience( ) 178 { 179 return _lIdAudience; 180 } 181 182 /** 183 * @param lIdAudience the _lIdAudience to set 184 */ 185 public void setIdAudience( Long lIdAudience ) 186 { 187 this._lIdAudience = lIdAudience; 188 } 189 190 /** 191 * @return the _type 192 */ 193 public LocalTypeDTO getType( ) 194 { 195 return _type; 196 } 197 198 /** 199 * @param type the _type to set 200 */ 201 public void setType( LocalTypeDTO type ) 202 { 203 this._type = type; 204 } 205 206 /** 207 * @return the _strBreadCrumb 208 */ 209 public String getBreadCrumb( ) 210 { 211 return _strBreadCrumb; 212 } 213 214 /** 215 * @param strBreadCrumb the _strBreadCrumb to set 216 */ 217 public void setBreadCrumb( String strBreadCrumb ) 218 { 219 this._strBreadCrumb = strBreadCrumb; 220 } 221 222 /** 223 * @return the _strDisplayPath 224 */ 225 public String getDisplayPath( ) 226 { 227 return _strDisplayPath; 228 } 229 230 /** 231 * @param strDisplayPath the _strDisplayPath to set 232 */ 233 public void setDisplayPath( String strDisplayPath ) 234 { 235 this._strDisplayPath = strDisplayPath; 236 } 237 238 /** 239 * @return the _creationDate 240 */ 241 public Date getCreationDate( ) 242 { 243 return (Date) _creationDate.clone( ); 244 } 245 246 /** 247 * @param creationDate the _creationDate to set 248 */ 249 public void setCreationDate( Date creationDate ) 250 { 251 this._creationDate = (Date) creationDate.clone( ); 252 } 253 254 /** 255 * Hack to order by type label 256 * @return the type label {@link LocalTypeDTO#getLabel()} 257 */ 258 public String getTypeLabel( ) 259 { 260 return getType( ).getLabel( ); 261 } 262 }