You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by mi...@apache.org on 2005/03/17 09:55:29 UTC

svn commit: r157920 - lenya/sandbox/jcrsitetree/src/java/org/apache/lenya/cms/publication/JCRSiteTree.java

Author: michi
Date: Thu Mar 17 00:55:27 2005
New Revision: 157920

URL: http://svn.apache.org/viewcvs?view=rev&rev=157920
Log:
namespace from registry added

Modified:
    lenya/sandbox/jcrsitetree/src/java/org/apache/lenya/cms/publication/JCRSiteTree.java

Modified: lenya/sandbox/jcrsitetree/src/java/org/apache/lenya/cms/publication/JCRSiteTree.java
URL: http://svn.apache.org/viewcvs/lenya/sandbox/jcrsitetree/src/java/org/apache/lenya/cms/publication/JCRSiteTree.java?view=diff&r1=157919&r2=157920
==============================================================================
--- lenya/sandbox/jcrsitetree/src/java/org/apache/lenya/cms/publication/JCRSiteTree.java (original)
+++ lenya/sandbox/jcrsitetree/src/java/org/apache/lenya/cms/publication/JCRSiteTree.java Thu Mar 17 00:55:27 2005
@@ -53,7 +53,7 @@
 import org.xml.sax.ContentHandler;
 
 /**
- * DOCUMENT ME!
+ * Sitetree implementation based on JCR
  */
 public class JCRSiteTree implements SiteTree {
     private static Category log = Category.getInstance(JCRSiteTree.class);
@@ -93,20 +93,8 @@
             log.error("Repo: " + repo);
             Session session = repo.login(new SimpleCredentials("anonymous", "".toCharArray()), null);
 
-            String prefix = null;
-
-            String[] prefixes = session.getNamespacePrefixes();
-            for (int i = 0; i < prefixes.length; i++) {
-                String namespace = session.getNamespaceURI(prefixes[i]);
-                if (namespace.equals(NAMESPACE_URI)) {
-                    prefix = prefixes[i];
-                    break;
-                }
-            }
-
-           if (prefix == null) {
-               throw new Exception("No prefix for namespace: " + NAMESPACE_URI);
-           }
+            NamespaceRegistry registry = session.getWorkspace().getNamespaceRegistry();
+            String prefix = registry.getPrefix(NAMESPACE_URI);
 
             org.apache.cocoon.xml.dom.DOMBuilder domBuilder = new org.apache.cocoon.xml.dom.DOMBuilder();
             // NOTE: XPath cannot be used



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org