Hi all,
I am trying to create a document inside a project. But i could not get any reason why the doc creation is failing. Please help. The code is:
try
{
LLSession session = null;
LAPI_DOCUMENTS documents = null;
int status, nodeId, nodeVol, parentId, parentVol = 0;
LLValue pwsInfo = (new LLValue().setAssocNotSet());
LLValue objInfo = (new LLValue().setAssocNotSet());
LLValue versionInfo = (new LLValue().setAssocNotSet());
LLValue createInfo=new LLValue().setAssoc();
LLValue objectInfo=new LLValue().setAssoc();
session = new LLSession("localhost",2099,"","Admin","livelink",null);
documents = new LAPI_DOCUMENTS(session);
status = documents.AccessEnterpriseWS(pwsInfo);
if(status == 0){
parentVol = pwsInfo.toInteger("VolumeID");
parentId = pwsInfo.toInteger("ID");
//Add Document
status = documents.CreateObjectEx(0, parentId,documents.PROJECTSUBTYPE, documents.PROJECTSUBTYPE,"Test Project", new LLValue().setAssoc(), objInfo);
//status = documents.AddDocument(parentVol, parentId, "JDK1.6.0_32.rar" , "E:/JDK1.6.0_32.rar", objInfo, versionInfo);
}
if(status == 0){
int id = objInfo.toInteger("ID");
System.out.println(id);
int docStatus = documents.CreateObjectEx(0, id, LAPI_DOCUMENTS.OBJECTTYPE, LAPI_DOCUMENTS.DOCUMENTSUBTYPE, "Test Doc", createInfo, objectInfo);
}
}
catch(Exception e)
{
e.printStackTrace();
}
I am able to create project with this code, but after that the doc creation is failing.