Michael Daum > WebService-Cmis-0.08 > WebService::Cmis::Object

Download:
WebService-Cmis-0.08.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  2
Open  0
View/Report Bugs
Source   Latest Release: WebService-Cmis-0.09

NAME ^

WebService::Cmis::Object - Representation of a cmis object

DESCRIPTION ^

This class provides the bulk of methods to work with CMIS objects. When creating a new object on the base of an xml document, will it be subclassed correctly reading the cmis:baseTypeId property.

  my $obj = WebService::Cmis::Object(
    repository=>$this->{repository}, 
    xmlDoc=>$xmlDoc
  );

  if ($obj->isa('WebService::Cmis::Folder')) {
    # this is a folder
  }

Parent class: WebService::Cmis::AtomEntry

Sub classes: WebService::Cmis::Folder, WebService::Cmis::Document, WebService::Cmis::Relationship, WebService::Cmis::Policy.

METHODS ^

new(repository=>$repository, xmlDoc=>$xmlDoc) -> $object

constructor to get a specialized object, a subclass of WebService::Cmis::Object representing a cmis:document, cmis:folder, cmis:relationship or cmis:policy.

DESTROY

clean up internal caches

reload(%params)

Fetches the latest representation of this object from the CMIS service. Some methods, like document->checkout do this for you.

If you call reload with a properties filter, the filter will be in effect on subsequent calls until the filter argument is changed. To reset to the full list of properties, call reload with filter set to '*'.

Parameters:

  • filter
  • includeAllowableActions
  • includePolicyIds
  • includeRelationships
  • includeACL
  • renditionFilter
getId() -> $id

returns the object ID for this object.

getName() -> $name

returns the cmis:name property.

getPath() -> $path

returns the cmis:path property.

getTypeId() -> $typeId

returns the cmis:objectTypeId property.

getProperties($filter) -> %properties;

returns a hash of the object's properties. If CMIS returns an empty element for a property, the property will be in the hash with an undef value

See CMIS specification document 2.2.4.8 getProperties

getProperty($propName) -> $propValue

returns the value of a given property or undef if not available.

This is not covered by the cmis specs but makes live easier.

getAllowableActions() -> %allowableActions

returns a hash of allowable actions, keyed off of the action name.

  my $allowableActions = $obj->getAllowableActions;
  while (my ($action, $booleanFlag) = each %$allowableActions) {
    print "$action=$booleanFlag\n";
  }

See CMIS specification document 2.2.4.6 getAllowableActions

getACL() -> $acl

returns the access controls for this object.

The repository must have ACL capabilities 'manage' or 'discover'.

The optional onlyBasicPermissions argument is currently not supported.

See CMIS specification document 2.2.10.1 getACL

getSelfLink -> $href

returns the URL used to retrieve this object.

getEditLink -> $href

returns the URL that can be used with the HTTP PUT method to modify the atom:entry for the CMIS resource

See CMIS specification document 3.4.3.1 Existing Link Relations

getAppliedPolicies(%params) -> $atomFeed

returns the list of policies applied to this object.

See CMIS specification document 2.2.9.3 getAppliedPolicies

getObjectParents(%params) -> $atomFeedOrEntry

gets the parent(s) for the specified non-folder, fileable object. This is either an atom feed of objects or the parent cmis object depending on the "up" relation.

The following optional arguments are - NOT YET - supported: (TODO)

  • filter
  • includeRelationships
  • renditionFilter
  • includeAllowableActions
  • includeRelativePathSegment

See CMIS specification document 2.2.3.5 getObjectParents

getRelationships(%params) -> $atomFeed

returns a result set of relationship objects for each relationship where the source is this object.

The following optional arguments are - NOT YET - supported: (TODO)

  • includeSubRelationshipTypes
  • relationshipDirection
  • typeId
  • maxItems
  • skipCount
  • filter
  • includeAllowableActions

See CMIS specification document 2.2.8.1 getObjectRelationships

delete(%params)

Deletes this cmis object from the repository. Note that in the case of a Folder object, some repositories will refuse to delete it if it contains children and some will delete it without complaint. If what you really want to do is delete the folder and all of its descendants, use Folder->deleteTree instead.

The following optional arguments are - NOT YET - supported: (TODO)

  • allVersions: if TRUE (default), then delete all versions of the document. If FALSE, delete only the document object specified. The Repository MUST ignore the value of this parameter when this service is invoke on a non-document object or non-versionable document object.

See CMIS specification document 2.2.4.14 delete

move($sourceFolder, $targetFolder) -> $this

Moves the specified file-able object from one folder to another.

See CMIS specification document 2.2.4.13 move

moveTo($targetFolder) -> $this

Convenience function to move an object from its parent folder to a given target folder. Same as Folder::addObject but in reverse logic

unfile($folder)

removes this object from the given parent folder. If the $folder parameter is not provided, the document is removed from any of its parent folders.

See CMIS specification document 2.2.5.2

updateProperties($propertyList) -> $this

TODO: The optional changeToken is not yet supported.

Updates the properties of an object with the properties provided. Only provide the set of properties that need to be updated.

  $folder = $repo->getObjectByPath('/SomeFolder');
  $folder->getName; # returns SomeFolder

  $folder->updateProperties([
    WebService::Cmis::Property::newString(
      id => 'cmis:name',
      value => 'SomeOtherName',
    ),
  ]);

  $folder->getName; # returns SomeOtherName

See CMIS specification document 2.2.4.12 updateProperties

rename($string) -> $this

rename this object updating its cmis:properties

updateSummary($text) -> $this

changes the atom:summary of this object

applyACL($acl) -> $acl

applies specified ACL to the object and returns the updated ACLs as stored on the server.

  my $obj = $repo->getObject($id);
  my $acl = $obj->getACL->addEntry(
    new WebService::Cmis::ACE(
      principalId => 'jdoe',
      permissions => ['cmis:write', 'cmis:read'],
      direct => 'true',
    )
  );
  my $updatedACL => $obj->applyACL($acl);

See CMIS specification document 2.2.10.2 applyACL

applyPolicy()

TODO: This is not yet implemented.

createRelationship()

TODO: This is not yet implemented.

removePolicy()

TODO: This is not yet implemented.

COPYRIGHT AND LICENSE ^

Copyright 2012 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: