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.directory.modules.pdfproducerarchive.business.zipbasket; 35 36 import fr.paris.lutece.portal.service.i18n.I18nService; 37 import fr.paris.lutece.portal.service.i18n.Localizable; 38 import fr.paris.lutece.portal.service.rbac.RBACAction; 39 40 import java.util.Locale; 41 42 43 /** 44 * ZipBasketAction 45 * 46 */ 47 public class ZipBasketAction implements RBACAction, Localizable 48 { 49 // Variables declarations 50 private String _strUrl; 51 private String _strNameKey; 52 private String _strDescriptionKey; 53 private String _strIconUrl; 54 private String _strPermission; 55 private int _nFormState; 56 private Locale _locale; 57 58 /** 59 * 60 * @return 1 if the action must be use when the form is enable 61 * 0 if the action must be use when the form is disable 62 * 63 */ 64 public int getFormState( ) 65 { 66 return _nFormState; 67 } 68 69 /** 70 * set 1 if the action must be use when the form is enable 71 * 0 if the action must be use when the form is disable 72 * 73 * @param nState 1 if the action must be use when the form is enable 74 * 0 if the action must be use when the form is disable 75 */ 76 public void setFormState( int nState ) 77 { 78 _nFormState = nState; 79 } 80 81 /** 82 * Returns the Url 83 * 84 * @return The Url 85 */ 86 public String getUrl( ) 87 { 88 return _strUrl; 89 } 90 91 /** 92 * Sets the Url 93 * 94 * @param strUrl The Url 95 */ 96 public void setUrl( String strUrl ) 97 { 98 _strUrl = strUrl; 99 } 100 101 /** 102 * Returns the NameKey 103 * 104 * @return The NameKey 105 */ 106 public String getNameKey( ) 107 { 108 return _strNameKey; 109 } 110 111 /** 112 * Returns the Name 113 * 114 * @return The Name 115 */ 116 public String getName( ) 117 { 118 return I18nService.getLocalizedString( _strNameKey, _locale ); 119 } 120 121 /** 122 * Sets the NameKey 123 * 124 * @param strNameKey The NameKey 125 */ 126 public void setNameKey( String strNameKey ) 127 { 128 _strNameKey = strNameKey; 129 } 130 131 /** 132 * Returns the DescriptionKey 133 * 134 * @return The DescriptionKey 135 */ 136 public String getDescriptionKey( ) 137 { 138 return _strDescriptionKey; 139 } 140 141 /** 142 * Returns the Description 143 * 144 * @return The Description 145 */ 146 public String getDescription( ) 147 { 148 return I18nService.getLocalizedString( _strDescriptionKey, _locale ); 149 } 150 151 /** 152 * Sets the DescriptionKey 153 * 154 * @param strDescriptionKey The DescriptionKey 155 */ 156 public void setDescriptionKey( String strDescriptionKey ) 157 { 158 _strDescriptionKey = strDescriptionKey; 159 } 160 161 /** 162 * Returns the IconUrl 163 * 164 * @return The IconUrl 165 */ 166 public String getIconUrl( ) 167 { 168 return _strIconUrl; 169 } 170 171 /** 172 * Sets the IconUrl 173 * 174 * @param strIconUrl The IconUrl 175 */ 176 public void setIconUrl( String strIconUrl ) 177 { 178 _strIconUrl = strIconUrl; 179 } 180 181 /** 182 * Returns the permission associated to the action 183 * @return The permission 184 */ 185 public String getPermission( ) 186 { 187 return _strPermission; 188 } 189 190 /** 191 * Sets the Permission 192 * 193 * @param strPermission The Permission 194 */ 195 public void setPermission( String strPermission ) 196 { 197 _strPermission = strPermission; 198 } 199 200 /** 201 * Implements Localizable 202 * @param locale The current locale 203 */ 204 public void setLocale( Locale locale ) 205 { 206 _locale = locale; 207 } 208 }