Package org.apache.tapestry

Examples of org.apache.tapestry.INamespace


                _componentResolver.resolve(cycle, namespace, type, location);

                IComponentSpecification componentSpecification = _componentResolver
                        .getSpecification();
                INamespace componentNamespace = _componentResolver.getNamespace();

                // Instantiate the contained component.

                IComponent component = instantiateComponent(
                        page,
View Full Code Here


    {
        IPage page = container.getPage();

        _componentResolver.resolve(cycle, container.getNamespace(), componentType, location);

        INamespace componentNamespace = _componentResolver.getNamespace();
        IComponentSpecification spec = _componentResolver.getSpecification();

        IComponent result = instantiateComponent(
                page,
                container,
View Full Code Here

        return embedded.getSpecification().getAllowBody();
    }

    public boolean getAllowBody(String libraryId, String type, Location location)
    {
        INamespace namespace = _component.getNamespace();

        _resolver.resolve(_cycle, namespace, libraryId, type, location);

        IComponentSpecification spec = _resolver.getSpecification();
View Full Code Here

            String type, Location location)
    {
        reset();
        _type = type;

        INamespace namespace;
        try
        {
            namespace = findNamespaceForId(containerNamespace, libraryId);
        }
        catch (ApplicationRuntimeException e)
        {
            throw new ApplicationRuntimeException(e.getMessage(), location, e);
        }

        setNamespace(namespace);

        if (namespace.containsComponentType(type))
        {
            setSpecification(namespace.getComponentSpecification(type));
            return;
        }

        IComponentSpecification spec = searchForComponent(cycle);
View Full Code Here

    // Hm. This could maybe go elsewhere, say onto ISpecificationSource

    private IComponentSpecification searchForComponent(IRequestCycle cycle)
    {
        IComponentSpecification result = null;
        INamespace namespace = getNamespace();

        if (_log.isDebugEnabled())
            _log.debug(ResolverMessages.resolvingComponent(_type, namespace));
       
        String expectedName = _type + ".jwc";
        Resource namespaceLocation = namespace.getSpecificationLocation();
       
        // Look for appropriate file in same folder as the library (or application)
        // specificaiton.
       
        result = check(namespaceLocation.getRelativeResource(expectedName));
       
        if (result != null)
            return result;

        if (namespace.isApplicationNamespace()) {
           
            // The application namespace gets some extra searching.
           
            result = check(getWebInfAppLocation().getRelativeResource(expectedName));

            if (result == null)
                result = check(getWebInfLocation().getRelativeResource(expectedName));

            if (result == null)
                result = check((getContextRoot().getRelativeResource(expectedName)));
           
            if (result != null)
                return result;
        }
       
        result = getDelegate().findComponentSpecification(cycle, namespace, _type);
        if (result != null)
            return result;
       
        result = searchForComponentClass(namespace, _type);

        if (result != null)
            return result;

        // Not in the library or app spec; does it match a component
        // provided by the Framework?
       
        INamespace framework = getSpecificationSource().getFrameworkNamespace();
       
        if (framework.containsComponentType(_type))
            return framework.getComponentSpecification(_type);
       
        return null;
    }
View Full Code Here

        return getSpecificationSource().getComponentSpecification(resource);
    }
   
    private void install()
    {
        INamespace namespace = getNamespace();
        IComponentSpecification specification = getSpecification();
       
        if (_log.isDebugEnabled())
            _log.debug(ResolverMessages.installingComponent(_type, namespace, specification));
       
        namespace.installComponentSpecification(_type, specification);
    }
View Full Code Here

            firstId = id.substring(0, index);
            nextIds = id.substring(index + 1);
        }

        // Get the first namespace
        INamespace result = (INamespace) _children.get(firstId);

        if (result == null)
        {
            result = createNamespace(firstId);

            _children.put(firstId, result);
        }

        // If the id is a dot separated sequence, recurse to find
        // the needed namespace
        if (result != null && nextIds != null)
            result = result.getChildNamespace(nextIds);

        return result;
    }
View Full Code Here

        return result;
    }

    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

        IComponentSpecification spec = newSpec(location);
        spec.setLocation(_locationFixture);

        IPage page = newPage(spec, source, locale);

        INamespace namespace = new Namespace(null, null, newLibrarySpec(), null);

        page.setNamespace(namespace);

        return source.getMessages(page);
    }
View Full Code Here

        IPage page = newPage(spec, source, locale);
       
        ILibrarySpecification lspec = newLibrarySpec();
        lspec.setProperty(ComponentMessagesSourceImpl.NAMESPACE_PROPERTIES_NAME, propname);
       
        INamespace namespace = new Namespace(null, null, lspec, null);

        page.setNamespace(namespace);

        return source.getMessages(page);
    }
View Full Code Here

TOP

Related Classes of org.apache.tapestry.INamespace

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.