Ignore:
Timestamp:
09/12/10 20:47:10 (14 years ago)
Author:
vronk
Message:

added cache-parameter, small changes to stylesheets (record-detail, title-param)

Location:
MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice
Files:
3 edited

Legend:

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

    r676 r689  
    4848public class Cache {
    4949        public static String PREFIX = "xc_";
     50       
     51        public static String USE = "use";
     52        public static String REFRESH = "refresh";
     53        public static String SKIP= "skip";     
    5054       
    5155        private static Cache singleton;
  • MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action/GenericProxyAction.java

    r656 r689  
    3030        private String actionkey;
    3131        private String q;
     32        private String cache = Cache.USE;
    3233        private String collection;
    3334        private int maxdepth;
     
    4344        public void setQ(String q) {
    4445                this.q = q;
     46        }
     47
     48        public String getCache() {
     49                return cache;
     50        }
     51
     52        public void setCache(String cache) {
     53                this.cache = cache;
    4554        }
    4655
     
    177186                String xcid;
    178187                Admin.notifyUser("GPA.prepareSourceStream");
    179                 sourceStream = Cache.getCache().getFromCache(getRequestKey());
    180                 if (sourceStream == null) {
    181                         //sourceStream = getTargetRequest().openStream();
     188                if (getCache().equals(Cache.SKIP)) {
     189                       
    182190                        sourceStream = getSourceStream();
    183                         xcid = Cache.getCache().putInCache(getRequestKey(),sourceStream);                       
    184                         Admin.notifyUser("putting in cache: " + getRequestKey());                       
    185                         sourceStream = Cache.getCache().getFromCache(getRequestKey());
    186                 }  else {
    187                         Admin.notifyUser("reading from cache: " + getRequestKey());
    188                 }
    189        
     191                       
     192                } else {
     193                        if (getCache().equals(Cache.USE)) {
     194                                        sourceStream = Cache.getCache().getFromCache(getRequestKey());
     195                        }
     196
     197                        if (sourceStream == null) { // either not in cache or cache_flag=refresh
     198                                //sourceStream = getTargetRequest().openStream();
     199                                sourceStream = getSourceStream();
     200                                xcid = Cache.getCache().putInCache(getRequestKey(),sourceStream);                       
     201                                Admin.notifyUser("putting in cache: " + getRequestKey());                       
     202                                sourceStream = Cache.getCache().getFromCache(getRequestKey());
     203                        }  else {
     204                                Admin.notifyUser("reading from cache: " + getRequestKey());
     205                        }
     206                }
     207                       
    190208                if (format.equals("xml")) {                     
    191209                        resultStream = sourceStream;   
  • MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/model/Query.java

    r685 r689  
    176176                } else if (type.equals(RECORD)) {
    177177                        //  2010-07-11 this is just a hack, because url-encoding the handle acted strange
    178                         String corrid = getQueryString().replace('_', '/');
     178                        //String corrid = getQueryString().replace('_', '/');
     179                        String corrid = getQueryString();
    179180                        targetRequest = "//MdSelfLink[.='" + corrid + "']";                     
    180181                } else {
Note: See TracChangeset for help on using the changeset viewer.