13 Folios Services

This chapter describes the Oracle WebCenter Content services available when using and customizing the Folios component.

This chapter covers the following topics:

About Folios Services

Information about what is a WebCenter Content service and how services can be used is provided in Using Services. Information about basic services structure, attributes, actions, and a service example is provided in Customizing Services. You should be familiar with this information before customizing current services or creating new services

The locations for specific Folios services are listed within each individual service.

Note:

In this chapter the most commonly used services have more extensive descriptions.

For more information about Folios, see Understanding Content Folios in Managing Oracle WebCenter Content.

Note:

The most commonly used services have more extensive descriptions.

Folio Services

The following services are described in this section:

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: IdcHomeDir/components/ContentContentFolios/resources/cpd_service.htm

Additional Required Service Parameters

  • dID: The content ID of the folio.

  • RevisionSelectionMethod: Tells the 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.

Example 1

http://myserver/idc/idcplg?IdcService=LOAD_FOLIO_NODE&dID=68095
&RevisionSelectionMethod=Specific

Example 2

http://myserver/idc/idcplg?IdcService=LOAD_FOLIO_NODE&dID=68095
&RevisionSelectionMethod=Specific&parentNodeId=E176-3B00-1D2A-A592-E0CF

Note:

The response from a SOAP/RIDC request will not return the expected folio information. An example is shown below:

<children><slot id="7543-66EA-3794-F7C1-D2B9"> 
<properties> 
<property key="xcsd:dDocTitle" value="test 2"/> 
<property key="xcst:lastmodifieddate" value="6/7/17 9:47 AM"/> 
<property key="xcst:name" value="test 2"/> 
<property key="nodeId" value="7543-66EA-3794-F7C1-D2B9"/> 
<property key="xcst:createdate" value="6/7/17 9:45 AM"/> 
<property key="xcsd:dDocAuthor" value="weblogic"/> 
<property key="xcsd:dFormat" value="image/jpeg"/> 
<property key="xcsd:dDocName" value="APP1-000403"/> 
<property key="xcsd:dRevLabel" value="1"/> 
<property key="xcsd:dOriginalName" value="test.jpg"/> 
<property key="xcst:description" value="wwCpdUndefinedDesc"/> 
<property key="xcsd:dID" value="403"/> 
</properties> 
<children> 
</children> 
</slot> 
</children>

Instead, the URL should be used to get the folio information as described in the knowledge article because the LOAD_FOLIO_NODE service uses the FOLIO_NODE_XML template to build the XML from the data binder.

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 Content Server instance using the standard CHECKIN_NEW or CHECKIN_UNIVERSAL services.

Location: IdcHomeDir/components/ContentContentFolios/resources/cpd_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.

  • change(n-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.

    Note:

    For each change(n-1) parameter, you must use a change_data(n-1) parameter. For example, if you specify a change1 parameter you must also specify a change_data1 parameter.

    The value for the change(n-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.

  • change_data(n-1): Specifies the values for the operation specified in the change(n-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:namêvalue).

    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 an item to a folio:

IdcService=UPDATE_FOLIO
NumChanges=1
change0=1234:addContent:4CB9-6850-4880-4718=DE71

Example 2

To specify change_data values for the addContent operation in example 1 (with no custom properties included in the folio):

change_data0=dFormat:text/html,dDocName:myDocName,dID=1111,
cDocTitle=My Doc Title,dDocType=ADACCT,dRevLabel=1,dOriginalName=mydoc.txt,
dDocAuthor=sysadmin,docURL=http://server/idc/mydoc.txt,
dDocName_encoded=<URL encoded version of dDocName>,
docURL_encoded=<URL encoded version of docURL>

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 xcsd^name and xcst^name 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=xcsd^dFormat:application/vnd.ms-excel,id:4952-6EBE-1275-0A59-0D19,
xcsd^dID:18251,xcsd^dDocTitle:Next Year Goals,xcsd^dDocType:Document,xcsd^dRendition1:T,
xcsd^dRevLabel:3,xcsd^dOriginalName:Next Year Goals.xls,xcsd^dDocAuthor:weblogic,
xcsd^docURL:/cs/groups/Secure/documents/Document/OCS_158654.xls,xcsd^dDocName_encoded:OCS_158654,
xcsd^docURL_encoded:%2Fcs%2Fgroups%2FSecure%2Fdocuments%2FDocument%2FEOCS_158654.xls,
xcst^name:Next Year Goals,xcst^description:
change1=8611:addContent:4952-6EBE-1275-0A59-0D19
change_data1=xcsd^dFormat:application/vnd.ms-excel,id:4952-6EBE-1275-0A59-0D19,
xcsd^dDocName:OCS_158654,xcsd^dID:18251,xcsd^dDocTitle:Next Year Goals,xcsd^dDocType:Document,
xcsd^dRendition1:T,xcsd^dRevLabel:3,xcsd^dOriginalName:Next Year Goals.xls,
xcsd^dDocAuthor:weblogic,xcsd^docURL:/cs/groups/Secure/documents/Document/OCS_158654.xls,
xcsd^dDocName_encoded:OCS_158654,
xcsd^docURL_encoded:%2Fcs%2Fgroups%2FSecure%2Fdocuments%2FDocument%2FEOCS_158654.xls,
xcst^name:Next Year Goals,xcst^description:

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.createClient("idc://localhost:4444");

// create a trusted user connection to UCM
IdcContext userContext = new IdcContext("weblogic");

// create the binder for the set of GUIDs needed later on
DataBinder guidBinder = idcClient.createBinder();
// populate the binder with the parameters
guidBinder.putLocal("IdcService", "GENERATE_GUIDS");

// send the request and get the response back from local data and result set
ServiceResponse guidResponse = idcClient.sendRequest(userContext, 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.get("id");
}

// create the binder to get the content information of the document to add
DataBinder docInfoBinder = idcClient.createBinder();
// populate the binder with the parameters
docInfoBinder.putLocal("IdcService", "DOC_INFO_BY_NAME");
docInfoBinder.putLocal("dDocName", "OCS_158654");

// send the request and get the response back from local data and result set
ServiceResponse infoResponse = idcClient.sendRequest(userContext, 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.putLocal("IdcService", "DOC_INFO_BY_NAME");
folioInfoBinder.putLocal("dDocName", "OCS_223948);

// send the request and get the response back from local data and result set
ServiceResponse folioInfoResponse = idcClient.sendRequest(userContext, folioInfoBinder);
DataBinder folioInfoData = folioInfoResponse.getResponseAsBinder ();
DataResultSet folioInfoResults = folioInfoData.getResultSet ("DOC_INFO");
String foliodID = folioInfoData.getLocal("dID");

// build the change data string for the content
String newItemStr = "";
for (DataObject dataObject : docInfoResults.getRows ()) {
// build the path to the document
String urlStr = "/cs/groups/" + 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 = "xcsd^dFormat:" + dataObject.get ("dFormat") + ",";
newItemStr += "id:" + guids[0] + ",";
newItemStr += "xcsd^dDocName:" + dataObject.get ("dDocName") + ",";
newItemStr += "xcsd^dID:" + dataObject.get ("dID") + ",";
newItemStr += "xcsd^dDocTitle:" + dataObject.get ("dDocTitle") + ",";
newItemStr += "xcsd^dDocType:" + dataObject.get ("dDocType") + ",";
newItemStr += "xcsd^dRendition1:" + dataObject.get ("dRendition1") + ",";
newItemStr += "xcsd^dRevLabel:" + dataObject.get ("dRevLabel") + ",";
newItemStr += "xcsd^dOriginalName:" + dataObject.get ("dOriginalName") + ",";
newItemStr += "xcsd^dDocAuthor:" + dataObject.get ("dDocAuthor") + ",";
newItemStr += "xcsd^docURL:" + urlStr + ",";
newItemStr += "xcsd^dDocName_encoded:" + java.net.URLEncoder.encode(dataObject.get ("dDocName"), "UTF-8") + ",";
newItemStr += "xcsd^docURL_encoded:" + java.net.URLEncoder.encode(urlStr, "UTF-8") + ",";
newItemStr += "xcst^name:" + dataObject.get ("dDocTitle") + ",";
newItemStr += "xcst^description:";
}

// create the binder to get the folio root GUID
DataBinder rootBinder = idcClient.createBinder();
// populate the binder with the parameters
rootBinder.putLocal("IdcService", "LOAD_FOLIO_NODE");
rootBinder.putLocal("dDocName", "folioName");
rootBinder.putLocal("RevisionSelectionMethod", "Latest");

// send the request and get the response back from local data
ServiceResponse rootGUIDResponse = idcClient.sendRequest(userContext, rootBinder);
DataBinder rootGUIDData = rootGUIDResponse.getResponseAsBinder ();
String rootGUID = rootGUIDData.getLocal("RootNode");

// 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.putLocal("IdcService", "UPDATE_FOLIO");
folioBinder.putLocal("dDocName", folioName)
folioBinder.putLocal("RevisionSelectionMethod", "Latest");
folioBinder.putLocal("NumChanges", "2");
folioBinder.putLocal("change0", change0);
folioBinder.putLocal("change_data0", newItemStr);
folioBinder.putLocal("change1", change1);
folioBinder.putLocal("change_data1", newItemStr);

// send the request and get the response back from local data
ServiceResponse folioResponse = idcClient.sendRequest(userContext, folioBinder);
DataBinder folioData = folioResponse.getResponseAsBinder ();

CHECKIN_NEW_FOLIO

Service that creates and checks in a new folio with a root node.

Location: IdcHomeDir/components/ContentContentFolios/resources/cpd_service.htm

Optional Service Parameters

  • This service can use standard metadata parameters, such as dDocName, dDocTitle, and so forth. Any other metadata required by parameters used in this service must also be specified.

  • If auto-generation of content ID is set on the server and you do not specify the dDocName parameter, then a new content ID is automatically generated.

  • The dID of the new folio is listed in the LocalData section of the service response.

Example

http://myserver/xpedio/icdplg?IdcServer=CHECKIN_NEW_FOLIO
&dDocName=myFolioTest&dDocTitle=MyFolioAPITest2&dDocType=TestData
&dDocAuthor=authorname&dSecurityGropu=Public&IsJava=1

CREATE_FOLIO_SNAPSHOT

Service that takes a version of a folio and creates a locked version and a new version.

Location: IdcHomeDir/components/ContentContentFolios/resources/cpd_service.htm

Additional Required Service Parameters

  • dID: The content ID of the folio.

  • RevisionSelectionMethod: Tells the 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.

Example

http://myserver/idc/idcplg?IdcService=CREATE_FOLIO_SNAPSHOT&dID=68095
&RevisionSelectionMethod=Specific

LOCK_FOLIO

Service that locks a folio so that it can not be edited, only viewed. No further modifications are allowed on this content item.

Location: IdcHomeDir/components/ContentContentFolios/resources/cpd_service.htm

Additional Required Service Parameters

  • dID: The content ID of the folio.

  • RevisionSelectionMethod: Tells the Content Server instance whether to use retrieve 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.

Example

http://myserver/idc/idcplg?IdcService=LOCK_FOLIO&dID=68095&RevisionSelectionMethod=Specific

UNLOCK_FOLIO

Service that creates a new version of a locked folio, where the new version of the folio can be edited.

Location: IdcHomeDir/components/ContentContentFolios/resources/cpd_service.htm

Additional Required Service Parameters

  • dID: The content ID of the folio.

  • RevisionSelectionMethod: Tells the Content Server instance whether to use retrieve 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.

Example

http://myserver/idc/idcplg?IdcService=UNLOCK_FOLIO&dID=68095&RevisionSelectionMethod=Specific

CREATE_FOLIO_RENDITION

Service that returns a specific rendition of a folio revision to a browser. A copy of the folio is retrieved without performing a checkout.

Location: IdcHomeDir/components/ContentContentFolios/resources/cpd_service.htm

Additional Required Service Parameters

  • dID: The content ID of the folio.

  • RenderID: The type of rendition: PDF, ZIP, XML. A custom rendition can be used.

Example

http://myserver/idc/idcplg?IdcService=CREATE_FOLIO_RENDITION&dID=68095&RenditionID=PDF

GENERATE_GUIDS

Service that generates and returns 25 group user IDs for use.

Location: IdcHomeDir/components/ContentContentFolios/resources/cpd_service.htm

Example

http://myserver/expedio/idcplg?IdcService=GENERATE_GUIDS&IsJava=1