本文整理汇总了PHP中ArticleSearchIndex类的典型用法代码示例。如果您正苦于以下问题:PHP ArticleSearchIndex类的具体用法?PHP ArticleSearchIndex怎么用?PHP ArticleSearchIndex使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ArticleSearchIndex类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: rebuildSearchIndex
/**
* Rebuild the search index.
* @return boolean
*/
function rebuildSearchIndex()
{
import('classes.search.ArticleSearchIndex');
$articleSearchIndex = new ArticleSearchIndex();
$articleSearchIndex->rebuildIndex();
return true;
}
开发者ID:laelnasan,项目名称:UTFPR-ojs,代码行数:11,代码来源:Upgrade.inc.php
示例2: indexSubmissionFiles
/**
* indexes the files associated with a submission.
* @param $submission Submission
* @param $submissionFile SubmissionFile
*/
function indexSubmissionFiles($submission, $submissionFile)
{
// update the submission's search index if this submission is published.
if ($submission->getDatePublished()) {
import('classes.search.ArticleSearchIndex');
ArticleSearchIndex::articleFilesChanged($submission);
}
}
开发者ID:jalperin,项目名称:ojs,代码行数:13,代码来源:ManageFileApiHandler.inc.php
示例3: removeFileIndex
/**
* @copydoc PKPManageFileApiHandler::removeFileIndex()
*/
function removeFileIndex($submission, $submissionFile)
{
// update the submission's search index if this was a proof file
if ($submissionFile->getFileStage() == SUBMISSION_FILE_PROOF) {
import('lib.pkp.classes.search.SubmissionSearch');
import('classes.search.ArticleSearchIndex');
ArticleSearchIndex::deleteTextIndex($submission->getId(), SUBMISSION_SEARCH_GALLEY_FILE, $submissionFile->getFileId());
}
}
开发者ID:selwyntcy,项目名称:ojs,代码行数:12,代码来源:ManageFileApiHandler.inc.php
示例4: execute
/**
* Rebuild the search index for all articles in all journals.
*/
function execute()
{
// If we have an argument that this must be a journal path.
$journal = null;
if (count($this->argv)) {
$journalPath = array_shift($this->argv);
$journalDao =& DAORegistry::getDAO('JournalDAO');
$journal =& $journalDao->getJournalByPath($journalPath);
if (!$journal) {
die(__('search.cli.rebuildIndex.unknownJournal', array('journalPath' => $journalPath)) . "\n");
}
}
// Register a router hook so that we can construct
// useful URLs to journal content.
HookRegistry::register('Request::getBaseUrl', array(&$this, 'callbackBaseUrl'));
// Let the search implementation re-build the index.
$articleSearchIndex = new ArticleSearchIndex();
$articleSearchIndex->rebuildIndex(true, $journal);
}
开发者ID:EreminDm,项目名称:water-cao,代码行数:22,代码来源:rebuildSearchIndex.php
示例5: deleteSubmission
/**
* Delete a submission.
* @param $args array
* @param $request PKPRequest
*/
function deleteSubmission($args, $request)
{
$articleId = (int) array_shift($args);
$this->validate($request, $articleId);
$authorSubmission =& $this->submission;
$this->setupTemplate($request, true);
// If the submission is incomplete, allow the author to delete it.
if ($authorSubmission->getSubmissionProgress() != 0) {
import('classes.file.ArticleFileManager');
$articleFileManager = new ArticleFileManager($articleId);
$articleFileManager->deleteArticleTree();
$articleDao =& DAORegistry::getDAO('ArticleDAO');
$articleDao->deleteArticleById($articleId);
import('classes.search.ArticleSearchIndex');
$articleSearchIndex = new ArticleSearchIndex();
$articleSearchIndex->articleDeleted($articleId);
$articleSearchIndex->articleChangesFinished();
}
$request->redirect(null, null, 'index');
}
开发者ID:yuricampos,项目名称:ojs,代码行数:25,代码来源:TrackSubmissionHandler.inc.php
示例6: execute
/**
* Save changes to submission.
* @param $request PKPRequest
*/
function execute($request)
{
parent::execute($request);
$submission = $this->getSubmission();
$submissionDao = Application::getSubmissionDAO();
$submission->setSectionId($this->getData('sectionId'));
$submissionDao->updateObject($submission);
if ($submission->getDatePublished()) {
import('classes.search.ArticleSearchIndex');
ArticleSearchIndex::articleMetadataChanged($submission);
}
}
开发者ID:mosvits,项目名称:ojs,代码行数:16,代码来源:SubmissionMetadataViewForm.inc.php
示例7: import
/**
* @see Filter::process()
* @param $document DOMDocument|string
* @return array Array of imported documents
*/
function &process(&$document)
{
$importedObjects =& parent::process($document);
// Index imported content
import('classes.search.ArticleSearchIndex');
foreach ($importedObjects as $submission) {
assert(is_a($submission, 'Submission'));
ArticleSearchIndex::articleMetadataChanged($submission);
ArticleSearchIndex::submissionFilesChanged($submission);
}
ArticleSearchIndex::articleChangesFinished();
return $importedObjects;
}
开发者ID:pkp,项目名称:ojs,代码行数:18,代码来源:NativeXmlArticleFilter.inc.php
示例8: execute
/**
* Rebuild the search index for all articles in all journals.
*/
function execute()
{
// Check whether we have (optional) switches.
$switches = array();
while (count($this->argv) && substr($this->argv[0], 0, 1) == '-') {
$switches[] = array_shift($this->argv);
}
// If we have another argument that this must be a journal path.
$journal = null;
if (count($this->argv)) {
$journalPath = array_shift($this->argv);
$journalDao = DAORegistry::getDAO('JournalDAO');
$journal = $journalDao->getByPath($journalPath);
if (!$journal) {
die(__('search.cli.rebuildIndex.unknownJournal', array('journalPath' => $journalPath)) . "\n");
}
}
// Register a router hook so that we can construct
// useful URLs to journal content.
HookRegistry::register('Request::getBaseUrl', array($this, 'callbackBaseUrl'));
// Let the search implementation re-build the index.
$articleSearchIndex = new ArticleSearchIndex();
$articleSearchIndex->rebuildIndex(true, $journal, $switches);
}
开发者ID:laelnasan,项目名称:UTFPR-ojs,代码行数:27,代码来源:rebuildSearchIndex.php
示例9: execute
/**
* Save the metadata.
*/
function execute($request)
{
parent::execute($request);
$submission = $this->getSubmission();
$submissionDao = Application::getSubmissionDAO();
$publishedArticleDao = DAORegistry::getDAO('PublishedArticleDAO');
$publishedArticle = $publishedArticleDao->getPublishedArticleByArticleId($submission->getId(), null, false);
$isExistingEntry = $publishedArticle ? true : false;
if ($isExistingEntry) {
// Update the search index for this published article.
import('classes.search.ArticleSearchIndex');
ArticleSearchIndex::articleMetadataChanged($submission);
}
$submissionDao->updateObject($submission);
}
开发者ID:mosvits,项目名称:ojs,代码行数:18,代码来源:IssueEntrySubmissionReviewForm.inc.php
示例10: execute
//.........这里部分代码省略.........
}
}
$article->setHideCoverPageAbstract($hideCoverPageAbstract, null);
// Localized
$article->setDiscipline($this->getData('discipline'), null);
// Localized
$article->setSubjectClass($this->getData('subjectClass'), null);
// Localized
$article->setSubject($this->getData('subject'), null);
// Localized
$article->setCoverageGeo($this->getData('coverageGeo'), null);
// Localized
$article->setCoverageChron($this->getData('coverageChron'), null);
// Localized
$article->setCoverageSample($this->getData('coverageSample'), null);
// Localized
$article->setType($this->getData('type'), null);
// Localized
$article->setLanguage($this->getData('language'));
// Localized
$article->setSponsor($this->getData('sponsor'), null);
// Localized
$article->setCitations($this->getData('citations'));
if ($this->isEditor) {
$article->setHideAuthor($this->getData('hideAuthor') ? $this->getData('hideAuthor') : 0);
}
// consider the additional field names from the public identifer plugins
import('classes.plugins.PubIdPluginHelper');
$pubIdPluginHelper = new PubIdPluginHelper();
$pubIdPluginHelper->execute($this, $article);
// Update authors
$authors = $this->getData('authors');
for ($i = 0, $count = count($authors); $i < $count; $i++) {
if ($authors[$i]['authorId'] > 0) {
// Update an existing author
$author =& $authorDao->getAuthor($authors[$i]['authorId'], $article->getId());
$isExistingAuthor = true;
} else {
// Create a new author
if (checkPhpVersion('5.0.0')) {
// *5488* PHP4 Requires explicit instantiation-by-reference
$author = new Author();
} else {
$author =& new Author();
}
$isExistingAuthor = false;
}
if ($author != null) {
$author->setSubmissionId($article->getId());
$author->setFirstName($authors[$i]['firstName']);
$author->setMiddleName($authors[$i]['middleName']);
$author->setLastName($authors[$i]['lastName']);
$author->setAffiliation($authors[$i]['affiliation'], null);
// Localized
$author->setCountry($authors[$i]['country']);
$author->setEmail($authors[$i]['email']);
$author->setData('orcid', $authors[$i]['orcid']);
$author->setUrl($authors[$i]['url']);
if (array_key_exists('competingInterests', $authors[$i])) {
$author->setCompetingInterests($authors[$i]['competingInterests'], null);
// Localized
}
$author->setBiography($authors[$i]['biography'], null);
// Localized
$author->setPrimaryContact($this->getData('primaryContact') == $i ? 1 : 0);
$author->setSequence($authors[$i]['seq']);
HookRegistry::call('Submission::Form::MetadataForm::Execute', array(&$author, &$authors[$i]));
if ($isExistingAuthor) {
$authorDao->updateAuthor($author);
} else {
$authorDao->insertAuthor($author);
}
unset($author);
}
}
// Remove deleted authors
$deletedAuthors = preg_split('/:/', $this->getData('deletedAuthors'), -1, PREG_SPLIT_NO_EMPTY);
for ($i = 0, $count = count($deletedAuthors); $i < $count; $i++) {
$authorDao->deleteAuthorById($deletedAuthors[$i], $article->getId());
}
if ($this->isEditor) {
$article->setCopyrightHolder($this->getData('copyrightHolder'), null);
$article->setCopyrightYear($this->getData('copyrightYear'));
$article->setLicenseURL($this->getData('licenseURL'));
}
parent::execute();
// Save the article
$articleDao->updateArticle($article);
// Update search index
import('classes.search.ArticleSearchIndex');
$articleSearchIndex = new ArticleSearchIndex();
$articleSearchIndex->articleMetadataChanged($article);
$articleSearchIndex->articleChangesFinished();
// Update references list if it changed.
$rawCitationList = $article->getCitations();
if ($previousRawCitationList != $rawCitationList) {
$citationDao->importCitations($request, ASSOC_TYPE_ARTICLE, $article->getId(), $rawCitationList);
}
return $article->getId();
}
开发者ID:EreminDm,项目名称:water-cao,代码行数:101,代码来源:MetadataForm.inc.php
示例11: 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
示例12: publishIssue
/**
* Publish issue
* @param $args array
* @param $request Request
*/
function publishIssue($args, $request)
{
$issue = $this->getAuthorizedContextObject(ASSOC_TYPE_ISSUE);
$issueId = $issue->getId();
$journal = $request->getJournal();
$journalId = $journal->getId();
$articleSearchIndex = null;
if (!$issue->getPublished()) {
$confirmationText = __('editor.issues.confirmPublish');
import('controllers.grid.pubIds.form.AssignPublicIdentifiersForm');
$formTemplate = $this->getAssignPublicIdentifiersFormTemplate();
$assignPublicIdentifiersForm = new AssignPublicIdentifiersForm($formTemplate, $issue, true, $confirmationText);
if (!$request->getUserVar('confirmed')) {
// Display assign pub ids modal
$assignPublicIdentifiersForm->initData($args, $request);
return new JSONMessage(true, $assignPublicIdentifiersForm->fetch($request));
}
// Asign pub ids
$assignPublicIdentifiersForm->readInputData();
$assignPublicIdentifiersForm->execute($request);
// Set the status of any attendant queued articles to STATUS_PUBLISHED.
$publishedArticleDao = DAORegistry::getDAO('PublishedArticleDAO');
$articleDao = DAORegistry::getDAO('ArticleDAO');
$publishedArticles = $publishedArticleDao->getPublishedArticles($issueId);
foreach ($publishedArticles as $publishedArticle) {
$article = $articleDao->getById($publishedArticle->getId());
if ($article && $article->getStatus() == STATUS_QUEUED) {
$article->setStatus(STATUS_PUBLISHED);
$article->stampStatusModified();
$articleDao->updateObject($article);
if (!$articleSearchIndex) {
import('classes.search.ArticleSearchIndex');
$articleSearchIndex = new ArticleSearchIndex();
}
$articleSearchIndex->articleMetadataChanged($publishedArticle);
}
// delete article tombstone
$tombstoneDao = DAORegistry::getDAO('DataObjectTombstoneDAO');
$tombstoneDao->deleteByDataObjectId($article->getId());
}
}
$issue->setCurrent(1);
$issue->setPublished(1);
$issue->setDatePublished(Core::getCurrentDate());
// If subscriptions with delayed open access are enabled then
// update open access date according to open access delay policy
if ($journal->getSetting('publishingMode') == PUBLISHING_MODE_SUBSCRIPTION && $journal->getSetting('enableDelayedOpenAccess')) {
$delayDuration = $journal->getSetting('delayedOpenAccessDuration');
$delayYears = (int) floor($delayDuration / 12);
$delayMonths = (int) fmod($delayDuration, 12);
$curYear = date('Y');
$curMonth = date('n');
$curDay = date('j');
$delayOpenAccessYear = $curYear + $delayYears + (int) floor(($curMonth + $delayMonths) / 12);
$delayOpenAccessMonth = (int) fmod($curMonth + $delayMonths, 12);
$issue->setAccessStatus(ISSUE_ACCESS_SUBSCRIPTION);
$issue->setOpenAccessDate(date('Y-m-d H:i:s', mktime(0, 0, 0, $delayOpenAccessMonth, $curDay, $delayOpenAccessYear)));
}
$issueDao = DAORegistry::getDAO('IssueDAO');
$issueDao->updateCurrent($journalId, $issue);
if ($articleSearchIndex) {
$articleSearchIndex->articleChangesFinished();
}
// Send a notification to associated users
import('classes.notification.NotificationManager');
$notificationManager = new NotificationManager();
$notificationUsers = array();
$userGroupDao = DAORegistry::getDAO('UserGroupDAO');
$allUsers = $userGroupDao->getUsersByContextId($journalId);
while ($user = $allUsers->next()) {
$notificationUsers[] = array('id' => $user->getId());
}
foreach ($notificationUsers as $userRole) {
$notificationManager->createNotification($request, $userRole['id'], NOTIFICATION_TYPE_PUBLISHED_ISSUE, $journalId);
}
$notificationManager->sendToMailingList($request, $notificationManager->createNotification($request, UNSUBSCRIBED_USER_NOTIFICATION, NOTIFICATION_TYPE_PUBLISHED_ISSUE, $journalId));
return DAO::getDataChangedEvent();
}
开发者ID:pkp,项目名称:ojs,代码行数:83,代码来源:IssueGridHandler.inc.php
示例13: execute
/**
* Save changes to article.
*/
function execute()
{
$articleDao =& DAORegistry::getDAO('ArticleDAO');
$journal = Request::getJournal();
// Update article
$article =& $this->article;
if ($this->getData('commentsToEditor') != '') {
$article->setCommentsToEditor($this->getData('commentsToEditor'));
}
$article->setDateSubmitted(Core::getCurrentDate());
$article->setSubmissionProgress(0);
$article->stampStatusModified();
$articleDao->updateArticle($article);
// Designate this as the review version by default.
$authorSubmissionDao =& DAORegistry::getDAO('AuthorSubmissionDAO');
$authorSubmission =& $authorSubmissionDao->getAuthorSubmission($article->getArticleId());
AuthorAction::designateReviewVersion($authorSubmission, true);
unset($authorSubmission);
// Create additional submission mangement records
$copyeditorSubmissionDao =& DAORegistry::getDAO('CopyeditorSubmissionDAO');
$copyeditorSubmission =& new CopyeditorSubmission();
$copyeditorSubmission->setArticleId($article->getArticleId());
$copyeditorSubmission->setCopyeditorId(0);
$copyeditorSubmissionDao->insertCopyeditorSubmission($copyeditorSubmission);
$layoutDao =& DAORegistry::getDAO('LayoutAssignmentDAO');
$layoutAssignment =& new LayoutAssignment();
$layoutAssignment->setArticleId($article->getArticleId());
$layoutAssignment->setEditorId(0);
$layoutDao->insertLayoutAssignment($layoutAssignment);
$proofAssignmentDao =& DAORegistry::getDAO('ProofAssignmentDAO');
$proofAssignment =& new ProofAssignment();
$proofAssignment->setArticleId($article->getArticleId());
$proofAssignment->setProofreaderId(0);
$proofAssignmentDao->insertProofAssignment($proofAssignment);
$sectionEditors = $this->assignEditors($article);
$user =& Request::getUser();
// Update search index
import('search.ArticleSearchIndex');
ArticleSearchIndex::indexArticleMetadata($article);
ArticleSearchIndex::indexArticleFiles($article);
// Send author notification email
import('mail.ArticleMailTemplate');
$mail =& new ArticleMailTemplate($article, 'SUBMISSION_ACK');
$mail->setFrom($journal->getSetting('contactEmail'), $journal->getSetting('contactName'));
if ($mail->isEnabled()) {
$mail->addRecipient($user->getEmail(), $user->getFullName());
// If necessary, BCC the acknowledgement to someone.
if ($journal->getSetting('copySubmissionAckPrimaryContact')) {
$mail->addBcc($journal->getSetting('contactEmail'), $journal->getSetting('contactName'));
}
if ($journal->getSetting('copySubmissionAckSpecified')) {
$copyAddress = $journal->getSetting('copySubmissionAckAddress');
if (!empty($copyAddress)) {
$mail->addBcc($copyAddress);
}
}
// Also BCC automatically assigned section editors
foreach ($sectionEditors as $sectionEditorEntry) {
$sectionEditor =& $sectionEditorEntry['user'];
$mail->addBcc($sectionEditor->getEmail(), $sectionEditor->getFullName());
unset($sectionEditor);
}
$mail->assignParams(array('authorName' => $user->getFullName(), 'authorUsername' => $user->getUsername(), 'editorialContactSignature' => $journal->getSetting('contactName') . "\n" . $journal->getJournalTitle(), 'submissionUrl' => Request::url(null, 'author', 'submission', $article->getArticleId())));
$mail->send();
}
import('article.log.ArticleLog');
import('article.log.ArticleEventLogEntry');
ArticleLog::logEvent($this->articleId, ARTICLE_LOG_ARTICLE_SUBMIT, ARTICLE_LOG_TYPE_AUTHOR, $user->getUserId(), 'log.author.submitted', array('submissionId' => $article->getArticleId(), 'authorName' => $user->getFullName()));
return $this->articleId;
}
开发者ID:LiteratimBi,项目名称:jupitertfn,代码行数:73,代码来源:AuthorSubmitStep5Form.inc.php
示例14: execute
/**
* Save the metadata and store the catalog data for this published
* monograph.
*/
function execute($request)
{
parent::execute($request);
$submission = $this->getSubmission();
$context = $request->getContext();
$waivePublicationFee = $request->getUserVar('waivePublicationFee') ? true : false;
if ($waivePublicationFee) {
$markAsPaid = $request->getUserVar('markAsPaid');
import('classes.payment.ojs.OJSPaymentManager');
$paymentManager = new OJSPaymentManager($request);
$user = $request->getUser();
// Get a list of author user IDs
$authorUserIds = array();
$stageAssignmentDao = DAORegistry::getDAO('StageAssignmentDAO');
$submitterAssignments = $stageAssignmentDao->getBySubmissionAndRoleId($submission->getId(), ROLE_ID_AUTHOR);
$submitterAssignment = $submitterAssignments->next();
assert($submitterAssignment);
// At least one author should be assigned
$queuedPayment =& $paymentManager->createQueuedPayment($context->getId(), PAYMENT_TYPE_PUBLICATION, $markAsPaid ? $submitterAssignment->getUserId() : $user->getId(), $submission->getId(), $markAsPaid ? $context->getSetting('publicationFee') : 0, $markAsPaid ? $context->getSetting('currency') : '');
$paymentManager->queuePayment($queuedPayment);
// Since this is a waiver, fulfill the payment immediately
$paymentManager->fulfillQueuedPayment($request, $queuedPayment, $markAsPaid ? 'ManualPayment' : 'Waiver');
} else {
// Get the issue for publication.
$issueDao = DAORegistry::getDAO('IssueDAO');
$issueId = $this->getData('issueId');
$issue = $issueDao->getById($issueId, $context->getId());
$sectionDao = DAORegistry::getDAO('SectionDAO');
$publishedArticleDao = DAORegistry::getDAO('PublishedArticleDAO');
$publishedArticle = $publishedArticleDao->getPublishedArticleByArticleId($submission->getId(), null, false);
/* @var $publishedArticle PublishedArticle */
if ($publishedArticle) {
if (!$issue || !$issue->getPublished()) {
$fromIssue = $issueDao->getById($publishedArticle->getIssueId(), $context->getId());
if ($fromIssue->getPublished()) {
// Insert article tombstone
import('classes.article.ArticleTombstoneManager');
$articleTombstoneManager = new ArticleTombstoneManager();
$articleTombstoneManager->insertArticleTombstone($submission, $context);
}
}
}
import('classes.search.ArticleSearchIndex');
$articleSearchIndex = new ArticleSearchIndex();
// define the access status for the article if none is set.
$accessStatus = $this->getData('accessStatus') != '' ? $this->getData('accessStatus') : ARTICLE_ACCESS_ISSUE_DEFAULT;
$articleDao = DAORegistry::getDAO('ArticleDAO');
if (!is_null($this->getData('pages'))) {
$submission->setPages($this->getData('pages'));
}
if ($issue) {
// Schedule against an issue.
if ($publishedArticle) {
$publishedArticle->setIssueId($issueId);
$publishedArticle->setSequence(REALLY_BIG_NUMBER);
$publishedArticle->setDatePublished($this->getData('datePublished'));
$publishedArticle->setAccessStatus($accessStatus);
$publishedArticleDao->updatePublishedArticle($publishedArticle);
// Re-index the published article metadata.
$articleSearchIndex->articleMetadataChanged($publishedArticle);
} else {
$publishedArticle = $publishedArticleDao->newDataObject();
$publishedArticle->setId($submission->getId());
$publishedArticle->setIssueId($issueId);
$publishedArticle->setDatePublished(Core::getCurrentDate());
$publishedArticle->setSequence(REALLY_BIG_NUMBER);
$publishedArticle->setAccessStatus($accessStatus);
$publishedArticleDao->insertObject($publishedArticle);
// If we're using custom section ordering, and if this is the first
// article published in a section, make sure we enter a custom ordering
// for it. (Default at the end of the list.)
if ($sectionDao->customSectionOrderingExists($issueId)) {
if ($sectionDao->getCustomSectionOrder($issueId, $submission->getSectionId()) === null) {
$sectionDao->insertCustomSectionOrder($issueId, $submission->getSectionId(), REALLY_BIG_NUMBER);
$sectionDao->resequenceCustomSectionOrders($issueId);
}
}
// Index the published article metadata and files for the first time.
$articleSearchIndex->articleMetadataChanged($publishedArticle);
$articleSearchIndex->submissionFilesChanged($publishedArticle);
}
} else {
if ($publishedArticle) {
// This was published elsewhere; make sure we don't
// mess up sequencing information.
$issueId = $publishedArticle->getIssueId();
$publishedArticleDao->deletePublishedArticleByArticleId($submission->getId());
// Delete the article from the search index.
$articleSearchIndex->submissionFileDeleted($submission->getId());
}
}
if ($this->getData('attachPermissions')) {
$submission->setCopyrightYear($this->getData('copyrightYear'));
$submission->setCopyrightHolder($this->getData('copyrightHolder'), null);
// Localized
$submission->setLicenseURL($this->getData('licenseURL'));
//.........这里部分代码省略.........
开发者ID:jnugent,项目名称:ojs,代码行数:101,代码来源:IssueEntryPublicationMetadataForm.inc.php
示例15: updateSection
/**
* Changes the section.
* @param $submission object
* @param $sectionId int
*/
function updateSection($submission, $sectionId)
{
if (HookRegistry::call('SectionEditorAction::updateSection', array(&$submission, &$sectionId))) {
return;
}
$submissionDao =& DAORegistry::getDAO('SectionEditorSubmissionDAO');
$submission->setSectionId($sectionId);
// FIXME validate this ID?
$submissionDao->updateSectionEditorSubmission($submission);
// Reindex the submission (may be required to update section-specific ranking).
$articleSearchIndex = new ArticleSearchIndex();
$articleSearchIndex->articleMetadataChanged($submission);
$articleSearchIndex->articleChangesFinished();
}
开发者ID:yuricampos,项目名称:ojs,代码行数:19,代码来源:SectionEditorAction.inc.php
示例16: execute
/**
* Rebuild the search index for all articles in all journals.
*/
function execute()
{
ArticleSearchIndex::rebuildIndex(true);
}
开发者ID:JovanyJeff,项目名称:hrp,代码行数:7,代码来源:rebuildSearchIndex.php
示例17: execute
//.........这里部分代码省略.........
/* @var $authorDao AuthorDAO */
$authorDao->insertObject($author);
}
}
}
// Add the submission files as galleys
import('lib.pkp.classes.file.TemporaryFileManager');
import('classes.file.ArticleFileManager');
$tempFileIds = $this->getData('tempFileId');
$temporaryFileManager = new TemporaryFileManager();
$articleFileManager = new ArticleFileManager($articleId);
$designatedPrimary = false;
foreach (array_keys($tempFileIds) as $locale) {
$temporaryFile = $temporaryFileManager->getFile($tempFileIds[$locale], $user->getId());
$fileId = null;
if ($temporaryFile) {
$fileId = $articleFileManager->temporaryFileToArticleFile($temporaryFile, SUBMISSION_FILE_SUBMISSION);
$fileType = $temporaryFile->getFileType();
if (strstr($fileType, 'html')) {
import('classes.article.ArticleHTMLGalley');
$galley = new ArticleHTMLGalley();
} else {
import('classes.article.ArticleGalley');
$galley = new ArticleGalley();
}
$galley->setArticleId($articleId);
$galley->setFileId($fileId);
$galley->setLocale($locale);
if ($galley->isHTMLGalley()) {
$galley->setLabel('HTML');
} else {
if (strstr($fileType, 'pdf')) {
$galley->setLabel('PDF');
} else {
if (strstr($fileType, 'postscript')) {
$galley->setLabel('Postscript');
} else {
if (strstr($fileType, 'xml')) {
$galley->setLabel('XML');
} else {
$galley->setLabel(__('common.untitled'));
}
}
}
}
$galleyDao = DAORegistry::getDAO('ArticleGalleyDAO');
$galleyDao->insertGalley($galley);
if (!$designatedPrimary) {
$article->setSubmissionFileId($fileId);
if ($locale == $journal->getPrimaryLocale()) {
// Used to make sure that *some* file
// is designated Review Version, but
// preferrably the primary locale.
$designatedPrimary = true;
}
}
}
// Update file search index
import('classes.search.ArticleSearchIndex');
$articleSearchIndex = new ArticleSearchIndex();
if (isset($galley)) {
$articleSearchIndex->articleFileChanged($galley->getArticleId(), SUBMISSION_SEARCH_GALLEY_FILE, $galley->getFileId());
}
$articleSearchIndex->articleChangesFinished();
}
// Designate this as the review version by default.
$authorSubmissionDao = DAORegistry::getDAO('AuthorSubmissionDAO');
$authorSubmission =& $authorSubmissionDao->getAuthorSubmission($articleId);
import('classes.submission.author.AuthorAction');
AuthorAction::designateReviewVersion($authorSubmission, true);
// Accept the submission
$sectionEditorSubmission =& $sectionEditorSubmissionDao->getSectionEditorSubmission($articleId);
$articleFileManager = new ArticleFileManager($articleId);
import('classes.submission.sectionEditor.SectionEditorAction');
assert(false);
// FIXME: $decisionLabels missing from call below.
SectionEditorAction::recordDecision($this->request, $sectionEditorSubmission, SUBMISSION_EDITOR_DECISION_ACCEPT);
import('classes.author.form.submit.AuthorSubmitForm');
AuthorSubmitForm::assignEditors($article);
$articleDao->updateObject($article);
// Add to end of editing queue
import('classes.submission.editor.EditorAction');
if (isset($galley)) {
EditorAction::expediteSubmission($article, $this->request);
}
if ($this->getData('destination') == "issue") {
// Add to an existing issue
$issueId = $this->getData('issueId');
$this->scheduleForPublication($articleId, $issueId);
}
// Import the references list.
$citationDao = DAORegistry::getDAO('CitationDAO');
$rawCitationList = $article->getCitations();
$citationDao->importCitations($request, ASSOC_TYPE_ARTICLE, $articleId, $rawCitationList);
// Index article.
import('classes.search.ArticleSearchIndex');
$articleSearchIndex = new ArticleSearchIndex();
$articleSearchIndex->articleMetadataChanged($article);
$articleSearchIndex->articleChangesFinished();
}
开发者ID:jalperin,项目名称:ojs,代码行数:101,代码来源:QuickSubmitForm.inc.php
示例18: rebuildSearchIndex
/**
* Rebuild the article search index.
* Note: Rebuilds index for _all_ journals (non-optimal, but shouldn't be a problem)
* Based on code from tools/rebuildSearchIndex.php
*/
function rebuildSearchIndex()
{
if ($this->hasOption('verbose')) {
printf("Rebuilding search index\n");
}
ArticleSearchIndex::rebuildIndex();
}
开发者ID:Jouper,项目名称:jouper,代码行数:12,代码来源:ImportOJS1.inc.php
示例19: rebuildSearchIndex
/**
* Rebuild the search index.
* @return boolean
*/
function rebuildSearchIndex()
{
import('classes.search.ArticleSearchIndex');
ArticleSearchIndex::rebuildIndex();
return true;
}
开发者ID:reconciler,项目名称:ojs,代码行数:10,代码来源:Upgrade.inc.php
示例20: testIndexSubmissionFilesViaPluginHook
/**
* @covers ArticleSearchIndex
*/
public function testIndexSubmissionFilesViaPluginHook()
{
// Diverting to the search plugin hook.
HookRegistry::register('ArticleSearchIndex::submissionFilesChanged', array($this, 'callbackIndexSubmissionFiles'));
// The file DAOs should not be called.
$this->registerFileDAOs(false);
// Simulate indexing via hook.
$article = new Article();
$articleSearchIndex = new ArticleSearchIndex();
$articleSearchIndex->submissionFilesChanged($article);
// Test whether the hook was called.
$calledHooks = HookRegistry::getCalledHooks();
$lastHook = array_pop($calledHooks);
self::assertEquals('ArticleSearchIndex::submissionFilesChanged', $lastHook[0]);
// Remove the test hook.
HookRegistry::clear('ArticleSearchIndex::submissionFilesChanged');
}
开发者ID:mosvits,项目名称:ojs,代码行数:20,代码来源:ArticleSearchIndexTest.php
注:本文中的ArticleSearchIndex类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论