Package org.apache.myfaces.commons.resourcehandler.config.element

Examples of org.apache.myfaces.commons.resourcehandler.config.element.Library


    {
        String mapping = getResourceHandlerSupport().getMapping() != null ?
                getResourceHandlerSupport().getMapping() :
                "" ;

        Library library = getExtendedDefaultResourceHandlerSupport().getMyFacesResourcesConfig().
            getLibrary(getLibraryName());
           
        if (library.getRequestPath() == null)
        {
            String localePrefix = getResourceMeta().getLocalePrefix() != null
                    getResourceMeta().getLocalePrefix() : _expectedLocalePrefix;
            if (localePrefix == null)
            {
                // calculate current localePrefix (could be different from the one requested, e.g. on locale change)
                localePrefix = getRequestLocalePrefix();
            }
            String path = null;
            if (!getResourceHandlerSupport().isExtensionMapping())
            {
                path = mapping + getResourceHandlerSupport().getResourceIdentifier() + "/$/" +
                                localePrefix + '/' +
                                getLibraryName() + '/' +
                                getResourceName();
            }
            else
            {
                path = getResourceHandlerSupport().getResourceIdentifier() + "/$/" +
                localePrefix + '/' +
                getLibraryName() + '/' +
                getResourceName() + mapping;
            }
           
            FacesContext facesContext = FacesContext.getCurrentInstance();
            return facesContext.getApplication().getViewHandler().getResourceURL(facesContext, path);
        }
        else
        {
            //Redirect url assume prefix mapping.
            FacesContext facesContext = FacesContext.getCurrentInstance();
            return facesContext.getApplication().getViewHandler().getResourceURL(facesContext,
                    calculateRequestPath(facesContext, library.getRequestPath()));
        }
    }
View Full Code Here


                    return;
                }
               
                if ("library".equals(localName))
                {
                    Library l = new Library();
                    l.setName(libraryName);
                    l.setRedirectName(redirectName);
                    l.setRequestPath(requestPath);
                    config.addLibrary(l);
                }
                else if ("library-name".equals(localName))
                {
                    libraryName = captureBuffer();
View Full Code Here

    }

    public String resolveLibraryName(String libraryName)
    {
        String finalLibraryName = libraryName;
        Library library = null;
        boolean resolved = false;
        do
        {
            library = getResourceHandlerSupport().getMyFacesResourcesConfig().getLibrary(finalLibraryName);
            if (library != null)
            {
                if (library.getRedirectName() != null && library.getRedirectName().length() > 0)
                {
                    finalLibraryName = library.getRedirectName();
                }
                else
                {
                    //No redirect, so this is the real instance
                    resolved = true;
View Full Code Here

    {
        String mapping = getResourceHandlerSupport().getMapping() != null ?
                getResourceHandlerSupport().getMapping() :
                "" ;

        Library library = getExtendedDefaultResourceHandlerSupport().getMyFacesResourcesConfig().
            getLibrary(getLibraryName());
           
        if (library.getRequestPath() == null)
        {
            String localePrefix = getResourceMeta().getLocalePrefix() != null
                    getResourceMeta().getLocalePrefix() : _expectedLocalePrefix;
            if (localePrefix == null)
            {
                // calculate current localePrefix (could be different from the one requested, e.g. on locale change)
                localePrefix = getRequestLocalePrefix();
            }
            String path = null;
            if (!getResourceHandlerSupport().isExtensionMapping())
            {
                path = mapping + getResourceHandlerSupport().getResourceIdentifier() + "/$/" +
                                localePrefix + '/' +
                                getLibraryName() + '/' +
                                getResourceName();
            }
            else
            {
                path = getResourceHandlerSupport().getResourceIdentifier() + "/$/" +
                localePrefix + '/' +
                getLibraryName() + '/' +
                getResourceName() + mapping;
            }
           
            FacesContext facesContext = FacesContext.getCurrentInstance();
            return facesContext.getApplication().getViewHandler().getResourceURL(facesContext, path);
        }
        else
        {
            //Redirect url assume prefix mapping.
            FacesContext facesContext = FacesContext.getCurrentInstance();
            return facesContext.getApplication().getViewHandler().getResourceURL(facesContext,
                    calculateRequestPath(facesContext, library.getRequestPath()));
        }
    }
View Full Code Here

                    return;
                }
               
                if ("library".equals(localName))
                {
                    Library l = new Library();
                    l.setName(libraryName);
                    l.setRedirectName(redirectName);
                    l.setRequestPath(requestPath);
                    config.addLibrary(l);
                }
                else if ("library-name".equals(localName))
                {
                    libraryName = captureBuffer();
View Full Code Here

    }

    public String resolveLibraryName(String libraryName)
    {
        String finalLibraryName = libraryName;
        Library library = null;
        boolean resolved = false;
        do
        {
            library = getResourceHandlerSupport().getMyFacesResourcesConfig().getLibrary(finalLibraryName);
            if (library != null)
            {
                if (library.getRedirectName() != null && library.getRedirectName().length() > 0)
                {
                    finalLibraryName = library.getRedirectName();
                }
                else
                {
                    //No redirect, so this is the real instance
                    resolved = true;
View Full Code Here

TOP

Related Classes of org.apache.myfaces.commons.resourcehandler.config.element.Library

Copyright © 2018 www.massapicom. 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.