當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Opus_Document::getType方法代碼示例

本文整理匯總了PHP中Opus_Document::getType方法的典型用法代碼示例。如果您正苦於以下問題:PHP Opus_Document::getType方法的具體用法?PHP Opus_Document::getType怎麽用?PHP Opus_Document::getType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Opus_Document的用法示例。


在下文中一共展示了Opus_Document::getType方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getDocType

 /**
  * Returns document type.
  * @return string
  */
 public function getDocType()
 {
     try {
         return htmlspecialchars($this->document->getType());
     } catch (Exception $e) {
         return 'undefined';
     }
 }
開發者ID:alexukua,項目名稱:opus4,代碼行數:12,代碼來源:DocumentAdapter.php

示例2: testGetRecordOaiDcDoc91DocType

 /**
  * Regression test for OPUSVIER-2379
  */
 public function testGetRecordOaiDcDoc91DocType()
 {
     $doc = new Opus_Document(91);
     $this->assertEquals("report", $doc->getType(), "testdata changed");
     $this->dispatch('/oai?verb=GetRecord&metadataPrefix=oai_dc&identifier=oai::91');
     $this->assertResponseCode(200);
     $response = $this->getResponse();
     $badStrings = array("Exception", "Error", "Stacktrace", "badVerb");
     $this->checkForCustomBadStringsInHtml($response->getBody(), $badStrings);
     $xpath = $this->prepareXpathFromResultString($response->getBody());
     // Regression test for OPUSVIER-2379 (show doc-type:report)
     $elements = $xpath->query('//oai_dc:dc/dc:type[text()="doc-type:report"]');
     $this->assertEquals(1, $elements->length, "Unexpected count for doc-type:report");
 }
開發者ID:esmo,項目名稱:opus4-application,代碼行數:17,代碼來源:IndexControllerTest.php

示例3: ucfirst

    echo "parameter --enrichment not specified; function will now exit" . PHP_EOL;
    exit;
} else {
    $enrichmentField = $options['enrichment'];
}
$getType = 'getTitle' . ucfirst(strtolower($options['type']));
$addType = 'addTitle' . ucfirst(strtolower($options['type']));
if ($dryrun) {
    _log("TEST RUN: NO DATA WILL BE MODIFIED");
}
$docFinder = new Opus_DocumentFinder();
$docIds = $docFinder->setEnrichmentKeyExists($enrichmentField)->ids();
_log(count($docIds) . " documents found");
foreach ($docIds as $docId) {
    $doc = new Opus_Document($docId);
    if ($doc->getType() == $doctype || $doctype == '') {
        $enrichments = $doc->getEnrichment();
        foreach ($enrichments as $enrichment) {
            $enrichmentArray = $enrichment->toArray();
            if ($enrichmentArray['KeyName'] == $enrichmentField) {
                $titles = $doc->{$getType}();
                if (count($titles) > 0) {
                    _log('Title ' . ucfirst(strtolower($options['type'])) . ' already exists for Document #' . $docId . '. Skipping.. ');
                } else {
                    $title = $doc->{$addType}();
                    $title->setValue($enrichmentArray['Value']);
                    if (!$dryrun) {
                        $doc->store();
                    }
                    _log('Document #' . $docId . ' updated');
                }
開發者ID:alexukua,項目名稱:opus4,代碼行數:31,代碼來源:create_title_from_enrichment.php

示例4: populateFromModel

 /**
  * Befuellt das Formular anhand der Metadaten eines Dokuments.
  * @param Opus_Document $document
  */
 public function populateFromModel($document)
 {
     $datesHelper = $this->getDatesHelper();
     $this->getElement(self::ELEMENT_LANGUAGE)->setValue($document->getLanguage());
     $this->getElement(self::ELEMENT_TYPE)->setValue($document->getType());
     $date = $datesHelper->getDateString($document->getCompletedDate());
     $this->getElement(self::ELEMENT_COMPLETED_DATE)->setValue($date);
     $this->getElement(self::ELEMENT_COMPLETED_YEAR)->setValue($document->getCompletedYear());
     $date = $datesHelper->getDateString($document->getPublishedDate());
     $this->getElement(self::ELEMENT_PUBLISHED_DATE)->setValue($date);
     $this->getElement(self::ELEMENT_PUBLISHED_YEAR)->setValue($document->getPublishedYear());
     $date = $datesHelper->getDateString($document->getEmbargoDate());
     $this->getElement(self::ELEMENT_EMBARGO_DATE)->setValue($date);
 }
開發者ID:alexukua,項目名稱:opus4,代碼行數:18,代碼來源:General.php

示例5: getTemplateForDocument

 /**
  *
  * @param Opus_Document $document
  * @throws CitationExport_Module_Exception in case of an invalid parameter value
  *
  * @return string
  */
 public function getTemplateForDocument($document, $outputFormat)
 {
     if (is_null($outputFormat)) {
         throw new CitationExport_Model_Exception('invalid_format');
     }
     $stylesheetsAvailable = $this->getAvailableStylesheets();
     // check for document type specific stylesheet
     $pos = array_search($outputFormat . '_' . $document->getType(), $stylesheetsAvailable);
     if ($pos !== FALSE) {
         return $stylesheetsAvailable[$pos] . '.xslt';
     }
     // check for generic stylesheet for format
     $pos = array_search($outputFormat, $stylesheetsAvailable);
     if ($pos !== FALSE) {
         return $stylesheetsAvailable[$pos] . '.xslt';
     }
     // no applicable stylesheet found
     throw new CitationExport_Model_Exception('invalid_format');
 }
開發者ID:belapp,項目名稱:opus4-application,代碼行數:26,代碼來源:Helper.php

示例6: getTemplateForDocument

 /**
  *
  * @param Opus_Document $document
  * @throws CitationExport_Module_Exception in case of an invalid parameter value
  *
  * @return string
  */
 private function getTemplateForDocument($document)
 {
     $outputFormat = $this->getRequest()->getParam('output');
     if (is_null($outputFormat)) {
         throw new CitationExport_Model_Exception('invalid_format');
     }
     $stylesheetsAvailable = array();
     $dir = new DirectoryIterator($this->view->getScriptPath('index'));
     foreach ($dir as $file) {
         if ($file->isFile() && $file->getFilename() != '.' && $file->getFilename() != '..' && $file->isReadable()) {
             array_push($stylesheetsAvailable, $file->getBasename('.xslt'));
         }
     }
     $pos = array_search($outputFormat . '_' . $document->getType(), $stylesheetsAvailable);
     if ($pos !== FALSE) {
         return $stylesheetsAvailable[$pos] . '.xslt';
     }
     $pos = array_search($outputFormat, $stylesheetsAvailable);
     if ($pos !== FALSE) {
         return $stylesheetsAvailable[$pos] . '.xslt';
     }
     throw new CitationExport_Model_Exception('invalid_format');
 }
開發者ID:alexukua,項目名稱:opus4,代碼行數:30,代碼來源:IndexController.php


注:本文中的Opus_Document::getType方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。