Ignore:
Timestamp:
10/04/10 11:31:33 (14 years ago)
Author:
gaba
Message:

simple-querystring handling, collections treeview correction

File:
1 edited

Legend:

Unmodified
Added
Removed
  • MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action/Cache.java

    r713 r745  
    128128                        e.setAttribute("collection", "");
    129129                }
    130 
    131130                if (key_array.length > 3){
    132                         e.setAttribute("startRecord", key_array[3]);
     131                        e.setAttribute("squery", key_array[3]);
     132                }else{
     133                        e.setAttribute("squery", "");
     134                }
     135                if (key_array.length > 4){
     136                        e.setAttribute("startRecord", key_array[4]);
    133137                }else{
    134138                        e.setAttribute("startRecord", "");
    135139                }
    136                 if (key_array.length > 4){
    137                         e.setAttribute("maximumRecords", key_array[4]);
     140                if (key_array.length > 5){
     141                        e.setAttribute("maximumRecords", key_array[5]);
    138142                }else{
    139143                        e.setAttribute("maximumRecords", "");
     
    186190                Query query;
    187191               
    188                 query = new Query(str,"recordset","");
     192                if (str == null) return "";
     193                if (str.trim().length() == 0) return "";
     194               
     195                query = new Query("", str,"recordset","");
    189196                if (query.isStatus(Query.PARSEERROR)) {
    190197                        Admin.notifyUser("Cache.transformQuery.PARSEERROR:" + query.getMsg());
     
    207214               
    208215                String[] key_array = key_info.split("//-");
    209                 String query_str;
    210                
    211                 Admin.notifyUser("formPATH:" + key_info);
    212                
     216                String query_str;               
    213217               
    214218                if(key_array.length > 1){
    215219                        //Admin.notifyUser("formPATH- querystring:" + key_array[1]);
    216220                        if (key_array[0].equals("recordset")){
    217                                 query_str = transformQuery(key_array[1]);       
     221                                query_str = this.transformQuery(key_array[1]); 
    218222                                Admin.notifyUser("formPATH- querystring-transformed:" + query_str);
    219223                        }
     
    233237                }
    234238                if (key_array.length > 3){
    235                         xpath_expr = xpath_expr + "and @startRecord='"+key_array[3]+"'";
     239                        xpath_expr = xpath_expr + "and @squery='"+key_array[3]+"'";
     240                }else{
     241                        xpath_expr = xpath_expr + " and @squery=''";
     242                }
     243                if (key_array.length > 4){
     244                        xpath_expr = xpath_expr + "and @startRecord='"+key_array[4]+"'";
    236245                }else{
    237246                        xpath_expr = xpath_expr + " and @startRecord=''";
    238247                }
    239                 if (key_array.length > 4){
    240                         xpath_expr = xpath_expr + "and @maximumRecords='"+key_array[4]+"']";
     248                if (key_array.length > 5){
     249                        xpath_expr = xpath_expr + "and @maximumRecords='"+key_array[5]+"']";
    241250                }else{
    242251                        xpath_expr = xpath_expr + " and @maximumRecords='']";
     
    259268                        path = cachepath + PREFIX + key_array[0] + "_"+id + ".xml";
    260269                }  else if (list.getLength() > 1){
    261                         //Admin.notifyUser("formPath:!!!:multiple paths:"+key_info);
     270                        Admin.notifyUser("formPath ERROR:!!!:multiple paths:"+key_info);
    262271                       
    263272                }
Note: See TracChangeset for help on using the changeset viewer.