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_Service_37Signals_Basecamp
{zone-data}

{zone-data:proposer-list}
[w.naruniec@gmail.com|mailto:w.naruniec@gmail.com]
{zone-data}

{zone-data:liaison}
[~ralph]
{zone-data}

{zone-data:revision}
0.1 - 13 March 2008: Placeholder
0.2 - 30 May 2008: Initial version
0.3 - 13 July 2008: Ready for Review
0.4 - 29 July 2008: Ready for Recommendation
0.5 - 21 May 2009: Sync with new REST API
{zone-data}

{zone-data:overview}
Zend_Service_37Signals_Basecamp is an implementation of the Basecamp REST API. All methods return an instance of Zend_Rest_Client_Result.
{zone-data}

{zone-data:references}
* [Basecamp API Reference|http://developer.37signals.com/basecamp/reference.shtml]
{zone-data}

{zone-data:requirements}

* This component *will* implement all API functions.
* This component *will* handle authentication.
* This component *will* accept array or Zend_Config object as configuration options
* This component *will not* handle YAML requests.

{zone-data}

{zone-data:dependencies}
* Zend_Rest_Client
* Zend_Service_Exception
{zone-data}

{zone-data:operation}
Components makes request, parse response and return data.
{zone-data}

{zone-data:milestones}
* Milestone 1: \[DONE\] Publish proposal and prepare class sekeletons.
* Milestone 2: Working prototype checked into the incubator supporting use cases #1, #2 and #3
* Milestone 3: Working prototype checked into the incubator supporting with all methods implemented
* Milestone 4: Unit tests exist, work, and are checked into SVN.
* Milestone 5: Initial documentation exists.
{zone-data}

{zone-data:class-list}
* Zend_Service_37Signals_Basecamp_Exception
* Zend_Service_37Signals_Basecamp
{zone-data}

{zone-data:use-cases}
||UC-01||
h3. Configure and instantiate web service object:
{code:php}
$options = array(
'uri' => 'http://example.com/',
'login' => 'test',
'password' => 'test',
);

$basecamp = new Zend_Service_37Signals_Basecamp($options);
{code}
||UC-02||
h3. Get title for each message in project:
{code:php}
// uses $basecamp from UC-01

$projectId = 123;

$messages = $basecamp->getMessages($projectId);

foreach ($messages as $messages) {
echo $message->title . "\n";
}
{code}
||UC-03||
h3. Create new milestone in project:
{code:php}
// uses $basecamp from UC-01

$companyId = 'c' . 456;

$data = array(
'title' => 'Some milestone title',
'deadline' => '20090613',
'responsible-party' => $companyId,
'notify' => true,
);

$milestone = $basecamp->createMilestone($companyId, $data);

echo $milestone->id . "\n";

{code}
{zone-data}

{zone-data:skeletons}
{code:php}
class Zend_Service_37Signals_Basecamp_Exception extends Zend_Service_Exception {}

class Zend_Service_37Signals_Basecamp extends Zend_Rest_Client {

protected $_options = array(
'uri' => null,
'login' => null,
'password' => null,
);

/**
* Set options
*
* @param array|Zend_Config $options
*/
public function __construct($options = null) { }

/**
* Initialize HTTP authentication
*
* @return void
*/
protected function _init() { }

/**
* Set options
*
* @param array|Zend_Config $options
* @return Zend_Service_37Signals_Basecamp
* @throws Zend_Service_37Signals_Basecamp_Exception
*/
public function setOptions($options) { }

public function getOptions() { }


/**
* People
*/

public function currentPerson() { }

public function getPeople() { }

public function getProjectPeople($projectId) { }

public function getCompanyPeople($companyId) { }

public function getPerson($personId) { }

/**
* Companies
*/

public function getCompanies() { }

public function getProjectCompanies($projectId) { }

public function getCompany($companyId) { }

/**
* Categories
*/

public function getCategories($projectId, $type) { }

public function getCategory($categoryId) { }

public function createCategory($projectId, $data) { }

public function updateCategory($categoryId, $data) { }

public function destroyCategory($categoryId) { }

/**
* Messages
*/

public function getMessages($projectId) { }

public function getMessage($messageId) { }

public function getMessagesByCategory($projectId, $categoryId) { }

public function getArchivedMessages($projectId) { }

public function getArchivedMessagesByCategory($projectId, $categoryId) { }

public function newMessage($projectId)

public function createMessage($projectId, $data) { }

public function editMessage($messageId) { }

public function updateMessage($messageId, $data) { }

public function destroyMessage($messageId) { }

/**
* Comments
*/

public function getAllComments($resource, $resourceId) { }

public function getComment($commentId) { }

public function newComment($resource, $resourceId) { }

public function createComment($resource, $resourceId, $data) { }

public function editComment($commentId) { }

public function updateComment($commentId, $data) { }

public function destroyComment($commentId) { }

/**
* To-do Lists
*/
public function getAllLists($responsibleParty) { }

public function getAllListsByProject($projectId, $filter) { }

public function getList($listId) { }

public function editList($listId) { }

public function updateList($listId, $data) { }

public function newList($projectId) { }

public function createList($projectId, $data) { }

public function destroyList($listId) { }

public function reorderList($projectId, $data) { }

/**
* To-do Items
*/

public function getAllItems($todoListId) { }

public function getItem($todoItemId) { }

public function completeItem($todoItemId) { }

public function uncompleteItem($todoItemId) { }

public function newItem($todoListId) { }

public function createItem($todoListId, $data) { }

public function updateItem($todoItemId, $data) { }

public function editItem($todoItemId) { }

public function destroyItem($todoItemId) { }

public function reorderItems($todoListId, $data) { }

/**
* Milestones
*/
public function getAllMilestones($projectId, $find) { }

public function completeMilestone($milestoneId) { }

public function uncompleteMilestone($milestoneId) { }

public function createMilestone($projectId, $data) { }

public function createMultipleMilestones($projectId, $data) { }

public function updateMilestone($milestoneId, $data) { }

public function deleteMilestone($milestoneId) { }

/**
* Time Tracking
*/

public function getAllEntriesByProject($projectId, $page = 1) { }

public function getAllEntriesByTodoItem($todoItemId) { }

public function createEntry($resourceType, $resourceId, $data) { }

public function newEntry($projectId) { }

public function getEntry($entryId) { }

public function editEntry($entryId) { }

public function updateEntry($entryId, $data) { }

public function destroyEntry($entryId) { }

public function reportEntries($from, $to, $subjectId, $todoItemId, $filterProjectId, $filterCompanyId) { }

/**
* Files
*/
public function uploadFile($contentType, $contentLength, $body) { }

}
{code}
{zone-data}

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