mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
JavaScript AVM API enhancements. Template AVM API addition.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6049 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -48,36 +48,35 @@ public class AVMNode extends ScriptNode
|
||||
private AVMNodeDescriptor avmRef;
|
||||
private QName type;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param nodeRef
|
||||
* @param services
|
||||
* @param resolver
|
||||
*/
|
||||
|
||||
public AVMNode(NodeRef nodeRef, ServiceRegistry services)
|
||||
{
|
||||
this(nodeRef, services, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param nodeRef
|
||||
* @param services
|
||||
* @param resolver
|
||||
* @param scope
|
||||
*/
|
||||
public AVMNode(NodeRef nodeRef, ServiceRegistry services, Scriptable scope)
|
||||
{
|
||||
super(nodeRef, services, scope);
|
||||
|
||||
Pair<Integer, String> versionPath = AVMNodeConverter.ToAVMVersionPath(nodeRef);
|
||||
this.path = versionPath.getSecond();
|
||||
this.version = versionPath.getFirst();
|
||||
AVMNodeDescriptor descriptor = this.services.getAVMService().lookup(this.version, this.path, true);
|
||||
init(versionPath.getSecond(), versionPath.getFirst());
|
||||
}
|
||||
|
||||
public AVMNode(String path, int version, ServiceRegistry services, Scriptable scope)
|
||||
{
|
||||
super(AVMNodeConverter.ToNodeRef(version, path), services, scope);
|
||||
|
||||
init(path, version);
|
||||
}
|
||||
|
||||
private void init(String path, int version)
|
||||
{
|
||||
this.path = path;
|
||||
this.version = version;
|
||||
AVMNodeDescriptor descriptor = this.services.getAVMService().lookup(version, path, true);
|
||||
if (descriptor == null)
|
||||
{
|
||||
throw new IllegalArgumentException("Invalid node specified: " + nodeRef.toString());
|
||||
throw new IllegalArgumentException("Invalid node specified: " + this.nodeRef.toString());
|
||||
}
|
||||
this.avmRef = descriptor;
|
||||
this.deleted = descriptor.isDeleted();
|
||||
|
Reference in New Issue
Block a user