Changeset 32453
- Timestamp:
- 2018-09-13T14:18:16+12:00 (6 years ago)
- Location:
- main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/AbstractGS2FieldSearch.java
r32083 r32453 123 123 return false; 124 124 } 125 126 // set up which params to save 127 this.save_params.add(LEVEL_PARAM); 128 this.save_params.add(RANK_PARAM); 129 this.save_params.add(RAW_PARAM); 130 this.save_params.add(FIELD_QUERY_PARAM); 131 this.save_params.add(FIELD_STEM_PARAM); 132 this.save_params.add(FIELD_CASE_PARAM); 133 this.save_params.add(FIELD_ACCENT_PARAM); 134 this.save_params.add(FIELD_FIELD_PARAM); 135 this.save_params.add(FIELD_COMBINE_PARAM); 125 136 126 137 // Get the default level out of <defaultLevel> (buildConfig.xml) -
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/AbstractSearch.java
r30049 r32453 128 128 getSearchParamDefaults(search_elem); 129 129 } 130 131 // store any that we need to save 132 // previously these were all saved by default, so adding them all 133 this.save_params.add(INDEX_PARAM); 134 this.save_params.add(QUERY_PARAM); 135 this.save_params.add(RAW_PARAM); 136 this.save_params.add(MAXDOCS_PARAM); 137 this.save_params.add(HITS_PER_PAGE_PARAM); 138 this.save_params.add(START_PAGE_PARAM); 139 130 140 // add some format info to service map if there is any 131 141 // => lookin extra info first look in buildConfig -
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/AbstractTextSearch.java
r28966 r32453 71 71 } 72 72 73 public boolean configure(Element info, Element extra_info) 74 { 75 if (!super.configure(info, extra_info)) 76 { 77 return false; 78 } 79 80 logger.info("Configuring AbstractTextSearch..."); 81 // we need to set up the save_params - we want all our search settings saved by default 82 this.save_params.add(INDEX_SUBCOLLECTION_PARAM); 83 this.save_params.add(INDEX_LANGUAGE_PARAM); 84 this.save_params.add(CASE_PARAM); 85 this.save_params.add(STEM_PARAM); 86 this.save_params.add(ACCENT_PARAM); 87 this.save_params.add(MATCH_PARAM); 88 89 return true; 90 91 } 73 92 /** adds the standard query params into the service description */ 74 93 protected void addStandardQueryParams(Element param_list, String lang) -
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/BerryBasket.java
r32308 r32453 66 66 protected static final String DELETE_ITEM_SERVICE = "DeleteItem"; 67 67 68 // for AddItem 68 69 protected static final String ITEM_PARAM = "item"; 70 // for DeleteItems 71 protected static final String ITEMS_PARAM = "items"; 72 // for SendMail 73 protected static final String ADDRESS_PARAM = "address"; 74 protected static final String SUBJECT_PARAM = "subject"; 75 protected static final String CONTENT_PARAM = "content"; 76 protected static final String CC_PARAM = "cc"; 77 protected static final String BCC_PARAM = "bcc"; 78 79 69 80 protected static final String delimiter = "|"; 70 81 protected static final int delay = 1800000; … … 171 182 172 183 } 184 185 // if any params should be saved in the session, add them to save_params here 186 // this.save_params.add(XXX_PARAM); 173 187 return true; 174 188 … … 252 266 HashMap<String, Serializable> params = GSXML.extractParams(param_list, false); 253 267 254 String item = (String) params.get( "item");268 String item = (String) params.get(ITEM_PARAM); 255 269 String collection = ""; 256 270 int pos = item.indexOf(":"); … … 334 348 HashMap<String, Serializable> params = GSXML.extractParams(param_list, false); 335 349 336 String param = (String) params.get( "items");350 String param = (String) params.get(ITEMS_PARAM); 337 351 338 352 if (param == null) … … 496 510 HashMap<String, Serializable> params = GSXML.extractParams(param_list, false); 497 511 498 String to = (String) params.get( "address");499 String subject = (String) params.get( "subject");500 String content = (String) params.get( "content");501 String cc = (String) params.get( "cc");502 String bcc = (String) params.get( "bcc");512 String to = (String) params.get(ADDRESS_PARAM); 513 String subject = (String) params.get(SUBJECT_PARAM); 514 String content = (String) params.get(CONTENT_PARAM); 515 String cc = (String) params.get(CC_PARAM); 516 String bcc = (String) params.get(BCC_PARAM); 503 517 504 518 String mailhost = GlobalProperties.getProperty("mail.smtp.host"); -
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/CrossCollectionSearch.java
r31344 r32453 83 83 this.short_service_info.appendChild(dmr_service); 84 84 85 86 // what params do we want saved in the session? 87 this.save_params.add(QUERY_PARAM); 88 this.save_params.add(COLLECTION_PARAM); 89 this.save_params.add(GROUP_PARAM); 90 this.save_params.add(MAXDOCS_PARAM); 91 this.save_params.add(HITS_PER_PAGE_PARAM); 92 85 93 // get any format info 86 94 Element format_info = (Element) GSXML.getChildByTagName(info, GSXML.FORMAT_ELEM); -
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/GS2Construct.java
r31771 r32453 109 109 } 110 110 111 // in configure we set up any params that should be saved to the session. At this stage, assuming none should be saved. 112 111 113 /** returns a specific service description */ 112 114 protected Element getServiceDescription(Document doc, String service, String lang, String subset) -
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/GS2LuceneSearch.java
r32084 r32453 64 64 } 65 65 66 public boolean configure(Element info, Element extra_info) 67 { 68 if (!super.configure(info, extra_info)) 69 { 70 return false; 71 } 72 logger.info("Configuring GS2LuceneSearch..."); 73 74 // add our reverseSort param to be saved to the session 75 this.save_params.add(SORT_ORDER_PARAM); 76 return true; 77 } 66 78 /** add in the Lucene specific params to TextQuery */ 67 79 protected void addCustomQueryParams(Element param_list, String lang) -
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/ServiceRack.java
r30834 r32453 21 21 // greenstone classes 22 22 import java.lang.reflect.Method; 23 import java.util.ArrayList; 23 24 import java.util.HashMap; 24 25 … … 30 31 import org.greenstone.gsdl3.util.Dictionary; 31 32 import org.greenstone.gsdl3.util.GSFile; 33 import org.greenstone.gsdl3.util.GSParams; 32 34 import org.greenstone.gsdl3.util.GSPath; 33 35 import org.greenstone.gsdl3.util.GSXML; … … 95 97 protected HashMap<String, Node> format_info_map = null; 96 98 99 /** the list of cgi params that this services are looking for, that need saving in the session */ 100 protected ArrayList<String> save_params = null; 101 protected ArrayList<String> sensitive_params = null; 97 102 protected Element _globalFormat = null; 98 103 … … 159 164 } 160 165 166 public boolean addServiceParameters(GSParams params) { 167 168 if (params == null) { 169 logger.error("params is null!!!"); 170 return false; 171 } 172 173 for (int i=0; i<save_params.size(); i++) { 174 logger.error("adding save param "+save_params.get(i)); 175 params.addServiceParameter(save_params.get(i), "", true, false); 176 } 177 for (int i=0; i<sensitive_params.size(); i++) { 178 params.addServiceParameter(sensitive_params.get(i), "", false, true); 179 } 180 return true; 181 182 } 161 183 /** the no-args constructor */ 162 184 public ServiceRack() … … 166 188 this.short_service_info = this.desc_doc.createElement(GSXML.SERVICE_ELEM + GSXML.LIST_MODIFIER); 167 189 this.format_info_map = new HashMap<String, Node>(); 190 this.save_params = new ArrayList<String>(); 191 this.sensitive_params = new ArrayList<String>(); 168 192 } 169 193 -
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/UserTracker.java
r28966 r32453 16 16 public class UserTracker extends ServiceRack 17 17 { 18 static Logger logger = Logger.getLogger(org.greenstone.gsdl3.service. DocXMLUtil.class.getName());18 static Logger logger = Logger.getLogger(org.greenstone.gsdl3.service.UserTracker.class.getName()); 19 19 20 20 /************************************************** … … 27 27 String[] services = { RECORD_USER_ACTION, GET_ACTIVITY_ON_PAGE }; 28 28 29 // the parameters these services use 30 protected static final String USER_PARAM = "username"; 31 protected static final String COLLECTION_PARAM = "collection"; 32 protected static final String SITE_PARAM = "site"; 33 protected static final String OID_PARAM = "oid"; 34 protected static final String ACTION_PARAM = "action"; 35 29 36 /** configure this service */ 30 37 public boolean configure(Element info, Element extra_info) … … 35 42 } 36 43 37 logger.info("Configuring DocXMLUtil...");44 logger.info("Configuring UserTracker..."); 38 45 this.config_info = info; 39 46 … … 46 53 } 47 54 55 // should any of the params be saved to the session? 56 // assuming not at this stage. But if they do need to be, then 57 // sture them here in save_params. 58 // this.save_params.add(XXX_PARAM); 48 59 return true; 49 60 } … … 78 89 79 90 HashMap<String, Serializable> params = GSXML.extractParams(paramList, true); 80 String username = (String) params.get( "username");81 String collection = (String) params.get( "collection");82 String site = (String) params.get( "site");83 String oid = (String) params.get( "oid");84 String action = (String) params.get( "action");91 String username = (String) params.get(USER_PARAM); 92 String collection = (String) params.get(COLLECTION_PARAM); 93 String site = (String) params.get(SITE_PARAM); 94 String oid = (String) params.get(OID_PARAM); 95 String action = (String) params.get(ACTION_PARAM); 85 96 86 97 DerbyWrapper database = new DerbyWrapper(GlobalProperties.getGSDL3Home() + File.separatorChar + "etc" + File.separatorChar + "usersDB"); … … 106 117 107 118 HashMap<String, Serializable> params = GSXML.extractParams(paramList, true); 108 String collection = (String) params.get( "collection");109 String site = (String) params.get( "site");110 String oid = (String) params.get( "oid");119 String collection = (String) params.get(COLLECTION_PARAM); 120 String site = (String) params.get(SITE_PARAM); 121 String oid = (String) params.get(OID_PARAM); 111 122 112 123 DerbyWrapper database = new DerbyWrapper(GlobalProperties.getGSDL3Home() + File.separatorChar + "etc" + File.separatorChar + "usersDB");
Note:
See TracChangeset
for help on using the changeset viewer.