Table of Contents

Class: eXistDAsyn eXistDA/eXistDAsyn.py

An eXist syndicator object, containing many eXistDA objects.

Base Classes   
OFS.ObjectManager.ObjectManager
Persistent
Acquisition.Implicit
AccessControl.Role.RoleManager
App.Management.Navigation
Methods   
__init__
_findServerById
_findServerByURI
_getIteratedServers
getDoc
getEncoding
getFilesFromQuery
getId
getTitle
isOnline
listColl
listDAids
listDAs
manage_edit
query
xupdate
  __init__ 
__init__ (
        self,
        id,
        title,
        encoding=utils.DEFAULT_ENCODING,
        )

Initialization of the eXistDAsyn object.

  _findServerById 
_findServerById ( self,  id )

Find the corresponding DA in the syndicator by its id.

  • if a corresponding DA is found, returns the object. Else returns None

  • id : the string containing the id to test

  _findServerByURI 
_findServerByURI ( self,  URI )

Find the corresponding DA in the syndicator by its URI.

  • if a corresponding DA is found, returns the object. Else returns None

  • URI : the string containing the URI to test

  _getIteratedServers 
_getIteratedServers ( self,  my_items )

Returns a list containing all the servers we want to iterate over (may be empty).

  • my_items : None, string or list which represents all the server ids we want to iterate over

  getDoc 
getDoc (
        self,
        doc_name,
        xsl='',
        pretty_print=utils.DEFAULT_PP,
        **kws,
        )

Retrieve a document in one of our DBs.

  • Returns a string containing the (XSL transformed if suited) XML document.

  • doc_name : a string containing the server, the full path and name of an existing document in a DB

  • xsl : a string containing the full path and name of an existing XSL document in the DB (same as doc for the moment). If an empty string is passed, no XSLT is done

  • if pretty_print == 1, then the returned string is "pretty printed", ie indented. Else, the string is returned as it is saved in the DB

  getEncoding 
getEncoding ( self )

Returns the encoding of the object

  getFilesFromQuery 
getFilesFromQuery (
        self,
        query,
        **kws,
        )

Query all the DBs in the syndicator.

  • Returns a list of tuples like this (eXistDA object, filename) where filename matches the query

  • query : a string containing an XPATH query or an XQuery

  • **kws : see eXistDA for doc. Ignored for the moment, we'll see later how to do this.

  getId 
getId ( self )

Returns the id of the object

  getTitle 
getTitle ( self )

Returns the title of the object

  isOnline 
isOnline ( self,  servers=None )

Gets running servers.

  • Returns a list containing tuples (id of servers, 1 if online | 0 otherwise).

  listColl 
listColl (
        self,
        base_coll=utils.EXIST_ROOT_COLL,
        recursive=0,
        full_path=1,
        )

Lists collections in one DA (if server name is passed) or all DA applicable.

base_coll : URI of an eXist server (full or not)

recursive : integer, 1 will look into all subcollections, 0 only in the collection passed

full_path : integer, 1 will print full_path, 0 not

  listDAids 
listDAids ( self )

Returns a list of the ids of the DA contained in the syndicator.

  listDAs 
listDAs ( self )

Returns a list of DAs contained in the syndicator.

  manage_edit 
manage_edit (
        self,
        title="",
        encoding=utils.DEFAULT_ENCODING,
        REQUEST=None,
        )

Change values of parameters

  query 
query (
        self,
        query,
        xmled=1,
        **kws,
        )

Query all the DBs in the syndicator.

  • Returns an XML string which matches the query

  • query : a string containing an XPATH query or an XQuery

  • xmled : 1 to return a valid xml string (with <?xml... declaration), 0 to return the result as it comes from eXist

  • kws : other parameters

    • verbose : if set to 1, returns a list of lists [[DA1,[res1, nb_hist_1, query_time_1]], [DA2,[res2, nb_hits_2, query_time_2], ...]]

    • variables : dict containing variables to pass to the xquery

  xupdate 
xupdate (
        self,
        res_name,
        xupdate_doc,
        )

Issue a xupdate command to update a document or a whole collection in the database. If res_name is an eXist URI, only this database (if it's in the syndicator) will be "XUpdated". If no server name is given, the command is issued on all DA in the syndicator.

  • Returns the number of server where documents have been modified or raise an exception if pb

  • res_name : the name (with complete path) of a collection or a document

  • xupdate_doc : a string containing a xupdate file


Table of Contents

This document was automatically generated on Tue Jul 20 14:11:38 2004 by HappyDoc version 2.1