Changeset 1810 for MDService2
- Timestamp:
- 03/26/12 12:21:12 (12 years ago)
- 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 22 22 import org.w3c.dom.Node; 23 23 24 import eu.clarin.cmdi.mdservice.internal.CQLParseException; 24 25 import eu.clarin.cmdi.mdservice.internal.Cache; 26 import eu.clarin.cmdi.mdservice.internal.NoStylesheetException; 25 27 import eu.clarin.cmdi.mdservice.internal.Utils; 26 28 import eu.clarin.cmdi.mdservice.model.Diagnostic; … … 162 164 addParam("scripts_url",Utils.getConfig("webscripts.uri")); 163 165 } 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 /* 165 208 @Override 166 209 public void prepare() { … … 187 230 super.prepare(); 188 231 } 189 232 */ 190 233 @Override 191 234 public void setTargetProxy(){ … … 193 236 //Query query = new Query(); 194 237 238 if ((getRepository().equals("")) && (getParam("operation").equals("scan"))){ 239 return; 240 } 195 241 switch (WorkspaceProfile.RepositoryType.toRepositoryType(WorkspaceProfile.getRepositoryType(getRepository()))) 196 242 { -
MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/action/GenericAction.java
r1800 r1810 527 527 } 528 528 529 public boolean checkTargetProxy(){ 530 if ( getTargetProxy() == null) return false; 531 return true; 532 } 533 534 public void checkParams(){ 535 getTargetProxy().checkParams(); 536 } 529 537 /** 530 538 * This is the work-horse function. … … 551 559 552 560 setTargetProxy(); 553 if (getTargetProxy() == null) return; 554 getTargetProxy().checkParams(); 561 if (!checkTargetProxy()) return; 562 checkParams(); 563 555 564 556 565 // Do not continue if something is fatal. -
MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/action/WorkspaceAction.java
r1807 r1810 757 757 } 758 758 759 public Object getQueryParent() throws XPathExpressionException{759 public Object getQueryParent() throws XPathExpressionException{ 760 760 761 761 XPathFactory factory = XPathFactory.newInstance(); … … 774 774 } 775 775 776 public Object getQueryVcrid() throws XPathExpressionException{776 public Object getQueryVcrid() throws XPathExpressionException{ 777 777 778 778 XPathFactory factory = XPathFactory.newInstance(); … … 793 793 } 794 794 795 public Object getVcrid() throws XPathExpressionException{795 public Object getVcrid() throws XPathExpressionException{ 796 796 797 797 XPathFactory factory = XPathFactory.newInstance(); -
MDService2/branches/MDService_simple3/src/mdservice.properties
r1809 r1810 5 5 terms.file=terms_setup.xml 6 6 webscripts.uri = /MDService2 7 base.uri = /MDService2 7 8 virtualcollection.uri = http://clarin.ids-mannheim.de/vcr/service/virtualcollection 8 9
Note: See TracChangeset
for help on using the changeset viewer.