Search in sources :

Example 1 with FacesSharableRegistry

use of com.ibm.xsp.registry.FacesSharableRegistry in project org.openntf.nsfodp by OpenNTF.

the class ODPCompiler method compileXSP.

// *******************************************************************************
// * Internal utility methods
// *******************************************************************************
private XSPCompilationResult compileXSP(XPage xpage, JavaSourceClassLoader classLoader) throws Exception {
    try {
        String javaSource;
        try (InputStream xspSource = xpage.getSourceAsStream()) {
            javaSource = dynamicXPageBean.translate(xpage.getJavaClassName(), xpage.getPageName(), xspSource, (FacesSharableRegistry) facesProject.getRegistry());
        }
        Class<?> compiled = classLoader.addClass(xpage.getJavaClassName(), javaSource);
        return new XSPCompilationResult(javaSource, compiled);
    } catch (Throwable e) {
        throw new RuntimeException(MessageFormat.format(Messages.ODPCompiler_errorConvertingXSP, odp.getBaseDirectory().relativize(xpage.getDataFile())), e);
    }
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) InputStream(java.io.InputStream) FacesSharableRegistry(com.ibm.xsp.registry.FacesSharableRegistry) XSPCompilationResult(org.openntf.nsfodp.commons.odp.XSPCompilationResult)

Aggregations

FacesSharableRegistry (com.ibm.xsp.registry.FacesSharableRegistry)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 InputStream (java.io.InputStream)1 XSPCompilationResult (org.openntf.nsfodp.commons.odp.XSPCompilationResult)1