Ignore:
Timestamp:
09/19/10 09:37:51 (14 years ago)
Author:
gaba
Message:
 
Location:
MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice
Files:
4 edited

Legend:

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

    r689 r704  
    2929import org.xml.sax.SAXException;
    3030import org.xml.sax.InputSource;
     31import org.apache.commons.lang.StringEscapeUtils;
    3132
    3233
     
    108109                //e.setNamedItem(attr);
    109110                e.setAttribute("id", c.toString());
    110                 String[] key_array = key_info.split("-");
     111                String[] key_array = key_info.split("//-");
    111112               
    112113                e.setAttribute("type", key_array[0]);
     
    182183                        transformed = "";
    183184                } else {
    184                         try {
    185                                 transformed =  query.toURLParam();
    186                                 transformed = transformed.replace("'", "__qqqqq__");
    187                                 //Admin.notifyUser("CACHE.transformQuery:"+transformed);
    188                         } catch (MalformedURLException e) {
    189                                 // TODO Auto-generated catch block
    190                                 e.printStackTrace();
    191                                 transformed = "";
    192                         }
     185                        transformed =  query.getSimpleQueryString();
     186                        transformed = StringEscapeUtils.escapeXml(transformed);
     187                        //Admin.notifyUser("CACHE.transformQuery:"+transformed);
    193188                }
    194189                return transformed;
     
    201196                String xpath_expr="";
    202197               
    203                 String[] key_array = key_info.split("-");
     198                String[] key_array = key_info.split("//-");
    204199                String query_str;
    205200               
     201                Admin.notifyUser("formPATH:" + key_info);
     202               
     203               
    206204                if(key_array.length > 1){
     205                        //Admin.notifyUser("formPATH- querystring:" + key_array[1]);
    207206                        if (key_array[0].equals("recordset")){
    208207                                query_str = transformQuery(key_array[1]);       
     208                                Admin.notifyUser("formPATH- querystring-transformed:" + query_str);
    209209                        }
    210210                        else {
  • MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action/CompRegistryProxyAction.java

    r690 r704  
    5151                String key="";
    5252                if (getActionkey()!=null) {
    53                         key += getActionkey() + "-" ;
     53                        key += getActionkey() + "//-" ;
    5454                }
    5555                if (getCompid()!=null) {
    56                         key += getCompid() + "-" ;
     56                        key += getCompid() + "//-" ;
    5757                }
    5858                 
  • MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action/GenericProxyAction.java

    r690 r704  
    176176                String key="";
    177177                if (getActionkey()!=null) {
    178                         key += getActionkey() + "-" ;
     178                        key += getActionkey() + "//-" ;
    179179                }
    180180                if (getQ()!=null) {
    181                         key += getQ() + "-" ;
     181                        key += getQ() + "//-" ;
    182182                }
    183183                if (getCollection()!=null) {
  • MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/model/Query.java

    r690 r704  
    188188        }
    189189
     190        public String getSimpleQueryString() {
     191                String[] arr_and = query_string.split(" and ");
     192                String simple_form = "";
     193                String simple_form_all = "";
     194                String rel = "";
     195               
     196                for( int i=0;i<arr_and.length;i++){
     197                        arr_and[i] = arr_and[i].trim();
     198                        String[] arr_or = arr_and[i].split(" or ");
     199                        simple_form = "";
     200                        for( int j=0;j<arr_or.length;j++){
     201                                arr_or[j] = arr_or[j].trim();
     202                                while (arr_or[j].substring(0,1).equals("(") ) {
     203                                        arr_or[j] = arr_or[j].substring(1,arr_or[j].length());
     204                                        arr_or[j] = arr_or[j].trim();
     205                                }
     206                                while ( arr_or[j].substring(arr_or[j].length()-1,arr_or[j].length()).equals(")")){
     207                                        arr_or[j] = arr_or[j].substring(0,arr_or[j].length()-1);
     208                                        arr_or[j] = arr_or[j].trim();
     209                                }
     210                                if (j > 0) {
     211                                        rel = " or ";
     212                                } else {
     213                                        rel = "";
     214                                }
     215                                simple_form = simple_form + rel + arr_or[j];
     216                        }
     217                        Admin.notifyUser(simple_form);
     218                        if (arr_or.length > 1){
     219                                simple_form = "(" + simple_form + ") ";
     220                        }
     221                        if (i > 0) {
     222                                rel = " and  ";
     223                        } else {
     224                                rel = "";
     225                        }
     226                        simple_form_all = simple_form_all + rel + simple_form;
     227                       
     228                }
     229               
     230                return simple_form_all;
     231        }
    190232        /**
    191233         * construct the URL-Param
Note: See TracChangeset for help on using the changeset viewer.