On Saturday 12 November 2005 14:51, Emmanouil Batsis wrote:
> It would be great if you could suggest a way out of this one. For now the
> only obvious/easy fix for me would be adding getTree() to SiteManager and
> dummy implementations of the methods where applicable, probably throwing
> NonImplementedException or something. Alternative suggestions would be much
> appreciated.

Here's a temp fix patch as above. Just added getTree() to SiteManager 
interface and modified SitetreeModule to safely cast/use the proxy as a 
SiteManager since you cannot cast the proxy to the concrete TreeSiteManager 
class.

Manos
Index: 
/home/manos/workspace/lenya-trunk/src/java/org/apache/lenya/cms/site/SiteManager.java
===================================================================
--- 
/home/manos/workspace/lenya-trunk/src/java/org/apache/lenya/cms/site/SiteManager.java
       (revision 332496)
+++ 
/home/manos/workspace/lenya-trunk/src/java/org/apache/lenya/cms/site/SiteManager.java
       (working copy)
@@ -21,6 +21,7 @@
 import org.apache.lenya.cms.publication.DocumentIdentityMap;
 import org.apache.lenya.cms.publication.Publication;
 import org.apache.lenya.cms.publication.util.DocumentSet;
+import org.apache.lenya.cms.site.tree.SiteTree;
 
 /**
  * <p>
@@ -192,4 +193,16 @@
      */
     Document getAvailableDocument(Document document) throws SiteException;
 
+    
+    /**
+     * Returns the sitetree for a specific area of this publication. Sitetrees 
are created on demand
+     * and are cached. Added here to fix usecase URL issues (manos)
+     * 
+     * @param map The document identity map.
+     * @param publication The publication.
+     * @param area The area.
+     * @return A site tree.
+     * @throws SiteException if an error occurs.
+     */
+    public SiteTree getTree(DocumentIdentityMap map, Publication publication, 
String area) throws SiteException;
 }
\ No newline at end of file
Index: 
/home/manos/workspace/lenya-trunk/src/modules/sitetree/java/src/org/apache/lenya/cms/cocoon/components/modules/input/SitetreeModule.java
===================================================================
--- 
/home/manos/workspace/lenya-trunk/src/modules/sitetree/java/src/org/apache/lenya/cms/cocoon/components/modules/input/SitetreeModule.java
    (revision 332496)
+++ 
/home/manos/workspace/lenya-trunk/src/modules/sitetree/java/src/org/apache/lenya/cms/cocoon/components/modules/input/SitetreeModule.java
    (working copy)
@@ -72,7 +72,7 @@
 
         Object value = null;
         ServiceSelector selector = null;
-        TreeSiteManager _manager = null;
+        SiteManager _manager = null;
 
         try {
             PageEnvelope envelope = getEnvelope(objectModel, name);
@@ -79,8 +79,8 @@
             Publication publication = envelope.getPublication();
             
             selector = (ServiceSelector) this.manager.lookup(SiteManager.ROLE 
+ "Selector");
-            _manager = (TreeSiteManager) 
selector.select(publication.getSiteManagerHint());
-            
+            _manager = (SiteManager) 
selector.select(publication.getSiteManagerHint());
+             
             Request request = ObjectModelHelper.getRequest(objectModel);
             Session session = RepositoryUtil.getSession(request, getLogger());
             DocumentIdentityMap map = new DocumentIdentityMap(session, 
this.manager, getLogger());


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

Reply via email to