Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a Physical Object with Java 1

Status
Not open for further replies.

smallredville

Programmer
Aug 18, 2008
115
SG
Hi All,

Through this post, has anyone ever experienced in creating a physical item with lapi.jar (in java)?

I found the following as posted by Appnair in 2007. But I am still at a loss.
"I assume you know how to create objects using C#.Physical objects just means that you have to supply the correct object subtype (411,412 I belive)
First you need to secure the PhysObj.cs file if you were doing in c#.This is under the physical objects module in your server.Bring that in your name space and thru intell sense you can see all the functions like PhysObjAssignToTransfer thru intell sense.If you are doing c++ or VB then you need to compile it into a dll,the instructions are very clearly in the documentation".

In the meantime, I also found "PhysObj.java" in "D:\livelink960\module\physicalobjects_3_7_0\SDK\java\com\opentext\api" (Please refer to for the java file. But I am still at a loss on how to make use of it.

Hope someone hwo knows about it, kindly enough to share with me in this post.

Many thanks in advance =)

smallredville
 
My understanding is that you can create Physical Items with java using createobject methods but the template for creating your organization's physical items are probably not a good candidate for lapi.

Take a look at this simple example I put and see if they make sense.PhysItems and RecMgmt require you to have a lot of experience in livelink working with it so really don't get too hung upon it.


For a lot of faster work use OI with the additional plugin.

BTW:My java skills are very rusty at this point so the code is not really that well written,just to see if it helps somebody and since OT says not to program in lapi anyways.

Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
Certified OT Developer,Livelink ECM Champion 2008
 
Hi Appnair,

I would like to thank you for your generous post of the document.

I appreciate it very much.

smallredville
 
Hi Appnair,

May I check with you regarding the following error which I encountered when trying to run the code which you attached (I have followed the instructions in the doc - but it seems that the error pointed to CreateObjectEx):

D:\javalapi>java -classpath "lapi.jar;" CreateRockSample
AccessEnterpriseWS was succesful now for Phys Item Creation....
volumeID : -2000 dataID : 2000
get(name) not implemented for this datatype
com.opentext.api.LLIllegalOperationException: get(name) not implemented for this
datatype
at com.opentext.api.LLInstance.get(Unknown Source)
at com.opentext.api.LLValue.toValue(Unknown Source)
at com.opentext.api.LLConnect.unMarshall(Unknown Source)
at com.opentext.api.LAPI_DOCUMENTS.CreateObjectEx(Unknown Source)
at CreateRockSample.main(CreateRockSample.java:90)



At the same time, I would like to ask you : the idea of the code which you attached is basically copying/cloning an existing physical item in the livelink?

If yes, would it be possible for me to create a new physical item without copying/cloning an existing physical item in the livelink (For example: just like creating a document with CreateObjectEx)?


Please pardon me for my superficial knowledge by asking so many details =)

Many thanks in advance =)

smallredville
 
PhysItems in Livelink has some unique things other than electronic things.Let us look at this operation with creation of a document object subtype 144.OT has already given this template node for you.However as you can see for an organization PhysItems can mean anything,it could be paper,it could be files,it could be envelopes,books,rocks,oil samples etc so how can OT give all these permutations and combinations.That is how they come up with the template objects ,all in all they can only be in a class of container,non container & box all the rest is attributes that you make up.So you cannot create box,container & non container with lapi(you can if you so wish and hack their code).So once you have made a representative template for this
"class of node" for your organization,now you want to account for them.Obviously if I was a geological company I would have rocksamples from several wells that I want to keep.So creating the "original rock sample" representation is left to the PO administartor and bulk loading is left to people like you and me.Just like bulk loading of electronic documents.

If I put this with an approximation of OOP then

Non-Container class->Rock Sample Object(Create by Og)->{Instances of Rock Samples by lapi,GUI}
Non-Container class-> ->Fiction(Created by Org)-(Fiction books)
->Non Fiction(Created by Org)(Non Fiction Books)

As far as the error is concerned GetName errors are because of my bad error trapping.A call did complete and LL provided a value object,But I have simply tried outputting the value object without type testing.For eg If I do not have that value or if the value cannot be converted to string then those errosr will happen.Try to find "PrintTypeTree" from OT KB to see how the beautiful lapi data structures can be parsed.It should be also in many of the code examples I have posted at Greg';s and Communitise sites as well

Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
Certified OT Developer,Livelink ECM Champion 2008
 
Hi Appnair,

Many thanks for the clear and concise explanation.

I appreciate it very much =)

smallredville
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top