Kolab_Format Development TODO List
====================================
- - Find a decent way of handling tags within Horde 4
+ - Remove the automatic handling of Horde preferences within this
+ package. This is a task that belongs into the application NOT into
+ this package.
- Remove dependency on the Horde_Nls and Horde_String language
settings. I currently assume we should only return UTF-8 from this
library.
+ - Remove the charset conversion. It is perfectly fine to have a
+ package that expects all data in utf-8 format. Let the applications
+ handle the rest.
+
+ - Ultimately no required dependency should remain.
+
+ - Find a decent way of handling tags within Horde 4
+
- Probably: Pull the Format_Xml_* classes into Format_Mapper_Xml_*
classes.
- Add log decorators.
- - Remove the automatic handling of Horde preferences within this
- package. This is a task that belongs into the application NOT into
- this package.
-
- - Remove the charset conversion. It is perfectly fine to have a
- package that expects all data in utf-8 format. Let the applications
- handle the rest.
-
- Remove the use of the Horde_Date class from testing. It should be
no problem to get the same code coverage without using the external
class.
- - Ultimately only the dependency on Horde_Exception should remain.
-
- Think about storing the data in iCal format.
*
* @return mixed The newly created concrete Horde_Kolab_Format_XML instance
*
- * @throws Horde_Exception If the specified driver could not be loaded.
+ * @throws Horde_Kolab_Format_Exception If the specified driver could not be loaded.
*/
static public function &factory($format_type = '', $object_type = '',
$params = null)
$driver = call_user_func(array($class, 'factory'), $object_type,
$params);
} else {
- throw new Horde_Exception(sprintf(_("Failed to load Kolab Format driver %s"),
+ throw new Horde_Kolab_Format_Exception(sprintf(_("Failed to load Kolab Format driver %s"),
$format_type));
}
*
* @return array The data array representing the object.
*
- * @throws Horde_Exception
+ * @throws Horde_Kolab_Format_Exception
*/
abstract public function load(&$xmltext);
*
* @return string The data as XML string.
*
- * @throws Horde_Exception
+ * @throws Horde_Kolab_Format_Exception
*/
abstract public function save($object);
* @license http://www.fsf.org/copyleft/lgpl.html LGPL
* @link http://pear.horde.org/index.php?package=Kolab_Format
*/
-class Horde_Kolab_Format_Exception extends Horde_Exception
+class Horde_Kolab_Format_Exception extends Exception
{
}
\ No newline at end of file
*
* @return array Array with the object data
*
- * @throws Horde_Exception If parsing the XML data failed.
+ * @throws Horde_Kolab_Format_Exception If parsing the XML data failed.
*/
protected function _load(&$children)
{
*
* @return boolean True on success.
*
- * @throws Horde_Exception If converting the data to XML failed.
+ * @throws Horde_Kolab_Format_Exception If converting the data to XML failed.
*/
- protected function _save($root, $object)
+ protected function _save(&$root, $object)
{
$annotations = array();
foreach ($object as $key => $value) {
*
* @return array Array with the object data.
*
- * @throws Horde_Exception If parsing the XML data failed.
+ * @throws Horde_Kolab_Format_Exception If parsing the XML data failed.
*/
protected function _load(&$children)
{
*
* @return boolean True on success.
*
- * @throws Horde_Exception If converting the data to XML failed.
+ * @throws Horde_Kolab_Format_Exception If converting the data to XML failed.
*/
protected function _save(&$root, $object)
{
*
* @return array Array with data.
*
- * @throws Horde_Exception If parsing the XML data failed.
+ * @throws Horde_Kolab_Format_Exception If parsing the XML data failed.
*/
protected function _load(&$children)
{
*
* @return boolean True on success.
*
- * @throws Horde_Exception If converting the data to XML failed.
+ * @throws Horde_Kolab_Format_Exception If converting the data to XML failed.
*/
- protected function _save($root, $object)
+ protected function _save(&$root, $object)
{
// Map the display-name of a kolab dist list to horde's lastname attribute
if (isset($object['last-name'])) {
*
* @return array Array with the object data.
*
- * @throws Horde_Exception If parsing the XML data failed.
+ * @throws Horde_Kolab_Format_Exception If parsing the XML data failed.
*/
protected function _load(&$children)
{
*
* @return boolean True on success.
*
- * @throws Horde_Exception If converting the data to XML failed.
+ * @throws Horde_Kolab_Format_Exception If converting the data to XML failed.
*/
- protected function _save($root, $object)
+ protected function _save(&$root, $object)
{
// Translate start/end date including full day events
if (!empty($object['_is_all_day'])) {
*
* @return array The data array representing the object.
*
- * @throws Horde_Exception If parsing the XML data failed.
+ * @throws Horde_Kolab_Format_Exception If parsing the XML data failed.
*/
public function load(&$xmltext)
{
$object['application'] = $object['categories'];
unset($object['categories']);
} else {
- throw new Horde_Exception('Preferences XML object is missing an application setting.');
+ throw new Horde_Kolab_Format_Exception('Preferences XML object is missing an application setting.');
}
}
*
* @return string The data as XML string.
*
- * @throws Horde_Exception If converting the data to XML failed.
+ * @throws Horde_Kolab_Format_Exception If converting the data to XML failed.
*/
public function save($object)
{
$object['application'] = $object['categories'];
unset($object['categories']);
} else {
- throw new Horde_Exception('Preferences XML object is missing an application setting.');
+ throw new Horde_Kolab_Format_Exception('Preferences XML object is missing an application setting.');
}
}
*
* @return array Array with the object data
*
- * @throws Horde_Exception If parsing the XML data failed.
+ * @throws Horde_Kolab_Format_Exception If parsing the XML data failed.
*/
protected function _load(&$children)
{
*
* @return boolean True on success.
*
- * @throws Horde_Exception If converting the data to XML failed.
+ * @throws Horde_Kolab_Format_Exception If converting the data to XML failed.
*/
- protected function _save($root, $object)
+ protected function _save(&$root, $object)
{
$object['summary'] = $object['desc'];
unset($object['desc']);
*
* @return array Array with data.
*
- * @throws Horde_Exception If parsing the XML data failed.
+ * @throws Horde_Kolab_Format_Exception If parsing the XML data failed.
*/
protected function _load(&$children)
{
*
* @return boolean True on success.
*
- * @throws Horde_Exception If converting the data to XML failed.
+ * @throws Horde_Kolab_Format_Exception If converting the data to XML failed.
*/
- protected function _save($root, $object)
+ protected function _save(&$root, $object)
{
$object['summary'] = $object['name'];
unset($object['name']);
<min>1.4.0b1</min>
</pearinstaller>
<package>
- <name>Exception</name>
- <channel>pear.horde.org</channel>
- </package>
- <package>
<name>Nls</name>
<channel>pear.horde.org</channel>
</package>
$xml->load($recur);
$this->assertTrue(false);
} catch (Exception $e) {
- $this->assertTrue($e instanceOf Horde_Exception);
+ $this->assertTrue($e instanceOf Horde_Kolab_Format_Exception);
}
}
array('value' => Horde_Kolab_Format_Xml::VALUE_NOT_EMPTY));
$this->assertTrue(false);
} catch (Exception $e) {
- $this->assertTrue($e instanceOf Horde_Exception);
+ $this->assertTrue($e instanceOf Horde_Kolab_Format_Exception);
}
$xml->_updateNode($root,
'save' => '_unknown'));
$this->assertTrue(false);
} catch (Exception $e) {
- $this->assertTrue($e instanceOf Horde_Exception);
+ $this->assertTrue($e instanceOf Horde_Kolab_Format_Exception);
}
}
'type' => Horde_Kolab_Format_Xml::TYPE_STRING));
$this->assertTrue(false);
} catch (Exception $e) {
- $this->assertTrue($e instanceOf Horde_Exception);
+ $this->assertTrue($e instanceOf Horde_Kolab_Format_Exception);
}
// Test loading a missing value with a default