Update of
/var/cvs/contributions/CMSContainer_Modules/luceus/src/java/com/finalist/cmsc/module/luceusmodule
In directory
james.mmbase.org:/tmp/cvs-serv29928/luceus/src/java/com/finalist/cmsc/module/luceusmodule
Modified Files:
Tag: b1_5
IndexUpdateTask.java
Added Files:
Tag: b1_5
PageAwareCustomContentHandler.java
Log Message:
CMSC-1179 Added a CustomContentHandler which is aware of the page content a
content element is being indexed in.
See also:
http://cvs.mmbase.org/viewcvs/contributions/CMSContainer_Modules/luceus/src/java/com/finalist/cmsc/module/luceusmodule
See also: http://www.mmbase.org/jira/browse/CMSC-1179
PageAwareCustomContentHandler.java is new
Index: IndexUpdateTask.java
===================================================================
RCS file:
/var/cvs/contributions/CMSContainer_Modules/luceus/src/java/com/finalist/cmsc/module/luceusmodule/IndexUpdateTask.java,v
retrieving revision 1.10
retrieving revision 1.10.2.1
diff -u -b -r1.10 -r1.10.2.1
--- IndexUpdateTask.java 12 Apr 2008 14:26:33 -0000 1.10
+++ IndexUpdateTask.java 9 Dec 2008 11:00:48 -0000 1.10.2.1
@@ -9,6 +9,7 @@
*/
package com.finalist.cmsc.module.luceusmodule;
+import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
@@ -364,14 +365,24 @@
}
}
- if (cch != null) {
- Set<Node> custom = cch.findLinkedContent(contentElement);
+ // Assume there are no custom related elements
+ Set<Node> custom = Collections.emptySet();
+
+ // Then try to find related content, based on the handler implementation
if any
+ if (cch instanceof PageAwareCustomContentHandler) {
+ PageAwareCustomContentHandler pcch = (PageAwareCustomContentHandler)
cch;
+ custom = pcch.findLinkedContent(contentElement, pageNode);
+ }
+ else if (cch != null) {
+ custom = cch.findLinkedContent(contentElement);
+ }
+
+ // Finally fields of the custom content to the document
for (Node customNode : custom) {
if (module.isDoSecondaryWithPrimary()) {
LuceusUtil.nodeFields(customNode, doc);
}
}
- }
Indexer idx = module.getIndexer();
if (idx != null) {
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs