Changeset 4242
- Timestamp:
- 2003-05-08T12:11:52+12:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl3/src/java/org/greenstone/gsdl3/util/GSCGI.java
r4104 r4242 2 2 3 3 import java.util.HashMap; 4 import java.util.HashSet; 4 5 import org.w3c.dom.Element; 5 6 import org.w3c.dom.NodeList; … … 15 16 public static final String REQUEST_TYPE_ARG = "rt"; // whether the request is just to display the service form, or to actually do a request to teh service 16 17 public static final String REQUEST_ONLY_ARG = "ro"; // if == 1 do the request and pass back the xml - no page formatting 18 public static final String RESPONSE_ONLY_ARG = "ro"; // if == 1 do the request and pass back the response xml - no page formatting 17 19 public static final String OUTPUT_ARG = "o"; // if processing is to be done, what type of output - html/xml/other?? 18 20 public static final String SERVICE_ARG = "s"; // the name of the service … … 24 26 public static final String PROCESS_ID_ARG = "pid"; // if a request wasn't completed, this identifies the request - used when asking for a status update 25 27 28 public static final String SIBLING_ARG = "sib"; // this should not be in here 26 29 // internal configure args 27 30 public static final String STATUS_SUBSET_ARG = "ss"; 28 31 public static final String STATUS_MODULE_NAME_ARG = "sn"; 29 32 public static final String STATUS_MODULE_TYPE_ARG = "st"; 33 34 public static final String HITS_PER_PAGE_ARG = "hp"; 35 public static final String HITS_NUMBER_ARG = "hn"; 30 36 /** long to short mapping */ 31 37 protected HashMap long_map_=null; 32 38 /** short to long mapping */ 33 39 protected HashMap short_map_=null; 40 /** map for save data */ 41 protected HashSet save_set_ = null; 34 42 35 43 /** initialises the maps with known parameters */ … … 37 45 long_map_ = new HashMap(); 38 46 short_map_ = new HashMap(); 47 save_set_ = new HashSet(); 39 48 40 49 // initialize with the ones we know about 41 addStaticParam(ACTION_ARG); 42 addStaticParam(SUBACTION_ARG); 43 addStaticParam(REQUEST_TYPE_ARG); 44 addStaticParam(REQUEST_ONLY_ARG); 45 addStaticParam(CLUSTER_ARG); 46 addStaticParam(COLLECTION_ARG); 47 addStaticParam(LANGUAGE_ARG); 48 addStaticParam(DOCUMENT_ARG); 49 addStaticParam(RESOURCE_ARG); 50 addStaticParam(OUTPUT_ARG); 51 addStaticParam(SERVICE_ARG); 52 addStaticParam(PROCESS_ID_ARG); 53 addStaticParam(STATUS_SUBSET_ARG); 54 addStaticParam(STATUS_MODULE_NAME_ARG); 55 addStaticParam(STATUS_MODULE_TYPE_ARG); 50 addStaticParam(ACTION_ARG, false); 51 addStaticParam(SUBACTION_ARG, false); 52 addStaticParam(REQUEST_TYPE_ARG, false); 53 addStaticParam(REQUEST_ONLY_ARG, false); 54 addStaticParam(CLUSTER_ARG, true); 55 //addStaticParam(COLLECTION_ARG); 56 addStaticParam(LANGUAGE_ARG, true); 57 addStaticParam(DOCUMENT_ARG, true); 58 addStaticParam(RESOURCE_ARG, true); 59 addStaticParam(OUTPUT_ARG, false); 60 addStaticParam(SERVICE_ARG, true); 61 addStaticParam(PROCESS_ID_ARG, true); 62 addStaticParam(STATUS_SUBSET_ARG, true); 63 addStaticParam(STATUS_MODULE_NAME_ARG, true); 64 addStaticParam(STATUS_MODULE_TYPE_ARG, true); 65 addStaticParam(SIBLING_ARG, false); 66 addStaticParam(HITS_PER_PAGE_ARG, true); 56 67 } 57 68 58 69 /* static params - have only one form */ 59 public boolean addStaticParam(String param ) {60 return addParam(param, param );70 public boolean addStaticParam(String param, boolean save) { 71 return addParam(param, param, save); 61 72 } 62 73 /** adds another param to teh list 63 74 * should check that its not already present? */ 64 public boolean addParam(String long_name, String short_name ) {75 public boolean addParam(String long_name, String short_name, boolean save) { 65 76 long_map_.put(long_name, short_name); 66 77 short_map_.put(short_name, long_name); 78 if (save) { // used by servlet, so use short names 79 save_set_.add(short_name); 80 } 67 81 return true; 68 82 } … … 121 135 // else need to create a new mapping 122 136 String short_name = newShortName(long_name); 123 long_map_.put(long_name, short_name); 124 short_map_.put(short_name, long_name); 137 addParam(long_name, short_name, true); 125 138 return short_name; 126 139 } … … 140 153 141 154 } 155 public boolean shouldSave(String name) { 156 return save_set_.contains(name); 157 158 } 142 159 } 143 160
Note:
See TracChangeset
for help on using the changeset viewer.