Package javax.faces.application

Examples of javax.faces.application.ResourceHandler.createResource()


    public void testCreateResource() throws Exception {
        setupFacesRequest();

        ResourceHandler resourceHandler = facesContext.getApplication().getResourceHandler();

        assertNotNull(resourceHandler.createResource("org.richfaces.resource.CacheableResourceImpl"));
        assertNotNull(resourceHandler.createResource("org.richfaces.resource.CacheableResourceImpl", ""));
        assertNotNull(resourceHandler.createResource("org.richfaces.resource.CacheableResourceImpl", null));
        assertNotNull(resourceHandler.createResource("defaultResourceHandlerResource.js"));
        assertNotNull(resourceHandler.createResource("libraryResource.js", "org.richfaces.resource.test"));
    }
View Full Code Here


        setupFacesRequest();

        ResourceHandler resourceHandler = facesContext.getApplication().getResourceHandler();

        assertNotNull(resourceHandler.createResource("org.richfaces.resource.CacheableResourceImpl"));
        assertNotNull(resourceHandler.createResource("org.richfaces.resource.CacheableResourceImpl", ""));
        assertNotNull(resourceHandler.createResource("org.richfaces.resource.CacheableResourceImpl", null));
        assertNotNull(resourceHandler.createResource("defaultResourceHandlerResource.js"));
        assertNotNull(resourceHandler.createResource("libraryResource.js", "org.richfaces.resource.test"));
    }
View Full Code Here

        ResourceHandler resourceHandler = facesContext.getApplication().getResourceHandler();

        assertNotNull(resourceHandler.createResource("org.richfaces.resource.CacheableResourceImpl"));
        assertNotNull(resourceHandler.createResource("org.richfaces.resource.CacheableResourceImpl", ""));
        assertNotNull(resourceHandler.createResource("org.richfaces.resource.CacheableResourceImpl", null));
        assertNotNull(resourceHandler.createResource("defaultResourceHandlerResource.js"));
        assertNotNull(resourceHandler.createResource("libraryResource.js", "org.richfaces.resource.test"));
    }

    public void testLibraryExists() throws Exception {
View Full Code Here

        ResourceHandler resourceHandler = facesContext.getApplication().getResourceHandler();

        assertNotNull(resourceHandler.createResource("org.richfaces.resource.CacheableResourceImpl"));
        assertNotNull(resourceHandler.createResource("org.richfaces.resource.CacheableResourceImpl", ""));
        assertNotNull(resourceHandler.createResource("org.richfaces.resource.CacheableResourceImpl", null));
        assertNotNull(resourceHandler.createResource("defaultResourceHandlerResource.js"));
        assertNotNull(resourceHandler.createResource("libraryResource.js", "org.richfaces.resource.test"));
    }

    public void testLibraryExists() throws Exception {
        setupFacesRequest();
View Full Code Here

        assertNotNull(resourceHandler.createResource("org.richfaces.resource.CacheableResourceImpl"));
        assertNotNull(resourceHandler.createResource("org.richfaces.resource.CacheableResourceImpl", ""));
        assertNotNull(resourceHandler.createResource("org.richfaces.resource.CacheableResourceImpl", null));
        assertNotNull(resourceHandler.createResource("defaultResourceHandlerResource.js"));
        assertNotNull(resourceHandler.createResource("libraryResource.js", "org.richfaces.resource.test"));
    }

    public void testLibraryExists() throws Exception {
        setupFacesRequest();
View Full Code Here

            }
        }

        private Resource createResource(FacesContext facesContext, ResourceKey resourceInfo) {
            ResourceHandler resourceHandler = facesContext.getApplication().getResourceHandler();
            return resourceHandler.createResource(resourceInfo.getResourceName(), resourceInfo.getLibraryName());
        }

        private void renderResource(String skin) {
            log.debug("rendering " + resourceKey + " (" + skin + ")");
View Full Code Here

        if (base instanceof ResourceHandler) {
            ResourceHandler handler = (ResourceHandler) base;
            String prop = (String) property;
            Resource resource;
            if (!prop.contains(":")) {
                resource = handler.createResource(prop);
            } else {
                String[] parts = prop.split(":");
                if (parts.length != 2) {
                    throw new ELException(MessageFormat.format(
                            "Invalid resource format. Property {0} contains more than one colon (:)", prop));
View Full Code Here

                String[] parts = prop.split(":");
                if (parts.length != 2) {
                    throw new ELException(MessageFormat.format(
                            "Invalid resource format. Property {0} contains more than one colon (:)", prop));
                }
                resource = handler.createResource(parts[1], parts[0]);
            }

            context.setPropertyResolved(true);

            if (resource != null) {
View Full Code Here

    public static final String COMPONENT_TYPE = "org.richfaces.MediaOutput";
    public static final String COMPONENT_FAMILY = "org.richfaces.MediaOutput";

    public Resource getResource() {
        ResourceHandler resourceHandler = getFacesContext().getApplication().getResourceHandler();
        return resourceHandler.createResource(MediaOutputResource.class.getName());
    }

    /**
     * Get URI attribute for resource ( src for images, href for links etc ).
     */
 
View Full Code Here

    }

    private static LibraryFunction getScriptResource(FacesContext facesContext, Class<?> javaClass) {
        ResourceHandler resourceHandler = facesContext.getApplication().getResourceHandler();
        String resourceName = javaClass.getSimpleName() + ".js";
        Resource facesResource = resourceHandler.createResource(resourceName, ORG_RICHFACES_CSV, TEXT_JAVASCRIPT);
        if (null != facesResource) {
            final String functionName = firstToLowerCase(javaClass.getSimpleName());
            return new LibraryFunctionImplementation(functionName, resourceName, ORG_RICHFACES_CSV);
        } else {
            return NO_SCRIPT;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.