You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by jo...@apache.org on 2006/09/12 09:58:42 UTC

svn commit: r442508 - /lenya/trunk/src/pubs/default/java/src/org/apache/lenya/defaultpub/cms/publication/templating/Instantiator.java

Author: josias
Date: Tue Sep 12 00:58:41 2006
New Revision: 442508

URL: http://svn.apache.org/viewvc?view=rev&rev=442508
Log:
instantiator now updates the configuation of all available search indexes

Modified:
    lenya/trunk/src/pubs/default/java/src/org/apache/lenya/defaultpub/cms/publication/templating/Instantiator.java

Modified: lenya/trunk/src/pubs/default/java/src/org/apache/lenya/defaultpub/cms/publication/templating/Instantiator.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/pubs/default/java/src/org/apache/lenya/defaultpub/cms/publication/templating/Instantiator.java?view=diff&rev=442508&r1=442507&r2=442508
==============================================================================
--- lenya/trunk/src/pubs/default/java/src/org/apache/lenya/defaultpub/cms/publication/templating/Instantiator.java (original)
+++ lenya/trunk/src/pubs/default/java/src/org/apache/lenya/defaultpub/cms/publication/templating/Instantiator.java Tue Sep 12 00:58:41 2006
@@ -212,10 +212,12 @@
 
             Element[] indexElement = indexHelper.getChildren(indexDoc.getDocumentElement(), "index");
 
-            indexElement[0].setAttribute("id", newPublicationId + "-live");
-            indexElement[0].setAttribute("directory", indexDir + "/live/index");
-            indexElement[1].setAttribute("id", newPublicationId + "-authoring");
-            indexElement[1].setAttribute("directory", indexDir + "/authoring/index");
+            for (int i=0; i<indexElement.length; i++) {
+                String id = indexElement[i].getAttribute("id");
+                String area = id.split("-")[1];
+                indexElement[i].setAttribute("id", newPublicationId + "-" + area);
+                indexElement[i].setAttribute("directory", indexDir + "/" + area + "/index");
+            }
 
             save(indexDoc, indexSource);
 



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