Tour API Demos Download Tests
Aperture version 1.0
Generated by: JsDoc Toolkit 2.4.0

Namespace aperture.store

Functions used to store, get, and delete documents in a content store.

Namespace Summary
Constructor Attributes Constructor Name and Description
 

Method Summary

Namespace Detail

aperture.store
Requires:
an Aperture CMS service
jQuery

Method Detail

  • <static> aperture.store.get(descriptor, callback)
    Gets a document from the server given a descriptor.
    Parameters:
    {Object} descriptor
    an object describing the document to get
    {String} descriptor.store Optional
    the name of the content store to use. If not provided the default will be used.
    {String} descriptor.id
    the id of the document to get
    {String} descriptor.rev Optional
    the revision of the document to get. If not provided, the most recent revision will be retrieved.
    {Function(data|descriptor)} callback Optional
    a callback to be called when the document data is available. The callback will be provided with the data and a hash of the document descriptor.
  • <static> aperture.store.remove(descriptor, callback, fetch)
    Removes a document from the server given a descriptor, optionally returning it if a callback is supplied.
    Parameters:
    {Object} descriptor
    an object describing the document to get
    {String} descriptor.store Optional
    the name of the content store to use. If not provided the default will be used.
    {String} descriptor.id
    the id of the document to get
    {String} descriptor.rev Optional
    the revision of the document to get. If not provided, the most recent revision will be retrieved.
    {Function(data|descriptor)} callback Optional
    a callback to be called when the document data is available. The callback will be provided with the data and a hash of the document descriptor.
    {boolean=false} fetch
    optionally return the removed document.
  • <static> aperture.store.store(data, descriptor, callback)
    Store a data item in the CMS.
    Parameters:
    {String|Object} data
    the data item to store. Can be a string or a javascript object. If a string it will be stored as is. If an object, it will be converted to JSON and stored.
    {Object} descriptor Optional
    an optional descriptor object that specifies the cms store, document id, and document revision.
    {String} descriptor.store Optional
    the name of the content store in which to store the document. If not provided, the default will be used.
    {String} descriptor.id Optional
    the id of the document to store. If this is a new document this will try and use this id for the document when storing. If this is an existing document being updated this id specifies the id of the document to update.
    {String} descriptor.rev Optional
    the revision of the document to store. If updating a document this must be set to the current revision to be allowed to perform the update. This prevents updating a document with out of date information.
    {Function(descriptor)} callback Optional
    a function to be called after the store command completes on the server. The callback will be given a descriptor object in the same format as the descriptor to the store function on success. The descriptor describes the successfully stored document.
  • <static> aperture.store.url(descriptor, action, downloadAs)
    Gets the url of a document in the store given a descriptor.
    Parameters:
    {Object} descriptor
    an object describing the document to get
    {String} descriptor.store Optional
    the name of the content store to use. If not provided the default will be used.
    {String} descriptor.id
    the id of the document to get
    {String} descriptor.rev Optional
    the revision of the document to get. If not provided, the most recent revision will be retrieved.
    {String='get'|'remove'|'pop'} action Optional, Default: 'get'
    the action to perform, which defaults to get
    {String} downloadAs Optional
    the local filename of the document if is to be downloaded rather than opened by the browser. Do not specify this argument if the document should be subject to normal browser MIME type viewing.