예제 #1
0
 public function testTranslationOfOpusReferenceFields()
 {
     $model = new Opus_Reference();
     $fieldNames = $model->describe();
     foreach ($fieldNames as $name) {
         $key = $this->helper->getKeyForField('Opus_Reference', $name);
         $this->assertTrue($this->translate->isTranslated($key), 'Translation key \'' . $key . '\' is missing.');
     }
 }
예제 #2
0
 /**
  *
  * @deprecated
  */
 private function storeReferenceObject($dataKey, $dataValue)
 {
     //TODO: probably no valid storing possible because a label is missing
     //a reference should be a new datatype with implicit fields value and label
     $reference = new Opus_Reference();
     $reference->setValue($dataValue);
     $reference->setLabel("no Label given");
     try {
         if (strstr($dataKey, 'Isbn')) {
             $this->_document->addReferenceIsbn($reference);
         } else {
             if (strstr($dataKey, 'Urn')) {
                 $this->_document->addReferenceUrn($reference);
             } else {
                 if (strstr($dataKey, 'Doi')) {
                     $this->_document->addReferenceDoi($reference);
                 } else {
                     if (strstr($dataKey, 'Handle')) {
                         $this->_document->addReferenceHandle($reference);
                     } else {
                         if (strstr($dataKey, 'Url')) {
                             $this->_document->addReferenceUrl($reference);
                         } else {
                             if (strstr($dataKey, 'Issn')) {
                                 $this->_document->addReferenceIssn($reference);
                             } else {
                                 if (strstr($dataKey, 'StdDoi')) {
                                     $this->_document->addReferenceStdDoi($reference);
                                 } else {
                                     if (strstr($dataKey, 'CrisLink')) {
                                         $this->_document->addReferenceCrisLink($reference);
                                     } else {
                                         if (strstr($dataKey, 'SplashUrl')) {
                                             $this->_document->addReferenceSplashUrl($reference);
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     } catch (Opus_Model_Exception $e) {
         $this->_log->err("could not add reference of type {$dataKey} with value {$dataValue} to document " . $this->_docId . " : " . $e->getMessage());
         throw new Publish_Model_Exception();
     }
 }