Changeset 1807 for MDService2
- Timestamp:
- 03/23/12 10:30:34 (12 years ago)
- Location:
- MDService2/branches/MDService_simple3/src
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/action/FCSAction.java
r1802 r1807 97 97 } 98 98 99 @Override 100 public String getFullFormat() { 101 return getActionkey() + getOperation() + "2" + getFormat(); 102 } 103 99 104 public void addFCSParam(String key, String value){ 100 105 String[] sarr = new String[1]; … … 130 135 131 136 @Override 137 public String getFormat() { 138 if (getParams().get("x-format") == null){ 139 return "xml"; 140 } 141 return getParam("x-format"); 142 143 } 144 145 @Override 132 146 protected void setDefaultParams(){ 133 147 // set defaults 134 148 135 if (params.get("repository") == null){ 136 if (params.get("x-context") == null){ 137 addParam("repository",WorkspaceProfile.getRepositoryByIndex(0)); 138 } else { 149 if (params.get("x-context") != null){ 150 139 151 // search in fcs-mapping 140 152 if (WorkspaceProfile.getFCSMapping(params.get("x-context")[0]) == null){ … … 144 156 } 145 157 } 146 } 147 148 } 158 159 addParam("fullformat",getFullFormat()); 160 } 161 @Override 162 public void prepare() { 163 164 loadParams(); 165 // case scan 166 if ((getRepository().equals("")) && (getParam("operation").equals("scan"))){ 167 //TODO 168 WorkspaceRepositoryAction wra = new WorkspaceRepositoryAction(); 169 wra.setParam("format","sruscan"); 170 wra.setType("SERVER"); 171 try { 172 if (wra.execute() == SUCCESS){ 173 setResultStream(wra.getResultStream()); 174 } 175 } catch (Exception e) { 176 // TODO Auto-generated catch block 177 e.printStackTrace(); 178 } 179 180 //WorkspaceProfile.getRepositories() 181 return; 182 } 183 super.prepare(); 184 } 185 149 186 @Override 150 187 public void setTargetProxy(){ 151 188 152 189 //Query query = new Query(); 190 153 191 switch (WorkspaceProfile.RepositoryType.toRepositoryType(WorkspaceProfile.getRepositoryType(getRepository()))) 154 192 { -
MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/action/SRUAction.java
r1800 r1807 89 89 } 90 90 91 public String getOperation() { 92 if (getParams().get("operation") == null){ 93 return "searchRetrieve"; 94 } 95 return getParam("operation"); 96 } 97 91 98 protected final static HashMap<String,Integer> operation_code = new HashMap<String,Integer>(); 92 99 static -
MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/action/WorkspaceAction.java
r1663 r1807 46 46 import org.xml.sax.SAXException; 47 47 48 import eu.clarin.cmdi.mdservice.internal.Cache; 48 49 import eu.clarin.cmdi.mdservice.internal.Utils; 49 50 import eu.clarin.cmdi.mdservice.internal.MDTransformer; 50 51 import eu.clarin.cmdi.mdservice.model.Diagnostic; 52 import eu.clarin.cmdi.mdservice.model.WorkspaceProfile; 51 53 52 54 … … 208 210 } 209 211 212 @Override 213 protected void setDefaultParams(){ 214 215 addParam("fullformat",getFullFormat()); 216 } 210 217 //@Override 211 218 public URL getBaseURL() { … … 267 274 @Override 268 275 public String getFullFormat() { 269 return "xml2 json";276 return "xml2" + getFormat(); 270 277 } 271 278 -
MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/proxy/FCSProxy.java
r1802 r1807 2 2 3 3 import java.io.IOException; 4 import java.net.MalformedURLException; 4 5 import java.net.URL; 5 6 6 7 import org.apache.log4j.Logger; 7 8 9 import eu.clarin.cmdi.mdservice.action.WorkspaceRepositoryAction; 8 10 import eu.clarin.cmdi.mdservice.internal.CQLParseException; 9 11 import eu.clarin.cmdi.mdservice.model.Diagnostic; 12 import eu.clarin.cmdi.mdservice.model.Diagnostics; 10 13 import eu.clarin.cmdi.mdservice.model.Query; 11 14 import eu.clarin.cmdi.mdservice.model.WorkspaceProfile; … … 38 41 getSourceAction().getDiagnostics().Add(Diagnostic.MANDATORY_NOTSUPPLIED, "operation"); 39 42 } 40 43 /* 41 44 if (getParam("query").equals("") && getParam("operation").equals("searchRetrieve")) { 42 45 getSourceAction().getDiagnostics().Add(Diagnostic.MANDATORY_NOTSUPPLIED, "query"); … … 45 48 getSourceAction().getDiagnostics().Add(Diagnostic.MANDATORY_NOTSUPPLIED, "scan"); 46 49 } 50 */ 47 51 48 52 49 53 } 50 54 55 public String getRepositoryURI() { 56 String uri = "http://localhost:8080/MDService2/repository?format=scanxml";//WorkspaceProfile.getRepositoryPath(getSourceAction().getRepository()); 57 return uri; 58 } 59 60 61 /** 62 * Provides the repostory-URL specific to given target repository or registry 63 * @return 64 * @throws MalformedURLException 65 */ 66 public URL getScanRepositoryURL() throws MalformedURLException { 67 URL url = new URL(getRepositoryURI() + "?format=sruscan" ); 68 return url; 69 } 70 /** 71 * the operations scan, explain 72 * or in getSOurceStream?? 73 */ 74 /* 75 @Override 76 public URL getTargetRequest() throws IOException, CQLParseException { 77 78 URL targetURL; 79 if (getSourceAction().getParam("operation").equals("scan") && getSourceAction().getParam("x-context").equals("")) {// && getSourceAction().getParam("scanClause").equals("fcs.resource")){ 80 targetURL = getScanRepositoryURL(); 81 } else { 82 targetURL = super.getTargetRequest(); 83 } 84 85 log.debug("getTargetRequest().targetURL:" + targetURL); 86 return targetURL; 87 88 } 89 */ 51 90 } -
MDService2/branches/MDService_simple3/src/mdservice.properties
r1800 r1807 28 28 xsl.sru2htmlpage = sru2view.xsl 29 29 xsl.sru2htmltable = sru2view.xsl 30 xsl.fcsscan2htmlpage = fcs/scan2view.xsl 31 xsl.fcsexplain2htmlpage = fcs/explain2view.xsl 32 xsl.fcssearchRetrieve2htmlpage = fcs/result2view_v1.xsl 30 33 xsl.pazpar22htmlpage = mdset_pazpar2view.xsl 31 34 xsl.pazpar22htmlpagelist = mdset_pazpar2view.xsl … … 72 75 xsl.terms2txt = complist2termstxt.xsl 73 76 xsl.xml2json = xml2json.xsl 77 xsl.xml2sruscan = xml2sruscan.xsl 74 78 xsl.attr2elements = attr2elements.xsl 75 79 -
MDService2/branches/MDService_simple3/src/xsl/params.xsl
r1667 r1807 16 16 <xsl:param name="base_js_url" select="concat($base_dir, '/search/htmljspage')" /> 17 17 <xsl:param name="docs_baseuri" select="concat($base_dir, '/docs/htmlpage/welcome')" /> 18 <xsl:param name="repository_baseuri" select="concat($base_url, '/repository')" /> 18 19 19 20 <!-- momentary used in dcif2view.xsl to select appropriate language section
Note: See TracChangeset
for help on using the changeset viewer.