Download Livelink WCM Server Programming Guide for the WCM Java API
Transcript
Chapter 7 Accessing Enterprise Server systems
Example 7-27:
ContextId cid = ...
ObjectHandler oh = ...
ObjectData od = ...
// output object type for WCM object
System.out.println("object type="+ od.getObjectType().getName());
// output object type used by the deployment
System.out.println("deployment object type="+
od.getDeploymentObjectType().getName());
This difference between object type and deployment object type only exists for
relators. The icon representing the object type in the Content client and the MIME
type of relators is not determined by the object type, but by the WCM object itself.
For this reason, the icon's URL and the MIME type can be retrieved from an
ObjectData instance.
Example 7-28:
String imageurl = od.getImageURL("intranet_edit");
String mimetype = od.getMimeType();
System.out.println("objectdata: imageurl="+imageurl+
" mimetype="+mimetype);
// returns different results for relators
imageurl = od.getObjectType().getImageURL("intranet_edit");
mimetype = od.getObjectType().getMimeType();
System.out.println("objecttype: imageurl="+imageurl+"
mimetype="+mimetype);
Editing the
content of
relators
The content of relators is stored in the Enterprise Server database. Nevertheless, it
can be edited via the WCM Java API – just like the content of other WCM objects
(see “Editing content” on page 79). In order to decide whether the content can be
changed and how to analyze it, the relator's deployment object type is used.
Example 7-29: Retrieving the content of a relator
The following code sample reads the content of the relator and copies it to a
new file.
ContextId cid = ...
ObjectHandler oh = ...
ObjectId relatorOID=new ObjectId("123");
// checkout
oh.checkOut(cid,relatorOID,"test relator");
// get content
ObjectData od = oh.get(cid,relatorOID);
File outputFile = od.getCheckOutContent(cid,"intranet_edit",
null);
128
Livelink WCM Server
WM090700-PJA-EN-1