Changeset 1878


Ignore:
Timestamp:
04/12/12 11:52:51 (12 years ago)
Author:
gaba
Message:

htmljspage format - corrections

Location:
MDService2/branches/MDService_simple3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • MDService2/branches/MDService_simple3/WorkspaceProfile.xml

    r1874 r1878  
    77      <WorkspaceProfile user="server">
    88      <Repositories>
    9       <item>
     9      <!--
     10       <item>
    1011           <name>clarin.at-mirror</name>   
    1112           <id>52</id>
    1213           <type>md</type>
    1314           <uri>http://clarin.aac.ac.at/exist/rest/db/clarin/cmd-model.xql/</uri>
    14         </item>
     15        </item>
     16       -->
     17     
    1518    <item>
    1619              <name>clarin.eu:mdrepo</name>
  • MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/action/GenericAction.java

    r1852 r1878  
    559559                        loadParams();
    560560                       
     561                       
    561562                        setTargetProxy();
    562563                        if (checkTargetProxy()) {
     
    578579                       
    579580                        //Caching
    580                         if (getCache().equals(Cache.SKIP)) {
    581                                 sourceStream = getSourceStream();
    582                         } else {
    583                                 if (getCache().equals(Cache.USE)) {
     581                        if (getFormat().equals("htmljspage")) {
     582                                setSourceStream(WorkspaceProfile.createStream("htmljspage"));   
     583                        } else {
     584
     585                                if (getCache().equals(Cache.SKIP)) {
     586                                        sourceStream = getSourceStream();
     587                                } else {
     588                                        if (getCache().equals(Cache.USE)) {
     589                                                        sourceStream = Cache.getCache().getFromCache(req_key);
     590                                        }
     591                                        if (sourceStream == null) { // either not in cache or cache_flag=refresh
     592                                                long startMillis = System.currentTimeMillis();
     593                                                sourceStream = getSourceStream();
     594                                                duration = System.currentTimeMillis() - startMillis;
     595                                                req_key = addDurationKey();
     596                                                String xcid = Cache.getCache().putInCache(req_key,sourceStream);                       
     597                                                log.debug("putting in cache: " + req_key + ", " + xcid);                       
    584598                                                sourceStream = Cache.getCache().getFromCache(req_key);
     599                                        } else {
     600                                                log.debug("reading from cache: " + req_key);
     601                                        }
    585602                                }
    586                                 if (sourceStream == null) { // either not in cache or cache_flag=refresh
    587                                         long startMillis = System.currentTimeMillis();
    588                                         sourceStream = getSourceStream();
    589                                         duration = System.currentTimeMillis() - startMillis;
    590                                         req_key = addDurationKey();
    591                                         String xcid = Cache.getCache().putInCache(req_key,sourceStream);                       
    592                                         log.debug("putting in cache: " + req_key + ", " + xcid);                       
    593                                         sourceStream = Cache.getCache().getFromCache(req_key);
    594                                 } else {
    595                                         log.debug("reading from cache: " + req_key);
    596                                 }
    597603                        }
     604
    598605                       
    599606                        // append diagnostics to sourcestream
Note: See TracChangeset for help on using the changeset viewer.