我正在尝试在Groovy脚本中为方面使用Al新鲜to扩展。
我希望能够在文档上设置一个方面,但是当我试图将文档转换为AlfrescoDocument时,它会抛出一个错误。我将Groovy指向Alfresco化学jar文件,该文件附带于Al新鲜to 4.1.5
我可以创建一个文档并查看它的属性,但是当我试图将它转换为AlfrescoDocument时,它会抛出一个错误。
import org.apache.chemistry.opencmis.commons.*
import org.apache.chemistry.opencmis.commons.data.*
import org.apache.chemistry.opencmis.client.api.*
import org.apache.chemistry.opencmis.client.runtime.*
import org.alfresco.cmis.client.*;
import org.alfresco.cmis.client.impl.*;
def doc = (Document) session.getObject(id);
def adoc = (AlfrescoDocument) doc;。
Caught: org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'org.apache.chemistry.opencmis.client.runtime.DocumentImpl@3e0339' with class 'org.apache.chemistry.opencmis.client.runtime.DocumentImpl' to class 'org.alfresco.cmis.client.AlfrescoDocument'
org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'org.apache.chemistry.opencmis.client.runtime.DocumentImpl@3e0339' with class 'org.apache.chemistry.opencmis.client.runtime.DocumentImpl' to class 'org.alfresco.cmis.client.AlfrescoDocument'发布于 2013-09-01 23:41:02
找到答案了。会话需要连接,以便能够使用Alfresco扩展:
parameter.put(SessionParameter.OBJECT_FACTORY_CLASS, "org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl");https://stackoverflow.com/questions/18563769
复制相似问题