Package amplee :: Package atompub :: Module store :: Class AtomPubStore
[show private | hide private]
[frames | no frames]

Type AtomPubStore

object --+
         |
        AtomPubStore


Method Summary
  __init__(self, storage, media_storage, enable_lock)
Store acting has a container of APP entities.
  add_content(self, info, obj, **kwargs)
Adds content to the content storage.
  add_meta_data(self, info, obj, **kwargs)
Adds meta-data to the meta-data storage.
  commit(self, message)
Persists modification to the store into the storages.
  exists(self, info, as_media)
Returns ``True`` if the resource ``info`` does exist.
  fetch_content(self, info)
Returns the content object at ``info``.
  fetch_meta_data(self, info)
Returns the meta-data object at ``info``.
  get_content_info(self, *args)
Returns the info of resource used by the content storage.
  get_meta_data_info(self, *args)
Returns the info of resource used by the meta-data storage.
  list_members(self, info, ext)
Returns a dictionary of the form ``{resource-name: StorageResourceInfo}`` filtered by the given parameters.
  remove_content(self, info)
Removes the resource at ``info`` from the content storage.
  remove_meta_data(self, info)
Removes the resource at ``info`` from the meta-data storage.
    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)

Method Details

__init__(self, storage, media_storage=None, enable_lock=True)
(Constructor)

Store acting has a container of APP entities.

Operations on the store are only commited to the storage automatically when the ``autocommit`` parameter is ``True``. This is however not advised for performance issue.

In any case operations put each resource in distinct internal lists which are processed when ``commit()`` is called.

The ``storage`` is a ``mplee.storage.*`` instance to persist member resources.

The ``media_storage`` is a ``amplee.storage.*`` instance to persist media resources. If not provided ``storage`` will be used.

If ``enable_lock`` is ``True``, a thread lock will be used when performing operations against the store. This is enabled by default.
Overrides:
__builtin__.object.__init__

add_content(self, info, obj, **kwargs)

Adds content to the content storage. If ``self.autocommit`` is ``True`` the content is immediatly persisted.

The ``info`` is a value returned by ``get_content_info()`` The ``obj`` is whatever Python object that should be persisted ``**kwargs`` is any additional parameters to provide to the storage

add_meta_data(self, info, obj, **kwargs)

Adds meta-data to the meta-data storage. If ``self.autocommit`` is ``True`` the content is immediatly persisted.

The ``info`` is a value returned by ``get_meta_data_info()`` The ``obj`` is whatever Python object that should be persisted ``**kwargs`` is any additional parameters to provide to the storage

commit(self, message=None)

Persists modification to the store into the storages.

A ``message``, if the storage accepts it (like subversion), to pass to the storage.

exists(self, info, as_media=False)

Returns ``True`` if the resource ``info`` does exist.

Keyword arguments: The ``info`` is a value returned by ``get_meta_data_info()`` or ``get_content_info()``

If ``as_media`` is ``False`` the method checks in the member storage otherwise it checks in the media storage. When both are the same it does not matter but if both are different you should set this value accordingly.

fetch_content(self, info)

Returns the content object at ``info``.

The ``info`` is a value returned by ``get_content_info()``

fetch_meta_data(self, info)

Returns the meta-data object at ``info``.

The ``info`` is a value returned by ``get_meta_data_info()``

get_content_info(self, *args)

Returns the info of resource used by the content storage.

The returned value should only be seen as read-only.

Arguments depend on the underlying storage.

get_meta_data_info(self, *args)

Returns the info of resource used by the meta-data storage.

The returned value should only be seen as read-only.

Arguments depend on the underlying storage.

list_members(self, info, ext=None)

Returns a dictionary of the form ``{resource-name: StorageResourceInfo}`` filtered by the given parameters.

The ``info`` is the base info where to perform the lookup

The ``ext`` allows to filter by extension of the resource

remove_content(self, info)

Removes the resource at ``info`` from the content storage. If ``self.autocommit`` is ``True`` the content object is immediatly persisted.

The ``info`` is a value returned by ``get_meta_data_info()``

remove_meta_data(self, info)

Removes the resource at ``info`` from the meta-data storage. If ``self.autocommit`` is ``True`` the meta-data object is immediatly persisted.

The ``info`` is a value returned by ``get_meta_data_info()``

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