Examples of INamespace


Examples of org.apache.tapestry.INamespace

        return _simpleName;
    }

    private void searchForPage(IRequestCycle cycle)
    {
        INamespace namespace = getNamespace();

        if (_log.isDebugEnabled())
            _log.debug(ResolverMessages.resolvingPage(_simpleName, namespace));

        // Check with and without the leading slash

        if (_simpleName.regionMatches(true, 0, WEB_INF, 0, WEB_INF.length())
                || _simpleName.regionMatches(true, 0, WEB_INF, 1, WEB_INF
                        .length() - 1))
            throw new ApplicationRuntimeException(ResolverMessages
                    .webInfNotAllowed(_simpleName));

        String expectedName = _simpleName + ".page";

        Resource namespaceLocation = namespace.getSpecificationLocation();

        // See if there's a specification file in the same folder
        // as the library or application specification that's
        // supposed to contain the page.

        if (found(namespaceLocation, expectedName)) return;

        if (namespace.isApplicationNamespace())
        {

            // The application namespace gets some extra searching.

            if (found(getWebInfAppLocation(), expectedName)) return;
View Full Code Here

Examples of org.apache.tapestry.INamespace

        return true;
    }

    private void install()
    {
        INamespace namespace = getNamespace();
        IComponentSpecification specification = getSpecification();

        if (_log.isDebugEnabled())
            _log.debug(ResolverMessages.installingPage(_simpleName, namespace,
                    specification));

        namespace.installPageSpecification(_simpleName, specification);
    }
View Full Code Here

Examples of org.apache.tapestry.INamespace

    }

    private Properties getNamespaceProperties(IComponent component,
            Locale locale)
    {
        INamespace namespace = component.getNamespace();

        Resource namespaceLocation = namespace.getSpecificationLocation();

        Map propertiesMap = findPropertiesMapForResource(namespaceLocation);

        Properties result = (Properties) propertiesMap.get(locale);
View Full Code Here

Examples of org.apache.tapestry.INamespace

        IRequestCycle cycle = newCycle();
        Location l = fabricateLocation(13);
        IComponentSpecification spec = newSpecification();

        MockControl control = newControl(INamespace.class);
        INamespace namespace = (INamespace) control.getMock();

        namespace.containsComponentType("MyComponent");
        control.setReturnValue(true);

        namespace.getComponentSpecification("MyComponent");
        control.setReturnValue(spec);

        replayControls();

        ComponentSpecificationResolverImpl resolver = new ComponentSpecificationResolverImpl();
View Full Code Here

Examples of org.apache.tapestry.INamespace

        IRequestCycle cycle = newCycle();
        Location l = fabricateLocation(13);
        IComponentSpecification spec = newSpecification();

        MockControl namespacec = newControl(INamespace.class);
        INamespace namespace = (INamespace) namespacec.getMock();

        MockControl libraryc = newControl(INamespace.class);
        INamespace library = (INamespace) libraryc.getMock();

        namespace.getChildNamespace("lib");
        namespacec.setReturnValue(library);

        library.containsComponentType("MyComponent");
        libraryc.setReturnValue(true);

        library.getComponentSpecification("MyComponent");
        libraryc.setReturnValue(spec);

        replayControls();

        ComponentSpecificationResolverImpl resolver = new ComponentSpecificationResolverImpl();
View Full Code Here

Examples of org.apache.tapestry.INamespace

        MockControl logc = newControl(Log.class);
        Log log = (Log) logc.getMock();

        MockControl namespacec = newControl(INamespace.class);
        INamespace namespace = (INamespace) namespacec.getMock();

        Resource namespaceLocation = newResource("LibraryStandin.library");
        Resource specLocation = namespaceLocation.getRelativeResource("MyComponent.jwc");

        ISpecificationSource source = newSource(specLocation, spec);

        namespace.containsComponentType("MyComponent");
        namespacec.setReturnValue(false);

        train(log, logc, ResolverMessages.resolvingComponent("MyComponent", namespace));

        namespace.getSpecificationLocation();
        namespacec.setReturnValue(namespaceLocation);

        train(log, logc, ResolverMessages.checkingResource(specLocation));
        train(log, logc, ResolverMessages.installingComponent("MyComponent", namespace, spec));

        namespace.installComponentSpecification("MyComponent", spec);

        replayControls();

        ComponentSpecificationResolverImpl resolver = new ComponentSpecificationResolverImpl();
        resolver.setLog(log);
View Full Code Here

Examples of org.apache.tapestry.INamespace

    }

    private INamespace newNamespace(String prefixes)
    {
        MockControl control = newControl(INamespace.class);
        INamespace namespace = (INamespace) control.getMock();

        namespace.getPropertyValue(NamespaceClassSearchPageClassProvider.PACKAGES_NAME);
        control.setReturnValue(prefixes);

        return namespace;
    }
View Full Code Here

Examples of org.apache.tapestry.INamespace

        return namespace;
    }

    public void testDefaultSearchList()
    {
        INamespace namespace = newNamespace(null);

        replayControls();

        List prefixes = new NamespaceClassSearchPageClassProvider()
                .buildPackageSearchList(namespace);
View Full Code Here

Examples of org.apache.tapestry.INamespace

        verifyControls();
    }

    public void testSearchListWithPrefixes()
    {
        INamespace namespace = newNamespace("org.foo,org.bar.baz");

        replayControls();

        List prefixes = new NamespaceClassSearchPageClassProvider()
                .buildPackageSearchList(namespace);
View Full Code Here

Examples of org.apache.tapestry.INamespace

        MockControl logc = newControl(Log.class);
        Log log = (Log) logc.getMock();

        MockControl namespacec = newControl(INamespace.class);
        INamespace namespace = (INamespace) namespacec.getMock();

        MockControl frameworkc = newControl(INamespace.class);
        INamespace framework = (INamespace) frameworkc.getMock();

        Resource namespaceLocation = newResource("LibraryStandin.library");

        namespace.containsComponentType("FrameworkComponent");
        namespacec.setReturnValue(false);

        train(log, logc, ResolverMessages.resolvingComponent("FrameworkComponent", namespace));

        namespace.getSpecificationLocation();
        namespacec.setReturnValue(namespaceLocation);

        train(log, logc, ResolverMessages.checkingResource(namespaceLocation
                .getRelativeResource("FrameworkComponent.jwc")));

        namespace.isApplicationNamespace();
        namespacec.setReturnValue(false);

        ISpecificationSource source = newSource(framework);

        framework.containsComponentType("FrameworkComponent");
        frameworkc.setReturnValue(true);

        framework.getComponentSpecification("FrameworkComponent");
        frameworkc.setReturnValue(spec);

        train(log, logc, ResolverMessages
                .installingComponent("FrameworkComponent", namespace, spec));
        namespace.installComponentSpecification("FrameworkComponent", spec);
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.