Changeset 1515 for MDService2


Ignore:
Timestamp:
09/04/11 20:14:15 (13 years ago)
Author:
vronk
Message:

troubles commiting - trying once again (after update):
only package proxy

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  
    7070                 urls.put("model", "?operation=queryModel&q=");
    7171                 urls.put("values", "?operation=scanIndex&q=");
    72                  urls.put("recordset", "?operation=searchRetrieve&query=");
     72                 urls.put("search", "?operation=searchRetrieve&query=");
    7373                 urls.put("record", "?operation=searchRetrieve&query=");
    7474         }
    7575 
    76          
    7776        /**
    7877         * uses base_url + url_pattern (parametrized by actionkey) to form a url
     
    8281         @Override
    8382        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;
    8689                /*
    8790                log.debug("MDRPx.getQ:" + getSquery() + " and (" +  getQ() + ")");
    8891                log.debug("MDRPA.getActionkey:" + getActionkey());             
    8992               
    90                 Query query = new Query(getSquery(), getQ(),getActionkey());
     93               
    9194
    9295        // check if the query could get parsed
     
    114117                 
    115118        }
    116 
    117         @Override
    118         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 block
    125                                 e.printStackTrace();
    126                         }
    127                 }
    128                         */
    129                 return super.getSourceStream();
    130         }
    131119       
    132120}
  • MDService2/branches/MDService_simple2/src/eu/clarin/cmdi/mdservice/proxy/RepoProxy.java

    r1511 r1515  
    4545 *
    4646 */
    47 public class RepoProxy implements GenericProxy{
     47public class RepoProxy extends BasicProxy{
    4848
    4949        private static final long serialVersionUID = 1L;
    5050        private static Logger log = Logger.getLogger("RepoProxy");
    5151 
    52         private String proxy_key = "generic";
     52        private String proxy_key = "repo";
    5353               
    5454        // should perhaps be RepoAction, but it gets complicated with the types
     
    7171       
    7272        /**
     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        /**
    7390         * identification of the target-proxy (type)
    7491         * base for finding the right base_url in the props
     
    8198
    8299        /**
    83          * Override of the basic method provided by the super-class
    84          * Reading the repository-uri from the WorkspaceProfile based on the repository-parameter
     100         * Override of the basic method provided by the super-class:
     101         * Read the repository-uri from the WorkspaceProfile based on the repository-parameter
    85102         */
    86103               
Note: See TracChangeset for help on using the changeset viewer.