Changeset 1628
- Timestamp:
- 11/25/11 11:53:28 (12 years ago)
- Location:
- MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/action/GenericAction.java
r1627 r1628 339 339 340 340 protected void setDefaultParams(){ 341 341 //q=query 342 343 344 if (getQ() != null) { 345 addParam("q",getQ()); 346 addParam("query",getQ()); 347 } else { 348 addParam("q",this.getParam("query")); 349 } 350 351 if (this.format != null) { 352 addParam("format",this.format); 353 } 354 355 if (getParams().get("repository") == null){ 356 addParam("repository",WorkspaceProfile.getRepositoryByIndex(0)); 357 } 342 358 } 343 359 /** -
MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/action/RepoAction.java
r1627 r1628 40 40 } 41 41 42 /* 42 43 @Override 43 44 protected void setDefaultParams() { 44 //q=query 45 if (getQ() != null) { 46 addParam("q",getQ()); 47 addParam("query",getQ()); 48 } else { 49 addParam("q",this.getParam("query")); 50 } 45 51 46 52 47 // set defaults … … 120 115 121 116 addParam("fullformat",getFullFormat()); 122 */117 123 118 } 119 */ 124 120 /** 125 121 * Based on the repository type - we create a typed Proxy, that will do the work. -
MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/action/SRUAction.java
r1627 r1628 106 106 return ""; 107 107 } 108 108 /* 109 109 @Override 110 110 protected void setDefaultParams() { … … 178 178 179 179 addParam("fullformat",getFullFormat()); 180 */ 181 } 180 181 } 182 */ 182 183 /* 183 184 public void prepareOperation() throws UnsupportedEncodingException{ -
MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/proxy/BasicProxy.java
r1613 r1628 13 13 import eu.clarin.cmdi.mdservice.internal.NoStylesheetException; 14 14 import eu.clarin.cmdi.mdservice.internal.Utils; 15 import eu.clarin.cmdi.mdservice.model.Diagnostic; 16 import eu.clarin.cmdi.mdservice.model.WorkspaceProfile; 15 17 16 18 … … 46 48 } 47 49 50 public void addParam (String key, String value){ 51 getSourceAction().addParam(key, value); 52 } 53 48 54 public Map<String,String[]> getParams() { 49 55 return getSourceAction().getParams(); … … 60 66 61 67 public void checkParams() { 62 // required Params 68 // required Params 69 70 if (getParam("q").equals("")) { 71 getSourceAction().getDiagnostics().Add(Diagnostic.MANDATORY_NOTSUPPLIED, "q"); 72 } 73 if (getParams().get("format") == null){ 74 if (getSourceAction().getFormat() == null) { 75 addParam("format","xml"); 76 } else if (getSourceAction().getFormat().equals("")){ 77 addParam("format","xml"); 78 } else { 79 addParam("format",getSourceAction().getFormat()); 80 } 81 } 82 // moved into action - needed for creation proxy 83 /*if (getParams().get("repository") == null){ 84 addParam("repository",WorkspaceProfile.getRepositoryByIndex(0)); 85 } 86 */ 87 addParam("fullformat",getSourceAction().getFullFormat()); 63 88 } 64 89 -
MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/proxy/LocalProxy.java
r1520 r1628 26 26 private String proxy_key = "local"; 27 27 28 public void checkParams() {29 // required Params30 if (getParam("q")=="") {31 getSourceAction().getDiagnostics().Add(Diagnostic.MANDATORY_NOTSUPPLIED, "q");32 }33 }34 28 35 29 /** -
MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/proxy/MDRepoProxy.java
r1627 r1628 75 75 76 76 77 public void addParam (String key, String value){ 78 getSourceAction().addParam(key, value); 79 } 77 // check and set defaults 80 78 @Override 81 79 public void checkParams() { 82 80 // set defaults 81 super.checkParams(); 83 82 84 83 if ( getParams().get("startRecord") == null){ … … 122 121 123 122 if ( getParams().get("x-cmd-format") == null){ 123 // TODO moved into BasicAction 124 /* 124 125 if (getParams().get("format") == null){ 125 126 if (getSourceAction().getFormat() == null) { … … 130 131 addParam("format",getSourceAction().getFormat()); 131 132 } 132 } 133 } 134 */ 133 135 } else { 134 136 addParam("format",getParams().get("x-cmd-format")[0]); 135 137 } 136 138 139 //todo 137 140 addParam("fullformat",getSourceAction().getFullFormat()); 138 139 super.checkParams(); 141 //super.checkParams(); 140 142 141 143 // TODO ????? -
MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/proxy/RepoProxy.java
r1627 r1628 84 84 public void checkParams() { 85 85 // required Params 86 super.checkParams(); 86 87 // check and set defaults 87 88 if (WorkspaceProfile.getRepositoryPath(getParam("repository")) == null) {
Note: See TracChangeset
for help on using the changeset viewer.