RetrieveRepositoryObject

KCM Core retrieves a dynamic object from the specified KCM Repository. The dynamic object is stored in a file.

You can only use RetrieveRepositoryObject in the context of a Session.

Syntax

RetrieveRepositoryObject
  URI (<rep:/ uri>)
  Result (<file>)
  Encoding (<format>);

Parameters

  • URI: Required. A rep:/ URI that specifies the object that should be retrieved.
  • Result: Required. The file in which the retrieved object should be stored. If this file already exists, it is overwritten.
  • Encoding: Optional. If this parameter is omitted or set to "native," the object is stored in its native format. If this setting is set to "base64," the object will be base-64 encoded before it is stored. If this setting is set to "source-document," the word processor source variant of the object is stored. This feature is currently only supported for Rich Text Blocks; for other objects encoding "source-document" is treated as "native."

Rep:/ URIs

The URIs supported by RetrieveRepositoryObject use the following generic format.


rep:[//host[:port]]/type/project/[path/]object[?key=value[&key=value]*]

host: TCP/IP Host name of the system hosting the KCM Repository Server.

port: TCP/IP Port the server listens to (defaults to 2586)

type: Type object to retrieve. Supported objects are:

  • textblock
  • mastertemplate
  • wizard
  • form
  • documentationdocument (any object in the KCM Repository Documentation folder)
  • styledocument
  • quickdocument
  • letterbook
  • staticdocument
  • resource (any object in the KCM Repository Resources folder)
  • documentpacktemplate

project: Project. Use "*" to refer to the project. The previous project refers to values entered in previous calls to RetrieveRepositoryObject in the same session. Once objects are retrieved from a specific project you are not allowed to switch to other projects in the same session. This refers to changes in the values for host: port and project as entered in the URL. Changing these values returns an error.

path: Optional. Folders, separated by a slash.

object: The object to be retrieved.

key/value: Additional key/value pairs for parameters. Supported keys are:

  • user= Repository User. This is only relevant when development status objects are retrieved.
  • status=[published|accepted|current|development]. If the status is omitted, the published status is retrieved.

When retrieving objects from KCM Repository using RetrieveRepositoryObject, the following results can be expected.

Type Result
textblock Returns the Text Block XML for the Text Block. For Rich Text Blocks, setting the Encoding parameter to "source-document" returns the Microsoft Word document defining the Rich Text Block instead.
mastertemplate Returns the compiled Master Template. This is not a Microsoft Word document.
wizard Return the Content Wizard XML describing the Content Wizard.
form Returns the Form XML describing the Form.
documentationdocument Returns the documentation object requested. The type is equal to the type of the requested object.
styledocument Returns the Microsoft Word document containing the styles. Retrieving HTML style documents with RetrieveRepositoryObject is not supported, and will cause undefined results.
quickdocument Returns the compiled Quick Template. This is not a Microsoft Word or HTML document.
letterbook Returns the Letter Book XML describing the Letter Book.
staticdocument Returns the static document requested. The type is equal to the type of the Static Document and is either a .doc, .docx, .pdf, .xls, .xlsx, .ppt, or .pptx.
resource Returns the resource object requested. The type is equal to the type of the resource.
documentpacktemplate Returns the Document Pack Template XML describing the Document Pack Template.

Examples


rep://localhost:2587/letterbook/InstallationTest/Letters?status=accepted

This example refers to the accepted version of the Letter Book Letters in the project InstallationTest. The letterbook is retrieved from the KCM Repository server installed on the localhost for the instance indicated by port 2587. For information on the host and port to use for each instance, see the ReadMe.txt file that resides in: <instance folder>\designer\Client.

rep:/textblock/*/Clauses/US/Clause421

This example refers to the Text Block Clause421 in the Text Block folder Clauses/US. The location of the Repository server (host:port) and the project as indicated by * has been omitted and defaults to the previously used resources in the session.

Metadata

Some objects can provide additional information. This information is available in the internal constant _repository_metadata. If there is no information available, this constant is empty.

If the metadata contains multiple parts, they are separated by the content of the internal constant _newline.

textblock: _repository_metadata contains "itptbkxml<newline>description" for normal Text Blocks and "rich<newline>description" for Rich Text Blocks. Any line breaks within the description are replaced by spaces.

static document: _repository_metadata contains the extension of the static document.

Example

RetrieveRepositoryObject
  URI ("rep:/letterbook/myProject/Letters")
  Encoding ("Base64")
  Result ("letterbook" [ _SessionDir, "xml" ]);

This example retrieves the Letter Book Letters from the project myProject. The Letter Book definition is Base-64 encoded and stored in the file letterbook.xml in the current session directory.

Availability

The RetrieveRepositoryObject command is introduced in KCM Core 4.4.