Package ariba.ui.aribaweb.util

Examples of ariba.ui.aribaweb.util.AWResourceManager


        // Bad: doublecheck locking
        // Note: using brandName to indicate that this AWRM is the
        // manager for a set of branded ARRM's
        Assert.that(getBrandName() == null,
                    "Invalid AWResourceManager used to resolve brand");
        AWResourceManager rm =
            (AWResourceManager)_realmTable.get(brandName, version);
        if (rm == null && shouldCreate) {
            synchronized(_realmTable) {
                rm = (AWResourceManager)_realmTable.get(brandName, version);
                if (rm == null) {
                    rm = createBrandedResourceManager(brandName, version);
                    rm.setBaseResourceManager(this);
//                    rm.setCacheEnabled(false);
                    _realmTable.put(brandName,version, rm);
                }
            }
        }
View Full Code Here


        Class componentClass = AWUtil.getClassLoader().checkReloadClass(_componentClass);
        if (componentClass != null) setComponentClass(componentClass);

        // Handle templates with embedded script tags (e.g. <groovy></groovy>
        if (_isClassless) {
            AWResourceManager resourceManager = AWComponent.templateResourceManager();
            String templateName = templateName();
            AWResource resource = resourceManager.resourceNamed(templateName);
            checkForEmbeddedScriptChanges(resource);
        }
    }
View Full Code Here

        }

        //
        // get the right resource manager
        //
        AWResourceManager rm = application.resourceManager();
        rm = rm.resolveBrand(brandName, brandVersion);

        AWResource resource = rm.resourceNamed(filename, true);

        if (resource == null) {
            response.appendContent(Fmt.S("Cannot find resource named: %s",HTML.escape(filename)));
        }
        else {
View Full Code Here

        AWEncodedString.setDebuggingEnabled(IsDebuggingEnabled);
    }

    public static AWSingleLocaleResourceManager resourceManager (AWRequestContext requestContext)
    {
        AWResourceManager resourceManager = null;
        HttpSession existingHttpSession = (requestContext != null) ? requestContext.existingHttpSession() : null;
        if (existingHttpSession != null) {
            resourceManager = AWSession.session(existingHttpSession).resourceManager();
        }
        else {
View Full Code Here

    private static AWResourceManager resourceManager (AWRequestContext requestContext)
    {
        // TODO this block is basically duplicating code in AWPage.resourceManager()

        AWResourceManager rm;
        HttpSession httpSession = requestContext.existingHttpSession();
        if (httpSession != null) {
            rm = AWSession.session(httpSession).resourceManager();
        }
        else {
View Full Code Here

    }

    public static String  urlForResourceNamed (AWRequestContext requestContext, String name, boolean useFullURL)
    {
        Assert.that(!StringUtil.nullOrEmptyOrBlankString(name), "Unable to provide url for null/empty/blank resource");
        AWResourceManager resourceManager = resourceManager(requestContext);
        AWResource res = resourceManager.resourceNamed(name);

        if (!(res instanceof AWFileResource)) {
            boolean useFullUrl = requestContext.isMetaTemplateMode();
            boolean isSecure = useFullUrl ? requestContext.request() != null && requestContext.request().isSecureScheme() : false;
            return resourceManager.urlForResourceNamed(name, useFullUrl, isSecure, false);
        }

        String path = ((AWFileResource)res)._fullPath();
        Assert.that(path.endsWith(name), "Resource %s resolved to file path %s, which does not end with the requested resource!", name, path);
View Full Code Here

                        {
                            _componentDefinitionHashtable.put(componentName.intern(), componentDefinition);
                        }
                        else {
                            Class componentClass = null;
                            AWResourceManager resourceManager = resourceManager();
                            componentClass = resourceManager.classForName(componentName);
                            if (componentClass == null) {
                                if (Character.isUpperCase(componentName.charAt(0))) {
                                    String templateName = StringUtil.strcat(componentName, AWComponent.ComponentTemplateFileExtension);
                                    AWResource resource = resourceManager.packageResourceNamed(templateName);
                                    if (resource != null) {
                                        componentClass = readClassFromTemplate(resource);
                                        if (componentClass == null) {
                                            componentClass = DefaultComponentClass;
                                        }
View Full Code Here

    /*
        Silly general purpose utilities that might better be placed in UIMeta...
     */
    public static AWResource lookupRelativeResource (String baseResourcePath, String relativePath, AWRequestContext requestContext)
    {
        AWResourceManager resourceManager = requestContext.getCurrentComponent().resourceManager();
        AWResource resource = null;
        if (baseResourcePath != null) {
            AWResource baseResource = resourceManager.resourceNamed(baseResourcePath);
            if (baseResource != null) {
                resource = baseResource.relativeResource(relativePath, resourceManager);
            }
        }

        if (resource == null) resource = resourceManager.resourceNamed(relativePath);

        return resource;
    }
View Full Code Here

        throw new AWGenericException("*** Error: " + getClass().getName() + ": unable to locate file named \"" + templateName + "\"");
    }

    protected AWResource safeTemplateResource ()
    {
        AWResourceManager resourceManager = templateResourceManager();
        String templateName = templateName();
        AWResource resource = resourceManager.resourceNamed(templateName);
        if (resource == null) {
            resource = parentTemplateResource();
        }
        return resource;
    }
View Full Code Here

    {
        // Recurse up the superclass chain to locate a template.  We used to require subclasses
        // to explicitly provide the templateName of the superclass, but now we iteratively
        // locate the template resource as follows:
        AWResource resource = null;
        AWResourceManager resourceManager = templateResourceManager();
        Class superclass = getClass().getSuperclass();
        while (resource == null && AWComponent.ClassObject.isAssignableFrom(superclass)) {
            String superclassName = superclass.getName();
            AWComponentDefinition componentDefinition = application().componentDefinitionForName(superclassName);
            String templateName = componentDefinition.templateName();
            resource = resourceManager.resourceNamed(templateName);
            superclass = superclass.getSuperclass();
        }
        return resource;
    }
View Full Code Here

TOP

Related Classes of ariba.ui.aribaweb.util.AWResourceManager

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.