Skip to content

Commit

Permalink
1.4: Merged revision 682409 (JCR-1704)
Browse files Browse the repository at this point in the history
  • Loading branch information
jukka committed Sep 16, 2008
1 parent 682d4a4 commit 14ebcea
Showing 1 changed file with 18 additions and 3 deletions.
Expand Up @@ -124,15 +124,16 @@ public void init(Element config, QueryHandlerContext context, NamespaceMappings
if (configNode.getNodeName().equals("index-rule")) {
IndexingRule element = new IndexingRule(configNode);
// register under node type and all its sub types
log.debug("Found rule '{}' for NodeType '{}'", element, element.getNodeTypeName());
for (int n = 0; n < ntNames.length; n++) {
if (ntReg.getEffectiveNodeType(ntNames[n]).includesNodeType(
element.getNodeTypeName())) {
if (ntReg.getEffectiveNodeType(ntNames[n]).includesNodeType(element.getNodeTypeName())) {
List perNtConfig = (List) configElements.get(ntNames[n]);
if (perNtConfig == null) {
perNtConfig = new ArrayList();
configElements.put(ntNames[n], perNtConfig);
}
perNtConfig.add(element);
log.debug("Registering it for name '{}'", ntNames[n]);
perNtConfig.add(new IndexingRule(element, ntNames[n]));
}
}
} else if (configNode.getNodeName().equals("aggregate")) {
Expand Down Expand Up @@ -510,6 +511,20 @@ private class IndexingRule {
*/
private final float boost;

/**
* Creates a new indexing rule base on an existing one, but for a
* different node type name.
*
* @param original the existing rule.
* @param nodeTypeName the node type name for the rule.
*/
IndexingRule(IndexingRule original, Name nodeTypeName) {
this.nodeTypeName = nodeTypeName;
this.propConfigs = original.propConfigs;
this.condition = original.condition;
this.boost = original.boost;
}

/**
*
* @param config the configuration for this rule.
Expand Down

0 comments on commit 14ebcea

Please sign in to comment.