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
Need example or help with 'ListNodes' method
ecmrocks
Hello,I am trying to use ListNodes to get at the categories in livelink so that I can determine which categories exist and what properties they have.I cannot find any examples of documentation on this method.Can someone post an example of its usage or point me towards some documentation?Thanks
Find more posts tagged with
Comments
eLink User
Message from Carsten Kulms via eLinkI think there is no documentation for this function because it is notfor public use.[Private comment: I understand you need for it ... since you've foundthe function and you already know what it is good for, I guess you arealso able to look in LLBuilder how it works.]
Louis_Routhier
Since it is not for public use, first OT should not expose it as public! :P but second, you should not use it as it will not necessarily be supported in future versions. I did a little sample in VB.NET that would extract the definition of the category. At the end, you will see there is 2 different method of getting the version information. Personnaly, I don't see any reason why you should use one or the other except maybe that the XML is easier to understand but maybe the LLValue version has a bit more information; I didn't compare both. Also, to list the content of an LLValue, you could use the function here:
http://communities.opentext.com/communities/livelink.exe/wiki/162164/VB.NET - Convert LLValue to a string tree-viewor
this to get it as objects:
http://communities.opentext.com/communities/livelink.exe/wiki/162164/Convert LLValue to ObjectOh
, and don't forget if you use this in production to validate retStatus!-------------------------------------------------- Dim retStatus As Integer Dim LLV As LLValue = New LLValue().setAssocNotSet retStatus = Conn.DocumentsAPI.AccessCategoryWS(LLV) retStatus = Conn.DocumentsAPI.ListObjects(LLV.toInteger("VolumeID"), LLV.toInteger("ID"), Nothing, Nothing, Nothing, LLV) Dim Cat As LLValue Dim CatID As LLValue Dim CatVer As LLValue = New LLValue().setAssocNotSet() Dim CatDefXML As New Xml.XmlDocument For i As Integer = 0 To LLV.size - 1 Cat = LLV.toValue(i) CatID = New LLValue().setAssoc() CatID.add("ID", Cat.toInteger("ID")) CatID.add("Version", 0) retStatus = Conn.DocumentsAPI.FetchCategoryVersion(CatID, CatVer) retStatus = Conn.DocumentsAPI.FetchCategoryVersionXML(CatID, New LLValue().setAssocNotSet, CatVer) CatDefXML.LoadXml(retStatus.toString("catXML")) Next
eLink User
Message from Carsten Kulms via eLinkThanks Louis, for this very helpfull example!Of course this is the preferred way to access/browse all categories. So please ignore the private note in my last post
(I simply forgot that there is the AccessCategoryWS function ...)If "ListNodes" is really exposed as public (where?) but not documented,then I would consider this as a bug, too. (It was just a guess of minethat it is not public, because it is not documented.)I'm quite sure what you think about the following recommendation ;-),but nonetheless: If you found inconsistensies or defects in thedocumentation please inform OT customer support about.
Louis_Routhier
It is at least accessible in .NET in the LAPI_Documents object.As are ApplyQueryRecArray, GetBrokerAttributes, GetSearchableObjects and QuickTest in LAPI_Search (these were mentionned to support).
eLink User
Message from Carsten Kulms via eLinkAccessible does not mean (for) public (use).Maybe you know the power of Java's reflection feature -- if I wouldconsider everything I can find out by reflection as public usable ...So, I think, in this case, please consider the documentation as the onlysource for what the (L)API provides. Of course, if at one place in the documentation something is mentionedwhich is not explained/sepcified anywhere else in the documentation,then that would be a bug.And if there is something missing by means of functionality that may beworth an RFE. (It may even be a bug under certain circumstances.)
Louis_Routhier
Yes, I know about reflection but in this case it is directly available and you must understand that with intellisense, most users won't ever look at documentation! This means that if a function is declared public in the code (public function fetchAttributes(parm1 as String) ), then it is to be considered public by users of the API. This is simple API programming.I think this speech is an excellent one on API development principles:
http://www.infoq.com/presentations/effective-api-design
eLink User
Message from Carsten Kulms <
carsten.kulms@opentext.com
> via eLink
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
Yes, I know about reflection but in this case it is directly available and you...
> most users won't ever look at documentation!
I know that about users, but cannot believe programmers behave the same.
You should now an API you want to use. Otherwise you cannot implement effective software. Imho.
Also I wonder about how you find a public method without
- seeing the source code
- looking at the API documentation
- using something like reflection (or debug, or decompile, or ...)
Just consider the case where an API provides you an certain interface and the implementations of this interface you use have other public methods -- you won't know them if you're not seeking for them, because what you have (and know) is the interface, not the implementation.
Of course, there are ways to prevent even this situation.
However,
I have no interest to discuss API design and documentation practices here.
(Not at least because I have no hands on LAPI.)
Louis_Routhier
OK, since you can't directly test LAPI, it explains why you can't know how this is visible for us LAPI developers.About your first comment: a well constructed API will have self-descriptive function and properties naming conventions that will allow most developers to efficiently work without having to look at the documentation (but I must agree that most usage of LLValue's Assoc as a parameter may break this rule).Second, in VS (and I'm almost sure something similar exists in most Java dev environment and in VB6), you have what's called Intellisense. The role of intellisense is to list every method created public as soon as you enter . after an object instance's name. If the method was defined private, you would not see it but it is not the case. This being said, you don't need any reflection to know what functions are available on an object. This is one beauty of intellisense and real object oriented development.About your third comment, LAPI is not a set of interfaces. It is a set ob objects so you see everything on this object as soon as you start coding.
eLink User
Message from Carsten Kulms via eLinkThanks for the lesson in software development. After more than 25 yearsin this area I always appreciate to learn something new. ;->> called Intellisense. The role of intellisense is to list That's one flavour of what I called "something like reflection [...]".With "no hands on LAPI" I tried to say, that I have no otherpossibilities to change anything of LAPI, code or documentation, as youhave.I had to use LAPI quite a lot in the past. (And still have tosometimes.)That's why I read this forum and try to give answers.As already mentioned, no comments on the other topics.
Louis_Routhier
No offense meant. I didn't mean to be arrogant or anything only sometimes English being only a secondary language for me I may feel a bit harsh or not understand everything exactly as it was meant.I'm honestly sorry if I insulted you in any way.About reflection, you'Re quite right, we can see Intellisense as being reflection (and in fact, you almost surely right it is the way it works in .NET while it wasn't in VB6 :P)Do you know who are the people in charge for LAPI at OT? Maybe we should inform them on this matter do you think?
eLink User
Message from Carsten Kulms via eLinkOK. Obviously English isn't my native language, too. The usual way to inform whoever-is-the-right-one, is via customersupport. Well, since I'm an OT employee I can use some other channelsand I did so in the past. (Not only regarding technical issues, as youmay have observed as continous reader of this forum.)However, such basic issues with LAPI, as we currently discuss (resp. Iavoid to ;-)), are very unlikely to change. A solution would require anew API.Maybe the following is not what you like to read: I `believe` thatcurrently such a project is on the way, BUT I think that the outcomewill not affect current versions of LES. Also be warned: This is an absolutely IN-official information. Just a rumor. It wasn't me who told you.(In my position that would be one step too far.)I do not know how much effort will be spend on improving LAPI in thenear future. I think you (being a customer) have some power to get thisinformation.
Jeff Lang
Doesn't this just return the Categories that are in the Category volume? What about categories that do not live in that volume?How would you find all category nodes in the system?
Nair_Krishnankutty_(nairkrishnankutty_-_(deleted))
For one thing,I just did not want to get into any debate of what lapi is and isn't.To answer Jeff's qn,who I know is an oscript guru,and whether he genuinely wanted an answer or not or was just teasing:)The short answer:Create a LR filtered by the category subtype(131).using livelink API run that LR and process the result set.I think in the lapi area there is an example that shows how to run a LR thru lapi.
Jeff Lang
I helped write the first version of LAPI and I hate it. It seems weird to me that you can't use the NodeList call. I noticed that the Prototype for the call in the APIDoc ospace is incorrect. The return variable is of the wrong datatype. It is specified as an Assoc when the code wants to return a RecArray.The answer of a LiveReport is fine when you are working on a database that you own, but if you are trying to create a generic tool that is not allowed to modify the node structure, it doesn't pan out. There must be some way that you can return a list of nodes, using a query to select the nodes, without having to add additional nodes to the system.
Louis_Routhier
There would still be the possibility of doing a search based on the subtype (if categories are indexed). The 2 main drawbacks I see to this solution is the performance and the fact that there would be a delay.