cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vjacheslav Borisov (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CXF-5644) Introduce XSLTTransform annotation to support server-side transformations
Date Thu, 27 Mar 2014 04:12:14 GMT

    [ https://issues.apache.org/jira/browse/CXF-5644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13948863#comment-13948863
] 

Vjacheslav Borisov commented on CXF-5644:
-----------------------------------------

Server-side transformation  works when I annotate method

    @XSLTTransform(value="../../stylesheets/testappjava/document.xsl", mediaTypes = "application/xhtml+xml")

and with provider like this:

@Provider
public class XsiXSLTJaxbProvider extends XSLTJaxbProvider {

    @Override
    public boolean isWriteable(Class type, Type genericType, Annotation[] anns, MediaType
mt) {
        XSLTTransform xslt=AnnotationUtils.getAnnotation(anns, XSLTTransform.class);

        if(xslt!=null){
            String xsltUrl = this.getContext().getUriInfo().resolve(URI.create(xslt.value())).getPath();
            HashMap<String, String> outMediaTemplates = new HashMap<>();
            for (String mti : xslt.mediaTypes()) {
                outMediaTemplates.put(mti, xsltUrl);
            }
            this.setOutMediaTemplates(outMediaTemplates);
            
        }
        return super.isWriteable(type, genericType, anns, mt);
    }

}



> Introduce XSLTTransform annotation to support server-side transformations
> -------------------------------------------------------------------------
>
>                 Key: CXF-5644
>                 URL: https://issues.apache.org/jira/browse/CXF-5644
>             Project: CXF
>          Issue Type: Improvement
>          Components: JAX-RS
>            Reporter: Sergey Beryozkin
>            Priority: Minor
>




--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message