Michael Daum > WebService-Cmis-0.09 > WebService::Cmis::Repository

Download:
WebService-Cmis-0.09.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  2
Open  0
View/Report Bugs
Source  

NAME ^

WebService::Cmis::Repository - Representation of a cmis repository

DESCRIPTION ^

After fetching a WebService::Cmis::Client object, fetching the repository is the next thing to do in most cases using "getRepository" in WebService::Cmis::Client.

  my $repo = WebService::Cmis::getClient->getRepository('repositoryId');

METHODS ^

new($client, $xmlDoc)

Create a new repository object using the given $client and loading the information stored in the $xmlDoc.

getClient() -> WebService::Cmis::Client

returns the the client object used to communicate with the repository.

toString()

return a string representation of this repository

reload()

This method will re-fetch the repository's XML data from the CMIS repository.

getRepositoryId()

returns this repository's ID

getRepositoryName()

returns this repository's name

getRepositoryInfo() -> %info

returns this repository's info record

See CMIS specification document 2.2.2.2 getRepositoryInfo

getCapabilities() -> %caps

returns this repository's capabilities

getSupportedPermissions() -> $permissions

returns this repository's supported permissions. values are:

  basic: indicates that the CMIS Basic permissions are supported
  repository: indicates that repository specific permissions are supported
  both: indicates that both CMIS basic permissions and repository specific permissions are supported
getPropagation() -> $string

returns the value of the cmis:propagation element. Valid values are:

  objectonly: indicates that the repository is able to apply ACEs
    without changing the ACLs of other objects

  propagate: indicates that the repository is able to apply ACEs to a
    given object and propagate this change to all inheriting objects
getPermissionDefinitions() -> %permDefs

Returns a hash of permission definitions for this repository. The key is the permission string or technical name of the permission and the value is the permission description.

getPermissionMap() -> %permMap

returns a hash representing the permission mapping table where each key is a permission key string and each value is a list of one or more permissions the principal must have to perform the operation.

getUriTemplates() -> %templates

returns a hash of URI templates the repository service knows about.

getUriTemplate($type) -> $template

returns an uri template for the given type

getRootFolder() -> $folder

returns the root folder of the repository

getFolder($id) -> $foldeer

returns the a folder object of the given id

getCollection($collectionType, %args) -> $atomFeed

returns a AtomFeed of objects returned for the specified collection.

If the query collection is requested, an exception will be throwd. That collection isn't meant to be retrieved.

getTypeDefinition($typeId) -> $objectType

returns an ObjectType object for the specified object type id.

See CMIS specification document 2.2.2.5 getTypeDefinition

folderType = repo.getTypeDefinition('cmis:folder')

getCollectionLink($collectionType) -> $href

returns the link HREF from the specified collectionType (CHECKED_OUT_COLL, for example).

getLink($relation) -> $href

returns the HREF attribute of an Atom link element for the specified rel.

getObjectByPath($path, %params) -> $cmisObj

returns an object given the path to the object.

  my $doc = $repo->getObjectByPath("/User homes/jeff/sample.pdf");
  my $title = $doc->getTitle();

These optional arguments are supported:

filter: See section 2.2.1.2.1 Properties.
includeAllowableActions: See section 2.2.1.2.6 Allowable Actions.
includeRelationships: See section 2.2.1.2.2 Relationships.
renditionFilter: See section 2.2.1.2.4 Renditions.
includePolicyIds: See section 2.2.1.2.2 Relationships.
includeACL: See section 2.2.1.2.5 ACLs.

See CMIS specification document 2.2.4.9 getObjectByPath

getObject($id, %params) -> $cmisObj

returns an object given the specified object ID.

See CMIS specification document 2.2.4.7 getObject

getCheckedOutDocs(%params) -> $atomFeed

returns a result set of cmis objects that are currently checked out.

See CMIS specification document 2.2.3.6 getCheckedOutDocs

These optional arguments are supported:

folderId
maxItems
skipCount
orderBy
filter
includeRelationships
renditionFilter
includeAllowableActions
getUnfiledDocs(%params):

returns a AtomFeed of cmis objects that are currently unfiled.

These optional arguments are supported:

folderId
maxItems
skipCount
orderBy
filter
includeRelationships
renditionFilter
includeAllowableActions
getTypeDefinitions(%params) -> $atomFeed

returns a AtomFeed of ObjectTypes holding the base types in the repository.

Use the normal paging options.

createEntryXmlDoc( summary=>$summary folder=>$parentFolder, properties=>$propsList, contentFile=>$filename, contentData=>$data, contentType=>$type ) -> $atomEntry

helper method that knows how to build an Atom entry based on the properties and, optionally, the contentFile provided.

createObject($parentFolder, properties => $propertyList, %params);

creates a new CMIS Objec in the given folder using the properties provided.

To specify a custom object type, pass in a Property for cmis:objectTypeId representing the type ID of the instance you want to create. If you do not pass in an object type ID, an instance of 'cmis:document' will be created.

getTypeChildren($typeId, %params) -> $atomFeed

returns a result set ObjectType objects corresponding to the child types of the type specified by the typeId.

If no typeId is provided, the result will be the same as calling getTypeDefinitions

See CMIS specification document 2.2.2.3 getTypeChildren

These optional arguments are current supported:

includePropertyDefinitions
maxItems
skipCount
getTypeDescendants($typeId, %params) -> $atomFeed

Returns a result set ObjectType objects corresponding to the descendant types of the type specified by the typeId.

If no typeId is provided, the repository's "typesdescendants" URL will be called to determine the list of descendant types.

See CMIS specification document 2.2.2.4 getTypeDescendants

These optional arguments are supported:

depth
includePropertyDefinitions
query(statement, %params):

Returns a result set of CMIS Objects based on the CMIS Query Language passed in as the statement. The actual objects returned will be instances of the appropriate child class based on the object's base type ID.

In order for the results to be properly instantiated as objects, make sure you include 'cmis:objectId' as one of the fields in your select statement, or just use "SELECT \*".

If you want the search results to automatically be instantiated with the appropriate sub-class of CMIS Object you must either include cmis:baseTypeId as one of the fields in your select statement or just use "SELECT \*".

See CMIS specification document 2.2.6.1 query

The following optional arguments are supported:

searchAllVersions
includeRelationships
renditionFilter
includeAllowableActions
maxItems
skipCount
getLatestChangeLogToken () -> $token

returns a token to ge use fetching a changes atom feed.

getContentChanges(%params) -> $atomFeed

returns a AtomFeed containing ChangeEntry objects.

See CMIS specification document 2.2.6.2 getContentChanges

The following optional arguments are supported:

changeLogToken
includeProperties
includePolicyIDs
includeACL
maxItems

You can get the latest change log token by inspecting the repository info via Repository.getRepositoryInfo.

createDocument( $name, folder=>$parentFolder, properties=>$propsList, contentFile=>$filename, contentData=>$data, contentType=>$type, ) -> $cmisDocument

creates a new Document object in the parent folder provided or filed to the Unfiled collection of the repository.

The method will attempt to guess the appropriate content type and encoding based on the file. To specify it yourself, pass them in via the contentType and

To specify a custom object type, pass in a Property for cmis:objectTypeId representing the type ID of the instance you want to create. If you do not pass in an object type ID, an instance of 'cmis:document' will be created.

See CMIS specification document 2.2.4.1 createDument

createFolder($name, folder=>$parentFolder, properties=>$propertyList, %params) -> $cmisFolder

creates a new CMIS Folder using the properties provided.

To specify a custom folder type, pass in a property called cmis:objectTypeId representing the type ID of the instance you want to create. If you do not pass in an object type ID, an instance of 'cmis:folder' will be created.

  my $rootFolder = $repo->getRootFolder;

  my $subFolder = $rootFolder->createFolder(
    'My new folder', 
    summary => "This is my new test folder."
  );

  my $repo = $repo->createFolder(
    'My other folder', 
    folder => $rootFolder,
    summary => "This is my other test folder."
  );

See CMIS specification document 2.2.4.3 createFolder

createRelationship

TODO: This is not yet implemented.

createPolicy

TODO: This is not yet implemented.

AUTHOR ^

Michael Daum <daum@michaeldaumconsulting.com>

COPYRIGHT AND LICENSE ^

Copyright 2012-2013 Michael Daum

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://dev.perl.org/licenses/artistic.html.

syntax highlighting: