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; }
return; if (namespace.isApplicationNamespace())
return; if (namespace.isApplicationNamespace())
&& component.getNamespace().isApplicationNamespace()) result = findPageTemplateInApplicationRoot( cycle,
&& component.getNamespace().isApplicationNamespace()) result = findPageTemplateInApplicationRoot( cycle,
return result; if (namespace.isApplicationNamespace()) {
return result; if (namespace.isApplicationNamespace()) {
return result; if (namespace.isApplicationNamespace()) {