Hello Friends,
Could you please suggest the best way to get the absolute path (like Enterprise: Subfolder: SubSubFolder...) of a node using LAPI.
Thanks and Regards,
Anil Barkade
Hi Anil,
There is a method in EasyLAPI called LLObject.getPath() that'll do this. It's probably not the best solution because it requires multiple requests to generate the path, and would require you to switch your program over to the library. It also assumes you're using Java.
Cheers Chris
Chris’ EasyLAPI was available as a C# alternative here at some time KyleBaley.org not sure if it is there now or not
I did a pure lapi thing here as well see one of the snippets that say “Want to see full path from Enterprise”
https://communities.opentext.com/communities/cs.dll/wiki/7967685/cs.dll/open/7973190
If the link does not work let me know I will try to see if I have it with me
I would probably use Oracle’s connect by or a SQLserver function create a Live Report and call it form lapi if
You want it.That may be more efficient.
If you execute the search API(REST API not lapi or WS search) and out put it as XML I believe the xml output has the pathing as well.
From: eLink Entry: Content Server Development Forum [mailto:development@elinkkc.opentext.com] Sent: Wednesday, October 09, 2013 6:42 AMTo: eLink RecipientSubject: [EXTERNAL]How to get absolute path of a node using LAPI?
How to get absolute path of a node using LAPI?
Posted by chris.meyer@kwe.li (Meyer, Chris) On 10-09-2013 07:37
CheersChris
[To post a comment, use the normal reply function]
Topic:
Forum:
Content Server Development Forum
Content Server:
Knowledge Center
Very quickly wrote this code in Vb.net.
Test it thoroughly.
Public FURL As String
Public Sub GetPath()
Try
Dim ReturnVal As Integer
Dim ObjVal As LLValue = New LLValue
Dim StrReturnVal As String
Dim ObjName As String
StrReturnVal = GetParent1(2321554) ' Enter Node ID
ReturnVal = LapiDoc.GetObjectInfo(0, 2321554, ObjVal)
ObjName = ObjVal.ToString("Name")
FURL = FURL & ObjName
Console.WriteLine(FURL)
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Public Function GetParent1(ByVal NdID As Integer)
Dim llsession As LLSession
Dim llobj As Livelink = New Livelink
llsession = llobj.Livelink_Session("localhost", 2099, "opentextdv", "admin", "livelink")
Dim RetInt, ParentID As Integer
Dim ParName As String
Dim LLval, OobjInf As New LLValue
Dim lapi_doc As New LAPI_DOCUMENTS(llsession)
Dim EntWrkspc As Integer
Dim EntInf As LLValue = New LLValue
RetInt = lapi_doc.AccessEnterpriseWS(EntInf)
EntWrkspc = EntInf.toInteger("ID")
RetInt = lapi_doc.GetObjectInfo(0, NdID, OobjInf)
ParentID = OobjInf.toInteger("ParentID")
If ParentID = -1 Then
ParentID = OobjInf.toInteger("VOLUMEID")
'If Parent is -1 then we cant get name of it, so lets take the root container name itself
ParName = OobjInf.ToString("Name")
Else
RetInt = lapi_doc.GetObjectInfo(0, ParentID, OobjInf)
End If
FURL = ParName & ":" & FURL
If EntWrkspc = ParentID Then
'FURL = FURL.Remove(FURL.Length - 1)
GetParent1(ParentID)
Return FURL
Return Nothing
End Function
Hope this helps…
Cheers…
King
Appu's link is working.
Those are classic examples. Hope that helps
>> Want to see the full path to a object: https://communities.opentext.com/communities/cs.dll/wiki/7967685/cs.dll/open/7973190
>> Want to see full path from Enterprise: https://communities.opentext.com/communities/cs.dll?func=ll&objaction=overview&objid=7943825
Cheers...
Thanks, friends.
I could get it using the code from Appu's link (in Java).
Now, I am just trying to create a function in MS SQL Sever for the same.
Regards,