Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Jakarta-tapestry Wiki" 
for change notification.

The following page has been changed by ManriOffermann:
http://wiki.apache.org/jakarta-tapestry/PagesAndComponentsInWEB-INF

------------------------------------------------------------------------------
  {{{
  public class MySpecificationResolverDelegate implements 
ISpecificationResolverDelegate {
  
-       private ISpecificationSource specificationSource;
        private String pagePath;
        private String componentPath;
  
        private boolean isInitialized;
+       private boolean isCacheDisabled; // not used in sample
        private Resource pagesBaseLocation;
        private Resource componentsBaseLocation;
- 
-       /**
-        * @param specificationSource The specificationSource to set.
-        */
-       public void setSpecificationSource(ISpecificationSource 
specificationSource) {
-               this.specificationSource = specificationSource;
-       }
  
        /**
         * @param componentPath The componentPath to set.
@@ -47, +40 @@

  
                if (namespace.isApplicationNamespace()) {
                        Resource componentResource = 
componentsBaseLocation.getRelativeResource(type + ".jwc");
-               if (componentResource != null) {
+               if (componentResource != null)
-                       return 
specificationSource.getComponentSpecification(componentResource);
+                       return 
cycle.getInfrastructure().getSpecificationSource().getComponentSpecification(componentResource);
-               }
                }
                return null;
        }
@@ -60, +52 @@

        public IComponentSpecification findPageSpecification(IRequestCycle 
cycle, INamespace namespace, String simplePageName) {
                if (!isInitialized)
                        init(namespace);
-               
+ 
                if (namespace.isApplicationNamespace()) {
                        Resource pageResource = 
pagesBaseLocation.getRelativeResource(simplePageName + ".page");
                if (pageResource != null)
-                       return 
specificationSource.getPageSpecification(pageResource);
+                       return 
cycle.getInfrastructure().getSpecificationSource().getPageSpecification(pageResource);
                }
  
                return null;
        }
  
        private void init(INamespace namespace) {
+               isCacheDisabled = 
"true".equals(System.getProperty("org.apache.tapestry.disable-caching"));
+ 
                while (!namespace.isApplicationNamespace())
                        namespace = namespace.getParentNamespace();
                if (namespace.isApplicationNamespace()) {
@@ -82, +76 @@

        }
  
  }
+ 
  }}}
  
- And here's the necessary hivemind.xml configuration. The values of 'pagePath' 
and 'componentPath' are the path to your pages and components folder under 
WEB-INF:
+ And here's the necessary application configuration. The values of 'pagePath' 
and 'componentPath' are the path to your pages and components folder under 
WEB-INF:
+ {{{
+       <extension name="org.apache.tapestry.specification-resolver-delegate" 
+               class="foo.bar.MySpecificationResolverDelegate">
+               <configure property="pagePath" value="pages"/>
+               <configure property="componentPath" value="components"/> 
+       </extension>
+ }}}
+ 
+ OR if you prefer hivemodule.xml:
  {{{
        <implementation 
service-id="tapestry.page.SpecificationResolverDelegate">
                <invoke-factory>
-               <construct class="foo.bar.MySpecificationResolverDelegate">
+                       <construct 
class="foo.bar.MySpecificationResolverDelegate">
-                       <set property="pagePath" value="pages"/>
+                               <set property="pagePath" value="pages"/>
-                       <set property="componentPath" value="components"/>
+                               <set property="componentPath" 
value="components"/>
-                       <set-object property="specificationSource" 
value="infrastructure:specificationSource"/>
                        </construct>
                </invoke-factory>
        </implementation>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to