public function GET_action() { //Create a new response feed $feed = new KT_atom_responseFeed(KT_APP_BASE_URI); //Invoke the KtAPI to get detail about the referenced document $docDetail = KT_atom_service_helper::getDocumentDetail($this->params[0]); //Create the atom response feed $entry = $feed->newEntry(); foreach ($docDetail['results'] as $property => $value) { $feed->newField($property, $value, $entry); } //Add a downloaduri field manually $feed->newField('downloaduri', urlencode(KT_APP_SYSTEM_URI . '/action.php?kt_path_info=ktcore.actions.document.view&fDocumentId=' . $docDetail['results']['document_id']), $entry); //Expose the responseFeed $this->responseFeed = $feed; }
/** * Overridden constructor to allow easy adding of additional header attributes * * @param string $baseURI */ public function __construct($baseURI = null) { parent::__construct($baseURI); // append additional tags $this->feed->appendChild($this->newAttr('xmlns:app', 'http://www.w3.org/2007/app')); $this->feed->appendChild($this->newAttr('xmlns:cmis', 'http://docs.oasis-open.org/ns/cmis/core/200901')); // require the workspace for creating links within responses $queryArray = split('/', trim($_SERVER['QUERY_STRING'], '/')); $this->workspace = strtolower(trim($queryArray[0])); }