Changeset 1528 for MDService2


Ignore:
Timestamp:
09/08/11 20:37:47 (13 years ago)
Author:
gaba
Message:

genericAction params , loadParams changes

Location:
MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/action
Files:
2 edited

Legend:

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

    r1527 r1528  
    5151        private String actionkey = "generic";
    5252        private String q;
    53         private String format;
     53        private String format = "xml";
    5454       
    5555        private String actionContentType;
     
    9292         
    9393         public String getQ() {
    94                         /*
    95                         if  (q == null) {
    96                                 return "";
    97                         } else {
    98                                 return q;
    99                         }       
    100                         */
    10194                        return q;
    10295         }
    10396
    10497         public void setQ(String q) {
    105                         //if (q == null) q="";
    10698                        this.q = q;
    10799         }
    108100       
    109101         public void setFormat(String format) {
    110                         //if (q == null) q="";
    111102                        this.format = format;
    112103         }
     
    133124         }
    134125         public String getFormat() {
    135                         return getParam("x-cmd-format");
     126                        return getParam("format");
    136127         }
    137128         public String getCache() {
    138                         return getParam("x-cmd-cache");
     129                        return getParam("cache");
    139130         }
    140131         public String getRepository() {
    141                         return getParam("x-cmd-repository");
     132                        return getParam("repository");
    142133         }
    143134         public String getLang() {
    144                         return getParam("x-cmd-lang");
     135                        return getParam("lang");
    145136         }
    146137         public String getCollections() {
    147                         return getParam("x-cmd-collections");
     138                        return getParam("collections");
    148139         }
    149140         public String getColumns() {
    150                         return getParam("x-cmd-columns");
     141                        return getParam("columns");
    151142         }
    152143          public String getMaxdepth() {
    153                  return getParam("x-cmd-maxdepth");
     144                 return getParam("maxdepth");
    154145         }
    155146         
     
    292283                        addParam("maximumRecords","50");
    293284                }
     285               
    294286                if ( params.get("x-cmd-maxdepth") == null){
    295                         addParam("x-cmd-maxdepth","2");
    296                 }
     287                        if (params.get("maxdepth") == null){
     288                                addParam("maxdepth","2");
     289                        }
     290                } else {
     291                        addParam("maxdepth",params.get("x-cmd-maxdepth")[0]);
     292                }
     293               
    297294                if ( params.get("x-cmd-repository") == null){
    298                         addParam("x-cmd-repository", WorkspaceProfile.getRepositoryByIndex(0));
    299                 }
     295                        if (params.get("repository") == null){
     296                                addParam("repository",WorkspaceProfile.getRepositoryByIndex(0));
     297                        }
     298                } else {
     299                        addParam("repository",params.get("x-cmd-repository")[0]);
     300                }
     301               
    300302                if ( params.get("x-cmd-cache") == null){
    301                         addParam("x-cmd-cache",Cache.SKIP);
    302                 }
     303                        if (params.get("cache") == null){
     304                                addParam("cache",Cache.SKIP);
     305                        }
     306                } else {
     307                        addParam("cache",params.get("x-cmd-cache")[0]);
     308                }
     309               
    303310                if ( params.get("x-cmd-lang") == null){
    304                         addParam("x-cmd-lang","en");
    305                 }
     311                        if (params.get("lang") == null){
     312                                addParam("lang","en");
     313                        }
     314                } else {
     315                        addParam("lang",params.get("x-cmd-lang")[0]);
     316                }
     317               
    306318                if ( params.get("x-cmd-format") == null){
    307                         addParam("x-cmd-format","xml");
     319                        if (params.get("format") == null){
     320                                if (this.format == null) {
     321                                        addParam("format","xml");
     322                                } else if (this.format.equals("")){
     323                                        addParam("format","xml");
     324                                } else {
     325                                        addParam("format",this.format);
     326                                }
     327                        }
     328                } else {
     329                        addParam("format",params.get("x-cmd-format")[0]);
    308330                }
    309331
    310332                addParam("fullformat",getFullFormat());
    311                 addParam("format",getFormat());
    312333               
    313334        }
  • MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/action/RepoAction.java

    r1525 r1528  
    8383        @Override
    8484        public String getFullFormat() {         
    85                 return actionkey + "2" + getFormat();
     85                return getActionkey() + "2" + getFormat();
    8686        }
    8787        /**
Note: See TracChangeset for help on using the changeset viewer.