Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Content Management (Extended ECM)
API, SDK, REST and Web Services
LAPI and Java to extract field information from news items or discussions
Stonebridge_Consultants_(stonebridgeuser2_-_(delet
I am trying to find out how to extract field information from a news object. i.e. Headline, story, expiration date. The LAPI documentation is not much help. Can someone please point me in the right direction.If you want to send response directly to me my email is:steve.schumm@sbti.com
Find more posts tagged with
Comments
eLink User
Message from Sean M Alderman via eLinkSteve, I haven't handled this with news objects, but the way I'd go about itis first to take a look at the database view called 'webnodes'I access objects in general using the following methodology -Somewhere in your class, make a LAPI_DOCUMENTS Object for your session.Then do some code like this -LLValue value = new LLValue();if ( lapi_documents.ListObjects( volumeID, NodeID, // this should be of thechannel object "", // viewname queryString, // if you need to furtherprune objects from the list. lapi_documents.PERM_SEE, value ) == 0 ){ LLValueEnumeration rows = value.enumerateValues(); while ( rows.hasMoreElements() ) { LLValue row = rows.nextValue(); /* from here you should have a news item in row. what you want to do from there I don't know, but all of the junk in a news item that's not in a standard ll item is in the extended data field of the dtree record. this is almost always stored in an Assoc type (which I think LLValue can handle), but I'm not sure how to grab a record field that's in the shape of an assoc out of an LLValue and stick it into a new LLValue. I'm actually not sure if the ListObjects will return the ExtendedData field, unless you create a custom database view which has it, and then specify that view. */ }}Perhaps a better question would be to ask how can you manipulateExtendedData contents using LAPI Java.On Fri, 2002-01-04 at 14:22, eLink Discussion: LAPI Discussion wrote:> LAPI and Java to extract field information from news items or discussions> Posted by StonebridgeUser2 on 01/04/2002 02:21 PM> > I am trying to find out how to extract field information from a news object. i.e. Headline, story, expiration date. The LAPI documentation is not much help. Can someone please point me in the right direction.> > If you want to send response directly to me my email is:> steve.schumm@sbti.com> > [To reply to this thread, use your normal e-mail reply function.]> > ============================================================> > Discussion: LAPI Discussion>
https://knowledge.opentext.com/knowledge/livelink.exe?func=ll&objId=765428&objAction=view>
; > Livelink Server:>
https://knowledge.opentext.com/knowledge/livelink.exe>
; > -- Sean M. AldermanITRACK Systems AnalystPACE/NCI - NASA Glenn Research Center(216) 433-2795Calling a windowed operating system "Windows" is like naming anautomobile "Wheels."
Stonebridge_Consultants_(stonebridgeuser2_-_(delet
Sean,Thanks for your reply. My code is doing exactly what you described in the code snippets. I have pulled the ID and Name using listObjects. But as you alluded to I need to get to the extended data(I think). I have been trying to figure out how to do this but the documentation isn't much help. ListObjects has a fixed set of fields you have access to. However, the newsItem specific information I am looking for is not on the list. So I am a little fuzzy on what direction I need to go.
eLink User
Message from Sean M Alderman via eLinkA slight after thought on my previous post...The ObjectInfo object returned from LAPI_DOCUMENTS.GetObjectInfo() willhave the extendedData field in it. However, I am still unclear on howto dig that field (which is an assoc) out and put it into it's ownLLValue object.That being said...LLValue item = ( new LLValue() ).setAssocNotSet();LLValue extendedData = new LLValue;int x = lapi_documents.GetObjectInfo( volumeID, objID, item);// I don't think this line works, but it would be nice.extendedData = item.toValue( "EXTENDEDDATA" );String headLine = extendedData.toString("Headline");// and so on>From there, I can tell you that if you try aitem.toString("EXTENDEDDATA"); you can at least know that the assoclooks like -A<1,?,'Headline'='{headline text}','ImageID'={something, mine has a?},'Story'='{story body}'>so if you can't find a better way, at least you should be able to worksomething out via string manipulation.On Fri, 2002-01-04 at 14:22, eLink Discussion: LAPI Discussion wrote:> LAPI and Java to extract field information from news items or discussions> Posted by StonebridgeUser2 on 01/04/2002 02:21 PM> > I am trying to find out how to extract field information from a news object. i.e. Headline, story, expiration date. The LAPI documentation is not much help. Can someone please point me in the right direction.> > If you want to send response directly to me my email is:> steve.schumm@sbti.com> > [To reply to this thread, use your normal e-mail reply function.]> > ============================================================> > Discussion: LAPI Discussion>
https://knowledge.opentext.com/knowledge/livelink.exe?func=ll&objId=765428&objAction=view>
; > Livelink Server:>
https://knowledge.opentext.com/knowledge/livelink.exe>
; > -- Sean M. AldermanITRACK Systems AnalystPACE/NCI - NASA Glenn Research Center(216) 433-2795Calling a windowed operating system "Windows" is like naming anautomobile "Wheels."
Stonebridge_Consultants_(stonebridgeuser2_-_(delet
Sean,Thanks again for the great information. I'll give this a try and we'll see if this get's us where we want to be.Thanks.Stephen Schumm
Stonebridge_Consultants_(stonebridgeuser2_-_(delet
I tried the getObjectInfo method and am getting some errors, I tried it the way you suggested Sean but I am getting the following error:com.opentext.api.LLIllegalOperationException: toString() not implemented for this datatypeI have cut out the beef of the code (below): LLValue extendedData = new LLValue(); LAPI_DOCUMENTS docHandle = getDocHandle(); int _volumeID = ((Integer)objectID.getID()).intValue(); int objectNode = (_volumeID + 1); try{ docHandle.GetObjectInfo(volumeID,_volumeID,result1); System.out.println("in getObjectAttributes loop "+_volumeID+objectNode); extendedData = result1.toValue("EXTENDEDDATA"); attribs.addElement(new LivelinkObjectIdentifier(extendedData.toString()));// System.out.println("extended data: "+ attribs); } catch (Exception e) { System.out.println(e); System.out.println("An error has occured while listing the documents.");I think we are on the right track I just think that it needs to be tweeked. I am just not sure in what way. Any ideas?
Stonebridge_Consultants_(stonebridgeuser2_-_(delet
Sean,Your suggestion in the previous post worked. I had to tweak some of my code but I finally got it working. Now I will have to install it in my App. Thanks for your help.