Ignore:
Timestamp:
08/21/11 20:31:13 (13 years ago)
Author:
vronk
Message:

output - method, DOCTYPE, encoding issues (trying to unify for xhtml (but not over all xsls yet); test-suite update

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  
    9393                                // TODO Auto-generated catch block
    9494                                e.printStackTrace();
     95                        } catch (NoStylesheetException e) {
     96                                // TODO Auto-generated catch block
     97                                e.printStackTrace();
    9598                        }
    9699         }
     
    196199        public String getActionContentType() {
    197200                if (format.toLowerCase().startsWith("html")) {
    198                         this.actionContentType = "text/html";
     201                        this.actionContentType = "text/html";           
     202                        //this.actionContentType = "application/xhtml+xml";
    199203                } else {
    200204                        this.actionContentType = "text/xml";
     
    408412                        return key;
    409413        }
    410         public InputStream getSourceStream() throws IOException {               
     414        public InputStream getSourceStream() throws IOException, NoStylesheetException {               
    411415                return getTargetRequest().openStream();
    412416                //      Admin.notifyUser(getProxyKey() + ".getSourceStream() - unable to open stream: " + getTargetRequest(); 
     
    446450
    447451       
    448         public static JSONArray createRepositories() throws IOException, InterruptedException, TransformerException{
     452        public static JSONArray createRepositories() throws IOException, InterruptedException, TransformerException, NoStylesheetException{
    449453                String path = Admin.getConfig().getProperty("workspaceprofile.path") + WorkspaceAction.WORKSPACE_FILENAME;//PROFILENAME_SERVER;
    450454                File file=new File(path);
     
    452456               
    453457                MDTransformer transformer = new MDTransformer();
    454                 transformer.setSrcFile(file.toURL());
     458                transformer.setSrcFile(file.toURI().toURL());
    455459                transformer.setParams(MDTransformer.createParamsMap("xml2json"));
    456460                InputStream jsonstream = transformer.transformXML(in);
     
    497501                                // TODO Auto-generated catch block
    498502                                e.printStackTrace();
     503                        } catch (NoStylesheetException e) {
     504                                // TODO Auto-generated catch block
     505                                e.printStackTrace();
    499506                        }
    500507                }
     
    536543                                e.printStackTrace();
    537544                        } catch (TransformerException e) {
     545                                // TODO Auto-generated catch block
     546                                e.printStackTrace();
     547                        } catch (NoStylesheetException e) {
    538548                                // TODO Auto-generated catch block
    539549                                e.printStackTrace();
  • MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action/MDTransformer.java

    r1431 r1488  
    101101         * @param key
    102102         * @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 {           
    105106                String xslpath = "";
    106107                String xslfilename= Admin.getConfig().getProperty("xsl." + key);
     
    108109                if (xslfilename!=null) {                       
    109110                        xslpath =  Admin.getConfig().getProperty("scripts.path") + xslfilename;
    110                 }
     111                } else {
     112                        throw new NoStylesheetException("No Stylesheet found for format-key: " + key);
     113                }
    111114                Admin.notifyUser("xslfile:" + xslpath);
    112115                return xslpath;
    113116        }
    114117
    115         private StreamSource getXSLStreamSource (String key){           
     118        private StreamSource getXSLStreamSource (String key) throws NoStylesheetException{             
    116119               
    117120                InputStream xslstream;
     
    206209         * @throws TransformerException
    207210         * @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 {
    210214        //public void transformXML (InputStream in, String transkey, String cols, String startRecord, String maximumRecords, String lang, String q, String repositoryURI, OutputStream out ) throws TransformerException, IOException {
    211215       
     
    310314         * @throws InterruptedException
    311315         * @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 {
    314319        //public InputStream transformXML ( InputStream xmlStream, String transkey, String cols, String startRecord, String maximumRecords, String lang, String q, String repositoryURI) throws IOException, InterruptedException, TransformerException {
    315320               
     
    348353         * @throws TransformerException
    349354         * @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 {
    352358        //public InputStream transformXML (URL xmlFile, String transkey ) throws IOException, InterruptedException, TransformerException {
    353359                srcFile= xmlFile;
     
    365371         * @param transkey
    366372         * @return
     373         * @throws NoStylesheetException
    367374         * @throws IOException
    368375         */
    369         public String transformXML (String xml) {
     376        public String transformXML (String xml) throws NoStylesheetException {
    370377        //public String transformXML (String xml, String transkey ) {
    371378                String result="";
  • MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action/Pz2ProxyAction.java

    r1486 r1488  
    137137
    138138        @Override
    139         public InputStream getSourceStream() throws IOException {
     139        public InputStream getSourceStream() throws IOException, NoStylesheetException {
    140140                if (getCommand() == null){
    141141                        try {
  • MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action/TermsProxyAction.java

    r1268 r1488  
    128128        }
    129129       
    130         public InputStream getSourceStream() throws IOException{
     130        public InputStream getSourceStream() throws IOException, NoStylesheetException{
    131131                String type = getTSAttr("type");
    132132                Admin.notifyUser("TPA.getSourceStream.TStype: " + type);
Note: See TracChangeset for help on using the changeset viewer.