Changeset 33611 for main/trunk
- Timestamp:
- 2019-10-31T10:55:04+13:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSParams.java
r33283 r33611 29 29 30 30 static Logger logger = Logger.getLogger(org.greenstone.gsdl3.util.GSParams.class.getName()); 31 32 // Only used internally in the session 33 public static final String USER_SESSION_CACHE = "user_session_cache"; 34 31 35 // cgi parameter names 32 36 public static final String ACTION = "a"; // the major type of action- eg query or browse or process … … 105 109 106 110 // we now only need to add in the ones that need saving, as we will default to "not save" 107 addParameter(LANGUAGE, true); 111 // these ones are global params - apply across all collections 112 addParameter(LANGUAGE, true, false, true); 113 addParameter(BERRYBASKET, true, false, true); 114 addParameter(FAVOURITEBASKET, true, false, true); 115 addParameter(DEBUG, true, false, true); 116 117 // these will only be saved per collection/service 108 118 addParameter(DOCUMENT, true); 109 119 addParameter(PROCESS_ID, true); 110 120 addParameter(COLLECTION_TYPE, true); 111 addParameter(DEBUG, true); 112 addParameter(BERRYBASKET, true); 113 addParameter(FAVOURITEBASKET, true); 121 114 122 // password is sensitive. don't save, but also don't return it in the page response 115 123 addParameter(PASSWORD, false, true); … … 145 153 return true; 146 154 } 155 public boolean addParameter(String name, boolean save, boolean sensitive, boolean global) 156 { 157 if (this.param_map.containsKey(name)) 158 { 159 // already there so could not add 160 return false; 161 } 162 this.param_map.put(name, new Param("", save, sensitive, global)); 163 return true; 164 165 } 147 166 148 167 public boolean addServiceParameter(String name, String default_value, boolean save, boolean sensitive) { … … 211 230 } 212 231 213 public ArrayList<String> getParamsWithDefaults() { 214 return (ArrayList<String> )this.params_with_default_list.clone(); 215 } 216 232 public boolean isGlobal(String name) { 233 Param p = this.param_map.get(name); 234 if (p==null) { 235 return false; 236 } 237 return p.is_global; 238 } 239 240 public ArrayList<String> getParamsWithDefaults() { 241 return (ArrayList<String> )this.params_with_default_list.clone(); 242 } 243 217 244 private class Param 218 { 219 220 public String default_value = null; 221 public boolean save = true; 222 public boolean sensitive = false; 223 224 public Param(String default_value, boolean save) 225 { 226 this.default_value = default_value; 227 this.save = save; 228 } 229 230 public Param(String default_value, boolean save, boolean sensitive) { 231 this.default_value = default_value; 232 this.save = save; 233 this.sensitive = sensitive; 234 } 235 236 } 245 { 246 247 public String default_value = null; 248 public boolean save = true; 249 public boolean sensitive = false; 250 public boolean is_global = false; 251 252 public Param(String default_value, boolean save) 253 { 254 this.default_value = default_value; 255 this.save = save; 256 } 257 258 public Param(String default_value, boolean save, boolean sensitive) { 259 this.default_value = default_value; 260 this.save = save; 261 this.sensitive = sensitive; 262 } 263 264 public Param(String default_value, boolean save, boolean sensitive, boolean global) { 265 this.default_value = default_value; 266 this.save = save; 267 this.sensitive = sensitive; 268 this.is_global = global; 269 } 270 271 } 237 272 }
Note:
See TracChangeset
for help on using the changeset viewer.