Changeset 1629


Ignore:
Timestamp:
11/25/11 21:09:47 (12 years ago)
Author:
gaba
Message:
 
Location:
MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/action/GenericAction.java

    r1628 r1629  
    335335                params = new HashMap(getServletRequest().getParameterMap());   
    336336
    337                 setDefaultParams();             
     337                //setDefaultParams();
     338
     339                // set defaults
     340                if ( params.get("version") == null){
     341                        addParam("version","1.2");
     342                }
     343                if ( params.get("operation") == null){
     344                        addParam("operation","searchRetrieve");
     345                }
     346                //q=query                       
     347                if (getQ() != null) {
     348                        addParam("q",getQ());
     349                        addParam("query",getQ());
     350                } else {
     351                        addParam("q",this.getParam("query"));
     352                }
     353               
     354                if ( params.get("startRecord") == null){
     355                        addParam("startRecord","1");
     356                }
     357                if ( params.get("maximumRecords") == null){
     358                        addParam("maximumRecords","50");
     359                }
     360               
     361                if ( params.get("x-cmd-maxdepth") == null){
     362                        if (params.get("maxdepth") == null){
     363                                addParam("maxdepth","2");
     364                        }
     365                } else {
     366                        addParam("maxdepth",params.get("x-cmd-maxdepth")[0]);
     367                }
     368               
     369                if ( params.get("x-cmd-repository") == null){
     370                        if (params.get("repository") == null){
     371                                addParam("repository",WorkspaceProfile.getRepositoryByIndex(0));
     372                        }
     373                } else {
     374                        addParam("repository",params.get("x-cmd-repository")[0]);
     375                }
     376               
     377                if ( params.get("x-cmd-cache") == null){
     378                        if (params.get("cache") == null){
     379                                addParam("cache",Cache.SKIP);
     380                        }
     381                } else {
     382                        addParam("cache",params.get("x-cmd-cache")[0]);
     383                }
     384               
     385                if ( params.get("x-cmd-lang") == null){
     386                        if (params.get("lang") == null){
     387                                addParam("lang","en");
     388                        }
     389                } else {
     390                        addParam("lang",params.get("x-cmd-lang")[0]);
     391                }
     392               
     393                if ( params.get("x-cmd-format") == null){
     394                        if (params.get("format") == null){
     395                                if (this.format == null) {
     396                                        addParam("format","xml");
     397                                } else if (this.format.equals("")){
     398                                        addParam("format","xml");
     399                                } else {
     400                                        addParam("format",this.format);
     401                                }
     402                        }
     403                } else {
     404                        addParam("format",params.get("x-cmd-format")[0]);
     405                }
     406
     407                addParam("fullformat",getFullFormat());
    338408        }
    339409       
  • MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/action/RepoAction.java

    r1628 r1629  
    133133                                return;
    134134                        }
     135
    135136                        //Query query = new Query();
    136137                        switch (WorkspaceProfile.RepositoryType.toRepositoryType(WorkspaceProfile.getRepositoryType(getRepository())))
  • MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/proxy/BasicProxy.java

    r1628 r1629  
    6767        public void checkParams() {
    6868                // required Params
    69 
    70                 if (getParam("q").equals("")) {
    71                         getSourceAction().getDiagnostics().Add(Diagnostic.MANDATORY_NOTSUPPLIED, "q");
    72                 }
     69/*
     70                //if (getParam("q").equals("")) {
     71                //      getSourceAction().getDiagnostics().Add(Diagnostic.MANDATORY_NOTSUPPLIED, "q");
     72                //}
    7373                if (getParams().get("format") == null){
    7474                        if (getSourceAction().getFormat() == null) {
     
    8080                        }
    8181                }
    82                 // moved into action - needed for creation  proxy
    83                 /*if (getParams().get("repository") == null){
    84                         addParam("repository",WorkspaceProfile.getRepositoryByIndex(0));
    85                 }
     82               
     83                addParam("fullformat",getSourceAction().getFullFormat());
    8684                */
    87                 addParam("fullformat",getSourceAction().getFullFormat());
    8885        }
    8986       
  • MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/proxy/MDRepoProxy.java

    r1628 r1629  
    7979         public void checkParams() {
    8080                // set defaults
    81                         super.checkParams();
    82                        
     81                //      super.checkParams();
     82                        /*
    8383                if ( getParams().get("startRecord") == null){
    8484                                addParam("startRecord","1");
     
    122122                if ( getParams().get("x-cmd-format") == null){
    123123                        // TODO moved into BasicAction
    124                         /*
     124                       
    125125                                if (getParams().get("format") == null){
    126126                                        if (getSourceAction().getFormat() == null) {
     
    132132                                        }
    133133                                }
    134                                 */
     134                               
    135135                } else {
    136136                                addParam("format",getParams().get("x-cmd-format")[0]);
     
    140140                addParam("fullformat",getSourceAction().getFullFormat());
    141141                //super.checkParams();
    142                
     142                */
    143143                // TODO ?????
    144144                 if (getSourceAction().getActionkey().equals("sru")){
  • MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/proxy/RepoProxy.java

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