public function PUT_action()
 {
     // call the checkin function
     $RepositoryService = new RepositoryService();
     $VersioningService = new VersioningService(KT_cmis_atom_service_helper::getKt());
     $repositories = $RepositoryService->getRepositories();
     $repositoryId = $repositories[0]['repositoryId'];
     $response = $VersioningService->checkIn($repositoryId, $this->params[0]);
     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;
     }
     $this->setStatus(self::STATUS_NO_CONTENT);
     $this->responseFeed = null;
 }
 public function PUT_action()
 {
     $repositoryId = KT_cmis_atom_service_helper::getRepositoryId($RepositoryService);
     $VersioningService = new VersioningService(KT_cmis_atom_service_helper::getKt());
     $ObjectService = new ObjectService(KT_cmis_atom_service_helper::getKt());
     // check for content stream
     // NOTE this is a hack!  will not work with CMISSpaces at least, probably not with any client except RestTest and similar
     //      where we can manually modify the input
     // first we try for an atom content tag
     $content = KT_cmis_atom_service_helper::getAtomValues($this->parsedXMLContent['@children'], 'content');
     if (!empty($content)) {
         $contentStream = $content;
     } else {
         $content = KT_cmis_atom_service_helper::findTag('content', $this->parsedXMLContent['@children'], null, false);
         $contentStream = $content['@value'];
     }
     // if we haven't found it now, the real hack begins - retrieve the EXISTING content and submit this as the contentStream
     // this is needed because KnowledgeTree will not accept a checkin without a content stream but CMISSpaces (and possibly
     // other CMIS clients are the same, does not send a content stream on checkin nor does it offer the user a method to choose one)
     // NOTE that if the content is INTENDED to be empty this and all the above checks will FAIL!
     // FIXME this is horrible, terrible, ugly and bad!
     if (empty($contentStream)) {
         $contentStream = base64_encode(KT_cmis_atom_service_helper::getContentStream($this, $ObjectService, $repositoryId));
     }
     // and if we don't have it by now, we give up...but leave the error to be generated by the underlying KnowledgeTree code
     // checkin function call
     // TODO dynamically detect version change type - leaving this for now as the CMIS clients tested do not appear to
     //      offer the choice to the user - perhaps it will turn out that this will come from somewhere else but for now
     //      we assume minor version updates only
     $major = false;
     $response = $VersioningService->checkIn($repositoryId, $this->params[0], $major, $contentStream);
     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;
     }
     $feed = KT_cmis_atom_service_helper::getObjectFeed($this, $ObjectService, $repositoryId, $this->params[0]);
     // Expose the responseFeed
     $this->responseFeed = $feed;
 }