Examples of AWResource


Examples of ariba.ui.aribaweb.util.AWResource

        AWBinding binding = bindingForName(BindingNames.scriptFile, false);
        if (binding != null) {
            String scriptFileName = (String)valueForBinding(binding);
            scriptString = (String)ScriptFileHashtable.get(scriptFileName);
            if (scriptString == null) {
                AWResource resource = resourceManager().resourceNamed(scriptFileName);
                if (resource == null) {
                    throw new AWGenericException("Unable to locate script file named: " + scriptFileName);
                }
                InputStream scriptInputStream = resource.inputStream();
                scriptString = AWUtil.stringWithContentsOfInputStream(scriptInputStream);
                AWUtil.close(scriptInputStream);
                if (!AWConcreteApplication.IsRapidTurnaroundEnabled) {
                    ScriptFileHashtable.put(scriptFileName, scriptString);
                }
View Full Code Here

Examples of ariba.ui.aribaweb.util.AWResource

    }
   
    public String directConnectResourceUrl ()
    {
        String url = null;
        AWResource resource = styleSheetResource();
        Assert.that(resource != null, "Stylesheet resource %s not found",
                    styleSheetName());

        AWRequestContext requestContext = requestContext();
        AWConcreteApplication application =
            (AWConcreteApplication)AWConcreteApplication.sharedInstance();

        AWBrand brand = application().getBrand(requestContext);
        if (application.allowBrandingImages() && brand != null) {
            url = AWDirectAction.brandUrlForResourceNamed(requestContext,
                                                     resource.name(),
                                                     brand);
        }
        else {
            url =
                AWXDebugResourceActions.urlForResourceNamed(
                    requestContext, resource.name());
        }
        return url;
    }
View Full Code Here

Examples of ariba.ui.aribaweb.util.AWResource

        // 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 {
            if (Log.aribawebResource_brand.isDebugEnabled()) {
                String location = resource.url();
                if (resource instanceof AWFileResource) {
                    AWFileResource file = (AWFileResource)resource;
                    location = file._fullPath();
                }
                Log.aribawebResource_brand.debug("Found: %s", location);
            }

            String lastModified = fmt.format(new Date(resource.lastModified()));
            response.setHeaderForKey(lastModified, "Last-Modified");

            // we are not specifying any cache-control header
      // since we are letting the web server config control this

            if (resource instanceof AWFileResource) {
                AWFileResource file = (AWFileResource)resource;
                response.setContentFromFile(file._fullPath());
            }
            else {
                ((AWBaseResponse)response).setContentFromStream(resource.inputStream());
            }
        }
        return response;
    }
View Full Code Here

Examples of ariba.ui.aribaweb.util.AWResource

        if (!isValidResourceFilename(filename)) {
            response.appendContent("Invalid request: " + HTML.escape(filename));
            return response;
        }

        AWResource imageResource;

        if (session != null) {
            imageResource = session.resourceManager().resourceNamed(filename,true);
        }
        else {
View Full Code Here

Examples of ariba.ui.aribaweb.util.AWResource

        // 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

Examples of ariba.ui.aribaweb.util.AWResource

    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);
View Full Code Here

Examples of ariba.ui.aribaweb.util.AWResource

                            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;
                                        }
                                        if (AWComponent.ClassObject.isAssignableFrom(componentClass)) {
                                            componentDefinition = createComponentDefinitionForNameAndClass(componentName, componentClass);
                                            componentDefinition.setTemplateName(resource.relativePath());
                                            _componentDefinitionHashtable.put(componentName.intern(), componentDefinition);
                                        }
                                        else {
                                            throw new AWGenericException(getClass().getName() + ": invalid class specified for Classless component: " + componentClass.getName());
                                        }
View Full Code Here

Examples of ariba.ui.aribaweb.util.AWResource

        List allTemplates = ListUtil.list();
        Map alreadyParsedTemplates = MapUtil.map();
        List allResources = resourceManager().allResources();

        for (int index = 0, length = allResources.size(); index < length; index++) {
            AWResource resource = (AWResource)allResources.get(index);
            String relativePath = resource.relativePath();
            if (relativePath == null) {
                logWarning("**** Skipping malformed resource: " + resource);
            }
            else if (!relativePath.equals(alreadyParsedTemplates.get(relativePath))) {
                alreadyParsedTemplates.put(relativePath, relativePath);
                if (relativePath.endsWith("AXEtd.awl")) {
                    logString("*** Skipping parse of AXEtd.awl");
                    continue;
                }
                if (relativePath.endsWith(".awl") || relativePath.endsWith(".htm") || relativePath.endsWith(".html")) {

                    try {
                        if (instantiateDefinitions) {
                            String componentName = (new File(relativePath).getName());
                            componentName = AWUtil.substringTo(componentName, '.');
                            logString("-Loading " + relativePath + " (" + componentName + ")");

                            AWComponentDefinition componentDefinition = null;
                            try {
                                componentDefinition = componentDefinitionForName(componentName);
                            }
                            catch (AWGenericException e) {
                                // fall through to test below...
                            }

                            if (componentDefinition == null) {
                                logWarning("         *** null component definition");
                                continue;
                            }

                            AWComponentReference sharedComponentReference = componentDefinition.sharedComponentReference();
                            // AWComponent instance = componentDefinition.createComponent(sharedComponentReference, null, requestContext);
                            AWComponent instance = componentDefinition.newComponentInstance();
                            instance._setup(sharedComponentReference, new AWPage(instance,  requestContext));

                            if (instance == null) {
                                 logWarning("         *** null component instance");
                                 continue;
                            }
                            if (StringUtil.nullOrEmptyString(instance.name())) {
                                logWarning("         *** null component name");
                                continue;
                            }

                            if (AWConcreteApplication.IsDebuggingEnabled) {
                                instance.validate(requestContext.validationContext());
                            }

                            allTemplates.add(instance.loadTemplate());
                        }
                        else {
                            InputStream inputStream = resource.inputStream();
                            String templateString = AWComponent.readTemplateString(inputStream);
                            logString("-Parsing " + relativePath);
                            AWTemplate template = AWComponent.defaultTemplateParser().templateFromString(templateString, relativePath);
                            allTemplates.add(template);
                        }
View Full Code Here

Examples of ariba.ui.aribaweb.util.AWResource

        List componentDefinitions = ListUtil.list();
        Map alreadyParsedTemplates = MapUtil.map();
        List allResources = resourceManager().allResources();

        for (int index = 0, length = allResources.size(); index < length; index++) {
            AWResource resource = (AWResource)allResources.get(index);
            String relativePath = resource.relativePath();
            if (relativePath != null) {
                if (!relativePath.equals(alreadyParsedTemplates.get(relativePath))) {
                    alreadyParsedTemplates.put(relativePath, relativePath);
                    if (relativePath.endsWith("AXEtd.awl")) {
                        continue;
View Full Code Here

Examples of ariba.ui.aribaweb.util.AWResource

        if (shortSystemId != null &&
                (shortSystemId.equals("Frame.dtd") ||
                shortSystemId.equals("Wizard.dtd") ||
                shortSystemId.equals("FrameExt.dtd") ||
                shortSystemId.equals("WizardExt.dtd"))) {
            AWResource resource = _resourceManager.resourceNamed(
                    StringUtil.strcat("ariba/resource/global/dtd/", shortSystemId));
            if (resource != null) {
                String fullUrl = resource.fullUrl();
                return new InputSource(fullUrl);
            }
        }
        return super.resolveEntity(publicId, systemId);
    }
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.