mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
. Saved Search execution and direct Lucene query execution support added to Template API.
. Fixed bug in TemplateNode for encoding of UTF-8 characters in generated URL filenames. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2334 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
package org.alfresco.repo.template;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.service.ServiceRegistry;
|
||||
@@ -32,11 +32,9 @@ import org.apache.commons.logging.LogFactory;
|
||||
*
|
||||
* @author Kevin Roast
|
||||
*/
|
||||
public abstract class BasePathResultsMap extends HashMap implements Cloneable
|
||||
public abstract class BasePathResultsMap extends BaseTemplateMap
|
||||
{
|
||||
protected static Log logger = LogFactory.getLog(BasePathResultsMap.class);
|
||||
protected TemplateNode parent;
|
||||
protected ServiceRegistry services = null;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@@ -46,16 +44,17 @@ public abstract class BasePathResultsMap extends HashMap implements Cloneable
|
||||
*/
|
||||
public BasePathResultsMap(TemplateNode parent, ServiceRegistry services)
|
||||
{
|
||||
super(1, 1.0f);
|
||||
this.services = services;
|
||||
this.parent = parent;
|
||||
super(parent, services);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see java.util.Map#get(java.lang.Object)
|
||||
* Return a list or a single Node from executing an xpath against the parent Node.
|
||||
*
|
||||
* @param xpath XPath to execute
|
||||
* @param firstOnly True to return the first result only
|
||||
*
|
||||
* @return List<TemplateNode>
|
||||
*/
|
||||
public abstract Object get(Object key);
|
||||
|
||||
protected List<TemplateNode> getChildrenByXPath(String xpath, boolean firstOnly)
|
||||
{
|
||||
List<TemplateNode> result = null;
|
||||
@@ -92,6 +91,6 @@ public abstract class BasePathResultsMap extends HashMap implements Cloneable
|
||||
}
|
||||
}
|
||||
|
||||
return result != null ? result : new ArrayList<TemplateNode>(0);
|
||||
return result != null ? result : (List)Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user