public function getService($r) { $svc = new Dase_Atom_Service(); $meta_workspace = $svc->addWorkspace('DASe Sets Workspace'); $meta_coll = $meta_workspace->addCollection($r->app_root . '/tags', 'DASe Sets'); $meta_coll->addAccept('application/atom+xml;type=entry'); $r->response_mime_type = 'application/atomsvc+xml'; $r->renderResponse($svc->asXml()); }
public function getService($r) { $svc = new Dase_Atom_Service(); $meta_workspace = $svc->addWorkspace('DASe MetaCollections Workspace'); $meta_coll = $meta_workspace->addCollection($r->app_root . '/collections', 'DASe Collections'); $meta_coll->addAccept('application/atom+xml;type=entry'); $meta_cats = $meta_coll->addCategorySet(); $meta_cats->addCategory('collection', 'http://daseproject.com/category/entrytype'); $users_coll = $meta_workspace->addCollection($r->app_root . '/users', 'DASe Users'); $users_coll->addAccept('application/atom+xml;type=entry'); $users_cats = $users_coll->addCategorySet(); $users_cats->addCategory('user', 'http://daseproject.com/category/entrytype'); $r->response_mime_type = 'application/atomsvc+xml'; $r->renderResponse($svc->asXml()); }
public function getAtompubServiceDoc($app_root) { $svc = new Dase_Atom_Service(); $ws = $svc->addWorkspace($this->collection_name . ' Workspace'); $coll = $ws->addCollection($app_root . '/collection/' . $this->ascii_id . '.atom', $this->collection_name . ' Items'); $coll->addAccept('application/atom+xml;type=entry'); $coll->addCategorySet()->addCategory('item', 'http://daseproject.org/category/entrytype'); $atts = $coll->addCategorySet('yes', 'http://daseproject.org/category/metadata'); foreach ($this->getAttributes() as $att) { $atts->addCategory($att->ascii_id, '', $att->attribute_name); } $media_repos = $app_root . '/media/' . $this->ascii_id . '.atom'; $media_coll = $ws->addCollection($media_repos, $this->collection_name . ' Media'); foreach (Dase_Media::getAcceptedTypes() as $type) { //$media_coll->addAccept($type,true); $media_coll->addAccept($type); } //json items collection $ws->addCollection($app_root . '/collection/' . $this->ascii_id . '.atom', $this->collection_name . ' JSON Items')->addAccept('application/json'); $item_types_repos = $app_root . '/collection/' . $this->ascii_id . '/item_types.atom'; $ws->addCollection($item_types_repos, $this->collection_name . ' Item Types')->addAccept('application/atom+xml;type=entry')->addCategorySet()->addCategory('item_type', 'http://daseproject.org/category/entrytype'); $attributes_repos = $app_root . '/collection/' . $this->ascii_id . '/attributes.atom'; $atts_repos = $ws->addCollection($attributes_repos, $this->collection_name . ' Attributes'); $atts_repos->addAccept('application/atom+xml;type=entry')->addCategorySet()->addCategory('attribute', 'http://daseproject.org/category/entrytype', '', true); $html_inp_types = $atts_repos->addAccept('application/atom+xml;type=entry')->addCategorySet('yes', 'http://daseproject.org/category/html_input_type'); foreach (array('text', 'textarea', 'select', 'radio', 'checkbox', 'noedit', 'list') as $inp) { $html_inp_types->addCategory($inp); } return $svc->asXml(); }
public function getAtomPubServiceDoc($app_root) { $c = $this->getCollection(); $app = new Dase_Atom_Service(); $workspace = $app->addWorkspace($c->collection_name . ' Item ' . $this->serial_number . ' Workspace'); $media_coll = $workspace->addCollection($app_root . '/item/' . $this->p_collection_ascii_id . '/' . $this->serial_number . '/media.atom', $c->collection_name . ' Item ' . $this->serial_number . ' Media'); foreach (Dase_Media::getAcceptedTypes() as $type) { $media_coll->addAccept($type); } $comments_coll = $workspace->addCollection($app_root . '/item/' . $this->p_collection_ascii_id . '/' . $this->serial_number . '/comments.atom', $c->collection_name . ' Item ' . $this->serial_number . ' Comments'); $comments_coll->addAccept('text/plain'); $comments_coll->addAccept('text/html'); $comments_coll->addAccept('application/xhtml+xml'); $metadata_coll = $workspace->addCollection($app_root . '/item/' . $this->p_collection_ascii_id . '/' . $this->serial_number . '/metadata.atom', $c->collection_name . ' Item ' . $this->serial_number . ' Metadata'); $metadata_coll->addAccept('application/x-www-form-urlencoded'); $metadata_coll->addAccept('application/json'); return $app->asXml(); }
public function getAtompubServiceDoc($app_root) { $svc = new Dase_Atom_Service(); $ws = $svc->addWorkspace('User ' . $this->eid . ' Workspace'); $coll = $ws->addCollection($this->getUrl($app_root) . '/sets.atom', 'User ' . $this->eid . ' Sets'); $coll->addAccept('application/atom+xml;type=entry'); $coll->addCategorySet()->addCategory('set', 'http://daseproject.org/category/entrytype'); return $svc->asXml(); }