Download WCM Java API Programmer`s Manual
Transcript
WCMJavaAPIProgrammersManual_en.book Page 194 Tuesday, May 16, 2006 6:12 PM
Chapter 7
Performing Actions on a Livelink Object
Livelink objects can be modified via the LivelinkObjectHandler interface. You can perform the following actions on a Livelink object: adding,
adding content, modifying metadata, reserve, unreserve, and delete.
Adding a Livelink object
All Livelink object types are represented by interfaces. The
LivelinkObjectFactory class is provided for adding new items. For
each Livelink object type, this class provides methods for creating an
instance of the appropriate interface. After this, the object is added to
Livelink by means of the LivelinkObjectHandler.
ContextId cid = ...
LivelinkObjectHandler lloh =
LivelinkRuntime.getInstance().getObjectHandler(systemName);
LivelinkId parentllid = new LivelinkId(123);
LivelinkDocument lldoc =
LivelinkObjectFactory.createDocumentInstance("Demo Document",
"API test");
lldoc = (LivelinkDocument)lloh.create(cid, parentllid, lldoc);
Adding content to a Livelink object
The following code sample adds a file as content to a Livelink document.
File file = ...
lldoc = (LivelinkDocument)lloh.addVersion(cid, lldoc.getLivelinkId(),
file);
194
Livelink WCM Server