private IPropertySource createSourceForComponent(IComponent component) { IComponentSpecification specification = component.getSpecification(); List sources = new ArrayList(); sources.add(new PropertyHolderPropertySource(specification)); sources.add(getSourceForNamespace(component.getNamespace())); return (IPropertySource) _chainBuilder.buildImplementation( IPropertySource.class, sources, ImplMessages.componentPropertySourceDescription(specification)); }
private IPropertySource createSourceForComponent(IComponent component) { IComponentSpecification specification = component.getSpecification(); List sources = new ArrayList(); sources.add(new PropertyHolderPropertySource(specification)); sources.add(getSourceForNamespace(component.getNamespace())); return (IPropertySource) _chainBuilder.buildImplementation( IPropertySource.class, sources, ImplMessages.componentPropertySourceDescription(specification)); }
public boolean getAllowBody(String libraryId, String type, Location location) { INamespace namespace = _component.getNamespace(); _resolver.resolve(_cycle, namespace, libraryId, type, location); IComponentSpecification spec = _resolver.getSpecification(); return spec.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(); return spec.getAllowBody(); }
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); if (result == null) { result = new Properties(); // recurse through parent properties List spaceList = new ArrayList(); spaceList.add(namespace); INamespace parent = namespace; while (parent.getParentNamespace() != null) { parent = parent.getParentNamespace(); spaceList.add(parent); } // reverse it so top most namespace comes first for (int i=spaceList.size() - 1; i > -1; i--) { INamespace space = (INamespace)spaceList.get(i); result.putAll(assembleNamespaceProperties(space, findPropertiesMapForResource(space.getSpecificationLocation()), locale)); } propertiesMap.put(locale, result); } 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); if (result == null) { result = new Properties(); // recurse through parent properties List spaceList = new ArrayList(); spaceList.add(namespace); INamespace parent = namespace; while (parent.getParentNamespace() != null) { parent = parent.getParentNamespace(); spaceList.add(parent); } // reverse it so top most namespace comes first for (int i=spaceList.size() - 1; i > -1; i--) { INamespace space = (INamespace)spaceList.get(i); result.putAll(assembleNamespaceProperties(space, findPropertiesMapForResource(space.getSpecificationLocation()), locale)); } propertiesMap.put(locale, result); } return result; }
public BeanProvider(IComponent component) { _component = component; Infrastructure infrastructure = component.getPage().getRequestCycle().getInfrastructure(); _resolver = infrastructure.getClassResolver(); INamespace namespace = component.getNamespace(); _packageList = namespace.getPropertyValue("org.apache.tapestry.bean-class-packages"); _classFinder = infrastructure.getClassFinder(); }
public BeanProvider(IComponent component) { _component = component; Infrastructure infrastructure = component.getPage().getRequestCycle().getInfrastructure(); _resolver = infrastructure.getClassResolver(); INamespace namespace = component.getNamespace(); _packageList = namespace.getPropertyValue("org.apache.tapestry.bean-class-packages"); _classFinder = infrastructure.getClassFinder(); }
&& component.getNamespace().isApplicationNamespace()) result = findPageTemplateInApplicationRoot( cycle,
&& component.getNamespace().isApplicationNamespace()) result = findPageTemplateInApplicationRoot( cycle,
/** * Invoked to create an implicit component (one which is defined in the * containing component's template, rather that in the containing * component's specification). * * @see org.apache.tapestry.services.impl.ComponentTemplateLoaderImpl * @since 3.0 */ public IComponent createImplicitComponent(IRequestCycle cycle, IComponent container, String componentId, String componentType, Location location) { IPage page = container.getPage(); _componentResolver.resolve(cycle, container.getNamespace(), componentType, location); INamespace componentNamespace = _componentResolver.getNamespace(); IComponentSpecification spec = _componentResolver.getSpecification(); IContainedComponent contained = new ContainedComponent(); contained.setLocation(location); contained.setType(componentType); IComponent result = instantiateComponent(page, container, componentId, spec, _componentResolver.getType(), componentNamespace, contained); container.addComponent(result); // Recusively build the component. constructComponent(cycle, page, result, spec, componentNamespace); return result; }
/** * Invoked to create an implicit component (one which is defined in the * containing component's template, rather that in the containing * component's specification). * * @see org.apache.tapestry.services.impl.ComponentTemplateLoaderImpl * @since 3.0 */ public IComponent createImplicitComponent(IRequestCycle cycle, IComponent container, String componentId, String componentType, Location location) { IPage page = container.getPage(); _componentResolver.resolve(cycle, container.getNamespace(), componentType, location); INamespace componentNamespace = _componentResolver.getNamespace(); IComponentSpecification spec = _componentResolver.getSpecification(); IContainedComponent contained = new ContainedComponent(); contained.setLocation(location); contained.setType(componentType); IComponent result = instantiateComponent(page, container, componentId, spec, _componentResolver.getType(), componentNamespace, contained); container.addComponent(result); // Recusively build the component. constructComponent(cycle, page, result, spec, componentNamespace); return result; }
Resource findComponentClassResource(IComponent component, IRequestCycle cycle, String baseName, String extension, Locale locale) String componentPackages = component.getNamespace().getPropertyValue("org.apache.tapestry.component-class-packages");
Resource findComponentClassResource(IComponent component, IRequestCycle cycle, String baseName, String extension, Locale locale) String componentPackages = component.getNamespace().getPropertyValue("org.apache.tapestry.component-class-packages");