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.crm.business.demand; 35 36 import fr.paris.lutece.plugins.crm.service.notification.NotificationService; 37 38 import java.sql.Timestamp; 39 40 /** 41 * 42 * Demand 43 * 44 */ 45 public class Demand 46 { 47 private int _nIdDemand; 48 private int _nIdDemandType; 49 private int _nIdCRMUser; 50 private String _strStatusText; 51 private int _nIdStatusCRM; 52 private String _strData; 53 private Timestamp _dateModification; 54 private String _strRemoteId; 55 56 /** 57 * Set the ID demand 58 * 59 * @param nIdDemand 60 * the ID demand 61 */ 62 public void setIdDemand( int nIdDemand ) 63 { 64 _nIdDemand = nIdDemand; 65 } 66 67 /** 68 * Get the ID demand 69 * 70 * @return the ID demand 71 */ 72 public int getIdDemand( ) 73 { 74 return _nIdDemand; 75 } 76 77 /** 78 * Set the status 79 * 80 * @param strStatusText 81 * the status 82 */ 83 public void setStatusText( String strStatusText ) 84 { 85 _strStatusText = strStatusText; 86 } 87 88 /** 89 * Get the status 90 * 91 * @return the status 92 */ 93 public String getStatusText( ) 94 { 95 return _strStatusText; 96 } 97 98 /** 99 * Set the ID demand type 100 * 101 * @param nIdDemandType 102 * the ID demand type 103 */ 104 public void setIdDemandType( int nIdDemandType ) 105 { 106 _nIdDemandType = nIdDemandType; 107 } 108 109 /** 110 * Get the ID demand type 111 * 112 * @return the ID demand type 113 */ 114 public int getIdDemandType( ) 115 { 116 return _nIdDemandType; 117 } 118 119 /** 120 * Set the user crm id 121 * 122 * @param nIdCRMUser 123 * the user crm id 124 */ 125 public void setIdCRMUser( int nIdCRMUser ) 126 { 127 _nIdCRMUser = nIdCRMUser; 128 } 129 130 /** 131 * Get the user user crm id 132 * 133 * @return the user crm id 134 */ 135 public int getIdCRMUser( ) 136 { 137 return _nIdCRMUser; 138 } 139 140 /** 141 * Returns the Date of the last Modification 142 * 143 * @return The Date of the last Modification 144 */ 145 public Timestamp getDateModification( ) 146 { 147 return _dateModification; 148 } 149 150 /** 151 * Sets the Date of the last Modification 152 * 153 * @param dateModification 154 * The Date of the last Modification 155 */ 156 public void setDateModification( Timestamp dateModification ) 157 { 158 _dateModification = dateModification; 159 } 160 161 /** 162 * Get the number of unread notifications 163 * 164 * @return the number of unread notifications 165 */ 166 public int getNumberUnreadNotifications( ) 167 { 168 return NotificationService.getService( ).getNumberUnreadNotifications( _nIdDemand ); 169 } 170 171 /** 172 * Get the number of notifications 173 * 174 * @return the number of notifications 175 */ 176 public int getNumberNotifications( ) 177 { 178 return NotificationService.getService( ).getNumberNotifications( _nIdDemand ); 179 } 180 181 /** 182 * Set the data 183 * 184 * @param strData 185 * the data 186 */ 187 public void setData( String strData ) 188 { 189 _strData = strData; 190 } 191 192 /** 193 * Get the data 194 * 195 * @return the data 196 */ 197 public String getData( ) 198 { 199 return _strData; 200 } 201 202 /** 203 * Set the id status CRM 204 * 205 * @param nIdStatusCRM 206 * the id status crm 207 */ 208 public void setIdStatusCRM( int nIdStatusCRM ) 209 { 210 _nIdStatusCRM = nIdStatusCRM; 211 } 212 213 /** 214 * Get the id status crm 215 * 216 * @return the id status crm 217 */ 218 public int getIdStatusCRM( ) 219 { 220 return _nIdStatusCRM; 221 } 222 223 /** 224 * 225 * @return the remote Id 226 */ 227 public String getRemoteId( ) 228 { 229 return _strRemoteId; 230 } 231 232 /** 233 * 234 * @param _strRemoteId 235 * the Remote Id 236 */ 237 public void setRemoteId( String _strRemoteId ) 238 { 239 this._strRemoteId = _strRemoteId; 240 } 241 }