\Horde_SyncMl_Device_sync4j

Sync4j (www.sync4j.org)

The Sync4J outlook converter uses its native SIF format for data exchange. Conversion to text/vcalendar etc. is done by SifConverter.php The connector seems not support DevInf information, so Horde_SyncMl_Device can only detect it by the decice ID: so in the connector configuration the device ID must be set to 'sc-pim-' which should be the default anyhow.

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

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

Summary

Methods
Properties
Constants
factory()
getPreferredContentType()
getPreferredContentTypeClient()
convertClient2Server()
convertServer2Client()
handleTasksInCalendar()
omitIndividualSyncStatus()
useCdataTag()
useLocalTime()
sif2array()
array2sif()
sif2vnote()
sif2vcard()
sif2vevent()
sif2vtodo()
vnote2sif()
vcard2sif()
vevent2sif()
vtodo2sif()
$requestedContentType
No constants found
_convertUTC2LocalTime()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$requestedContentType

$requestedContentType : string

The original preferred content type of the client, if provided through DevInf.

Type

string

Methods

factory()

factory(string  $driver) : \Horde_SyncMl_Device

Attempts to return a concrete Horde_SyncMl_Device instance based on $driver.

Parameters

string $driver

The type of concrete Horde_SyncMl_Device subclass to return.

Returns

\Horde_SyncMl_Device

The newly created concrete Horde_SyncMl_Device instance, or false on error.

getPreferredContentType()

getPreferredContentType(string  $database) : string

Returns the guessed content type for a database URI.

When a client sends data during a sync but does not provide information about the MIME content type with this individual item, this function returns the content type the item is supposed to be in.

Parameters

string $database

A database URI.

Returns

string —

A MIME type that might match the database URI.

getPreferredContentTypeClient()

getPreferredContentTypeClient(string  $serverSyncURI, string  $sourceSyncURI) 

Returns the preferrred MIME content type of the client for the given sync data type (contacts/tasks/notes/calendar).

The result is passed as an option to the backend export functions. This is not the content type ultimately passed to the client but rather the content type presented to the backend export functions.

After the data is retrieved from the backend, convertServer2Client() can do some post-processing and set the correct content type acceptable for the client if necessary.

The default implementation tries to extract the content type from the device info. If this does not work, some defaults are used.

If the client does not provice proper DevInf data, this public function may have to be overwritten to return the correct values.

Parameters

string $serverSyncURI

The URI for the server database: contacts, notes, calendar or tasks.

string $sourceSyncURI

The URI for the client database. This is needed as the DevInf is grouped by sourceSyncURIs.

convertClient2Server()

convertClient2Server(string  $content, string  $contentType) : array

Convert the content.

Currently strips UID (primary key) information as client and server might use different ones.

Charset conversions might be added here too.

Parameters

string $content

The content to convert.

string $contentType

The content type of the content.

Returns

array —

Two-element array with the converted content and the (possibly changed) new content type.

convertServer2Client()

convertServer2Client(string  $content, string  $contentType, string  $database) : array

Converts the content from the backend to a format suitable for the client device.

Strips the uid (primary key) information as client and server might use different ones.

Parameters

string $content

The content to convert

string $contentType

The content type of content as returned from the backend

string $database

The server database URI.

Returns

array —

Three-element array with the converted content, the (possibly changed) new content type, and encoding type (like b64 as used by Funambol).

handleTasksInCalendar()

handleTasksInCalendar() : boolean

Returns whether the device handles tasks and events in a single "calendar" sync.

This requires special actions on our side as we store this in different backend databases.

Returns

boolean —

True if tasks and events are processed in a single request.

omitIndividualSyncStatus()

omitIndividualSyncStatus() : boolean

Returns whether to send individual status response for each Add, Delete and Replace.

Returns

boolean —

False if individual status responses should be send.

useCdataTag()

useCdataTag() : boolean

Sync4j as of Funambol Outlook connector 3.0.15 can't deal with <![CDATA[ so omit it.

The Funambol Sync4j client chokes on the cdata so for this device it has to be set to false. Syn4j uses base64 encoding and so the problems with escaping does not occur.

Returns

boolean —

True if the data should be enclosed in [CDATA[.

useLocalTime()

useLocalTime() : boolean

Returns whether the device accepts datetimes only in local time format (DTSTART:20061222T130000) instead of the more robust UTC time (DTSTART:20061222T110000Z).

Returns

boolean —

True if the client doesn't accept UTC datetimes.

sif2array()

sif2array(string  $sif) : array

Decodes a sif xml string to an associative array.

Quick hack to convert from text/vcard and text/vcalendar to Sync4J's proprietery sif datatypes and vice versa. For details about the sif format see the appendix of the developer guide on www.sync4j.org.

Parameters

string $sif

A sif string like v1>v2

Returns

array —

Assoc array in utf8 like array ('k1' => 'v1>', 'k2' => 'v2');

array2sif()

array2sif(array  $array, string  $pre = '', string  $post = '') : string

Converts a hash to a SIF XML structure.

Parameters

array $array

A hash.

string $pre

A prefix string for the XML result.

string $post

A suffix string for the XML result.

Returns

string —

The resulting XML string.

sif2vnote()

sif2vnote(  $sif) 

Parameters

$sif

sif2vcard()

sif2vcard(  $sif) 

Parameters

$sif

sif2vevent()

sif2vevent(  $sif) 

Parameters

$sif

sif2vtodo()

sif2vtodo(  $sif) 

Parameters

$sif

vnote2sif()

vnote2sif(  $vnote) 

Parameters

$vnote

vcard2sif()

vcard2sif(  $vcard) 

Parameters

$vcard

vevent2sif()

vevent2sif(  $vcard) 

Parameters

$vcard

vtodo2sif()

vtodo2sif(  $vcard) 

Parameters

$vcard

_convertUTC2LocalTime()

_convertUTC2LocalTime(array  $utc) : string

Converts an UTC timestamp like "20061222T110000Z" into a local timestamp like "20061222T130000" using the server timezone.

Parameters

array $utc

Array with a datetime string in UTC.

Returns

string —

The datetime string converted to the local timezone.