[Yanel-commits] rev 26478 - public/yanel/trunk/src/contributions/resources/nutch/src/java/org/wyona/yanel/impl/resources

michi at wyona.com michi at wyona.com
Thu Aug 2 15:23:48 CEST 2007


Author: michi
Date: 2007-08-02 15:23:47 +0200 (Thu, 02 Aug 2007)
New Revision: 26478

Modified:
   public/yanel/trunk/src/contributions/resources/nutch/src/java/org/wyona/yanel/impl/resources/NutchResource.java
Log:
add groups definition

Modified: public/yanel/trunk/src/contributions/resources/nutch/src/java/org/wyona/yanel/impl/resources/NutchResource.java
===================================================================
--- public/yanel/trunk/src/contributions/resources/nutch/src/java/org/wyona/yanel/impl/resources/NutchResource.java	2007-08-02 13:23:17 UTC (rev 26477)
+++ public/yanel/trunk/src/contributions/resources/nutch/src/java/org/wyona/yanel/impl/resources/NutchResource.java	2007-08-02 13:23:47 UTC (rev 26478)
@@ -246,6 +246,8 @@
         rootElement.setAttributeNS(NAME_SPACE, "translation-language", getContentLanguage());
         rootElement.setAttributeNS(NAME_SPACE, "local-nutch-config-url", finalResource.toString());
 
+        addGroups(document);
+
         if (searchTerm != null && searchTerm.length() > 0) {
             if(log.isDebugEnabled()) log.debug("Query: " + searchTerm);
             Element queryElement = (Element) rootElement.appendChild(document.createElementNS(NAME_SPACE, "query"));
@@ -724,4 +726,17 @@
         transformer.setParameter("translation.language", getContentLanguage());
         transformer.setParameter("show", getShowParameterValue());
     }
+
+    /**
+     * Add groups from resource instance configuration to DOM
+     */
+    private void addGroups(Document document) {
+        Document customResConfigDoc = getConfiguration().getCustomConfiguration();
+        Element rootElement = document.getDocumentElement();
+        if (customResConfigDoc != null) {
+            Element groupsElement = (Element) rootElement.appendChild(document.createElementNS(NAME_SPACE, "groups"));
+        } else {
+            rootElement.appendChild(document.createElementNS(NAME_SPACE, "no-custom-element-within-resource-config"));
+        }
+    }
 }



More information about the Yanel-commits mailing list