public String provideComponentClassName( ComponentClassProviderContext context) { // This may be null, if the namespace fails to define this meta data // value. return context.getNamespace().getPropertyValue( TapestryConstants.PAGE_CLASS_NAME); }
public String provideComponentClassName( ComponentClassProviderContext context) { // This may be null, if the namespace fails to define this meta data // value. return context.getNamespace().getPropertyValue( TapestryConstants.PAGE_CLASS_NAME); }
/** * Returns property values defined in the namespace's library specification. * * @return the property, or null if not provided in the specification. * @since 4.0 */ public String getPropertyValue(String propertyName) { String ret = _specification.getProperty(propertyName); if (ret == null && _parent != null) { return _parent.getPropertyValue(propertyName); } return ret; } }
/** * Returns property values defined in the namespace's library specification. * * @return the property, or null if not provided in the specification. * @since 4.0 */ public String getPropertyValue(String propertyName) { String ret = _specification.getProperty(propertyName); if (ret == null && _parent != null) { return _parent.getPropertyValue(propertyName); } return ret; } }
public String provideComponentClassName(ComponentClassProviderContext context) { INamespace namespace = context.getNamespace(); String packages = namespace.getPropertyValue(_packagesName); String componentClassName = context.getName().replace('/', '.'); Class clazz = _classFinder.findClass(packages, componentClassName); return clazz == null ? null : clazz.getName(); }
public String[] getPackages() { INamespace namespace = getSpecificationSource().getApplicationNamespace(); String pages = namespace.getPropertyValue(getPagePackages()); String comps = namespace.getPropertyValue(getComponentPackages()); StringBuffer sb = new StringBuffer(); if (pages != null) { sb.append(pages); if (comps!=null) sb.append(","); } if (comps != null) sb.append(comps); return TapestryUtils.split(sb.toString(), ','); } }
public String provideComponentClassName(ComponentClassProviderContext context) { INamespace namespace = context.getNamespace(); String packages = namespace.getPropertyValue(_packagesName); String componentClassName = context.getName().replace('/', '.'); Class clazz = _classFinder.findClass(packages, componentClassName); return clazz == null ? null : clazz.getName(); }
public String[] getPackages() { INamespace namespace = getSpecificationSource().getApplicationNamespace(); String pages = namespace.getPropertyValue(getPagePackages()); String comps = namespace.getPropertyValue(getComponentPackages()); StringBuffer sb = new StringBuffer(); if (pages != null) { sb.append(pages); if (comps!=null) sb.append(","); } if (comps != null) sb.append(comps); return TapestryUtils.split(sb.toString(), ','); } }
private Properties assembleNamespaceProperties(INamespace namespace, Map propertiesMap, Locale locale) { List localizations = findLocalizationsForResource(namespace.getSpecificationLocation(), locale, namespace.getPropertyValue(NAMESPACE_PROPERTIES_NAME)); // Build them back up in reverse order. Properties parent = _emptyProperties; Iterator i = localizations.iterator(); while(i.hasNext()) { ResourceLocalization rl = (ResourceLocalization) i.next(); Locale l = rl.getLocale(); Properties properties = (Properties) propertiesMap.get(l); if (properties == null) { properties = readNamespaceProperties(namespace, l, rl.getResource(), parent); propertiesMap.put(l, properties); } parent = properties; } return parent; }
private Properties assembleNamespaceProperties(INamespace namespace, Map propertiesMap, Locale locale) { List localizations = findLocalizationsForResource(namespace.getSpecificationLocation(), locale, namespace.getPropertyValue(NAMESPACE_PROPERTIES_NAME)); // Build them back up in reverse order. Properties parent = _emptyProperties; Iterator i = localizations.iterator(); while(i.hasNext()) { ResourceLocalization rl = (ResourceLocalization) i.next(); Locale l = rl.getLocale(); Properties properties = (Properties) propertiesMap.get(l); if (properties == null) { properties = readNamespaceProperties(namespace, l, rl.getResource(), parent); propertiesMap.put(l, properties); } parent = properties; } return parent; }
IComponentSpecification searchForComponentClass(INamespace namespace, String type) { String packages = namespace.getPropertyValue("org.apache.tapestry.component-class-packages"); String className = type.replace('/', '.'); Class componentClass = _classFinder.findClass(packages, className); if (componentClass == null) return null; IComponentSpecification spec = new ComponentSpecification(); Resource namespaceResource = namespace.getSpecificationLocation(); Resource componentResource = namespaceResource.getRelativeResource(type + ".jwc"); // try classpath relative if namespace relative doesn't resolve if (componentResource.getResourceURL() == null) { componentResource = new ClasspathResource(_classResolver, componentClass.getName().replace('.', '/')); } Location location = new LocationImpl(componentResource); spec.setLocation(location); spec.setSpecificationLocation(componentResource); spec.setComponentClassName(componentClass.getName()); return spec; }
IComponentSpecification searchForComponentClass(INamespace namespace, String type) { String packages = namespace.getPropertyValue("org.apache.tapestry.component-class-packages"); String className = type.replace('/', '.'); Class componentClass = _classFinder.findClass(packages, className); if (componentClass == null) return null; IComponentSpecification spec = new ComponentSpecification(); Resource namespaceResource = namespace.getSpecificationLocation(); Resource componentResource = namespaceResource.getRelativeResource(type + ".jwc"); // try classpath relative if namespace relative doesn't resolve if (componentResource.getResourceURL() == null) { componentResource = new ClasspathResource(_classResolver, componentClass.getName().replace('.', '/')); } Location location = new LocationImpl(componentResource); spec.setLocation(location); spec.setSpecificationLocation(componentResource); spec.setComponentClassName(componentClass.getName()); return spec; }
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(); }
public IComponentSpecification findPageSpecification(IRequestCycle cycle, INamespace namespace, String name) { if (namespace.isApplicationNamespace()) { String packages = namespace .getPropertyValue("org.apache.tapestry.page-class-packages"); String className = name.replace('/', '.'); Class pageClass = classFinder.findClass(packages, className); if (pageClass == null) { return null; } String fullPath = pageClass.getName().replace('.', '/'); ClasspathResource html = new ClasspathResource(new DefaultClassResolver(), fullPath + ".html"); if (html.getResourceURL() != null) { return setupImplicitPage(namespace.getSpecificationLocation(), new ClasspathResource(new DefaultClassResolver(), fullPath + ".page")); } } return null; }
IComponentSpecification searchForComponentClass(INamespace namespace, String componentType) { String packages = namespace .getPropertyValue("org.apache.tapestry.component-class-packages"); String className = componentType.replace('/', '.'); Class componentClass = classFinder.findClass(packages, className); if (componentClass == null) { return null; } Resource componentResource = null; Resource namespaceResource = namespace.getSpecificationLocation(); String fullPath = componentClass.getName().replace('.', '/'); ClasspathResource html = new ClasspathResource( new DefaultClassResolver(), fullPath + ".html"); // first check near the class, if the html is there then that's where // the (fictional) jwc should be - need exploded wars for this if (html.getResourceURL() != null && namespace.isApplicationNamespace()) { componentResource = new ClasspathResource( new DefaultClassResolver(), fullPath + ".jwc"); } else { componentResource = namespaceResource.getRelativeResource(componentType + ".jwc"); } Location location = new LocationImpl(componentResource); IComponentSpecification spec = new ComponentSpecification(); spec.setLocation(location); spec.setSpecificationLocation(componentResource); spec.setComponentClassName(componentClass.getName()); return spec; }
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");