Inheritance diagram for bocalupdate_vevents:
$boc =& CreateObject('calendar.bocalupdate'); $ev1 = $boc->read(1233); // get two events $ev2 = $boc->read(4011); $calhnd =& CreateObject('egwical.bocalupdate_vevents',$boc);
// alternative 1 $vevent1 = $calhnd->export_vevent($ev1,UMM_ID2UID); $vcalstr1 = egwical_resourcehandler::render_velt2vcal($vevent1); // alternative 2 (generic for all resourcehandlers) $calhnd->uid_mapping_export = UMM_ID2UID; $vevent1 = $calhnd->export_ncvelt($ev1); $vcalstr1 = egwical_resourcehandler::render_velt2vcal($vevent1); // alternative 3 (via baseclass, without intermediate vevent) $vcalstr1 = $calhnd->export_vcal($ev1);
// alternative 1 (via the concrete method) $vevent1 = ..... a good vevent $ev_id1 = $calhnd->import_vevent($vevent1, UMM_UID2ID,1); if ($ev_id1 > 0) { echo "imported vevent1 as event with id $ev_id1"; } // alternative 2 (generic for all resourcehandlers) $calhnd->uid_mapping_import = UMM_UID2ID; $ev_id1 = $calhnd->import_ncvelt($vevent1); if ($ev_id1 > 0) { echo "imported vevent1 as event with id $ev_id1"; } // alternative 3 (via base class, easier for multiple vevents) $my_vevents = array($vevent1,$event2,..); $calhnd->uid_mapping_import = UMM_UID2ID; $eids = $calhnd->import_velts($my_vevents); echo "we imported" . count($eids) . "vevents";
// alternative 1 $vcalstr = .. an vcalendar format string with multiple vevents $compvelt = egwical_resourcehandler::parse_vcal2velt($vcalstr); if($compvelt === false) exit; $eids = $calhnd->import_velts($compvelt); if ($eids) { echo "we imported" . count($eids) . "vevents"; } // alternative 2 (using the baseclass its methods) $eids = $calhnd->import_vcal($vcalstr); if ($eids) echo "we imported" . count($eids) . "vevents";
Lars Kneschke <lkneschke@egroupware.org> (parts from boical that are reused here)
Ralf Becker <RalfBecker-AT-outdoor-training.de> (parts from boical that are reused here)
0.9.36 update does not change owner anymore
0.9.36 first version with NAPI-3.1 (rsc_owner_id parameter)
0.9.30 first version for napi3 license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
Public Member Functions | |
bocalupdate_vevents (egwobj $egwrsc=null, ProductType $devicetype='all', string $rscownid='0') | |
Our Constructor, if given it sets the egw resource $egwrsc is set as so called bound egw resource. | |
VEVENT | export_ncvelt (EventId-I-EventData &$eid) |
Wrapper around export_vevent() with simplified parameters. | |
VEVENT I false | export_vevent (EventId-I-EventData &$event, int $uid_mapping_export=ID2UID) |
Export calendar event from bound bocalupdate resource as VEVENT. | |
EventId I errorstring | import_ncvelt (VEVENT &$ncvelt, int $eid=-1) |
Wrapper around import_vevent() with simplified set of call parameters. | |
EventId I Errorstring | import_vevent (VEVENT &$vevent, int $uid_mapping_import, boolean $reimport_missing_events=false, int $cal_id=0) |
Import a VEVENT as a event into the bound Egw calendar resource. | |
boolean | set_rsc (egwobj $egw_rsc) |
Set the egw calendar resource that this class will handle. | |
void | setSupportedFields (ProductType $devicetype= 'all') |
Set the list of ical fields that are supported during the next imports and exports. | |
Private Member Functions | |
array | _provided_vevent2eventFields () |
Deliver the implemented vevent to event mapping as provided by this class. | |
Private Attributes | |
boolean | $evdebug = true |
Switch to print extra debugging about imported and exported events to the httpd errorlog stream. | |
bocalupdate | $rsc = null |
The Bound Egw Resource that we handle. | |
array | $vevent2eventFields = array() |
mapping from iCalendar VEVENT fields to egw calendar fields |
|
Our Constructor, if given it sets the egw resource $egwrsc is set as so called bound egw resource. And $prodid, the product id of the client that will use or produce ical data is set to determine which fields to use in coming import and exportd conversions between vcalendar and egw data.
|
|
Deliver the implemented vevent to event mapping as provided by this class. Produce the array of vevent to event field mappings that this class implements. These are stored on instantiation in the variable $vevent2eventFields
|
|
Wrapper around export_vevent() with simplified parameters.
|
|
Export calendar event from bound bocalupdate resource as VEVENT. The eGW event in $event is exported to iCalendar VEVENT (of type Horde_iCalendar_vevent) Note that only the set of supported Fields, as indicated by the $supportedFields member variable, are exported into the VEVENT. The uid field of the generated VEVENT will be filled according to the setting of the $uid_mapping_export parameter. Either with the event id encoded (ID2UID) or with the event uid field copied (UID2UID) or with a completey new generated string (NEWUID). For more info see UID to ID Mapping and Matching.
|
|
Wrapper around import_vevent() with simplified set of call parameters.
The value of the member variable $uid_mapping_import is used to control the set of iCalendar fields that are imported.
|
|
Import a VEVENT as a event into the bound Egw calendar resource. The ical VEVENT component is converted to an eGW event for the calendar resource in $rsc and then imported into this eGW calendar resource. Depending on the value of $uid_mapping_import, the conversion will either:
Default the mode $supportedFields determines the VEVENTS that will be used for import For importing vevents the calendar of $this->rsc_owner_id is taken. That is the ownership of the new event is set to that owner. For editing(and deleting) of existing events the id of the current owner is always (re-) used.
|
|
Set the egw calendar resource that this class will handle. This worker is only capable of handling bocalupdate calendar objects, so it should be of that class. The $egw_rsc is registered in the $rsc variable and the supported ical element is set to be 'vevent'. This is registered in $rsc_vtypes.
|
|
Set the list of ical fields that are supported during the next imports and exports. The list of iCal fields that should be converted during the following imports and exports of VEVENTS is set. This is done according to a given ProductType as mostly set in the $deviceType field of the egwical_resourcehandler. See there for a further description. In a small lookup table the set of currently supported fields is searched for and then and then these are set accordingly in the class member $supportedFields.
|
|
Switch to print extra debugging about imported and exported events to the httpd errorlog stream.
|
|
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 from egwical_resourcehandler. |
|
mapping from iCalendar VEVENT fields to egw calendar fields An array containing roughly the mapping from iCalendar to egw fields. Set by constructor. example entry (rn stands for "Resourced_Name"): 'SUMMARY' => array('rn' => 'title'),Here rn stands for "Resourced Name", to indicate the name of the related related field in the bound egw resource
|