当前位置: 首页>>代码示例>>PHP>>正文


PHP ArticleSearchIndex::indexSuppFileMetadata方法代码示例

本文整理汇总了PHP中ArticleSearchIndex::indexSuppFileMetadata方法的典型用法代码示例。如果您正苦于以下问题:PHP ArticleSearchIndex::indexSuppFileMetadata方法的具体用法?PHP ArticleSearchIndex::indexSuppFileMetadata怎么用?PHP ArticleSearchIndex::indexSuppFileMetadata使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ArticleSearchIndex的用法示例。


在下文中一共展示了ArticleSearchIndex::indexSuppFileMetadata方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: execute

 /**
  * Save changes to the supplementary file.
  * @return int the supplementary file ID
  */
 function execute($fileName = null)
 {
     import("file.ArticleFileManager");
     $articleFileManager =& new ArticleFileManager($this->article->getArticleId());
     $suppFileDao =& DAORegistry::getDAO('SuppFileDAO');
     $fileName = isset($fileName) ? $fileName : 'uploadSuppFile';
     if (isset($this->suppFile)) {
         $suppFile =& $this->suppFile;
         // Upload file, if file selected.
         if ($articleFileManager->uploadedFileExists($fileName)) {
             $articleFileManager->uploadSuppFile($fileName, $suppFile->getFileId());
             import('search.ArticleSearchIndex');
             ArticleSearchIndex::updateFileIndex($this->article->getArticleId(), ARTICLE_SEARCH_SUPPLEMENTARY_FILE, $suppFile->getFileId());
         }
         // Index metadata
         ArticleSearchIndex::indexSuppFileMetadata($suppFile);
         // Update existing supplementary file
         $this->setSuppFileData($suppFile);
         $suppFileDao->updateSuppFile($suppFile);
     } else {
         // Upload file, if file selected.
         if ($articleFileManager->uploadedFileExists($fileName)) {
             $fileId = $articleFileManager->uploadSuppFile($fileName);
             import('search.ArticleSearchIndex');
             ArticleSearchIndex::updateFileIndex($this->article->getArticleId(), ARTICLE_SEARCH_SUPPLEMENTARY_FILE, $fileId);
         } else {
             $fileId = 0;
         }
         // Insert new supplementary file
         $suppFile =& new SuppFile();
         $suppFile->setArticleId($this->article->getArticleId());
         $suppFile->setFileId($fileId);
         $this->setSuppFileData($suppFile);
         $suppFileDao->insertSuppFile($suppFile);
         $this->suppFileId = $suppFile->getSuppFileId();
     }
     return $this->suppFileId;
 }
开发者ID:Jouper,项目名称:jouper,代码行数:42,代码来源:SuppFileForm.inc.php

示例2: execute

 /**
  * Save changes to the supplementary file.
  * @return int the supplementary file ID
  */
 function execute($fileName = null, $createRemote = false)
 {
     import('classes.file.ArticleFileManager');
     $articleFileManager = new ArticleFileManager($this->article->getId());
     $suppFileDao =& DAORegistry::getDAO('SuppFileDAO');
     $fileName = isset($fileName) ? $fileName : 'uploadSuppFile';
     if (isset($this->suppFile)) {
         parent::execute();
         // Upload file, if file selected.
         if ($articleFileManager->uploadedFileExists($fileName)) {
             $fileId = $this->suppFile->getFileId();
             if ($fileId != 0) {
                 $articleFileManager->uploadSuppFile($fileName, $fileId);
             } else {
                 $fileId = $articleFileManager->uploadSuppFile($fileName);
                 $this->suppFile->setFileId($fileId);
             }
             import('classes.search.ArticleSearchIndex');
             ArticleSearchIndex::updateFileIndex($this->article->getId(), ARTICLE_SEARCH_SUPPLEMENTARY_FILE, $fileId);
         }
         // Index metadata
         ArticleSearchIndex::indexSuppFileMetadata($this->suppFile);
         // Update existing supplementary file
         $this->setSuppFileData($this->suppFile);
         if ($this->getData('remoteURL')) {
             $this->suppFile->setRemoteURL($this->getData('remoteURL'));
         }
         $suppFileDao->updateSuppFile($this->suppFile);
     } else {
         // Upload file, if file selected.
         if ($articleFileManager->uploadedFileExists($fileName)) {
             $fileId = $articleFileManager->uploadSuppFile($fileName);
             import('classes.search.ArticleSearchIndex');
             ArticleSearchIndex::updateFileIndex($this->article->getId(), ARTICLE_SEARCH_SUPPLEMENTARY_FILE, $fileId);
         } else {
             $fileId = 0;
         }
         // Insert new supplementary file
         $this->suppFile = new SuppFile();
         $this->suppFile->setArticleId($this->article->getId());
         $this->suppFile->setFileId($fileId);
         if ($createRemote) {
             $this->suppFile->setRemoteURL(__('common.remoteURL'));
         }
         parent::execute();
         $this->setSuppFileData($this->suppFile);
         $suppFileDao->insertSuppFile($this->suppFile);
         $this->suppFileId = $this->suppFile->getId();
     }
     return $this->suppFileId;
 }
开发者ID:reconciler,项目名称:ojs,代码行数:55,代码来源:SuppFileForm.inc.php

示例3: indexArticleFiles

 /**
  * Index all article files (supplementary and galley).
  * @param $article Article
  */
 function indexArticleFiles(&$article)
 {
     // Index supplementary files
     $fileDao =& DAORegistry::getDAO('SuppFileDAO');
     $files =& $fileDao->getSuppFilesByArticle($article->getId());
     foreach ($files as $file) {
         if ($file->getFileId()) {
             ArticleSearchIndex::updateFileIndex($article->getId(), ARTICLE_SEARCH_SUPPLEMENTARY_FILE, $file->getFileId());
         }
         ArticleSearchIndex::indexSuppFileMetadata($file);
     }
     unset($files);
     // Index galley files
     $fileDao =& DAORegistry::getDAO('ArticleGalleyDAO');
     $files =& $fileDao->getGalleysByArticle($article->getId());
     foreach ($files as $file) {
         if ($file->getFileId()) {
             ArticleSearchIndex::updateFileIndex($article->getId(), ARTICLE_SEARCH_GALLEY_FILE, $file->getFileId());
         }
     }
 }
开发者ID:JovanyJeff,项目名称:hrp,代码行数:25,代码来源:ArticleSearchIndex.inc.php

示例4: execute

 /**
  * Save changes to the supplementary file.
  * @return int the supplementary file ID
  */
 function execute($fileName = null)
 {
     import('classes.file.ArticleFileManager');
     $articleFileManager = new ArticleFileManager($this->article->getArticleId());
     $suppFileDao =& DAORegistry::getDAO('SuppFileDAO');
     $fileName = isset($fileName) ? $fileName : 'uploadSuppFile';
     if (isset($this->suppFile)) {
         $suppFile =& $this->suppFile;
         // Upload file, if file selected.
         if ($articleFileManager->uploadedFileExists($fileName)) {
             $articleFileManager->uploadSuppFile($fileName, $suppFile->getFileId());
             import('classes.search.ArticleSearchIndex');
             ArticleSearchIndex::updateFileIndex($this->article->getArticleId(), ARTICLE_SEARCH_SUPPLEMENTARY_FILE, $suppFile->getFileId());
         }
         // Index metadata
         ArticleSearchIndex::indexSuppFileMetadata($suppFile);
         // Update existing supplementary file
         $this->setSuppFileData($suppFile);
         $suppFileDao->updateSuppFile($suppFile);
     } else {
         // Upload file, if file selected.
         if ($articleFileManager->uploadedFileExists($fileName)) {
             $fileId = $articleFileManager->uploadSuppFile($fileName);
             import('classes.search.ArticleSearchIndex');
             ArticleSearchIndex::updateFileIndex($this->article->getArticleId(), ARTICLE_SEARCH_SUPPLEMENTARY_FILE, $fileId);
             // Insert new supplementary file
             $suppFile = new SuppFile();
             $suppFile->setArticleId($this->article->getArticleId());
             $suppFile->setFileId($fileId);
             $this->setSuppFileData($suppFile);
             $suppFileDao->insertSuppFile($suppFile);
             $this->suppFileId = $suppFile->getId();
         } else {
             $fileId = 0;
         }
     }
     // Notifications
     import('lib.pkp.classes.notification.NotificationManager');
     $notificationManager = new NotificationManager();
     $journal =& Request::getJournal();
     $url = Request::url($journal->getPath(), 'sectionEditor', 'submission', array($this->article->getArticleId(), 'submissionReview'));
     $sectionEditorsDao =& DAORegistry::getDAO('SectionEditorsDAO');
     $sectionEditors =& $sectionEditorsDao->getEditorsBySectionId($journal->getId(), $this->article->getSectionId());
     foreach ($sectionEditors as $sectionEditor) {
         $notificationSectionEditors[] = array('id' => $sectionEditor->getId());
     }
     if ($suppFile->getData('type') == 'Raw Data File') {
         $message = 'notification.type.rawDataSubmitted';
     }
     if ($suppFile->getData('type') == 'Other Supplementary Research Output') {
         $message = 'notification.type.otherSuppResearchOutput';
     }
     if ($suppFile->getData('type') == 'Progress Report') {
         $message = 'notification.type.progressReport';
     }
     if ($suppFile->getData('type') == 'Completion Report') {
         $message = 'notification.type.completionReport';
     }
     if ($suppFile->getData('type') == 'Extension Request') {
         $message = 'notification.type.extensionRequest';
     }
     if ($this->getData('type') == "Supp File") {
         $message = 'notification.type.suppFile';
     }
     if (isset($message)) {
         foreach ($notificationSectionEditors as $userRole) {
             $notificationManager->createNotification($userRole['id'], $message, $this->article->getLocalizedTitle(), $url, 1, NOTIFICATION_TYPE_SUPP_FILE_MODIFIED);
         }
     }
     return $this->suppFileId;
 }
开发者ID:elavaud,项目名称:hrp_ct,代码行数:75,代码来源:SuppFileForm.inc.php


注:本文中的ArticleSearchIndex::indexSuppFileMetadata方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。