10
Folios Services 10-1
10
Folios Services
This chapter describes the services available when using and customizing Folios. The location for specific Folios services are listed within each individual service.
10.1 Folio Services
Individual service types are noted in each service description. The following services are described in this section:
■
LOAD_FOLIO_NODE
■
UPDATE_FOLIO
■
CHECKIN_NEW_FOLIO
■
CREATE_FOLIO_SNAPSHOT
■
LOCK_FOLIO
■
UNLOCK_FOLIO
■
CREATE_FOLIO_RENDITION
■
GENERATE_GUIDS
10.1.1 LOAD_FOLIO_NODE
Service that displays the contents of a folio node by returning the nodes, slots and links that are the immediate children of the requested node. By default this service is
not recursive; if called recursively, this service returns a complete folio.
Location: IdcHomeDircomponentsContentContentFoliosresourcescpd_ service.htm
Additional Required Service Parameters
■
dID: The content ID of the folio.
■
RevisionSelectionMethod: Tells the Oracle Content Server instance whether to use retrieved information based on the latest revision, which could be in an unreleased
state, or the latest released version. The value can be: Specific, Latest which could be unreleased, or Latest Released.
Optional Service Parameter
■
parentNodeID: Retrieves details, but not the properties, of the contents of the specified node within a folio. If this parameter is omitted, by default the service
retrieves the root node and its properties.
10-2 Oracle Fusion Middleware Services Reference Guide for Oracle Universal Content Management
Example 1
http:myserveridcidcplg?IdcService=LOAD_FOLIO_NODEdID=68095 RevisionSelectionMethod=Specific
Example 2
http:myserveridcidcplg?IdcService=LOAD_FOLIO_NODEdID=68095 RevisionSelectionMethod=SpecificparentNodeId=E176-3B00-1D2A-A592-E0CF
10.1.2 UPDATE_FOLIO
Service that adds one or more content items to a folio and modifies a folio. Multiple changes can be requested as part of a single service call.
Prerequisite: Before an item can be added to a folio, the item must be checked in to the Oracle Content Server instance using the standard
CHECKIN_NEW or
CHECKIN_ UNIVERSAL
services. Location: IdcHomeDircomponentsContentContentFoliosresourcescpd_
service.htm
Additional Required Service Parameters
■
NumChanges: Specifies the number of changes or updates passed as part of the service call. For example, to pass two changes, NumChanges=2.
■
changen-1: Specifies the actual change to be made to the folio. The default is one change, which is indicated by change or change0. If there are multiple changes to
the folio, as indicated by NumChanges, then a parameter must be passed for each change. For example, if NumChanges=3, then change, change1, and change2.
The value for the changen-1 parameter must be in the following format: dID:Operation:TargetGUID:ParentGUID
– dID: The dID of the folio to be updated.
– Operation: One of the following choices:
removeNode: remove a node addNode: add a node
addItem: add a slot addContent: add an actual file
removeContent: remove a content item modifyAttribute: modify a property
modifyTemplateAttribute: modify a template property
– TargetGUID: The GUID of the node, slot, or content item in the folio to be
modified.
– ParentGUID: The parent GUID of the mode, slot, or content item to be
modified. This is relevant for only some of the operations, such as addNode.
Note: For each changen-1 parameter, you must use a change_
datan-1 parameter. For example, if you specify a change1 parameter you must also specify a change_data1 parameter.
Folios Services 10-3
■
change_datan-1: Specifies the values for the operation specified in the changen-1 parameter. The format for this parameter is name:value pairs separated
by commas. A carat can be used as a separator if a colon : is required in any of the names or values name:namevalue.
When adding content these properties must be specified:
– dDocAuthor
– dDocName
– dDocName_encoded
– dDocTitle
– dDocType
– dFormat
– dID
– docURL
– docURL_encoded
– dOriginalName
– dRevLabel
Property information can be retrieved using a DOC_INFO
service call against the item you want to add to a folio. You must provide the information for the
dDocName_encoded, docURL, and docURL_encoded properties. You can specify custom properties that you add to the folio definition as XCST or XCSD data.
Example 1 To add a new content item to an existing content folio, you must define two changes.
The first change operation is to specify addItem, which will add a slot. The second change operation is to specify addContent, which will insert the document into the
slot. For both changes, the change_data parameter must specify the content properties. The xcsdname and xcstname designation for the properties also must
be specified.
IdcService=UPDATE_FOLIO NumChanges=2
dDocName=OCS_223948 RevisionSelectionMethod=Latest
change0=8611:addItem:4952-6EBE-1275-0A59-0D19:F5C4-A3D0-E671-D4CF-9C28 change_data0=xcsddFormat:applicationvnd.ms-excel,id:4952-6EBE-1275-0A59-0D19,
xcsddID:18251,xcsddDocTitle:Next Year Goals,xcsddDocType:Document,xcsddRendition1:T, xcsddRevLabel:3,xcsddOriginalName:Next Year Goals.xls,xcsddDocAuthor:weblogic,
xcsddocURL:csgroupsSecuredocumentsDocumentOCS_158654.xls,xcsddDocName_encoded:OCS_158654, xcsddocURL_encoded:2Fcs2Fgroups2FSecure2Fdocuments2FDocument2FEOCS_158654.xls,
xcstname:Next Year Goals,xcstdescription: change1=8611:addContent:4952-6EBE-1275-0A59-0D19
change_data1=xcsddFormat:applicationvnd.ms-excel,id:4952-6EBE-1275-0A59-0D19, xcsddDocName:OCS_158654,xcsddID:18251,xcsddDocTitle:Next Year Goals,xcsddDocType:Document,
xcsddRendition1:T,xcsddRevLabel:3,xcsddOriginalName:Next Year Goals.xls, xcsddDocAuthor:weblogic,xcsddocURL:csgroupsSecuredocumentsDocumentOCS_158654.xls,
xcsddDocName_encoded:OCS_158654, xcsddocURL_encoded:2Fcs2Fgroups2FSecure2Fdocuments2FDocument2FEOCS_158654.xls,
xcstname:Next Year Goals,xcstdescription:
10-4 Oracle Fusion Middleware Services Reference Guide for Oracle Universal Content Management
Example 2 To add a new content item to an existing folio as part of RIDC code:
Start a new client connection to UCM IdcClientManager manager = new IdcClientManager;
build a client that will communicate using the intradoc protocol IdcClient idcClient = manager.createClientidc:localhost:4444;
create a trusted user connection to UCM IdcContext userContext = new IdcContextweblogic;
create the binder for the set of GUIDs needed later on DataBinder guidBinder = idcClient.createBinder;
populate the binder with the parameters guidBinder.putLocalIdcService, GENERATE_GUIDS;
send the request and get the response back from local data and result set ServiceResponse guidResponse = idcClient.sendRequestuserContext, guidBinder;
DataBinder folderData = guidResponse.getResponseAsBinder ; DataResultSet guidResults = folderData.getResultSet GUID_SET;
put the set of GUIDs in an array String guids[] = new String[25];
int n = 0; for DataObject dataObject : guidResults.getRows {
guids[n] = dataObject.getid; }
create the binder to get the content information of the document to add DataBinder docInfoBinder = idcClient.createBinder;
populate the binder with the parameters docInfoBinder.putLocalIdcService, DOC_INFO_BY_NAME;
docInfoBinder.putLocaldDocName, OCS_158654;
send the request and get the response back from local data and result set ServiceResponse infoResponse = idcClient.sendRequestuserContext, docInfoBinder;
DataBinder infoData = infoResponse.getResponseAsBinder ; DataResultSet docInfoResults = infoData.getResultSet DOC_INFO;
create the binder to get the content information of the folio to update DataBinder folioInfoBinder = idcClient.createBinder;
populate the binder with the parameters folioInfoBinder.putLocalIdcService, DOC_INFO_BY_NAME;
folioInfoBinder.putLocaldDocName, OCS_223948;
send the request and get the response back from local data and result set ServiceResponse folioInfoResponse = idcClient.sendRequestuserContext, folioInfoBinder;
DataBinder folioInfoData = folioInfoResponse.getResponseAsBinder ; ataResultSet folioInfoResults = folioInfoData.getResultSet DOC_INFO;
String foliodID = folioInfoData.getLocaldID;
build the change data string for the content String newItemStr = ;
for DataObject dataObject : docInfoResults.getRows { build the path to the document
String urlStr = csgroups + dataObject.get dSecurityGroup + documents + dataObject.get dDocType + + dataObject.get dDocName + . + dataObject.get dWebExtension;
assemble the string with the parameters needed for the content folio service change string newItemStr = xcsddFormat: + dataObject.get dFormat + ,;
newItemStr += id: + guids[0] + ,;
Folios Services 10-5
newItemStr += xcsddDocName: + dataObject.get dDocName + ,; newItemStr += xcsddID: + dataObject.get dID + ,;
newItemStr += xcsddDocTitle: + dataObject.get dDocTitle + ,; newItemStr += xcsddDocType: + dataObject.get dDocType + ,;
newItemStr += xcsddRendition1: + dataObject.get dRendition1 + ,; newItemStr += xcsddRevLabel: + dataObject.get dRevLabel + ,;
newItemStr += xcsddOriginalName: + dataObject.get dOriginalName + ,; newItemStr += xcsddDocAuthor: + dataObject.get dDocAuthor + ,;
newItemStr += xcsddocURL: + urlStr + ,; newItemStr += xcsddDocName_encoded: + java.net.URLEncoder.encodedataObject.get dDocName,
UTF-8 + ,; newItemStr += xcsddocURL_encoded: + java.net.URLEncoder.encodeurlStr, UTF-8 + ,;
newItemStr += xcstname: + dataObject.get dDocTitle + ,; newItemStr += xcstdescription:;
}
create the binder to get the folio root GUID DataBinder rootBinder = idcClient.createBinder;
populate the binder with the parameters rootBinder.putLocalIdcService, LOAD_FOLIO_NODE;
rootBinder.putLocaldDocName, folioName; rootBinder.putLocalRevisionSelectionMethod, Latest;
send the request and get the response back from local data ServiceResponse rootGUIDResponse = idcClient.sendRequestuserContext, rootBinder;
DataBinder rootGUIDData = rootGUIDResponse.getResponseAsBinder ; String rootGUID = rootGUIDData.getLocalRootNode;
assemble the first change parameter for the service. This will tell the content folio service to add a slot
String change0 = foliodID + :addItem: + guids[0] + : + rootGUID;
assemble the second change parameter for the service. This will tell the content folio service to add a content item to the new slot
String change1 = foliodID + :addContent: + guids[0];
create the binder to run the UPDATE_FOLIO service DataBinder folioBinder = idcClient.createBinder;
populate the binder with the parameters folioBinder.putLocalIdcService, UPDATE_FOLIO;
folioBinder.putLocaldDocName, folioName folioBinder.putLocalRevisionSelectionMethod, Latest;
folioBinder.putLocalNumChanges, 2; folioBinder.putLocalchange0, change0;
folioBinder.putLocalchange_data0, newItemStr; folioBinder.putLocalchange1, change1;
folioBinder.putLocalchange_data1, newItemStr;
send the request and get the response back from local data ServiceResponse folioResponse = idcClient.sendRequestuserContext, folioBinder;
DataBinder folioData = folioResponse.getResponseAsBinder ;
10-6 Oracle Fusion Middleware Services Reference Guide for Oracle Universal Content Management
10.1.3 CHECKIN_NEW_FOLIO