Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Content Management (Extended ECM)
API, SDK, REST and Web Services
Help! LAPI CreateObjectEx() doesn't seem to work...
Robert_Davies_(unlondonadmin_-_(deleted))
Hi folks.I am trying to use LAPI-8.0.2 from a Java application to create a compound document. It isn't working and I am having some difficulty understanding the code (it is of course completely undocumented) in the APIDoc module that is (not) doing the work. Can anyone help me?The LAPI CreateObjectEx() method is handled within Livelink by APIDOC:APIDocuments:CreateObjectEx:Execute(). The code that is problematic is:llnode = $LLIAPI.LLNodeSubsystem.GetItem( .fInArgs.ObjSubType ) sTypeList = ._GetChildrenList( parentNode, InArgs.ObjSubType ) for obj in sTypeList if ( obj.fSubType == .fInArgs.ObjSubType ) container = TRUE endendand the function that get's called, _GetChildrenList() is: Function List GetChildrenList( \ DAPINODE parent, \ Integer subtype ) Assoc result List sTypeList if ( parent.pSUBTYPE == $ApplTypeProjectVol ) if ( subtype == $ApplTypeProject ) sTypeList = $WebNode.WebNodes.GetItem( $ApplTypeProject ).ChildWebNodes( FALSE ) end else sTypeList = $WebNode.WebNodes.GetItem( parent.pSUBTYPE ).ChildWebNodes( FALSE ) end return sTypeList endI really am not sure what this is doing. It appears to be getting a list of children valid for the parent? Presumably to decide whether this object should be allowed to be created?What get's passed in are the Project that I have specified as the parent for my compound document, and the SubType: 136 (Compound document).The code tests the Parent and find's that it is a Project Volume, then tests the subtype. When it finds it is not a project it drops through and returns an empty list.The calling code seeing the empty list decides the object cannot be created and returns an error.What would be helpful to me is any clear explanation of what is going on here, why the tests that are made are made, and what should be happening.Oh, when I call CreateObjectEx() I am passing a NodeId and VolumeID of a project selected with the standard Browse Livelink dialog (targetbrowse.html), where I retrieve the object ID via the dialog and the Volume ID through a call to DAPI.GetNodeByID( session, DAPI.BY_DATAID, nodeId )Please can someone help me with this. It has me stumped for the moment and is holding up important work...Many thanks.Matt.
Find more posts tagged with
Comments
Robert_Davies_(unlondonadmin_-_(deleted))
Hi.In looking into this further I can see the following from the database (where "New Compound Document" was created via the livelink interface):OWNERID PARENTID DATAID NAME SUBTYPE ---------- ---------- ---------- -------------------------------------------------------------------------------- ---------- -3041 3041 4981 New Item 128 -3108 3108 3109 New Item 128 -2000 2000 4123 New Project 202 4123 -1 -4123 New Project 201 -2897 2897 4856 New Item 28 128 -2897 2897 4866 New Item 29 128 -2897 2897 4872 New Item 30 128 4123 -4123 5152 New Compound Document 136My servlet is using VolId 4123, NodeId -4123 which is what is passed back via the TargetBrowse & GetNodeByID I described in my previous message.It looks like I am getting the Project Volume. Maybe the only thing that can be added to such a volume is a Project? That seems to make sense.Can anyone confirm this?Am I on the right track now?Best regards/matt.
Robert_Davies_(unlondonadmin_-_(deleted))
I do hope someone else is reading this, who knows what they are doing because I am not finding this easy...When I use the Livelink browse dialog and select a Project (e.g. My 'New Project') it is returning a NodeId (dataId in the database) of -4123.This corresponds (according to the database) with the ProjectVol (SubType 201) and not the Project (SubType 202).However I am guessing that I can't add things like compound documents to the ProjectVol.The ProjectVol has an OwnerID (VolumeID?) of 4123 which appears to be the NodeId of the Project. The Project in turn is owned by -2000. There is no object with a NodeId of -2000, but there is the Enterprise workspace with a NodeId of 2000.In this case it looks like the ProjectVol is contained inside the Project. Which - if it is correct - doesn't make sense to me right now. Is this correct?I am inclined right now to just take whatever NodeId I get back from the TargetBrowse dialog and just multiply by -1 to get the Id of the volume. I only hope that works!I'll keep plodding away at this, and posting what I am doing here in case it's of use to anyone else.However, OpenText, PLEASE PLEASE will you document this stuff and soon!?!Best regards/matt.
Robert_Davies_(unlondonadmin_-_(deleted))
Having tested my code withA)Enterprise WorkspaceB)Personal WorkspaceC)A folderD)A projectI find that the only failure seems to be with projects. The target browse dialog is returning the ProjectVol object and not the Project object.Looking inside the Action-BrowseProjectVol() method of the ProjectVol object I see that they just multiply the Node-Id by -1.So my strategy will become:For each NodeId returned from TargetBrowse,Get the LLNode corresponding to the NodeIdIf LLNode is a ProjectVol,Multiply NodeId by -1otherwiseuse NodeId as is.Does this sound reasonable? Where might this catch me out?Best regards/matt.
Robert_Davies_(unlondonadmin_-_(deleted))
This is pretty grim.I tried changing my code so that if it see's a ProjectVol object, that it should transparently substitute the Project object (by inverting the NodeId, ala Action-BrowseTarget).Unfortunately this didn't work. I still get the "Container Error" that I got before. Now I don't know what to do...Lost of London.
Bickers
Matt,Looks like you need to make sure that the Project subtype is passed in. Because you are passing in the ProjectVol subtype, it is doing the first check, which, as you point out, will always return emtpy unless you're creating a Project.I have been doing quite a lot with volumes (projects and discussions), and it still catches me out.
Robert_Davies_(unlondonadmin_-_(deleted))
Hi Phil.Many thanks for responding.Ok, i'm not too sure what you are advising me to do. Let me recap, I appreciate my last few posts have been a bit of a ramble.I am trying to create a Compound document inside a Project using LAPI/Java.To do this I am calling:LAPI_DOCUMENTS.CreateObjectEx()Here's the code:int ccode = docs.CreateObjectEx( profile.getVolumeId(), profile.getNodeId(), LAPI_DOCUMENTS.OBJECTTYPE, LAPI_DOCUMENTS.COMPOUNDDOCUMENTSUBTYPE, name, createInfo, objectInfo );Where profile.getVolumeId() and profile.getNode() return the VolumeID and NodeId() of the parent object. I've tried using *both* the ProjectVol and Project object's as the parent and I get the "Container Error" message in both cases.You say "make sure that the Project subtype is passed in". I am not sure where you mean. Can you expand on this?Best regards/matt.
Robert_Davies_(unlondonadmin_-_(deleted))
I'm still looking for help in resolving the problem that I describe in this thread.Can no-one help me..?OpenText..?Best regards/matt.
Paul_Eddie_(PEddie_(Delete)_801545)
I took a look into this (debugging and tracing) and you found a BUG!I, then, took a peek at 8.1.1 and the feature named '_GetChildrenList' has been changed to fix this bug:Here is the script from 8.1.1 -- they just added one line of code:Function List GetChildrenList( \ DAPINODE parent, \ Integer subtype ) Assoc result List sTypeList if ( parent.pSUBTYPE == $ApplTypeProjectVol ) if ( subtype == $ApplTypeProject ) sTypeList = $WebNode.WebNodes.GetItem( $ApplTypeProject ).ChildWebNodes(FALSE ) else sTypeList = $WebNode.WebNodes.GetItem( parent.pSUBTYPE ).ChildWebNodes(FALSE ) end else sTypeList = $WebNode.WebNodes.GetItem( parent.pSUBTYPE ).ChildWebNodes(FALSE ) end return sTypeList end
Robert_Davies_(unlondonadmin_-_(deleted))
Hi Paul.Many many thanks for looking at this for me. I'll patch the file and look forward to creating Compound Documents whereever I go!Best regards/matt.