View Javadoc

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.digglike.business;
35  
36  import fr.paris.lutece.portal.service.image.ImageResource;
37  import fr.paris.lutece.portal.service.rbac.RBACResource;
38  
39  import java.io.Serializable;
40  
41  /**
42   *
43   * class DiggSubmit
44   *
45   */
46  public class DiggSubmitType implements RBACResource, Serializable
47  {
48      private static final long serialVersionUID = 6012149058400580840L;
49      public static final String RESOURCE_TYPE = "DIGGLIKE_DIGG_SUBMIT_TYPE";
50      private int _nIdType;
51      private String _strName;
52      private String _strColor;
53      private ImageResource _imgPictogram;
54      private Boolean _bParameterizableInFO;
55      private int _nIdXSLStyleSheet;
56      private Integer _nIdImageResource;
57  
58      /**
59       * @param nIdType the _nIdType to set
60       */
61      public void setIdType( int nIdType )
62      {
63          this._nIdType = nIdType;
64      }
65  
66      /**
67       * @return the _nIdType
68       */
69      public int getIdType(  )
70      {
71          return _nIdType;
72      }
73  
74      /**
75       * @param strName the _strName to set
76       */
77      public void setName( String strName )
78      {
79          this._strName = strName;
80      }
81  
82      /**
83       * @return the _strName
84       */
85      public String getName(  )
86      {
87          return _strName;
88      }
89  
90      /**
91       * @param strColor the _strColor to set
92       */
93      public void setColor( String strColor )
94      {
95          this._strColor = strColor;
96      }
97  
98      /**
99       * @return the _strColor
100      */
101     public String getColor(  )
102     {
103         return _strColor;
104     }
105 
106     /**
107      * @param imgPictogram the _imgPictogram to set
108      */
109     public void setPictogram( ImageResource imgPictogram )
110     {
111         this._imgPictogram = imgPictogram;
112     }
113 
114     /**
115      * @return the _imgPictogram
116      */
117     public ImageResource getPictogram(  )
118     {
119         return _imgPictogram;
120     }
121 
122     /**
123      * @param bParameterizableInFO the _bParameterizableInFO to set
124      */
125     public void setParameterizableInFO( Boolean bParameterizableInFO )
126     {
127         this._bParameterizableInFO = bParameterizableInFO;
128     }
129 
130     /**
131      * @return the _bParameterizableInFO
132      */
133     public Boolean getParameterizableInFO(  )
134     {
135         return _bParameterizableInFO;
136     }
137 
138     /**
139     * RBAC resource implmentation
140     * @return The resource type code
141     */
142     public String getResourceTypeCode(  )
143     {
144         return RESOURCE_TYPE;
145     }
146 
147     /**
148      * RBAC resource implmentation
149      * @return The resourceId
150      */
151     public String getResourceId(  )
152     {
153         return "" + _nIdType;
154     }
155 
156     /**
157      * @param idXSLStyleSheet the idXSLStyleSheet to set
158      */
159     public void setIdXSLStyleSheet( int idXSLStyleSheet )
160     {
161         this._nIdXSLStyleSheet = idXSLStyleSheet;
162     }
163 
164     /**
165      * @return the idXSLStyleSheet
166      */
167     public int getIdXSLStyleSheet(  )
168     {
169         return _nIdXSLStyleSheet;
170     }
171 
172     /**
173      * @param obj the Digg Submit Type  to compare
174      * @return true if Digg Submit Type  in parameter is the same object
175      *
176      */
177     public boolean equals( Object obj )
178     {
179         if ( obj instanceof DiggSubmitType && ( (DiggSubmitType) obj ).getIdType( ) == _nIdType )
180         {
181             return true;
182         }
183 
184         return false;
185     }
186 
187     /**
188      * the image resource id associate to the response
189      * @return Resource Image
190      */
191     public Integer getIdImageResource(  )
192     {
193         return _nIdImageResource;
194     }
195 
196     /**
197      * image resource id associate to the response
198      * @param idImageResource image resource id associate to the response
199      */
200     public void setIdImageResource( Integer idImageResource )
201     {
202         _nIdImageResource = idImageResource;
203     }
204 }