/**
  * Publishes the selected Contents
  * @param $selectedContentsArray array - array with the contents' IDs to publish 
  */
 function publish($selectedContents)
 {
     $selectedContentsArray = split(",", $selectedContents);
     $objectService = new ObjectService();
     $objectService->publishArray($selectedContentsArray);
     $this->show_view();
 }
 /**
  * Deals with DELETE actions for folders.
  * This includes deleting a single folder (with no content) and deleting an entire folder tree
  * 
  * @return 204 on success, 500 on error
  */
 public function DELETE_action()
 {
     // NOTE due to the way KnowledgeTree works with folders this is always going to call deleteTree.
     //      we COULD call deleteObject but when we delete a folder we expect to be trying to delete
     //      the folder and all content.
     $RepositoryService = new RepositoryService();
     $ObjectService = new ObjectService(KT_cmis_atom_service_helper::getKt());
     $repositories = $RepositoryService->getRepositories();
     $repositoryId = $repositories[0]['repositoryId'];
     // attempt delete
     $response = $ObjectService->deleteTree($repositoryId, $this->params[0]);
     // error?
     if (PEAR::isError($response)) {
         $feed = KT_cmis_atom_service_helper::getErrorFeed($this, self::STATUS_SERVER_ERROR, $response->getMessage());
         //Expose the responseFeed
         $this->responseFeed = $feed;
         return null;
     }
     // list of failed objects?
     if (is_array($response)) {
         $this->setStatus(self::STATUS_SERVER_ERROR);
         $feed = new KT_cmis_atom_responseFeed_GET(CMIS_APP_BASE_URI);
         $feed->newField('title', 'Error: Failed to delete all objects in tree: ' . self::STATUS_SERVER_ERROR, $feed);
         foreach ($response as $failed) {
             $entry = $feed->newEntry();
             $objectElement = $feed->newElement('cmis:object');
             $propertiesElement = $feed->newElement('cmis:properties');
             $propElement = $feed->newElement('cmis:propertyId');
             $propElement->appendChild($feed->newAttr('cmis:name', 'ObjectId'));
             $feed->newField('cmis:value', $failed, $propElement);
             $propertiesElement->appendChild($propElement);
             $objectElement->appendChild($propertiesElement);
             $entry->appendChild($objectElement);
             $entry->appendChild($feed->newElement('cmis:terminator'));
         }
         $this->responseFeed = $feed;
         return null;
     }
     // success
     $this->setStatus(self::STATUS_NO_CONTENT);
 }
 protected function addObject(ObjectService $comp)
 {
     $this->objects[$comp->getName()] = $comp;
 }
示例#4
0
 /**
  * Updates an object
  * @param $object Object to update, must have its ID set
  */
 function publish($id)
 {
     echo "Employing NewsService";
     ObjectService::publish($id);
 }