View Source

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[{zone-template-instance:ZFPROP:Proposal Zone Template}

{zone-data:component-name}
Zend_Vcard
{zone-data}

{zone-data:proposer-list}
[Thomas Schaaf|mailto:thomas.schaaf@komola.de]
[Sebastian Hoitz|mailto:sebastian.hoitz@komola.de]
{zone-data}

{zone-data:liaison}
TBD
{zone-data}

{zone-data:revision}
1.0 - 19 October 2010: Initial Draft.
{zone-data}

{zone-data:overview}
Zend_Vcard is a class which has the capability to Generate and Parse Vcards.
{zone-data}

{zone-data:references}
* [Vcard Wikipedia Entry|http://en.wikipedia.org/wiki/VCard]
* [Official specs for Vcard 2.1|http://www.imc.org/pdi/vcard-21.doc]
{zone-data}

{zone-data:requirements}
* This component *will* extract all the information it can get out of a given Vcard string or Vcard file.
* This component *will* generate Vcards either by the Vcard 2.1 or 3.0 standard.
{zone-data}

{zone-data:dependencies}
* Zend_Exception
* Zend_Date
* Zend_Mime
{zone-data}

{zone-data:operation}
You can give it any Vcard and it will make a PHP Object.
You can give it a PHP Object and it will generate a Vcard.
{zone-data}

{zone-data:milestones}
* Milestone 1: \[DONE\]Write unit tests.
* Milestone 2: \[DONE\]Write code.
* Milestone 3: Get feedback and get approved.
* Milestone 4: Create documentation.
{zone-data}

{zone-data:class-list}
* Zend_Vcard
* Zend_Vcard_Parser
* Zend_Vcard_Generator
{zone-data}

{zone-data:use-cases}
||UC-01||
Just a simple example.
{code}
$vcardString = "BEGIN:VCARD\r\nVERSION:3.0\r\nN:Lastname;Firstname\r\nFN:Firstname Lastname\r\nX-SKYPE:skypeAccount\r\nEND:VCARD";
$parser = new App_Data_Vcard_Parser($vcardString);
$vcardObject = $parser->parse();

$vcardObject = new App_Data_Vcard();
$vcardObject->setFirstname("Firstname")
->setLastname("Lastname")
->setFullname("Firstname Lastname")
->addInstantmessenger('skypeAccount', App_Data_Vcard::IMSKYPE);
$outputString = App_Data_Vcard_Generator::generate($vcardObject);
{code}
{zone-data}

{zone-data:skeletons}
{code}
class Zend_Vcard_Exception extends Zend_Exception {}

class Zend_Vcard {
//constants
public function __call($function, $args){}
public function __get($name){}
public function __set($name, $value){}
public function addPhonenumber($phonenumberArray, $type = null){}
public function addEmail($emailArray, $type = null){}
public function addUrl($urlArray, $type = null){}
public function addAddress($addressArray){}
public function addInstantmessenger($imArray, $messenger = null, $type = null){}
}

class Zend_Vcard_Generator {
protected static function _renderName($vcardObject) {
}
protected static function _renderFullname($vcardObject) {
}
protected static function _render...($vcardObject) {
}
public static function generate($vcardObjects , $version = App_Data_Vcard::VERSION30)
return $vcardString;
}

class Zend_Vcard_Parser {
public function __construct($filename)

protected static function _parseName($vcardObject) {
}
protected static function _parseFullname($vcardObject) {
}
protected static function _parse...($vcardObject) {
}
public static function parse()
return $vcardObjectsArray;
}

{code}
{zone-data}

{zone-template-instance}]]></ac:plain-text-body></ac:macro>