Added native support for Java->JavaScript Date() object conversion for Alfresco node properties

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3415 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2006-07-26 14:53:05 +00:00
parent 0c3112b44c
commit 0003524f68
4 changed files with 108 additions and 9 deletions

View File

@@ -37,6 +37,7 @@ import org.apache.commons.logging.LogFactory;
import org.dom4j.Document;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;
import org.mozilla.javascript.Scriptable;
/**
* Search component for use by the ScriptService.
@@ -51,7 +52,7 @@ import org.dom4j.io.SAXReader;
*
* @author Kevin Roast
*/
public final class Search
public final class Search implements Scopeable
{
private static Log logger = LogFactory.getLog(Search.class);
@@ -59,6 +60,9 @@ public final class Search
private StoreRef storeRef;
private TemplateImageResolver imageResolver;
/** Root scope for this object */
private Scriptable scope;
/**
* Constructor
@@ -72,6 +76,14 @@ public final class Search
this.imageResolver = imageResolver;
}
/**
* @see org.alfresco.repo.jscript.Scopeable#setScope(org.mozilla.javascript.Scriptable)
*/
public void setScope(Scriptable scope)
{
this.scope = scope;
}
/**
* Execute a Lucene search
*
@@ -171,7 +183,9 @@ public final class Search
for (ResultSetRow row: results)
{
NodeRef nodeRef = row.getNodeRef();
nodes[count++] = new Node(nodeRef, services, this.imageResolver);
nodes[count] = new Node(nodeRef, services, this.imageResolver);
nodes[count].setScope(this.scope);
count++;
}
}
}