- Timestamp:
- 08/21/11 20:31:13 (13 years ago)
- Location:
- MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action/GenericProxyAction.java
r1481 r1488 93 93 // TODO Auto-generated catch block 94 94 e.printStackTrace(); 95 } catch (NoStylesheetException e) { 96 // TODO Auto-generated catch block 97 e.printStackTrace(); 95 98 } 96 99 } … … 196 199 public String getActionContentType() { 197 200 if (format.toLowerCase().startsWith("html")) { 198 this.actionContentType = "text/html"; 201 this.actionContentType = "text/html"; 202 //this.actionContentType = "application/xhtml+xml"; 199 203 } else { 200 204 this.actionContentType = "text/xml"; … … 408 412 return key; 409 413 } 410 public InputStream getSourceStream() throws IOException {414 public InputStream getSourceStream() throws IOException, NoStylesheetException { 411 415 return getTargetRequest().openStream(); 412 416 // Admin.notifyUser(getProxyKey() + ".getSourceStream() - unable to open stream: " + getTargetRequest(); … … 446 450 447 451 448 public static JSONArray createRepositories() throws IOException, InterruptedException, TransformerException {452 public static JSONArray createRepositories() throws IOException, InterruptedException, TransformerException, NoStylesheetException{ 449 453 String path = Admin.getConfig().getProperty("workspaceprofile.path") + WorkspaceAction.WORKSPACE_FILENAME;//PROFILENAME_SERVER; 450 454 File file=new File(path); … … 452 456 453 457 MDTransformer transformer = new MDTransformer(); 454 transformer.setSrcFile(file.toUR L());458 transformer.setSrcFile(file.toURI().toURL()); 455 459 transformer.setParams(MDTransformer.createParamsMap("xml2json")); 456 460 InputStream jsonstream = transformer.transformXML(in); … … 497 501 // TODO Auto-generated catch block 498 502 e.printStackTrace(); 503 } catch (NoStylesheetException e) { 504 // TODO Auto-generated catch block 505 e.printStackTrace(); 499 506 } 500 507 } … … 536 543 e.printStackTrace(); 537 544 } catch (TransformerException e) { 545 // TODO Auto-generated catch block 546 e.printStackTrace(); 547 } catch (NoStylesheetException e) { 538 548 // TODO Auto-generated catch block 539 549 e.printStackTrace(); -
MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action/MDTransformer.java
r1431 r1488 101 101 * @param key 102 102 * @return 103 */ 104 private String getXSLPath (String key) { 103 * @throws NoStylesheetException - if no matching entry in properties could be found 104 */ 105 private String getXSLPath (String key) throws NoStylesheetException { 105 106 String xslpath = ""; 106 107 String xslfilename= Admin.getConfig().getProperty("xsl." + key); … … 108 109 if (xslfilename!=null) { 109 110 xslpath = Admin.getConfig().getProperty("scripts.path") + xslfilename; 110 } 111 } else { 112 throw new NoStylesheetException("No Stylesheet found for format-key: " + key); 113 } 111 114 Admin.notifyUser("xslfile:" + xslpath); 112 115 return xslpath; 113 116 } 114 117 115 private StreamSource getXSLStreamSource (String key) {118 private StreamSource getXSLStreamSource (String key) throws NoStylesheetException{ 116 119 117 120 InputStream xslstream; … … 206 209 * @throws TransformerException 207 210 * @throws IOException 208 */ 209 public void transformXML (InputStream in, OutputStream out ) throws TransformerException, IOException { 211 * @throws NoStylesheetException 212 */ 213 public void transformXML (InputStream in, OutputStream out ) throws TransformerException, IOException, NoStylesheetException { 210 214 //public void transformXML (InputStream in, String transkey, String cols, String startRecord, String maximumRecords, String lang, String q, String repositoryURI, OutputStream out ) throws TransformerException, IOException { 211 215 … … 310 314 * @throws InterruptedException 311 315 * @throws TransformerException 312 */ 313 public InputStream transformXML ( InputStream xmlStream) throws IOException, InterruptedException, TransformerException { 316 * @throws NoStylesheetException 317 */ 318 public InputStream transformXML ( InputStream xmlStream) throws IOException, InterruptedException, TransformerException, NoStylesheetException { 314 319 //public InputStream transformXML ( InputStream xmlStream, String transkey, String cols, String startRecord, String maximumRecords, String lang, String q, String repositoryURI) throws IOException, InterruptedException, TransformerException { 315 320 … … 348 353 * @throws TransformerException 349 354 * @throws IOException 350 */ 351 public InputStream transformXML (URL xmlFile ) throws IOException, InterruptedException, TransformerException { 355 * @throws NoStylesheetException 356 */ 357 public InputStream transformXML (URL xmlFile ) throws IOException, InterruptedException, TransformerException, NoStylesheetException { 352 358 //public InputStream transformXML (URL xmlFile, String transkey ) throws IOException, InterruptedException, TransformerException { 353 359 srcFile= xmlFile; … … 365 371 * @param transkey 366 372 * @return 373 * @throws NoStylesheetException 367 374 * @throws IOException 368 375 */ 369 public String transformXML (String xml) {376 public String transformXML (String xml) throws NoStylesheetException { 370 377 //public String transformXML (String xml, String transkey ) { 371 378 String result=""; -
MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action/Pz2ProxyAction.java
r1486 r1488 137 137 138 138 @Override 139 public InputStream getSourceStream() throws IOException {139 public InputStream getSourceStream() throws IOException, NoStylesheetException { 140 140 if (getCommand() == null){ 141 141 try { -
MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action/TermsProxyAction.java
r1268 r1488 128 128 } 129 129 130 public InputStream getSourceStream() throws IOException {130 public InputStream getSourceStream() throws IOException, NoStylesheetException{ 131 131 String type = getTSAttr("type"); 132 132 Admin.notifyUser("TPA.getSourceStream.TStype: " + type);
Note: See TracChangeset
for help on using the changeset viewer.