Every repository resource inherits from this class in order to
store and provide access to information about its existence.
- __cmp__(self, other)
- __init__(self, path, connection, resourceType, root)
- addAcl(self, aclKey, aclIdent, allowed=1)
Add an acl identifier to the acl key.
If the specified key does not exist on the resource
this function has the same functionality of setAcl.
- addAlias(self, path, docDef=None)
Adds an alias for this resource to the repository.
- addLiteralProperty(self, predicate, object, scope='', statementUri='')
Adds a statement about this repository object,
with a literal property, to the model
- addResourceProperty(self, predicate, object, scope='', statementUri='')
Adds a statement about this repository object, with a resource
property, to the model
- applyXslt(self, chain, params=None, ignorePis=1, extParams=None, extModules=None)
applies the specified chain of stylesheets (with the specified
transformation parameters) using the "self" object as source
chain - can be a list of transforms, in which case only one
transform run will execute, with the list of transforms
all used such that [a.xsl, b.xsl] is equivalent to
adding an import of b.xsl to a.xsl and applying a.xsl
can also be a list of lists of transforms, in which case
a chain of transforms is run,
one pass for each inner list. The output of each
step in the chain is fed as the input to the next
params - a dictionary giving the overridden top-level parameters
for the transforms
ignorePis - whether or not to ignore <xml-stylesheet processing
instructions in the source document
extParams - a special dictionary of parameters that allows the
processor to communicate special values back to the caller
extModules - a list of modules containing extension function and
- asDom(self, stripElements=None)
Return this object as a non-live DOM instance.
This means that any mutations to the returned DOM object will
not affect the content of this resource.
Delete this object from the repository
- fetchResource(self, path)
Fetch a resource from the system.
path is a string. The traverseAliases parameter is deprecated
and the new ";traverse" path arguments should be used. As an
example, where before you could call:
resource.fetchResource('path', 1) now you would call
Get the full path into the system
Get the full path into the system, as an absolute URI string.
- getAcl(self, aclKey=None)
Get a list of users and groups specified by the aclKey.
If an aclKey is specified, then the results will be a
list of dictionaries keyed by acl identifiers and with
values of ALLOWED or DISALLOWED (from AclConstants). The
values in the list of dictionaries could be inherited from
the parent object. If no aclKey is specified, then the
results will be a nested dictionary. The outer dictionary
is keyed by all of the defined acl keys on this resource.
Each value of the outer dictionary will be a dictionary
identical to when this method is called with a aclKey.
These results will not return any inherited values.
Get the ACL identifier for the current user (without expansion).
Get a list of all acl identifiers for the current users.
This is equivalent to performing an "expandGroups" of the
current user. It will also add things such as "WORLD-GROUP"
or "USER-GROUP" if they exist.
Get a list of alias objects that reference this object
Get the base path of this object.
The only difference between this and getPath is that for all
non-container objects it will return the parent's path.
For a container object it will return its path.
Get the string content of this resource
Get the resource the represents the content of this object
- getContentSlice(self, start=None, end=None)
Get a piece of our content. Really only makes sense for large raw files
Get the date that this resource was created.
The date will be an ISO 8601 string like u'2002-08-16T22:49:56Z'.
Get the path relative to the document root
Returns the Internet Media Type of the raw file resource
Get the date that this resource was last modified.
The date will be an ISO 8601 string like u'2002-08-16T22:49:56Z'.
Get the string meta data of this resource
Retrieves the common model associated w/ the repository
Get the name of the resource.
Get the owner of this resource
Get the parent container of this resource
Get the path of this resource
Get the type of this resource.
Types are defined in Ft.Server.Common.ResourceTypes.ResourceType.
Get a reference to the system repository
Get the size of the content
Returns all statements about this object in the model
Returns all statements in the model generated by this object
Get the validation information associated with this resource.
- hasResource(self, path)
Query if the system has a resource specified by the path.
No exception will be raised by this function. If the current
user cannot access the resource or the resource does not exist
in the repository, then the results will be 0. If the resource
does exist, then the results will be the integer resource type
of the resource (see
- inheritAcl(self, aclKey)
Remove the entire key from the ACL entry so that it is
inherited again from its parent
- isResourceType(self, testType)
Determine if this resource is of a certain type
- markTemporary(self, timeToLive)
Mark this resource as temporary. Temporary objects will be removed from the repository when thier
timeToLive has expired and purgeTemporaryResources is called the repository.
Time to live is seconds from now.
- pprint(self, stream=<open file '<stdout>', mode 'w' at 0x401dd060>)
- removeAcl(self, aclKey, aclIdent)
Remove the acl identifier from the acl key.
If the specified aclKey is not present on the resource or the
specified aclIdent is not in the key, then do nothing.
Remember that entries inherited from the parent are *not*
included in the acl on the actual resurce. In order to
override inherited permissions, set to no access rather than
trying to remove.
- removeAlias(self, path)
Removes the specified alias for this resource
- removeLiteralProperty(self, predicate, object)
Removes a statement about this repository object, with a literal property, from
- removeResourceProperty(self, predicate, object)
Remove a statement about this repository object, with a resource preoperty, from
- setAcl(self, aclKey, aclIdent, allowed=1)
Replace the aclKey with a single entry of aclIdent.
- setContent(self, src)
Set the string content of this resource
- setOwner(self, newOwner)
Change the owner of this resource
- toXPathContext(self, nss=None)
Create an XPath Context with the src of this RawFile.
nss is a dictionary of namespace definitions to include in the
- verifyAcl(self, aclKey, verifyTraverse=1)
Test to see whether the current user (and the current users set
of acl identifiers) is allowed to perform the specified action,
aclKey, on the current object. If verifyTraverse is specified,
then execute premissions are tested on all of the parents of
this resource as well.
- xUpdate(self, updateSrc)
Allows XML content to be updated with the XUpdate protocol