Documentation

Mnemo_Driver_Kolab extends Mnemo_Driver
in package

Horde Mnemo driver for the Kolab_Storage backend.

Copyright 2004-2017 Horde LLC (http://www.horde.org/)

See the enclosed file LICENSE for license information (ASL). If you did not receive this file, see http://www.horde.org/licenses/apache.

Tags
author

Gunnar Wrobel wrobel@pardus.de

author

Thomas Jarosch thomas.jarosch@intra2net.com

author

Stuart Binge omicron@mighty.co.za

since

Mnemo 2.0

Table of Contents

$_memos  : array<string|int, mixed>
Array holding the current memo list. Each array entry is a hash describing a memo. The array is indexed numerically by memo ID.
$_notepad  : string
String containing the current notepad name.
$_pgp  : Horde_Crypt_pgp
Crypting processor.
$_data  : Horde_Kolab_Storage_Data
The current notepad.
$_kolab  : Horde_Kolab_Storage
The Kolab_Storage backend.
__construct()  : mixed
Construct a new Kolab storage object.
add()  : string
Adds a note to the backend storage.
delete()  : mixed
Deletes a note permanently.
deleteAll()  : mixed
Deletes all notes from the current notepad.
encryptionSupported()  : bool
Returns whether note encryption is supported.
fromiCalendar()  : array<string|int, mixed>
Create a memo (hash array) from a Horde_Icalendar_Vnote object.
get()  : array<string|int, mixed>
Retrieves one note from the backend.
getByUID()  : array<string|int, mixed>
Retrieves one note from the backend by UID.
getMemoDescription()  : mixed
Update the description (short summary) of a memo.
listMemos()  : array<string|int, mixed>
Lists memos based on the given criteria. All memos will be returned by default.
modify()  : mixed
Modifies an existing note.
move()  : mixed
Moves a note to a new notepad.
retrieve()  : mixed
Retrieves all of the notes of the current notepad from the backend.
synchronize()  : mixed
Synchronize with the Kolab backend.
toASNote()  : Horde_ActiveSync_Message_Note
Create an AS memo from this task
toiCalendar()  : Horde_Icalendar_Vnote
Export this memo in iCalendar format.
_add()  : string
Adds a note to the backend storage.
_buildNote()  : array<string|int, mixed>
Build a note based on data array
_buildObject()  : object
Converts a note hash to a Kolab hash.
_decrypt()  : string
Decrypts a note.
_decryptBody()  : bool
Tries to decrypt the note body.
_delete()  : string
Deletes a note permanently.
_deleteAll()  : array<string|int, mixed>
Deletes all notes from the current notepad.
_encrypt()  : string
Encrypts a note.
_generateId()  : string
Generates a local note ID.
_getData()  : Horde_Kolab_Storage_Data
Return the Kolab data handler for the current notepad.
_getDataForNotepad()  : Horde_Kolab_Storage_Data
Return the Kolab data handler for the specified notepad.
_loadPGP()  : mixed
Loads the PGP encryption driver.
_modify()  : string
Modifies an existing note.
_move()  : string
Moves a note to a new notepad.

Properties

$_memos

Array holding the current memo list. Each array entry is a hash describing a memo. The array is indexed numerically by memo ID.

protected array<string|int, mixed> $_memos = array()

$_notepad

String containing the current notepad name.

protected string $_notepad = ''

$_pgp

Crypting processor.

protected Horde_Crypt_pgp $_pgp

$_data

The current notepad.

private Horde_Kolab_Storage_Data $_data

$_kolab

The Kolab_Storage backend.

private Horde_Kolab_Storage $_kolab

Methods

__construct()

Construct a new Kolab storage object.

public __construct(string $notepad[, array<string|int, mixed> $params = array() ]) : mixed
Parameters
$notepad : string

The name of the notepad to load/save notes from.

$params : array<string|int, mixed> = array()

The connection parameters

Tags
throws
InvalidArguementException
Return values
mixed

add()

Adds a note to the backend storage.

public add(string $desc, string $body[, array<string|int, mixed>|string $tags = '' ][, string $passphrase = null ][, string $uid = null ]) : string
Parameters
$desc : string

The first line of the note.

$body : string

The whole note body.

$tags : array<string|int, mixed>|string = ''

The tags of the note.

$passphrase : string = null

The passphrase to encrypt the note with.

$uid : string = null

The note's UID.

Tags
throws
Mnemo_Exception
Return values
string

The ID of the new note.

delete()

Deletes a note permanently.

public delete(string $noteId) : mixed
Parameters
$noteId : string

The note to delete.

Tags
throws
Mnemo_Exception
Return values
mixed

deleteAll()

Deletes all notes from the current notepad.

public deleteAll() : mixed
Tags
throws
Mnemo_Exception
Return values
mixed

encryptionSupported()

Returns whether note encryption is supported.

public encryptionSupported() : bool

Checks if PGP support could be loaded, if it supports symmetric encryption, and if we have a secure connection.

Return values
bool

Whether encryption is suppoted.

fromiCalendar()

Create a memo (hash array) from a Horde_Icalendar_Vnote object.

public fromiCalendar(Horde_Icalendar_Vnote $vNote) : array<string|int, mixed>
Parameters
$vNote : Horde_Icalendar_Vnote
Return values
array<string|int, mixed>

Memo (hash array) created from the vNote.

get()

Retrieves one note from the backend.

public get(string $noteId[, string $passphrase = null ]) : array<string|int, mixed>
Parameters
$noteId : string

The ID of the note to retrieve.

$passphrase : string = null

A passphrase with which this note was supposed to be encrypted.

Tags
throws
Mnemo_Exception
throws
Horde_Exception_NotFound
Return values
array<string|int, mixed>

The array of note attributes.

getByUID()

Retrieves one note from the backend by UID.

public getByUID(string $uid[, string $passphrase = null ]) : array<string|int, mixed>
Parameters
$uid : string

The UID of the note to retrieve.

$passphrase : string = null

A passphrase with which this note was supposed to be encrypted.

Tags
throws
Mnemo_Exception
throws
Horde_Exception_NotFound
Return values
array<string|int, mixed>

The array of note attributes.

getMemoDescription()

Update the description (short summary) of a memo.

public getMemoDescription(mixed $body) : mixed
Parameters
$body : mixed
Return values
mixed

listMemos()

Lists memos based on the given criteria. All memos will be returned by default.

public listMemos() : array<string|int, mixed>
Return values
array<string|int, mixed>

Returns a list of the requested memos.

modify()

Modifies an existing note.

public modify(string $noteId, string $desc, string $body[, string $tags = '' ][, string $passphrase = null ]) : mixed
Parameters
$noteId : string

The note to modify.

$desc : string

The first line of the note.

$body : string

The whole note body.

$tags : string = ''

The tags of the note.

$passphrase : string = null

The passphrase to encrypt the note with.

Tags
throws
Mnemo_Exception
Return values
mixed

move()

Moves a note to a new notepad.

public move(string $noteId, string $newNotepad) : mixed
Parameters
$noteId : string

The note to move.

$newNotepad : string

The new notepad.

Tags
throws
Mnemo_Exception
Return values
mixed

retrieve()

Retrieves all of the notes of the current notepad from the backend.

public retrieve([bool $raw = false ]) : mixed
Parameters
$raw : bool = false

Return the raw bodies, don't try to decrypt.

Tags
throws
Mnemo_Exception
Return values
mixed

synchronize()

Synchronize with the Kolab backend.

public synchronize([mixed $token = false ]) : mixed
Parameters
$token : mixed = false

A value indicating the last synchronization point, if available.

Return values
mixed

toASNote()

Create an AS memo from this task

public toASNote(array<string|int, mixed> $memo[, array<string|int, mixed> $options = array() ]) : Horde_ActiveSync_Message_Note
Parameters
$memo : array<string|int, mixed>

A memo array.

$options : array<string|int, mixed> = array()
Return values
Horde_ActiveSync_Message_Note

toiCalendar()

Export this memo in iCalendar format.

public toiCalendar(mixed $memo, mixed $calendar) : Horde_Icalendar_Vnote
Parameters
$memo : mixed
$calendar : mixed
Return values
Horde_Icalendar_Vnote

object for this event.

_add()

Adds a note to the backend storage.

protected _add(string $noteId, string $desc, string $body, array<string|int, mixed>|string $tags, string $uid) : string
Parameters
$noteId : string

The ID of the new note.

$desc : string

The first line of the note.

$body : string

The whole note body.

$tags : array<string|int, mixed>|string

The tags of the note.

$uid : string

The note's UID.

Tags
throws
Mnemo_Exception
Return values
string

The unique ID of the new note.

_buildNote()

Build a note based on data array

protected _buildNote(array<string|int, mixed> $note[, string $passphrase = null ][, bool $raw = false ]) : array<string|int, mixed>
Parameters
$note : array<string|int, mixed>

The data for the note

$passphrase : string = null

A passphrase for decrypting a note

$raw : bool = false

Return the raw body, don't try to decrypt.

Return values
array<string|int, mixed>

The converted data array representing the note

_buildObject()

Converts a note hash to a Kolab hash.

protected _buildObject(string $noteId, string $desc, string $body, array<string|int, mixed>|string $tags, string $uid) : object
Parameters
$noteId : string

The note to modify.

$desc : string

The first line of the note.

$body : string

The whole note body.

$tags : array<string|int, mixed>|string

The tags of the note.

$uid : string

The note's UID.

Return values
object

The Kolab hash.

_decrypt()

Decrypts a note.

protected _decrypt(string $note, string $passphrase) : string
Parameters
$note : string

The encrypted note text.

$passphrase : string

The passphrase to decrypt the note with.

Tags
throws
Mnemo_Exception
Return values
string

The decrypted text.

_decryptBody()

Tries to decrypt the note body.

protected _decryptBody(string &$body, string $id, string $passphrase) : bool
Parameters
$body : string

The note body. Will be decrypted if possible, or set to an exception if decryption failed.

$id : string

The note ID.

$passphrase : string

An optional encryption password.

Return values
bool

Whether this was an encrypted note.

_delete()

Deletes a note permanently.

protected _delete(mixed $noteId) : string
Parameters
$noteId : mixed
Tags
throws
Mnemo_Exception
Return values
string

The note's UID.

_deleteAll()

Deletes all notes from the current notepad.

protected _deleteAll() : array<string|int, mixed>
Tags
throws
Mnemo_Exception
Return values
array<string|int, mixed>

An array of uids that have been removed.

_encrypt()

Encrypts a note.

protected _encrypt(string $note, string $passphrase) : string
Parameters
$note : string

The note text.

$passphrase : string

The passphrase to encrypt the note with.

Return values
string

The encrypted text.

_generateId()

Generates a local note ID.

protected _generateId() : string
Return values
string

A new note ID.

_getData()

Return the Kolab data handler for the current notepad.

protected _getData([bool $force = false ]) : Horde_Kolab_Storage_Data
Parameters
$force : bool = false

Force returning a new handler.

Return values
Horde_Kolab_Storage_Data

The data handler.

_getDataForNotepad()

Return the Kolab data handler for the specified notepad.

protected _getDataForNotepad(string $notepad) : Horde_Kolab_Storage_Data
Parameters
$notepad : string

The notepad name.

Return values
Horde_Kolab_Storage_Data

The data handler.

_loadPGP()

Loads the PGP encryption driver.

protected _loadPGP() : mixed
Tags
TODO:

Inject into driver from the factory binder

Return values
mixed

_modify()

Modifies an existing note.

protected _modify(string $noteId, string $desc, string $body, string $tags) : string
Parameters
$noteId : string

The note to modify.

$desc : string

The first line of the note.

$body : string

The whole note body.

$tags : string

The tags of the note.

Tags
throws
Mnemo_Exception
Return values
string

The note's UID.

_move()

Moves a note to a new notepad.

protected _move(string $noteId, string $newNotepad) : string
Parameters
$noteId : string

The note to move.

$newNotepad : string

The new notepad.

Tags
throws
Mnemo_Exception
Return values
string

The note's UID.

Search results