Changeset 1810 for MDService2


Ignore:
Timestamp:
03/26/12 12:21:12 (12 years ago)
Author:
gaba
Message:

scan format , base_uri

Location:
MDService2/branches/MDService_simple3/src
Files:
4 edited

Legend:

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

    r1809 r1810  
    2222import org.w3c.dom.Node;
    2323
     24import eu.clarin.cmdi.mdservice.internal.CQLParseException;
    2425import eu.clarin.cmdi.mdservice.internal.Cache;
     26import eu.clarin.cmdi.mdservice.internal.NoStylesheetException;
    2527import eu.clarin.cmdi.mdservice.internal.Utils;
    2628import eu.clarin.cmdi.mdservice.model.Diagnostic;
     
    162164                        addParam("scripts_url",Utils.getConfig("webscripts.uri"));
    163165                }
    164         }
     166               
     167                if (params.get("base_url") == null){
     168                        addParam("base_url",Utils.getConfig("base.uri"));
     169                }
     170                if (params.get("cache") == null){
     171                        addParam("cache",Cache.SKIP);
     172                }
     173        }
     174       
     175        @Override
     176        public boolean checkTargetProxy(){
     177                //if ( getTargetProxy() == null) return false;
     178                return true;
     179        }
     180       
     181        @Override
     182        public void checkParams(){
     183                if (getTargetProxy() != null){
     184                        getTargetProxy().checkParams();
     185                }
     186        }
     187        @Override
     188        public InputStream getSourceStream() throws IOException, NoStylesheetException, CQLParseException {             
     189                // TODO condition case scan
     190                if (getTargetProxy() == null){
     191                        WorkspaceRepositoryAction wra = new WorkspaceRepositoryAction();
     192                        wra.setParam("format","sruscan");
     193                        wra.setType("SERVER");
     194                        try {
     195                                if (wra.execute() == SUCCESS){
     196                                        return wra.getResultStream();
     197                                }
     198                        } catch (Exception e) {
     199                                // TODO Auto-generated catch block
     200                                e.printStackTrace();
     201                        }
     202                        return null;
     203                }
     204                return getTargetProxy().getSourceStream();
     205               
     206        }
     207        /*
    165208        @Override
    166209        public void prepare()  {
     
    187230                super.prepare();
    188231        }
    189                
     232                */
    190233        @Override
    191234        public void setTargetProxy(){
     
    193236                //Query query = new Query();
    194237               
     238                if ((getRepository().equals("")) && (getParam("operation").equals("scan"))){
     239                        return;
     240                }
    195241                switch (WorkspaceProfile.RepositoryType.toRepositoryType(WorkspaceProfile.getRepositoryType(getRepository())))
    196242                {               
  • MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/action/GenericAction.java

    r1800 r1810  
    527527        }
    528528
     529        public boolean checkTargetProxy(){
     530                if ( getTargetProxy() == null) return false;
     531                return true;
     532        }
     533       
     534        public void checkParams(){
     535                getTargetProxy().checkParams();
     536        }
    529537        /**
    530538         * This is the work-horse function.
     
    551559                       
    552560                        setTargetProxy();
    553                         if (getTargetProxy() == null) return;                   
    554                         getTargetProxy().checkParams();
     561                        if (!checkTargetProxy()) return;
     562                        checkParams();
     563                       
    555564                       
    556565                        // Do not continue if something is fatal.
  • MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/action/WorkspaceAction.java

    r1807 r1810  
    757757        }
    758758
    759 public Object getQueryParent() throws XPathExpressionException{
     759        public Object getQueryParent() throws XPathExpressionException{
    760760               
    761761                XPathFactory factory = XPathFactory.newInstance();
     
    774774        }
    775775
    776 public Object getQueryVcrid() throws XPathExpressionException{
     776        public Object getQueryVcrid() throws XPathExpressionException{
    777777       
    778778        XPathFactory factory = XPathFactory.newInstance();
     
    793793}
    794794
    795 public Object getVcrid() throws XPathExpressionException{
     795        public Object getVcrid() throws XPathExpressionException{
    796796       
    797797        XPathFactory factory = XPathFactory.newInstance();
  • MDService2/branches/MDService_simple3/src/mdservice.properties

    r1809 r1810  
    55terms.file=terms_setup.xml
    66webscripts.uri = /MDService2
     7base.uri = /MDService2
    78virtualcollection.uri = http://clarin.ids-mannheim.de/vcr/service/virtualcollection
    89
Note: See TracChangeset for help on using the changeset viewer.