You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2005/02/16 18:20:31 UTC

svn commit: r154050 - in lenya/branches/BRANCH_1_2_X/src/java/org/apache/lenya/cms/publication: AbstractPublication.java Publication.java

Author: andreas
Date: Wed Feb 16 09:20:29 2005
New Revision: 154050

URL: http://svn.apache.org/viewcvs?view=rev&rev=154050
Log:
added link-attribute configuration

Modified:
    lenya/branches/BRANCH_1_2_X/src/java/org/apache/lenya/cms/publication/AbstractPublication.java
    lenya/branches/BRANCH_1_2_X/src/java/org/apache/lenya/cms/publication/Publication.java

Modified: lenya/branches/BRANCH_1_2_X/src/java/org/apache/lenya/cms/publication/AbstractPublication.java
URL: http://svn.apache.org/viewcvs/lenya/branches/BRANCH_1_2_X/src/java/org/apache/lenya/cms/publication/AbstractPublication.java?view=diff&r1=154049&r2=154050
==============================================================================
--- lenya/branches/BRANCH_1_2_X/src/java/org/apache/lenya/cms/publication/AbstractPublication.java (original)
+++ lenya/branches/BRANCH_1_2_X/src/java/org/apache/lenya/cms/publication/AbstractPublication.java Wed Feb 16 09:20:29 2005
@@ -23,6 +23,7 @@
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 import org.apache.avalon.framework.configuration.Configuration;
@@ -42,34 +43,24 @@
             INFO_AREA_PREFIX + ARCHIVE_AREA, INFO_AREA_PREFIX + TRASH_AREA };
 
     private String id;
-
     private PublishingEnvironment environment;
-
     private File servletContext;
-
     private DocumentIdToPathMapper mapper = null;
-
     private ArrayList languages = new ArrayList();
-
     private String defaultLanguage = null;
-
     private String breadcrumbprefix = null;
-
     private String sslprefix = null;
-
     private String livemountpoint = null;
-
     private HashMap siteTrees = new HashMap();
-
+    private String[] rewriteAttributeXPaths = { };
     private boolean hasSitetree = true;
 
     private static final String ELEMENT_PROXY = "proxy";
-
     private static final String ATTRIBUTE_AREA = "area";
-
     private static final String ATTRIBUTE_URL = "url";
-
     private static final String ATTRIBUTE_SSL = "ssl";
+    private static final String ELEMENT_REWRITE_ATTRIBUTE = "link-attribute";
+    private static final String ATTRIBUTE_XPATH = "xpath";
 
     /**
      * Creates a new instance of Publication
@@ -160,6 +151,14 @@
                             + "]");
                 }
             }
+            
+            Configuration[] rewriteAttributeConfigs = config.getChildren(ELEMENT_REWRITE_ATTRIBUTE);
+            List xPaths = new ArrayList();
+            for (int i = 0; i < rewriteAttributeConfigs.length; i++) {
+                String xPath = rewriteAttributeConfigs[i].getAttribute(ATTRIBUTE_XPATH);
+                xPaths.add(xPath);
+            }
+            this.rewriteAttributeXPaths = (String[]) xPaths.toArray(new String[xPaths.size()]);
 
         } catch (PublicationException e) {
             throw e;
@@ -598,4 +597,10 @@
         return proxy;
     }
 
+    /**
+     * @see org.apache.lenya.cms.publication.Publication#getRewriteAttributeXPaths()
+     */
+    public String[] getRewriteAttributeXPaths() {
+        return this.rewriteAttributeXPaths;
+    }
 }

Modified: lenya/branches/BRANCH_1_2_X/src/java/org/apache/lenya/cms/publication/Publication.java
URL: http://svn.apache.org/viewcvs/lenya/branches/BRANCH_1_2_X/src/java/org/apache/lenya/cms/publication/Publication.java?view=diff&r1=154049&r2=154050
==============================================================================
--- lenya/branches/BRANCH_1_2_X/src/java/org/apache/lenya/cms/publication/Publication.java (original)
+++ lenya/branches/BRANCH_1_2_X/src/java/org/apache/lenya/cms/publication/Publication.java Wed Feb 16 09:20:29 2005
@@ -15,7 +15,7 @@
  *
  */
 
-/* $Id: Publication.java,v 1.52 2004/07/26 08:32:31 roku Exp $  */
+/* $Id$  */
 
 package org.apache.lenya.cms.publication;
 
@@ -231,5 +231,12 @@
      * for this version.
      */
     Proxy getProxy(Document document, boolean isSslProtected);
+    
+    /**
+     * Returns an array of XPaths representing attributes to be rewritten
+     * when a document URL has changed.
+     * @return An array of strings.
+     */
+    String[] getRewriteAttributeXPaths();
     
 }



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