Package ariba.ui.aribaweb.core

Examples of ariba.ui.aribaweb.core.AWConcreteApplication


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


        String lookup (String componentName)
        {
            for (String prefix : _prefixes) {
                String name = prefix.concat(componentName);
                String pkg = null;
                AWConcreteApplication application = (AWConcreteApplication)AWConcreteApplication.sharedInstance();
                AWComponentDefinition componentDefinition = application._componentDefinitionForName(name, null);
                if (componentDefinition != null) {
                    pkg = componentDefinition.componentPackageName();
                } else {
                    Class componentClass = application.resourceManager().classForName(name);
                    if (componentClass != null) {
                        Package compPkg = componentClass.getPackage();
                        pkg = (compPkg != null) ? compPkg.getName() : "";
                    }
                }
View Full Code Here

            _DidInit = true;

            UIMeta.getInstance().registerKeyInitObserver(ObjectMeta.KeyType, new TypeToOneMetaProvider());
            UIMeta.getInstance().registerKeyInitObserver(ObjectMeta.KeyElementType, new TypeToManyMetaProvider());

            AWConcreteApplication application = (AWConcreteApplication) AWConcreteServerApplication.sharedInstance();
            application.registerDidInitCallback(new AWConcreteApplication.DidInitCallback() {
                public void applicationDidInit (AWConcreteApplication application) {
                    UIMeta.getInstance().loadRuleFile("PersistenceRules.oss", true, Meta.SystemRulePriority + 2000);
                    hideSupercededClasses(UIMeta.getInstance());
                }
            });
View Full Code Here

    public static String imageUrl (AWRequestContext requestContext, AWComponent component,
                                   String filename, boolean useFullUrl)
    {
        String imageUrl = null;
        AWConcreteApplication application =
            (AWConcreteApplication)AWConcreteApplication.sharedInstance();

        if (application.allowBrandingImages()) {
            AWBrand brand =
                requestContext.application().getBrand(requestContext);
            if (brand != null) {
                imageUrl = AWDirectAction.brandUrlForResourceNamed(requestContext,
                                                                   filename,
                                                                   brand);
            }
            else {
                // The way we're constructing the URL is a bit messy.
                // If we need a full URL, use checkoutFullUrl in order to contruct the
                // full URL and pass requestContext as is required to create full URL.
                // But, do not set set AWRequestContext on the AWDirectActionUrl as doing
                // this will cause an response id to be added to the URL.  This can lead
                // to our image URL's causing FPR's.
                // Also, explicitly onstructing the URL prevents URL decorators
                // from being used.
                AWDirectActionUrl url = useFullUrl ?
                            AWDirectActionUrl.checkoutFullUrl(requestContext) :
                            AWDirectActionUrl.checkoutUrl();
                url.setDirectActionName(AWDirectAction.AWImgActionName);
                url.put("name", filename);
                imageUrl = url.finishUrl();
                if (useFullUrl) {
                    AWNodeManager nodeManager = application.getNodeManager();
                    if (nodeManager != null) {
                        imageUrl = nodeManager.prepareUrlForNodeValidation(imageUrl);
                    }
                }
            }
View Full Code Here

        if (filename == null) {
            imageUrl = encodedStringValueForBinding(_srcBinding);
            Log.aribawebResource_brand.debug("AWBaseImage: filename %s", imageUrl);
        }
        else {
            AWConcreteApplication application =
                (AWConcreteApplication)AWConcreteApplication.sharedInstance();

            if (application.allowBrandingImages()) {
                String urlString = imageUrl(requestContext(), this, filename, useFullUrl());
                imageUrl = AWEncodedString.sharedEncodedString(urlString);
            }
            else {
                AWImageInfo imageInfo = imageInfo(filename);
View Full Code Here

            properties.load(new FileInputStream(propertiesFile));
        } catch (IOException e) {
            Assert.that(false, "Exception loading properties from: %s: %s", propertiesFile, e);
        }

        final AWConcreteApplication application = (AWConcreteApplication)AWConcreteApplication.defaultApplication();

        AWEvaluateTemplateFile page = create(templateFile, properties);

        // force initialization of the default application
        System.out.printf("AWEvaluateTemplateFile evaluating %s to %s ...\n", templateFile, outputFile);
View Full Code Here

    Pattern _CssUrlRef = Pattern.compile("url\\s*\\(\\s*[\"\']?([\\w\\.\\-]+)[\"\']?\\s*\\)");

    void noteResourcesInCss (File file, AWResource cssResource)
    {
        final AWConcreteApplication application = (AWConcreteApplication)AWConcreteApplication.sharedInstance();
        String css = AWUtil.stringWithContentsOfInputStream(cssResource.inputStream());
        Matcher m = _CssUrlRef.matcher(css);
        while (m.find()) {
            String ref = m.group(1);
            AWResource resource = cssResource.relativeResource(ref , application.resourceManager());
            System.out.printf("     -- CSS %s ref to resource %s (%s)\n", file.getPath(), ref, resource.name());
            noteResource(resource.name(), resource);
        }
    }
View Full Code Here

            Assert.that(appDir.isDirectory(), "Not a directory: %s", args[1]);
            // AWConcreteServerApplication.registerDebugSearchPath(appDir.getAbsolutePath());
            AppDir = appDir.getAbsolutePath();
        }

        final AWConcreteApplication application = (AWConcreteApplication)AWConcreteApplication.createApplication(
                ExtendedDefaultApplication.class.getName(), ExtendedDefaultApplication.class);
        AWConcreteApplication.IsDebuggingEnabled = false;
       
        Assert.that(outputDir.isDirectory(), "Not a directory: %s", args[0]);
        AWComponent startPage;
        String mainName = application.mainPageName();

        if (args.length > 2 && !args[2].equals(".")) {
            mainName = args[2];
            startPage = AWComponent.createPageWithName(mainName);
        }
        else {
            startPage = (AWComponent)application.mainPage(application.createRequestContext(_fakeRequest));
        }

        if (args.length > 3) {
            staticizer._aliasForPath.put(staticizer.urlForComponent(startPage), args[3]);
        }
View Full Code Here

        final List<String> orderedJarNames = new ArrayList();
        final boolean didLoad = !awJarUrlsByName.isEmpty();
        Set<String> processedJars = new HashSet();

        // Register post-loads after the application has completed initialization
        AWConcreteApplication application = (AWConcreteApplication)AWConcreteApplication.sharedInstance();

        Map<String, Set<String>> jarToLoadedPackageNames = MapUtil.map();
        for (Map.Entry<String, URL> e : awJarUrlsByName.entrySet()) {
            initJar(resourceManager, rd, e.getValue(), e.getKey(), awJarUrlsByName,
                    processedJars, orderedJarNames, jarToLoadedPackageNames);
        }

        long runtime = System.currentTimeMillis() - startMillis;
        /// System.out.printf("*** Jar scan time = %f", ((float)runtime)/1000);

        // fire the initializers
        for (String jarName : orderedJarNames) {
            Properties properties = aribawebPropertiesForName(jarName);
            String initializer = (String)properties.get("initializer");
            if (initializer != null) {
                AWBinding.fieldBinding("initializer", initializer, null).value(null);
            }

            Set<String> loadedPackageNames = jarToLoadedPackageNames.get(jarName);
            // set the namespace resolver for these packages
            String parentPackage = (String)properties.get("use-namespace-from-package");
            if (parentPackage != null) {
                AWNamespaceManager ns = AWNamespaceManager.instance();
                AWNamespaceManager.Resolver resolver = ns.resolverForPackage(parentPackage);
                Assert.that(resolver != null, "Couldn't find resolver for package: %s", parentPackage);

                String namespaceId = (String)properties.get("namespace-identifier");
                if (namespaceId != null) {
                    resolver = new AWNamespaceManager.Resolver(resolver);
                    resolver.addIncludeToNamespace(namespaceId, new AWNamespaceManager.Import(
                            new ArrayList(loadedPackageNames), Arrays.asList("")));
                }

                for (String packageName : loadedPackageNames) {
                    ns.registerResolverForPackage(packageName, resolver);
                }
            }
        }

        // register to run post initializers after application done initializing
        application.registerDidInitCallback(new AWConcreteApplication.DidInitCallback() {
            public void applicationDidInit (AWConcreteApplication application) {
                // Run the post-initializers
                for (String jarName : orderedJarNames) {
                    Properties properties = aribawebPropertiesForName(jarName);
                    String postInitializer = (String)properties.get("post-initializer");
View Full Code Here

        Assert.that(destDir.exists(), "Destination dir does not exist: %s", destDir);
        final File xsdDir = new File(args[1]);
        Assert.that(xsdDir.exists(), "XSD destination dir does not exist: %s", xsdDir);

        // force initialization of the default application
        final AWConcreteApplication application = (AWConcreteApplication)AWConcreteApplication.defaultApplication();
        AWComponent.defaultTemplateParser().registerContainerClassForTagName("a:Api", AWApi.class);

        mergeAWApiDoc(args, destDir, application);
        fixPackageOverviews(destDir, application);
        writeXSDFiles(xsdDir);
View Full Code Here

TOP

Related Classes of ariba.ui.aribaweb.core.AWConcreteApplication

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.