Package amplee :: Package atompub :: Package member :: Class MemberResource
[show private | hide private]
[frames | no frames]

Type MemberResource

object --+
         |
        MemberResource


Method Summary
  __init__(self, collection, id, atom)
Keyword Arguments: collection -- AtomPubCollection instance holding this member id -- identifier for this member atom -- bridge.Element instance
  __cmp__(self, other)
By default members are compared following their app:edited element
  __getstate__(self)
  __setstate__(self, state)
  create(self, source, slug)
Called to generate the member entry from the atom entry provided in the source parameter.
  from_entry(self, entry)
Allows the filling of the current instance from an Atom entry.
  generate_atom_id(self, entry, slug)
Called to generate a valid atom identifier (a valid URI) which will be used within the Atom entry itself.
  generate_resource_id(self, entry, slug)
Called to generate a token that will be used as the internal identifier for this member within its collection.
  get_edit_media_uri(self)
Returns the URI of the media link entry (MLE)
  get_edit_uri(self)
Returns the URI of the member resource
  get_public_stripped_uri(self)
Returns a URI suitable for public feed and independant from the collection URI.
  get_public_uri(self)
Returns a URI suitable for public feed and independant from the collection URI
  index(self)
Passes the member to the collection indexers
  is_draft(self)
Returns True is the entry has a app:control element with an app:draft element which has a text value set to 'yes'.
  load_document(self, source)
  merge_dates(self, new_member)
  prepare_for_public(self, content, external_content, rel, media_type, xslt_path)
  set_xslt(self, info)
Sets the XSLT to associate to the Atom entry.
  update(self, source, exisiting_member)
Called to generate the new member entry from the atom entry provided in the source parameter as well as from the existing member in the store.
  update_dates(self)
  xml(self)
Returns the serialization as a string of the atom entry.
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __repr__(x)
x.__repr__() <==> repr(x)
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Property Summary
  atom
  content
  media_uri: Returns the URI of the media link entry (MLE)
  member_uri: Returns the URI of the member resource
  public_uri: Returns a URI suitable for public feed and independant from the collection URI
  public_uri_stripped: Returns a URI suitable for public feed and independant from the collection URI

Method Details

__init__(self, collection, id=None, atom=None)
(Constructor)

Keyword Arguments: collection -- AtomPubCollection instance holding this member id -- identifier for this member atom -- bridge.Element instance
Overrides:
__builtin__.object.__init__

__cmp__(self, other)
(Comparison operator)

By default members are compared following their app:edited element

create(self, source, slug=None)

Called to generate the member entry from the atom entry provided in the source parameter.

This must return the source again after being processed if need be within the method call. The content can be returned either as a byte string, unicode or a file object.

Keyword arguments: source -- resource string to handle

slug -- hint on how to generate the name of the resource and used as the last part of the edit and edit-media IRIs (default:None)

from_entry(self, entry)

Allows the filling of the current instance from an Atom entry.

This will lookup for two links:
 * rel='edit'
 * rel='edit-media'

generate_atom_id(self, entry=None, slug=None)

Called to generate a valid atom identifier (a valid URI) which will be used within the Atom entry itself.

By default this returns a random urn:uuid value.

generate_resource_id(self, entry, slug=None)

Called to generate a token that will be used as the internal identifier for this member within its collection. Also used as the identifier within the storage it will be added to which means the returned value should be valid for the chosen storage.

By default this returns the atom:id value of the member entry.

get_edit_media_uri(self)

Returns the URI of the media link entry (MLE)

get_edit_uri(self)

Returns the URI of the member resource

get_public_stripped_uri(self)

Returns a URI suitable for public feed and independant from the collection URI. It removes any trailing extension there may be.

get_public_uri(self)

Returns a URI suitable for public feed and independant from the collection URI

index(self)

Passes the member to the collection indexers

is_draft(self)

Returns True is the entry has a app:control element with an app:draft element which has a text value set to 'yes'. Returns False otherwise.

set_xslt(self, info)

Sets the XSLT to associate to the Atom entry. A processing instruction will be inserted when tge self.xml() method is called.

The ``path`` is a URI to the the XSLT resource.

update(self, source, exisiting_member)

Called to generate the new member entry from the atom entry provided in the source parameter as well as from the existing member in the store.

This must return the source again after being processed if need be within the method call. The content can be returned either as a byte string, unicode or a file object.

Keyword arguments: source -- resource string to handle exisiting_member -- member instance of an existing member resource

xml(self)

Returns the serialization as a string of the atom entry.

Property Details

media_uri

Returns the URI of the media link entry (MLE)
Get Method:
get_edit_media_uri(self)

member_uri

Returns the URI of the member resource
Get Method:
get_edit_uri(self)

public_uri

Returns a URI suitable for public feed and independant from the collection URI
Get Method:
get_public_uri(self)

public_uri_stripped

Returns a URI suitable for public feed and independant from the collection URI
Get Method:
get_public_uri(self)

Generated by Epydoc 2.1 on Thu Jul 19 15:32:17 2007 http://epydoc.sf.net