Changeset 1628


Ignore:
Timestamp:
11/25/11 11:53:28 (12 years ago)
Author:
gaba
Message:
 
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  
    339339       
    340340        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                }
    342358        }
    343359        /**
  • MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/action/RepoAction.java

    r1627 r1628  
    4040        }
    4141
     42        /*
    4243        @Override
    4344        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               
    5146               
    5247                // set defaults
     
    120115
    121116                addParam("fullformat",getFullFormat());
    122                 */
     117               
    123118        }
     119*/
    124120        /**
    125121         * 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  
    106106                return "";
    107107        }
    108 
     108/*
    109109        @Override
    110110        protected void setDefaultParams() {             
     
    178178
    179179                addParam("fullformat",getFullFormat());
    180                 */
    181         }
     180               
     181        }
     182*/
    182183        /*
    183184        public void prepareOperation() throws UnsupportedEncodingException{
  • MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/proxy/BasicProxy.java

    r1613 r1628  
    1313import eu.clarin.cmdi.mdservice.internal.NoStylesheetException;
    1414import eu.clarin.cmdi.mdservice.internal.Utils;
     15import eu.clarin.cmdi.mdservice.model.Diagnostic;
     16import eu.clarin.cmdi.mdservice.model.WorkspaceProfile;
    1517
    1618
     
    4648        }
    4749       
     50        public void addParam (String key, String value){
     51                 getSourceAction().addParam(key, value);
     52         }
     53       
    4854        public Map<String,String[]> getParams() {
    4955                return getSourceAction().getParams();
     
    6066       
    6167        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());
    6388        }
    6489       
  • MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/proxy/LocalProxy.java

    r1520 r1628  
    2626        private String proxy_key = "local";
    2727
    28         public void checkParams() {
    29                 // required Params
    30                 if (getParam("q")=="") {
    31                         getSourceAction().getDiagnostics().Add(Diagnostic.MANDATORY_NOTSUPPLIED, "q");
    32                 }
    33         }
    3428       
    3529        /**
  • MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/proxy/MDRepoProxy.java

    r1627 r1628  
    7575 
    7676         
    77          public void addParam (String key, String value){
    78                  getSourceAction().addParam(key, value);
    79          }
     77         // check and set defaults
    8078         @Override
    8179         public void checkParams() {
    8280                // set defaults
     81                        super.checkParams();
    8382                       
    8483                if ( getParams().get("startRecord") == null){
     
    122121                       
    123122                if ( getParams().get("x-cmd-format") == null){
     123                        // TODO moved into BasicAction
     124                        /*
    124125                                if (getParams().get("format") == null){
    125126                                        if (getSourceAction().getFormat() == null) {
     
    130131                                                addParam("format",getSourceAction().getFormat());
    131132                                        }
    132                                 }
     133                                }
     134                                */
    133135                } else {
    134136                                addParam("format",getParams().get("x-cmd-format")[0]);
    135137                }
    136 
     138                 
     139                //todo
    137140                addParam("fullformat",getSourceAction().getFullFormat());
    138                  
    139                 super.checkParams();
     141                //super.checkParams();
    140142               
    141143                // TODO ?????
  • MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/proxy/RepoProxy.java

    r1627 r1628  
    8484        public void checkParams() {
    8585                // required Params
     86                super.checkParams();
    8687                // check and set defaults
    8788                if (WorkspaceProfile.getRepositoryPath(getParam("repository")) == null) {
Note: See TracChangeset for help on using the changeset viewer.