Changeset 1515
- Timestamp:
- 09/04/11 20:14:15 (13 years ago)
- Location:
- MDService2/branches/MDService_simple2/src/eu/clarin/cmdi/mdservice/proxy
- Files:
-
- 3 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
MDService2/branches/MDService_simple2/src/eu/clarin/cmdi/mdservice/proxy/MDRepoProxy.java
r1511 r1515 70 70 urls.put("model", "?operation=queryModel&q="); 71 71 urls.put("values", "?operation=scanIndex&q="); 72 urls.put(" recordset", "?operation=searchRetrieve&query=");72 urls.put("search", "?operation=searchRetrieve&query="); 73 73 urls.put("record", "?operation=searchRetrieve&query="); 74 74 } 75 75 76 77 76 /** 78 77 * uses base_url + url_pattern (parametrized by actionkey) to form a url … … 82 81 @Override 83 82 public URL getTargetRequest() throws IOException { 84 // URL targetURL =new URL( base_url, compname + ".xml"); 85 return getBaseURL(); 83 84 Query query = new Query(getParam("squery"), getParam("q"),getSourceAction().getActionkey()); 85 86 URL targetURL =new URL( getBaseURL(), urls.get(getSourceAction().getActionkey()) + query.toURLParam()); 87 88 return targetURL; 86 89 /* 87 90 log.debug("MDRPx.getQ:" + getSquery() + " and (" + getQ() + ")"); 88 91 log.debug("MDRPA.getActionkey:" + getActionkey()); 89 92 90 Query query = new Query(getSquery(), getQ(),getActionkey());93 91 94 92 95 // check if the query could get parsed … … 114 117 115 118 } 116 117 @Override118 public InputStream getSourceStream() throws IOException, NoStylesheetException {119 120 /*if (getCommand() == null){121 try {122 return getSourcePz2();123 } catch (Exception e) {124 // TODO Auto-generated catch block125 e.printStackTrace();126 }127 }128 */129 return super.getSourceStream();130 }131 119 132 120 } -
MDService2/branches/MDService_simple2/src/eu/clarin/cmdi/mdservice/proxy/RepoProxy.java
r1511 r1515 45 45 * 46 46 */ 47 public class RepoProxy implements GenericProxy{47 public class RepoProxy extends BasicProxy{ 48 48 49 49 private static final long serialVersionUID = 1L; 50 50 private static Logger log = Logger.getLogger("RepoProxy"); 51 51 52 private String proxy_key = " generic";52 private String proxy_key = "repo"; 53 53 54 54 // should perhaps be RepoAction, but it gets complicated with the types … … 71 71 72 72 /** 73 * Convenience function to access the request-parameters in the Action 74 * @param key 75 * @return 76 */ 77 public String getParam(String key) { 78 return getSourceAction().getParam(key); 79 } 80 81 public void checkParams() { 82 // required Params 83 if (getParam("repository")=="") { 84 getSourceAction().getDiagnostics().Add(Diagnostic.MANDATORY_NOTSUPPLIED, "repository"); 85 } 86 } 87 88 89 /** 73 90 * identification of the target-proxy (type) 74 91 * base for finding the right base_url in the props … … 81 98 82 99 /** 83 * Override of the basic method provided by the super-class 84 * Read ingthe repository-uri from the WorkspaceProfile based on the repository-parameter100 * Override of the basic method provided by the super-class: 101 * Read the repository-uri from the WorkspaceProfile based on the repository-parameter 85 102 */ 86 103
Note: See TracChangeset
for help on using the changeset viewer.