Ignore:
Timestamp:
11/22/11 10:57:22 (13 years ago)
Author:
gaba
Message:

query params

File:
1 edited

Legend:

Unmodified
Added
Removed
  • MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/proxy/SRUProxy.java

    r1540 r1623  
    2121
    2222import eu.clarin.cmdi.mdservice.model.Diagnostics;
     23import eu.clarin.cmdi.mdservice.model.Query;
    2324import eu.clarin.cmdi.mdservice.model.WorkspaceProfile;
    2425
     
    3940         * Properties to be filled by Struts with according request-parameters
    4041         */     
     42        /*
    4143        private String q;
    4244        private String version;
     
    5456        private String x_cmd_repository;
    5557        private String x_cmd_collections;
     58        */
    5659        private Set paramSet;
    5760
     
    5962        private static int OP_EXPLAIN = 2;
    6063        private static int OP_SCAN = 3;
     64       
     65       
    6166       
    6267       
     
    8287         }
    8388         
     89         public SRUProxy(Query q){
     90                        setQuery(q);
     91                }
     92         
    8493         protected void  initialize(){
    85                                
     94                /*             
    8695                 // TODO set SRU params
    8796                        // missing collections, columns...
     
    94103                        setX_cmd_repository(getSourceAction().getRepository());
    95104                        setQuery(this.fullQueryString());
    96                        
     105                */     
    97106        /*       
    98107                 if (getServletRequest() != null){
     
    126135                }
    127136       
    128                
     137        /*     
    129138         public String getQ() {
    130139                        return q;
     
    134143                        this.q = q;
    135144                }
     145                */
    136146         /*
    137147         public InputStream getResultStream() {
     
    142152         }
    143153        */
    144 
     154/*
    145155        public String getVersion() {
    146156                return version;
     
    254264                this.x_cmd_collections = x_cmd_collections;
    255265        }
    256        
     266        */
    257267       
    258268        @Override
     
    483493                //TODO params
    484494                if (paramSet == null){
    485                         if (!(operation == null)){
    486                                 params = params + "operation=" + operation;
    487                         }
    488                         if (!(version == null)){
    489                                 params = params + "&version=" + version;
    490                         }
    491                         if (!(query == null)){
    492                                 params = params + "&query=" + query;
    493                         }
    494                         if (getStartRecord() > 0){
    495                                 params = params + "&startRecord=" + String.valueOf(getStartRecord());
    496                         }
    497                         if (getMaximumRecords()> 0){
    498                                 params = params + "&numRecords=" + String.valueOf(getMaximumRecords());
     495                        if (!(getParam("operation") == null)){
     496                                params = params + "operation=" + getParam("operation");
     497                        }
     498                        if (!(getParam("version") == null)){
     499                                params = params + "&version=" + getParam("version");
     500                        }
     501                        if (!(getParam("query") == null)){
     502                                params = params + "&query=" + getParam("query");
     503                        }
     504                        if (Integer.parseInt(getParam("startRecord")) > 0){
     505                                params = params + "&startRecord=" + String.valueOf(getParam("startRecord"));
     506                        }
     507                        if (Integer.parseInt(getParam("maximumRecords"))> 0){
     508                                params = params + "&numRecords=" + String.valueOf(getParam("maximumRecords"));
    499509                        }
    500510                } else {
     
    519529               
    520530                if (this.getBaseURI() == null){
    521                         requestURI = this.getX_cmd_repository();
     531                        requestURI = getParam("x_cmd_repository");//this.getX_cmd_repository();
    522532                } else {
    523533                        requestURI = this.getBaseURI();
Note: See TracChangeset for help on using the changeset viewer.