コード例 #1
0
 /**
  * Builds the indexed data for first indexation
  *
  * @param Docman_Item    $item
  * @param Docman_Version $version
  *
  * @return array
  */
 public function getIndexedDataForItemVersion(Docman_Item $item)
 {
     $hardcoded_metadata = array('id' => $item->getId(), 'group_id' => $item->getGroupId(), 'title' => $item->getTitle(), 'description' => $item->getDescription(), 'create_date' => date('c', $item->getCreateDate()), 'update_date' => date('c', $item->getUpdateDate()), 'permissions' => $this->permissions_manager->exportPermissions($item), 'approval_table_comments' => $this->getDocumentApprovalTableComments($item), 'owner' => $item->getOwnerId());
     if ($item->getObsolescenceDate()) {
         $hardcoded_metadata['obsolescence_date'] = date('c', $item->getObsolescenceDate());
     }
     return $hardcoded_metadata;
 }
コード例 #2
0
 /**
  * Update title, description and custom textual metadata of a document
  *
  * @param Docman_Item $item The item
  * @throws FullTextSearchDocmanIndexFileTooBigException
  */
 public function updateDocument(Docman_Item $item)
 {
     try {
         $this->client->getIndexedElement($item->getGroupId(), $item->getId());
         $this->logger->debug('update document #' . $item->getId());
         $update_data = array();
         $this->request_data_factory->setUpdatedData($update_data, 'title', $item->getTitle());
         $this->request_data_factory->setUpdatedData($update_data, 'description', $item->getDescription());
         $this->updateContent($item, $update_data);
         $update_data = $this->request_data_factory->updateCustomTextualMetadata($item, $update_data);
         $update_data = $this->updateCustomDateMetadata($item, $update_data);
         $this->client->update($item->getGroupId(), $item->getId(), $update_data);
     } catch (ElasticSearch_ElementNotIndexed $exception) {
         $this->indexNonexistantDocument($item);
         return;
     }
 }
コード例 #3
0
 private function getIndexedData(Docman_Item $item, Docman_Version $version)
 {
     return array('id' => $item->getId(), 'group_id' => $item->getGroupId(), 'title' => $item->getTitle(), 'description' => $item->getDescription(), 'permissions' => $this->permissions_manager->exportPermissions($item), 'file' => $this->fileContentEncode($version->getPath()));
 }