| applications_cms

# Class: Bs_XStorage Source Location: /applications/cms/Bs_XStorage.class.php
### Class Overview
    Bs_Object
       |
       --Bs_XStorage
XStorage class #### Author(s): andrej arn <at blueshoes dot org>, Sam Blum <sam at blueshoes dot org> #### Version: 4.3.$Revision: 1.2 $ $Date: 2003/08/09 15:22:34 $ #### Copyright: blueshoes.org | ### Variables $_xPath | ### Methods Bs_XStorage deleteNode getCandidateUIDs loadXAtom moveNode persist _exclusiveWrite _initXPath _loadBlock _loadBlockTableLayoutCell _loadBlockTableLayoutRow _loadFromCache _loadGuard _loadLayout _loadNode _loadPage _loadToCache
### Inherited Variables | ### Inherited Methods #### Class: Bs_Object Bs_Object::Bs_Object() Bs_Object::getErrors() Basic error handling: Get *all* errors as string array from the global Bs_Error-error stack. Bs_Object::getLastError() Basic error handling: Get last error string from the global Bs_Error-error stack. Bs_Object::getLastErrors() Basic error handling: Get last errors string array from the global Bs_Error-error stack sinc last call of getLastErrors(). Bs_Object::persist() Persists this object by serializing it and saving it to a file with unique name. Bs_Object::setError() Basic error handling: Push an error string on the global Bs_Error-error stack. Bs_Object::toHtml() Dumps the content of this object to a string using PHP's var_dump(). Bs_Object::toString() Dumps the content of this object to a string using PHP's var_dump(). Bs_Object::unpersist() Fetches an object that was persisted with persist()
### Class Details [line 28] XStorage class dependencies: XPath #### Tags:
copyright: | blueshoes.org
pattern: | singleton: (pseudostatic)
access: | public
version: | 4.3.$Revision: 1.2 $ $Date: 2003/08/09 15:22:34 $
author: | andrej arn <at blueshoes dot org>, Sam Blum <sam at blueshoes dot org>
[ Top ] ### Class Variables #### $_xPath = NULL [line 33] reference to XPath object (static)
Type: | object
[ Top ] ### Class Methods ### constructor Bs_XStorage [line 38]
`Bs_XStorage Bs_XStorage( )`
Constructor. [ Top ] ### method deleteNode [line 1018]
`void deleteNode( )`
[ Top ] ### method getCandidateUIDs [line 794]
`array getCandidateUIDs( object &$parentNode, string $source, array $xAtomProfile)`
Get the list of candidates as array of UID's SOME INFO: To make this function as flexible as possible a whole set of attributes can be passed with the $xAtomProfile. If $source == 'db' I'm sure we're able to narrow the possible candidates to a minimum. If $source == 'file' we're only able to use a small number of the profile attributes (corename, lang, version, mime, fileExt). This will result in a larger list of UID's that must be further analyzed by the calling routine. Profile Strukture $xAtomProfile = array { 'element' => NULL, // <- the element we are looking for. E.g. 'page', 'layout', 'block', ... 'mime' => '' // <- if element == 'block' this will describe what type of block it is e.g. text, image, ... 'lang' => 'xx', // <- the ISO language code ('' OR 'xx' == any lang, en == all en-pages: en-uk, en-us, ...) 'coreName' => '.*', // <- core name (and path) of the element. (No version, no extention, no nothing.) 'version' => 'x.x.x', // <- a nomalized version-mask string 'fileExt' => '', // <- XML source file use this extention. Only unsed when source is a file (not a Db) 'alive' => array( // <- the alive info. If empty we assume active/alive 'isDeactivated' => FALSE, // <- if TRUE we are never alive 'startDatetime' => '0000-00-00 00:00:00', // <- the start datetime in gmt. 'endDatetime' => '0000-00-00 00:00:00' // <- the end datetime in gmt. ), 'browscap' => array( // <- the browscap info. If empty we assume no restrictions are mad 'browser' => "", // <- cvs-list of accepted browsers E.g. "ie4+;ns4+" 'feature' => "", // <- cvs-list of needed features E.g. "javaScript" 'plugin' => "" // <- cvs-list of needed plugins E.g. "flash;pdf" ), ); SAMPLE: If profile contais coreName='main', version ='1.x.x' and the parent node is pointing to '/p/' Then return would be an array of UID's E.g.: array('/p/main.1.1.1','/p/main.1.2.1') #### Tags:
return: | of UID's (see above)
throws: | FALSE on error and the $parentNode will contain details of error.
#### Parameters:
object | &$parentNode | The parent Node
string | $source | 'db' or 'file'
array | $xAtomProfile | (see above)
[ Top ] ### method loadXAtom [line 55]
`void loadXAtom( mixed &$xAtomObj)`
[ Top ] ### method moveNode [line 1015]
`void moveNode( )`
[ Top ] ### method persist [line 954]
`bool persist( object &$xAtomObj)`
Persist the xAtom-element. #### Tags:
return: | TRUE on success, FALSE otherwise.
Overrides Bs_Object::persist() (Persists this object by serializing it and saving it to a file with unique name.) #### Parameters:
object | $xAtomObj | the element to persist
[ Top ] ### method _exclusiveWrite [line 898]
`void _exclusiveWrite( string $pathFile, string $out)`
didn't i move this to the bs_file class?? please have a look. --andrej Exclusive file write. Try to get hold of a file exclusively and overwrite it with the passed data. #### Parameters:
string | $pathFile | A file including path
string | $out | data to write to file.
[ Top ] ### method _initXPath [line 1110]
`bool _initXPath( object &$xAtomObj)`
If we are working with file based Nodes, Pages, Layouts, Blocks, ... we have to use xPath object to parse those objects So we use this function to do that job. NOTE: In case of failure we set the $object->_failedReason. #### Tags:
return: | TRUE on success and FALSE otherwise
#### Parameters:
object | &$xAtomObj | any object
[ Top ] ### method _loadBlock [line 459]
`TRUE _loadBlock( object &$xAtomObj)`
XPath load of specialized data of element Block. NOTE: Errorhandling is as follows: We set the _failedReason of the passed object and return FALSE. Then let the caller handle the error. #### Tags:
return: | if OK, FALSE otherwise.
see: | Bs_XStorage::loadXAtom()
#### Parameters:
object | &$xAtomObj | of element type Block
[ Top ] ### method _loadBlockTableLayoutCell [line 728]
`mixed _loadBlockTableLayoutCell( string $baseKey, [string $cellType = 'CELL'])`
helper function to load the blocks #### Tags:
return: | (string or vector)
#### Parameters:
string | $baseKey |
string | $cellType | (one of 'CELL' (default), 'FIRSTCELL', 'LASTCELL')
[ Top ] ### method _loadBlockTableLayoutRow [line 675]
`array _loadBlockTableLayoutRow( string $baseKey, [string $rowType = 'ROW'])`
#### Tags:
return: | (hash or vector holding hashes)
#### Parameters:
string | $baseKey |
string | $rowType | (one of 'ROW' (default), 'FIRSTROW' or 'LASTROW')
[ Top ] ### method _loadFromCache [line 1046]
`bool _loadFromCache( object &$xAtomObj)`
Load parsed XML data *from* a file cache. #### Tags:
return: | TRUE if found, otherwise FALSE
#### Parameters:
object | &$xAtomObj |
[ Top ] ### method _loadGuard [line 254]
`TRUE _loadGuard( object &$xAtomObj)`
XPath load of specialized data of element Guard. NOTE: Errorhandling is as follows: We set the _failedReason of the passed object and return FALSE. Then let the caller handle the error. #### Tags:
return: | if OK, FALSE otherwise.
see: | Bs_XStorage::loadXAtom()
#### Parameters:
object | &$xAtomObj | of element type Guard
[ Top ] ### method _loadLayout [line 389]
`TRUE _loadLayout( object &$xAtomObj)`
XPath load of specialized data of element Layout. NOTE: Errorhandling is as follows: We set the _failedReason of the passed object and return FALSE. Then let the caller handle the error. #### Tags:
return: | if OK, FALSE otherwise.
see: | Bs_XStorage::loadXAtom()
#### Parameters:
object | &$xAtomObj | of element type Layout
[ Top ] ### method _loadNode [line 185]
`TRUE _loadNode( object &$xAtomObj)`
XPath load of specialized data of element Node. NOTE: Errorhandling is as follows: We set the _failedReason of the passed object and return FALSE. Then let the caller handle the error. #### Tags:
return: | if OK, FALSE otherwise.
see: | Bs_XStorage::loadXAtom()
#### Parameters:
object | &$xAtomObj | of element type Node
[ Top ] ### method _loadPage [line 281]
`TRUE _loadPage( object &$xAtomObj)`
XPath load of specialized data of element Page. NOTE: Errorhandling is as follows: We set the _failedReason of the passed object and return FALSE. Then let the caller handle the error. #### Tags:
return: | if OK, FALSE otherwise.
see: | Bs_XStorage::loadXAtom()
#### Parameters:
object | &$xAtomObj | of element type Page
[ Top ] ### method _loadToCache [line 1080]
`bool _loadToCache( object &$xAtomObj)`
Load parsed XML data *to* a file cache. #### Tags:
return: | TRUE if found, otherwise FALSE
#### Parameters:
object | &$xAtomObj |
[ Top ] Documentation generated on Mon, 29 Dec 2003 21:13:32 +0100 by phpDocumentor 1.2.3