Inheritance diagram for egwical_resourcehandler:
An egwical object is used in an application to transport Ical information to Egw data elements and vice versa.
The base class egwical_resourcehandler is a base class that implements generic code to handle these Egw resources. For example parsing or rendering from/to an iCalendar string, or handling sets of EElts and VElts For actual work with the NonCompound Vcalendar Elements (NCElts) it has no code by itself but relies on code within a socalled concrete subclass that is dedicated towards handling a specific Egw resource. These subclass must implement the virtual methods of the base class.
In the current implementation (>= v0.9.30) that uses the pattern of ical accessors as egwical_resourcehandler subclasses the class acts as a Abstract Base Class in the sense that it should not be instantiated directly but rather be used by instantiating one of its concrete subclasses.
Currently there are three such concrete resource handling subclasses available:
bocalupdate_vevents
to convert between egw calendar events and VEVENTS and allow import and export of these.bocalupdate_vfreebusy
to convert between egw calendar events and VFREEBUSY components. At the moment only export of these is implemented.boinfolog_vtodos
to convert between egw infolog tasks events and VTODOS and allow import and export of these. See the add_rsc() routine for more info on how to use these.
If $uid_mapping_export is UMM_ID2UID
, then:
If $uid_mapping_export is UMM_UID2UID
, then:
if $uid_mapping_import is UMM_UID2ID
then:
If $uid_mapping_import is UMM_UID2UID
then:
0.9.30 new api: ical accessors as egwical_resourcehandler subclasses
0.9.22 new api2 using eicnvutils via $ecu
Lars Kneschke <lkneschke@egroupware.org> (original code of reused parts)
Ralf Becker <RalfBecker-AT-outdoor-training.de> (original code of reused parts)
Class Methods | |
Methods that can be called without an instance of class egwical_resourcehandler | |
string | deviceType2contentType ($devtyp='all') |
Derive the contentType for export to a devictype. | |
ProductType I False | httpUserAgent2deviceType ($agentidstr) |
Derive the deviceType from a http request agent field. | |
ProductType I False | icalendarProdId2devicetype (string $prodidstr) |
Derive the deviceType for an iCalendar. | |
VElt I false & | parse_vcal2velt (VcalStr &$vcal) |
Parse Vcalstring into a Vcal Element. | |
ProductType I False | product2deviceType ($productManufacturer='all', $productName='') |
Derive the deviceType from a product manufacturer and name description. | |
VcalStr I false | render_velt2vcal (VElt $vobj, array $attribs=null) |
Render a Vcal Element as a VcalString. | |
array | _provided_ical2egwComponents () |
Deliver the implemented ical to egw components mapping. | |
array | _provided_vcalendar2egwAttributes () |
Deliver the implemented vcalendar attributes to egw standard values mapping. | |
Public Member Functions | |
egwical_resourcehandler (egwobj $egwrsc=null, $devicetype='all', $rscownerid=null) | |
Constructor that inits the handler object. | |
VcalStr | export_vcal (array_of_EEltId-I-array_of_EEltData &$eids, array $attribs=null) |
Export egw elements from bound egw resource as an iCalendar string. | |
array_of_VElt | export_velts (array_of_EEltId-I-array_of_EEltData &$eids) |
Export Egw elements from bound resource as Vcalendar Elements. | |
array_of_EEltId I false | import_vcal (VcalStr &$vcal) |
Import all suited elements from an iCalendar string into the bound Egw resource. | |
array_of_EEltId I false | import_velts (array_of_VElt &$vobjs) |
Import a set of Vcalendar Elements into the bound Egw resource. | |
Virtual Methods | |
These methods must be overridden in concrete subclasses | |
virtual NCVElt | export_ncvelt (EEltId-I-EEltData &$eid) |
Export Egw element from bound resource as NonCompound Vcal Element. | |
virtual false | import_ncvelt (VElt $ncvelt, EEltId $eid=-1) |
Import a Non Compound Vcalendar Element into the bound resource. | |
virtual boolean | set_rsc (obj $egw_rsc) |
Set the egw resource and ical element types to handle. | |
set_rsc_owner_id (int $account_id='0') | |
Define owner (by account_id) for new to import egw elements. | |
Public Attributes | |
boolean | $reimport_missing_elements = true |
Switch to allow reimport of gone egw elements. | |
int | $uid_mapping_export = UMM_ID2UID |
Switch that determines the way uid fields are generated at export. | |
int | $uid_mapping_import = UMM_UID2ID |
Switch that determines how uid fields are used for import. | |
Private Member Functions | |
_errorlog_evupd (string $vtype, string $fault='ERROR', ind $user_id, array &$new_egwelt, $cur_egwelt) | |
Log Egw and Velt update problems to errorlog. | |
Private Attributes | |
ProductType | $deviceType = 'all' |
the generic type of device now using the egwical_resourcehandler | |
eicnvutils | $ecu |
The library object with the conversion utilities. | |
int | $eidebug = 1 |
extra debugging switch | |
Horde_iCalendar | $hi |
Horde calendar used for various conversions. | |
array | $ical2egwComponents = array() |
mapping from iCalendar components to egw elements | |
egwrscobj | $rsc = null |
The Bound Egw Resource that we handle. | |
int | $rsc_owner_id = 0 |
Owner of the (virtual) resource is used to add or delete Egw Elements | |
array | $rsc_vtypes = array() |
This list gives all the vcalendar type supported by the (currently) bounded resource. | |
array | $supportedFields |
supported fields of the importing/exporting device | |
array | $vcalendar2egwAttributes |
Standard attributes values used in rendering a iCalendar string. |
|
Constructor that inits the handler object. The auxiliary object $hi, $ecu , $ical2egwComponents and $vcalendar2egwAttributes are all initialized. Optionally an egwresource (like calendar- or infolog object) can already be passed and a devicetype.
|
|
Log Egw and Velt update problems to errorlog.
|
|
Deliver the implemented ical to egw components mapping. --Class Method-- Produce the array of icalcomponent (types) to egw element mappings that this are implemented. This info is used to initialize the variable $ical2egwComponents
|
|
Deliver the implemented vcalendar attributes to egw standard values mapping. --Class Method-- Produce an array that holds the mapping of some VCALENDAR element attributes to Egw fields. These data are also used to initialize the variable $vcalendar2egwAttributes.
|
|
Derive the contentType for export to a devictype. --Class method--
|
|
Export Egw element from bound resource as NonCompound Vcal Element.
|
|
Export egw elements from bound egw resource as an iCalendar string. All the egw elements in the bound egw resource, refered to by the ids in $eids are exported as Vcalendar elements and then rendered into a iCalendar formatted string. Specific global attributes settings for this string are taken from .....
|
|
Export Egw elements from bound resource as Vcalendar Elements.
|
|
Derive the deviceType from a http request agent field. --Class method--
|
|
Derive the deviceType for an iCalendar. --Class method--
|
|
Import a Non Compound Vcalendar Element into the bound resource.
|
|
Import all suited elements from an iCalendar string into the bound Egw resource. This import routine parses the Vcal string and then tries to import into the egw resource bound in $this->rsc all vcalendar elements of the supported type (VEVENTS or VTODOS, ..) for this resource. This supported type is found in $this->??
|
|
Import a set of Vcalendar Elements into the bound Egw resource. All vcalendar elements that are of an appropiate type, supported by the bound resource in $this->rsc are converted to egw elements and then imported into the resource. Non appropiate vcalendar element types are simply ignored. Full VCALENDAR objects are decomposed and each (appropiate) part is imported.
|
|
Parse Vcalstring into a Vcal Element. --Class Method--
The Vcalstring should form a single Vcal element, thus it should be of the form
|
|
Derive the deviceType from a product manufacturer and name description. --Class method--
|
|
Render a Vcal Element as a VcalString. --Class Method--
|
|
Set the egw resource and ical element types to handle. The egw resource and ical element types that are used to handle are registered in the variable $rsc and $rsc_vtypes.
|
|
Define owner (by account_id) for new to import egw elements. Just fill the member variable $this->rsc_owner_id by the appropiae value
|
|
the generic type of device now using the egwical_resourcehandler Label that identifies the device capabilities for import and export of the currently connected client device. This ProductType will be used to control the import and export by using it as argument for setSupportedFields(). This label is a string with a slash separating generic and the more specific description. Examples are: all // the default siemens/sx11 nexthaus corporation/ sonyericsson/ multisync/ ... remotecalendars/See icalendarProdId2devicetype() and httpAgent2deviceType() to derive the ProductType from a iCalendar resp. a http request. |
|
The library object with the conversion utilities. This object can be reused in other egwical objects, it is used readonly. Therefore you can pass an instantion of it via the class constructor, if you have one. Else the constructor will create a new version. |
|
extra debugging switch Switch to print extra debugging about imported and exported events to the httpd errorlog stream. (0 is off 1 is on 2 is more on ... |
|
Horde calendar used for various conversions. Placeholder object used to access various Horde_iCalendar methods In here the constructor will create a Horde_iCalendar object that can be used by the various routines in the class |
|
mapping from iCalendar components to egw elements An (nested0 hash array containing the mapping from iCalendar components to egw elements. This is set by constructor. And for each component (like 'VEVENT', 'VTODO' etc) the entry will point to an array that gives a mapping of fields and subcomponents of that component type. These arrays are set either by
|
|
Switch to allow reimport of gone egw elements. Switch that determines if events not anymore in egw are allowed to be reimported Default this is on |
|
The Bound Egw Resource that we handle. Registry for the egw resource object (calendar, infolog,..) that will be used to transport ical elements from and to: The socalled Bound Resource This can be set by the constructor or later by set_rsc(). Reimplemented in bocalupdate_vevents, bocalupdate_vfreebusy, and boinfolog_vtodos. |
|
Owner of the (virtual) resource is used to add or delete Egw Elements This variable can be set via the constructor. When not used it has the default value 0, meaning that the resource owned by the authenticated user is taken. |
|
This list gives all the vcalendar type supported by the (currently) bounded resource. As only a concrete resource handler subclass has this knowledge, it should be set by such a subclass! |
|
supported fields of the importing/exporting device
An array with the current supported fields of the importing/exporting device. To detect if a certain ical property (eg ORGANIZER) is supported in the current data import/export do a
|
|
Switch that determines the way uid fields are generated at export. According to the value, on export, a uid will be generated:
|
|
Switch that determines how uid fields are used for import. According to the value, on import, the uid field of a vcalendar element will be determine how the search for a matching egw element is done. The choices are:
|
|
Standard attributes values used in rendering a iCalendar string.
Hash of some standard attributes of a VCALENDAR element. These used for rendering a Vcal formatted string. Mostly these are only the |