Add namespaces to all common classes

This commit is contained in:
Sebastian Meyer 2019-03-13 17:55:50 +01:00
parent 52336a8ebe
commit bb7ac1ba6e
32 changed files with 273 additions and 188 deletions

View File

@ -291,7 +291,7 @@ abstract class AbstractPlugin extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin
*/
protected function parseTS($string = '') {
$parser = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\TypoScript\\Parser\\TypoScriptParser');
$parser = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser::class);
$parser->parse($string);

View File

@ -163,7 +163,7 @@ final class Document {
protected $metadataArrayLoaded = FALSE;
/**
* This holds the XML file's METS part as SimpleXMLElement object
* This holds the XML file's METS part as \SimpleXMLElement object
*
* @var \SimpleXMLElement
* @access protected
@ -336,9 +336,9 @@ final class Document {
protected $uid = 0;
/**
* This holds the whole XML file as SimpleXMLElement object
* This holds the whole XML file as \SimpleXMLElement object
*
* @var SimpleXMLElement
* @var \SimpleXMLElement
* @access protected
*/
protected $xml;
@ -784,7 +784,7 @@ final class Document {
$class = $this->formats[$this->dmdSec[$dmdId]['type']]['class'];
// Get the metadata from class.
if (class_exists($class) && ($obj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance($class)) instanceof FormatInterface) {
if (class_exists($class) && ($obj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance($class)) instanceof MetadataInterface) {
$obj->extractMetadata($this->dmdSec[$dmdId]['xml'], $metadata);
@ -835,10 +835,10 @@ final class Document {
''
);
// We need a DOMDocument here, because SimpleXML doesn't support XPath functions properly.
// We need a \DOMDocument here, because SimpleXML doesn't support XPath functions properly.
$domNode = dom_import_simplexml($this->dmdSec[$dmdId]['xml']);
$domXPath = new DOMXPath($domNode->ownerDocument);
$domXPath = new \DOMXPath($domNode->ownerDocument);
$this->registerNamespaces($domXPath);
@ -848,7 +848,7 @@ final class Document {
// Set metadata field's value(s).
if ($resArray['format'] > 0 && !empty($resArray['xpath']) && ($values = $domXPath->evaluate($resArray['xpath'], $domNode))) {
if ($values instanceof DOMNodeList && $values->length > 0) {
if ($values instanceof \DOMNodeList && $values->length > 0) {
$metadata[$resArray['index_name']] = array ();
@ -858,7 +858,7 @@ final class Document {
}
} elseif (!($values instanceof DOMNodeList)) {
} elseif (!($values instanceof \DOMNodeList)) {
$metadata[$resArray['index_name']] = array (trim((string) $values));
@ -881,11 +881,11 @@ final class Document {
if ($resArray['format'] > 0 && !empty($resArray['xpath_sorting']) && ($values = $domXPath->evaluate($resArray['xpath_sorting'], $domNode))) {
if ($values instanceof DOMNodeList && $values->length > 0) {
if ($values instanceof \DOMNodeList && $values->length > 0) {
$metadata[$resArray['index_name'].'_sorting'][0] = trim((string) $values->item(0)->nodeValue);
} elseif (!($values instanceof DOMNodeList)) {
} elseif (!($values instanceof \DOMNodeList)) {
$metadata[$resArray['index_name'].'_sorting'][0] = trim((string) $values);
@ -1337,11 +1337,11 @@ final class Document {
}
/**
* Register all available namespaces for a SimpleXMLElement object
* Register all available namespaces for a \SimpleXMLElement object
*
* @access public
*
* @param SimpleXMLElement|DOMXPath &$obj: SimpleXMLElement or DOMXPath object
* @param \SimpleXMLElement|\DOMXPath &$obj: \SimpleXMLElement or \DOMXPath object
*
* @return void
*/
@ -1349,12 +1349,12 @@ final class Document {
$this->loadFormats();
// Do we have a SimpleXMLElement or DOMXPath object?
if ($obj instanceof SimpleXMLElement) {
// Do we have a \SimpleXMLElement or \DOMXPath object?
if ($obj instanceof \SimpleXMLElement) {
$method = 'registerXPathNamespace';
} elseif ($obj instanceof DOMXPath) {
} elseif ($obj instanceof \DOMXPath) {
$method = 'registerNamespace';
@ -1563,7 +1563,7 @@ final class Document {
if (!defined('TYPO3_cliMode')) {
$message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
'TYPO3\\CMS\\Core\\Messaging\\FlashMessage',
\TYPO3\CMS\Core\Messaging\FlashMessage::class,
htmlspecialchars(sprintf(Helper::getLL('flash.newCollection'), $collection, $substUid[$collNewUid])),
Helper::getLL('flash.attention', TRUE),
\TYPO3\CMS\Core\Messaging\FlashMessage::INFO,
@ -1624,7 +1624,7 @@ final class Document {
if (!defined('TYPO3_cliMode')) {
$message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
'TYPO3\\CMS\\Core\\Messaging\\FlashMessage',
\TYPO3\CMS\Core\Messaging\FlashMessage::class,
htmlspecialchars(sprintf(Helper::getLL('flash.newLibrary'), $owner, $ownerUid)),
Helper::getLL('flash.attention', TRUE),
\TYPO3\CMS\Core\Messaging\FlashMessage::INFO,
@ -1792,7 +1792,7 @@ final class Document {
if (!defined('TYPO3_cliMode')) {
$message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
'TYPO3\\CMS\\Core\\Messaging\\FlashMessage',
\TYPO3\CMS\Core\Messaging\FlashMessage::class,
htmlspecialchars(sprintf(Helper::getLL('flash.documentSaved'), $metadata['title'][0], $this->uid)),
Helper::getLL('flash.done', TRUE),
\TYPO3\CMS\Core\Messaging\FlashMessage::OK,
@ -2055,7 +2055,7 @@ final class Document {
*
* @access protected
*
* @return SimpleXMLElement The XML's METS part as SimpleXMLElement object
* @return \SimpleXMLElement The XML's METS part as \SimpleXMLElement object
*/
protected function _getMets() {
@ -2743,7 +2743,7 @@ final class Document {
*/
public function __sleep() {
// SimpleXMLElement objects can't be serialized, thus save the XML as string for serialization
// \SimpleXMLElement objects can't be serialized, thus save the XML as string for serialization
$this->asXML = $this->xml->asXML();
return array ('uid', 'pid', 'recordId', 'parentId', 'asXML');
@ -2759,7 +2759,7 @@ final class Document {
*/
public function __toString() {
$xml = new DOMDocument('1.0', 'utf-8');
$xml = new \DOMDocument('1.0', 'utf-8');
$xml->appendChild($xml->importNode(dom_import_simplexml($this->mets), TRUE));

View File

@ -20,11 +20,11 @@ namespace Kitodo\Dlf\Common;
* @subpackage dlf
* @access public
*/
class DocumentList implements ArrayAccess, Countable, Iterator, \TYPO3\CMS\Core\SingletonInterface {
class DocumentList implements \ArrayAccess, \Countable, \Iterator, \TYPO3\CMS\Core\SingletonInterface {
/**
* This holds the number of documents in the list
* @see Countable
* @see \Countable
*
* @var integer
* @access protected
@ -33,7 +33,7 @@ class DocumentList implements ArrayAccess, Countable, Iterator, \TYPO3\CMS\Core\
/**
* This holds the list entries in sorted order
* @see ArrayAccess
* @see \ArrayAccess
*
* @var array
* @access protected
@ -50,7 +50,7 @@ class DocumentList implements ArrayAccess, Countable, Iterator, \TYPO3\CMS\Core\
/**
* This holds the current list position
* @see Iterator
* @see \Iterator
*
* @var integer
* @access protected
@ -107,7 +107,7 @@ class DocumentList implements ArrayAccess, Countable, Iterator, \TYPO3\CMS\Core\
/**
* This counts the elements
* @see Countable::count()
* @see \Countable::count()
*
* @access public
*
@ -121,7 +121,7 @@ class DocumentList implements ArrayAccess, Countable, Iterator, \TYPO3\CMS\Core\
/**
* This returns the current element
* @see Iterator::current()
* @see \Iterator::current()
*
* @access public
*
@ -374,7 +374,7 @@ class DocumentList implements ArrayAccess, Countable, Iterator, \TYPO3\CMS\Core\
/**
* This returns the current position
* @see Iterator::key()
* @see \Iterator::key()
*
* @access public
*
@ -473,7 +473,7 @@ class DocumentList implements ArrayAccess, Countable, Iterator, \TYPO3\CMS\Core\
/**
* This increments the current list position
* @see Iterator::next()
* @see \Iterator::next()
*
* @access public
*
@ -487,7 +487,7 @@ class DocumentList implements ArrayAccess, Countable, Iterator, \TYPO3\CMS\Core\
/**
* This checks if an offset exists
* @see ArrayAccess::offsetExists()
* @see \ArrayAccess::offsetExists()
*
* @access public
*
@ -503,7 +503,7 @@ class DocumentList implements ArrayAccess, Countable, Iterator, \TYPO3\CMS\Core\
/**
* This returns the element at the given offset
* @see ArrayAccess::offsetGet()
* @see \ArrayAccess::offsetGet()
*
* @access public
*
@ -533,7 +533,7 @@ class DocumentList implements ArrayAccess, Countable, Iterator, \TYPO3\CMS\Core\
/**
* This sets the element at the given offset
* @see ArrayAccess::offsetSet()
* @see \ArrayAccess::offsetSet()
*
* @access public
*
@ -655,7 +655,7 @@ class DocumentList implements ArrayAccess, Countable, Iterator, \TYPO3\CMS\Core\
/**
* This resets the list position
* @see Iterator::rewind()
* @see \Iterator::rewind()
*
* @access public
*
@ -803,7 +803,7 @@ class DocumentList implements ArrayAccess, Countable, Iterator, \TYPO3\CMS\Core\
/**
* This unsets the element at the given offset
* @see ArrayAccess::offsetUnset()
* @see \ArrayAccess::offsetUnset()
*
* @access public
*
@ -824,7 +824,7 @@ class DocumentList implements ArrayAccess, Countable, Iterator, \TYPO3\CMS\Core\
/**
* This checks if the current list position is valid
* @see Iterator::valid()
* @see \Iterator::valid()
*
* @access public
*

View File

@ -1,4 +1,6 @@
<?php
namespace Kitodo\Dlf\Common;
/**
* (c) Kitodo. Key to digital objects e.V. <contact@kitodo.org>
*
@ -9,19 +11,16 @@
* LICENSE.txt file that was distributed with this source code.
*/
use Kitodo\Dlf\Common\Document;
use Kitodo\Dlf\Common\Helper;
/**
* Document Type Check for usage as Typoscript Condition.
* Document Type Checker for usage as Typoscript Condition.
* @see dlf/ext_localconf.php->user_dlf_docTypeCheck()
*
* @author Alexander Bigga <alexander.bigga@slub-dresden.de>
* @package TYPO3
* @subpackage tx_dlf
* @subpackage dlf
* @access public
*/
class tx_dlf_doctype {
class DocumentTypeCheck {
/**
* This holds the current document
@ -173,7 +172,7 @@ class tx_dlf_doctype {
if (TYPO3_DLOG) {
\TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_doctype->loadDocument()] Failed to load document with UID "'.$this->piVars['id'].'"', $this->extKey, SYSLOG_SEVERITY_WARNING);
\TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[\Kitodo\Dlf\Common\DocumentTypeCheck->loadDocument()] Failed to load document with UID "'.$this->piVars['id'].'"', $this->extKey, SYSLOG_SEVERITY_WARNING);
}
@ -208,7 +207,7 @@ class tx_dlf_doctype {
if (TYPO3_DLOG) {
\TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_doctype->loadDocument()] Failed to load document with record ID "'.$this->piVars['recordId'].'"', $this->extKey, SYSLOG_SEVERITY_WARNING);
\TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[\Kitodo\Dlf\Common\DocumentTypeCheck->loadDocument()] Failed to load document with record ID "'.$this->piVars['recordId'].'"', $this->extKey, SYSLOG_SEVERITY_WARNING);
}

View File

@ -27,10 +27,10 @@ interface FulltextInterface {
*
* @access public
*
* @param SimpleXMLElement $xml: The XML to extract the metadata from
* @param \SimpleXMLElement $xml: The XML to extract the metadata from
*
* @return string The raw unformatted fulltext
*/
public function getRawText(SimpleXMLElement $xml);
public function getRawText(\SimpleXMLElement $xml);
}

View File

@ -49,7 +49,7 @@ class Helper {
*/
public static function addMessage($message) {
$flashMessageService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessageService');
$flashMessageService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Messaging\FlashMessageService::class);
$flashMessageService->getMessageQueueByIdentifier()->enqueue($message);
@ -337,7 +337,7 @@ class Helper {
if (TYPO3_MODE === 'FE' || TYPO3_MODE === 'BE') {
// Initialize backend session with CLI user's rights.
$userObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Authentication\\BackendUserAuthentication');
$userObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Authentication\BackendUserAuthentication::class);
$userObj->dontSetCookie = TRUE;
@ -915,7 +915,7 @@ class Helper {
public static function processDB(array $data = array (), array $cmd = array (), $reverseOrder = FALSE, $be_user = FALSE) {
// Instantiate TYPO3 core engine.
$tce = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\DataHandling\\DataHandler');
$tce = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\DataHandling\DataHandler::class);
// Set some configuration variables.
$tce->stripslashes_values = FALSE;
@ -997,7 +997,7 @@ class Helper {
*/
public static function renderFlashMessages() {
$flashMessageService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessageService');
$flashMessageService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Messaging\FlashMessageService::class);
$content = '';
@ -1300,7 +1300,7 @@ class Helper {
} else {
$pageRepository = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Page\\PageRepository');
$pageRepository = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Frontend\Page\PageRepository::class);
$GLOBALS['TSFE']->includeTCA();

View File

@ -180,7 +180,7 @@ class Indexer {
if (!$errors) {
$message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
'TYPO3\\CMS\\Core\\Messaging\\FlashMessage',
\TYPO3\CMS\Core\Messaging\FlashMessage::class,
htmlspecialchars(sprintf(Helper::getLL('flash.documentIndexed'), $resArray['title'], $doc->uid)),
Helper::getLL('flash.done', TRUE),
\TYPO3\CMS\Core\Messaging\FlashMessage::OK,
@ -190,7 +190,7 @@ class Indexer {
} else {
$message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
'TYPO3\\CMS\\Core\\Messaging\\FlashMessage',
\TYPO3\CMS\Core\Messaging\FlashMessage::class,
htmlspecialchars(sprintf(Helper::getLL('flash.documentNotIndexed'), $resArray['title'], $doc->uid)),
Helper::getLL('flash.error', TRUE),
\TYPO3\CMS\Core\Messaging\FlashMessage::ERROR,
@ -205,12 +205,12 @@ class Indexer {
return $errors;
} catch (Exception $e) {
} catch (\Exception $e) {
if (!defined('TYPO3_cliMode')) {
$message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
'TYPO3\\CMS\\Core\\Messaging\\FlashMessage',
\TYPO3\CMS\Core\Messaging\FlashMessage::class,
Helper::getLL('flash.solrException', TRUE).'<br />'.htmlspecialchars($e->getMessage()),
Helper::getLL('flash.error', TRUE),
\TYPO3\CMS\Core\Messaging\FlashMessage::ERROR,
@ -236,7 +236,7 @@ class Indexer {
if (!defined('TYPO3_cliMode')) {
$message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
'TYPO3\\CMS\\Core\\Messaging\\FlashMessage',
\TYPO3\CMS\Core\Messaging\FlashMessage::class,
Helper::getLL('flash.solrNoConnection', TRUE),
Helper::getLL('flash.warning', TRUE),
\TYPO3\CMS\Core\Messaging\FlashMessage::WARNING,
@ -301,12 +301,12 @@ class Indexer {
$updateQuery->addCommit();
self::$solr->service->update($updateQuery);
} catch (Exception $e) {
} catch (\Exception $e) {
if (!defined('TYPO3_cliMode')) {
$message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
'TYPO3\\CMS\\Core\\Messaging\\FlashMessage',
\TYPO3\CMS\Core\Messaging\FlashMessage::class,
Helper::getLL('flash.solrException', TRUE).'<br />'.htmlspecialchars($e->getMessage()),
Helper::getLL('flash.error', TRUE),
\TYPO3\CMS\Core\Messaging\FlashMessage::ERROR,
@ -332,7 +332,7 @@ class Indexer {
if (!defined('TYPO3_cliMode')) {
$message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
'TYPO3\\CMS\\Core\\Messaging\\FlashMessage',
\TYPO3\CMS\Core\Messaging\FlashMessage::class,
Helper::getLL('flash.solrNoConnection', TRUE),
Helper::getLL('flash.error', TRUE),
\TYPO3\CMS\Core\Messaging\FlashMessage::ERROR,
@ -356,7 +356,7 @@ class Indexer {
if (!defined('TYPO3_cliMode')) {
$message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
'TYPO3\\CMS\\Core\\Messaging\\FlashMessage',
\TYPO3\CMS\Core\Messaging\FlashMessage::class,
htmlspecialchars(sprintf(Helper::getLL('flash.documentDeleted'), $title, $uid)),
Helper::getLL('flash.done', TRUE),
\TYPO3\CMS\Core\Messaging\FlashMessage::OK,
@ -632,12 +632,12 @@ class Indexer {
$updateQuery->addDocument($solrDoc);
self::$solr->service->update($updateQuery);
} catch (Exception $e) {
} catch (\Exception $e) {
if (!defined('TYPO3_cliMode')) {
$message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
'TYPO3\\CMS\\Core\\Messaging\\FlashMessage',
\TYPO3\CMS\Core\Messaging\FlashMessage::class,
Helper::getLL('flash.solrException', TRUE).'<br />'.htmlspecialchars($e->getMessage()),
Helper::getLL('flash.error', TRUE),
\TYPO3\CMS\Core\Messaging\FlashMessage::ERROR,
@ -799,12 +799,12 @@ class Indexer {
$updateQuery->addDocument($solrDoc);
self::$solr->service->update($updateQuery);
} catch (Exception $e) {
} catch (\Exception $e) {
if (!defined('TYPO3_cliMode')) {
$message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
'TYPO3\\CMS\\Core\\Messaging\\FlashMessage',
\TYPO3\CMS\Core\Messaging\FlashMessage::class,
Helper::getLL('flash.solrException', TRUE).'<br />'.htmlspecialchars($e->getMessage()),
Helper::getLL('flash.error', TRUE),
\TYPO3\CMS\Core\Messaging\FlashMessage::ERROR,

View File

@ -12,7 +12,7 @@ namespace Kitodo\Dlf\Common;
*/
/**
* Format interface for the 'dlf' extension.
* Metadata interface for the 'dlf' extension.
*
* @author Sebastian Meyer <sebastian.meyer@slub-dresden.de>
* @package TYPO3
@ -20,18 +20,18 @@ namespace Kitodo\Dlf\Common;
* @access public
* @abstract
*/
interface FormatInterface {
interface MetadataInterface {
/**
* This extracts metadata from XML
*
* @access public
*
* @param SimpleXMLElement $xml: The XML to extract the metadata from
* @param \SimpleXMLElement $xml: The XML to extract the metadata from
* @param array &$metadata: The metadata array to fill
*
* @return void
*/
public function extractMetadata(SimpleXMLElement $xml, array &$metadata);
public function extractMetadata(\SimpleXMLElement $xml, array &$metadata);
}

View File

@ -105,7 +105,7 @@ class Solr {
*/
public static function escapeQuery($query) {
$helper = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('Solarium\Core\Query\Helper');
$helper = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\Solarium\Core\Query\Helper::class);
// Escape query phrase or term.
if (preg_match('/^".*"$/', $query)) {
@ -661,7 +661,7 @@ class Solr {
);
// Instantiate Solarium\Client class.
$this->service = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('Solarium\Client', $config);
$this->service = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\Solarium\Client::class, $config);
// Check if connection is established.
$ping = $this->service->createPing();
@ -676,7 +676,7 @@ class Solr {
// Instantiation successful!
$this->ready = TRUE;
} catch (Exception $e) {
} catch (\Exception $e) {
// Nothing to do here.

View File

@ -1,4 +1,6 @@
<?php
namespace Kitodo\Dlf\Formats;
/**
* (c) Kitodo. Key to digital objects e.V. <contact@kitodo.org>
*
@ -10,25 +12,25 @@
*/
/**
* Fulltext format class 'tx_dlf_alto' for the 'dlf' extension.
* Fulltext ALTO format class for the 'dlf' extension.
*
* @author Sebastian Meyer <sebastian.meyer@slub-dresden.de>
* @package TYPO3
* @subpackage tx_dlf
* @subpackage dlf
* @access public
*/
class tx_dlf_alto implements \Kitodo\Dlf\Common\FulltextInterface {
class Alto implements \Kitodo\Dlf\Common\FulltextInterface {
/**
* This extracts the fulltext data from ALTO XML
*
* @access public
*
* @param SimpleXMLElement $xml: The XML to extract the raw text from
* @param \SimpleXMLElement $xml: The XML to extract the raw text from
*
* @return string The raw unformatted fulltext
*/
public function getRawText(SimpleXMLElement $xml) {
public function getRawText(\SimpleXMLElement $xml) {
$xml->registerXPathNamespace('alto', 'http://www.loc.gov/standards/alto/ns-v2#');

View File

@ -1,4 +1,6 @@
<?php
namespace Kitodo\Dlf\Formats;
/**
* (c) Kitodo. Key to digital objects e.V. <contact@kitodo.org>
*
@ -10,26 +12,26 @@
*/
/**
* Metadata format class 'tx_dlf_mods' for the 'dlf' extension.
* Metadata MODS format class for the 'dlf' extension.
*
* @author Sebastian Meyer <sebastian.meyer@slub-dresden.de>
* @package TYPO3
* @subpackage tx_dlf
* @subpackage dlf
* @access public
*/
class tx_dlf_mods implements \Kitodo\Dlf\Common\FormatInterface {
class Mods implements \Kitodo\Dlf\Common\MetadataInterface {
/**
* This extracts the essential MODS metadata from XML
*
* @access public
*
* @param SimpleXMLElement $xml: The XML to extract the metadata from
* @param \SimpleXMLElement $xml: The XML to extract the metadata from
* @param array &$metadata: The metadata array to fill
*
* @return void
*/
public function extractMetadata(SimpleXMLElement $xml, array &$metadata) {
public function extractMetadata(\SimpleXMLElement $xml, array &$metadata) {
$xml->registerXPathNamespace('mods', 'http://www.loc.gov/mods/v3');

View File

@ -1,4 +1,6 @@
<?php
namespace Kitodo\Dlf\Formats;
/**
* (c) Kitodo. Key to digital objects e.V. <contact@kitodo.org>
*
@ -10,26 +12,26 @@
*/
/**
* Metadata format class 'tx_dlf_teihdr' for the 'dlf' extension.
* Metadata TEI-Header format class for the 'dlf' extension.
*
* @author Sebastian Meyer <sebastian.meyer@slub-dresden.de>
* @package TYPO3
* @subpackage tx_dlf
* @subpackage dlf
* @access public
*/
class tx_dlf_teihdr implements \Kitodo\Dlf\Common\FormatInterface {
class TeiHeader implements \Kitodo\Dlf\Common\MetadataInterface {
/**
* This extracts the essential TEIHDR metadata from XML
*
* @access public
*
* @param SimpleXMLElement $xml: The XML to extract the metadata from
* @param \SimpleXMLElement $xml: The XML to extract the metadata from
* @param array &$metadata: The metadata array to fill
*
* @return void
*/
public function extractMetadata(SimpleXMLElement $xml, array &$metadata) {
public function extractMetadata(\SimpleXMLElement $xml, array &$metadata) {
$xml->registerXPathNamespace('teihdr', 'http://www.tei-c.org/ns/1.0');

View File

@ -1,4 +1,6 @@
<?php
namespace Kitodo\Dlf\Hooks;
/**
* (c) Kitodo. Key to digital objects e.V. <contact@kitodo.org>
*
@ -13,14 +15,14 @@ use Kitodo\Dlf\Common\Helper;
use Kitodo\Dlf\Common\Solr;
/**
* Hooks and helper for the extension manager.
* Hooks and helper for \TYPO3\CMS\Core\TypoScript\ConfigurationForm
*
* @author Sebastian Meyer <sebastian.meyer@slub-dresden.de>
* @package TYPO3
* @subpackage tx_dlf
* @subpackage dlf
* @access public
*/
class tx_dlf_em {
class ConfigurationForm {
/**
* This holds the current configuration
@ -84,7 +86,7 @@ class tx_dlf_em {
if (is_array($status)) {
$message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
'TYPO3\\CMS\\Core\\Messaging\\FlashMessage',
\TYPO3\CMS\Core\Messaging\FlashMessage::class,
sprintf($GLOBALS['LANG']->getLL('solr.status'), (string) $status[0]),
$GLOBALS['LANG']->getLL('solr.connected'),
($status[0] == 0 ? \TYPO3\CMS\Core\Messaging\FlashMessage::OK : \TYPO3\CMS\Core\Messaging\FlashMessage::WARNING),
@ -100,7 +102,7 @@ class tx_dlf_em {
}
$message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
'TYPO3\\CMS\\Core\\Messaging\\FlashMessage',
\TYPO3\CMS\Core\Messaging\FlashMessage::class,
sprintf($GLOBALS['LANG']->getLL('solr.error'), $url),
$GLOBALS['LANG']->getLL('solr.notConnected'),
\TYPO3\CMS\Core\Messaging\FlashMessage::WARNING,
@ -157,7 +159,7 @@ class tx_dlf_em {
$usrUid = $resArray['uid'];
$message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
'TYPO3\\CMS\\Core\\Messaging\\FlashMessage',
\TYPO3\CMS\Core\Messaging\FlashMessage::class,
$GLOBALS['LANG']->getLL('cliUserGroup.usrOkayMsg'),
$GLOBALS['LANG']->getLL('cliUserGroup.usrOkay'),
\TYPO3\CMS\Core\Messaging\FlashMessage::OK,
@ -189,7 +191,7 @@ class tx_dlf_em {
$usrUid = $resArray['uid'];
$message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
'TYPO3\\CMS\\Core\\Messaging\\FlashMessage',
\TYPO3\CMS\Core\Messaging\FlashMessage::class,
$GLOBALS['LANG']->getLL('cliUserGroup.usrConfiguredMsg'),
$GLOBALS['LANG']->getLL('cliUserGroup.usrConfigured'),
\TYPO3\CMS\Core\Messaging\FlashMessage::INFO,
@ -199,7 +201,7 @@ class tx_dlf_em {
} else {
$message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
'TYPO3\\CMS\\Core\\Messaging\\FlashMessage',
\TYPO3\CMS\Core\Messaging\FlashMessage::class,
$GLOBALS['LANG']->getLL('cliUserGroup.usrNotConfiguredMsg'),
$GLOBALS['LANG']->getLL('cliUserGroup.usrNotConfigured'),
\TYPO3\CMS\Core\Messaging\FlashMessage::ERROR,
@ -211,7 +213,7 @@ class tx_dlf_em {
} else {
$message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
'TYPO3\\CMS\\Core\\Messaging\\FlashMessage',
\TYPO3\CMS\Core\Messaging\FlashMessage::class,
$GLOBALS['LANG']->getLL('cliUserGroup.usrNotConfiguredMsg'),
$GLOBALS['LANG']->getLL('cliUserGroup.usrNotConfigured'),
\TYPO3\CMS\Core\Messaging\FlashMessage::ERROR,
@ -246,7 +248,7 @@ class tx_dlf_em {
$usrUid = $substUid[$tempUid];
$message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
'TYPO3\\CMS\\Core\\Messaging\\FlashMessage',
\TYPO3\CMS\Core\Messaging\FlashMessage::class,
$GLOBALS['LANG']->getLL('cliUserGroup.usrCreatedMsg'),
$GLOBALS['LANG']->getLL('cliUserGroup.usrCreated'),
\TYPO3\CMS\Core\Messaging\FlashMessage::INFO,
@ -256,7 +258,7 @@ class tx_dlf_em {
} else {
$message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
'TYPO3\\CMS\\Core\\Messaging\\FlashMessage',
\TYPO3\CMS\Core\Messaging\FlashMessage::class,
$GLOBALS['LANG']->getLL('cliUserGroup.usrNotCreatedMsg'),
$GLOBALS['LANG']->getLL('cliUserGroup.usrNotCreated'),
\TYPO3\CMS\Core\Messaging\FlashMessage::ERROR,
@ -268,7 +270,7 @@ class tx_dlf_em {
} else {
$message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
'TYPO3\\CMS\\Core\\Messaging\\FlashMessage',
\TYPO3\CMS\Core\Messaging\FlashMessage::class,
$GLOBALS['LANG']->getLL('cliUserGroup.usrNotCreatedMsg'),
$GLOBALS['LANG']->getLL('cliUserGroup.usrNotCreated'),
\TYPO3\CMS\Core\Messaging\FlashMessage::ERROR,
@ -368,7 +370,7 @@ class tx_dlf_em {
$grpUid = $resArray['uid'];
$message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
'TYPO3\\CMS\\Core\\Messaging\\FlashMessage',
\TYPO3\CMS\Core\Messaging\FlashMessage::class,
$GLOBALS['LANG']->getLL('cliUserGroup.grpOkayMsg'),
$GLOBALS['LANG']->getLL('cliUserGroup.grpOkay'),
\TYPO3\CMS\Core\Messaging\FlashMessage::OK,
@ -403,7 +405,7 @@ class tx_dlf_em {
$grpUid = $resArray['uid'];
$message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
'TYPO3\\CMS\\Core\\Messaging\\FlashMessage',
\TYPO3\CMS\Core\Messaging\FlashMessage::class,
$GLOBALS['LANG']->getLL('cliUserGroup.grpConfiguredMsg'),
$GLOBALS['LANG']->getLL('cliUserGroup.grpConfigured'),
\TYPO3\CMS\Core\Messaging\FlashMessage::INFO,
@ -413,7 +415,7 @@ class tx_dlf_em {
} else {
$message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
'TYPO3\\CMS\\Core\\Messaging\\FlashMessage',
\TYPO3\CMS\Core\Messaging\FlashMessage::class,
$GLOBALS['LANG']->getLL('cliUserGroup.grpNotConfiguredMsg'),
$GLOBALS['LANG']->getLL('cliUserGroup.grpNotConfigured'),
\TYPO3\CMS\Core\Messaging\FlashMessage::ERROR,
@ -425,7 +427,7 @@ class tx_dlf_em {
} else {
$message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
'TYPO3\\CMS\\Core\\Messaging\\FlashMessage',
\TYPO3\CMS\Core\Messaging\FlashMessage::class,
$GLOBALS['LANG']->getLL('cliUserGroup.grpNotConfiguredMsg'),
$GLOBALS['LANG']->getLL('cliUserGroup.grpNotConfigured'),
\TYPO3\CMS\Core\Messaging\FlashMessage::ERROR,
@ -461,7 +463,7 @@ class tx_dlf_em {
$grpUid = $substUid[$tempUid];
$message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
'TYPO3\\CMS\\Core\\Messaging\\FlashMessage',
\TYPO3\CMS\Core\Messaging\FlashMessage::class,
$GLOBALS['LANG']->getLL('cliUserGroup.grpCreatedMsg'),
$GLOBALS['LANG']->getLL('cliUserGroup.grpCreated'),
\TYPO3\CMS\Core\Messaging\FlashMessage::INFO,
@ -471,7 +473,7 @@ class tx_dlf_em {
} else {
$message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
'TYPO3\\CMS\\Core\\Messaging\\FlashMessage',
\TYPO3\CMS\Core\Messaging\FlashMessage::class,
$GLOBALS['LANG']->getLL('cliUserGroup.grpNotCreatedMsg'),
$GLOBALS['LANG']->getLL('cliUserGroup.grpNotCreated'),
\TYPO3\CMS\Core\Messaging\FlashMessage::ERROR,
@ -483,7 +485,7 @@ class tx_dlf_em {
} else {
$message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
'TYPO3\\CMS\\Core\\Messaging\\FlashMessage',
\TYPO3\CMS\Core\Messaging\FlashMessage::class,
$GLOBALS['LANG']->getLL('cliUserGroup.grpNotCreatedMsg'),
$GLOBALS['LANG']->getLL('cliUserGroup.grpNotCreated'),
\TYPO3\CMS\Core\Messaging\FlashMessage::ERROR,
@ -528,7 +530,7 @@ class tx_dlf_em {
if (is_executable(PATH_typo3.'cli_dispatch.phpsh')) {
$message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
'TYPO3\\CMS\\Core\\Messaging\\FlashMessage',
\TYPO3\CMS\Core\Messaging\FlashMessage::class,
$GLOBALS['LANG']->getLL('cliUserGroup.cliOkayMsg'),
$GLOBALS['LANG']->getLL('cliUserGroup.cliOkay'),
\TYPO3\CMS\Core\Messaging\FlashMessage::OK,
@ -538,7 +540,7 @@ class tx_dlf_em {
} else {
$message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
'TYPO3\\CMS\\Core\\Messaging\\FlashMessage',
\TYPO3\CMS\Core\Messaging\FlashMessage::class,
$GLOBALS['LANG']->getLL('cliUserGroup.cliNotOkayMsg'),
$GLOBALS['LANG']->getLL('cliUserGroup.cliNotOkay'),
\TYPO3\CMS\Core\Messaging\FlashMessage::ERROR,
@ -595,7 +597,7 @@ class tx_dlf_em {
'type' => 'MODS',
'root' => 'mods',
'namespace' => 'http://www.loc.gov/mods/v3',
'class' => 'tx_dlf_mods'
'class' => 'Kitodo\\Dlf\\Formats\\Mods'
);
}
@ -608,7 +610,7 @@ class tx_dlf_em {
'type' => 'TEIHDR',
'root' => 'teiHeader',
'namespace' => 'http://www.tei-c.org/ns/1.0',
'class' => 'tx_dlf_teihdr'
'class' => 'Kitodo\\Dlf\\Formats\\TeiHeader'
);
}
@ -621,7 +623,7 @@ class tx_dlf_em {
'type' => 'ALTO',
'root' => 'alto',
'namespace' => 'http://www.loc.gov/standards/alto/ns-v2#',
'class' => 'tx_dlf_alto'
'class' => 'Kitodo\\Dlf\\Formats\\Alto'
);
}
@ -634,7 +636,7 @@ class tx_dlf_em {
if (!empty($substUid)) {
$message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
'TYPO3\\CMS\\Core\\Messaging\\FlashMessage',
\TYPO3\CMS\Core\Messaging\FlashMessage::class,
$GLOBALS['LANG']->getLL('metadataFormats.nsCreatedMsg'),
$GLOBALS['LANG']->getLL('metadataFormats.nsCreated'),
\TYPO3\CMS\Core\Messaging\FlashMessage::INFO,
@ -644,7 +646,7 @@ class tx_dlf_em {
} else {
$message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
'TYPO3\\CMS\\Core\\Messaging\\FlashMessage',
\TYPO3\CMS\Core\Messaging\FlashMessage::class,
$GLOBALS['LANG']->getLL('metadataFormats.nsNotCreatedMsg'),
$GLOBALS['LANG']->getLL('metadataFormats.nsNotCreated'),
\TYPO3\CMS\Core\Messaging\FlashMessage::ERROR,
@ -656,7 +658,7 @@ class tx_dlf_em {
} else {
$message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
'TYPO3\\CMS\\Core\\Messaging\\FlashMessage',
\TYPO3\CMS\Core\Messaging\FlashMessage::class,
$GLOBALS['LANG']->getLL('metadataFormats.nsOkayMsg'),
$GLOBALS['LANG']->getLL('metadataFormats.nsOkay'),
\TYPO3\CMS\Core\Messaging\FlashMessage::OK,

View File

@ -1,4 +1,6 @@
<?php
namespace Kitodo\Dlf\Hooks;
/**
* (c) Kitodo. Key to digital objects e.V. <contact@kitodo.org>
*
@ -14,14 +16,14 @@ use Kitodo\Dlf\Common\Helper;
use Kitodo\Dlf\Common\Solr;
/**
* Hooks and helper for the '\TYPO3\CMS\Core\DataHandling\DataHandler' library.
* Hooks and helper for \TYPO3\CMS\Core\DataHandling\DataHandler
*
* @author Sebastian Meyer <sebastian.meyer@slub-dresden.de>
* @package TYPO3
* @subpackage tx_dlf
* @subpackage dlf
* @access public
*/
class tx_dlf_tcemain {
class DataHandler {
/**
* Field post-processing hook for the process_datamap() method.
@ -161,7 +163,7 @@ class tx_dlf_tcemain {
if (TYPO3_DLOG) {
\TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_tcemain->processDatamap_postProcessFieldArray('.$status.', '.$table.', '.$id.', [data], ['.get_class($pObj).'])] Could not create new Apache Solr core "dlfCore'.$coreNumber.'"', $this->extKey, SYSLOG_SEVERITY_ERROR, $fieldArray);
\TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[\Kitodo\Dlf\Hooks\DataHandler->processDatamap_postProcessFieldArray('.$status.', '.$table.', '.$id.', [data], ['.get_class($pObj).'])] Could not create new Apache Solr core "dlfCore'.$coreNumber.'"', $this->extKey, SYSLOG_SEVERITY_ERROR, $fieldArray);
}
@ -269,7 +271,7 @@ class tx_dlf_tcemain {
if (TYPO3_DLOG) {
\TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_tcemain->processDatamap_postProcessFieldArray('.$status.', '.$table.', '.$id.', [data], ['.get_class($pObj).'])] Prevented change of "index_name" for UID "'.$id.'" in table "'.$table.'"', $this->extKey, SYSLOG_SEVERITY_NOTICE, $fieldArray);
\TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[\Kitodo\Dlf\Hooks\DataHandler->processDatamap_postProcessFieldArray('.$status.', '.$table.', '.$id.', [data], ['.get_class($pObj).'])] Prevented change of "index_name" for UID "'.$id.'" in table "'.$table.'"', $this->extKey, SYSLOG_SEVERITY_NOTICE, $fieldArray);
}
@ -348,7 +350,7 @@ class tx_dlf_tcemain {
if (TYPO3_DLOG) {
\TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_tcemain->processDatamap_afterDatabaseOperations('.$status.', '.$table.', '.$id.', [data], ['.get_class($pObj).'])] Failed to re-index document with UID "'.$id.'"', $this->extKey, SYSLOG_SEVERITY_ERROR, $fieldArray);
\TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[\Kitodo\Dlf\Hooks\DataHandler->processDatamap_afterDatabaseOperations('.$status.', '.$table.', '.$id.', [data], ['.get_class($pObj).'])] Failed to re-index document with UID "'.$id.'"', $this->extKey, SYSLOG_SEVERITY_ERROR, $fieldArray);
}
@ -434,7 +436,7 @@ class tx_dlf_tcemain {
if (TYPO3_DLOG) {
\TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_tcemain->processCmdmap_postProcess('.$command.', '.$table.', '.$id.', '.$value.', ['.get_class($pObj).'])] Failed to re-index document with UID "'.$id.'"', $this->extKey, SYSLOG_SEVERITY_ERROR);
\TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[\Kitodo\Dlf\Hooks\DataHandler->processCmdmap_postProcess('.$command.', '.$table.', '.$id.', '.$value.', ['.get_class($pObj).'])] Failed to re-index document with UID "'.$id.'"', $this->extKey, SYSLOG_SEVERITY_ERROR);
}

View File

@ -1,4 +1,6 @@
<?php
namespace Kitodo\Dlf\Hooks;
/**
* (c) Kitodo. Key to digital objects e.V. <contact@kitodo.org>
*
@ -12,14 +14,14 @@
use Kitodo\Dlf\Common\Helper;
/**
* Hooks and helper for the '\TYPO3\CMS\Backend\Form\FormEngine' library.
* Hooks and helper for \TYPO3\CMS\Backend\Form\FormEngine
*
* @author Sebastian Meyer <sebastian.meyer@slub-dresden.de>
* @package TYPO3
* @subpackage tx_dlf
* @subpackage dlf
* @access public
*/
class tx_dlf_tceforms {
class FormEngine {
/**
* Helper to display document's thumbnail for table "tx_dlf_documents"

View File

@ -1,4 +1,6 @@
<?php
namespace Kitodo\Dlf\Hooks;
/**
* (c) Kitodo. Key to digital objects e.V. <contact@kitodo.org>
*
@ -10,14 +12,14 @@
*/
/**
* Hooks and hacks for Kitodo.Production.
* Hooks and hacks for Kitodo.Production
*
* @author Sebastian Meyer <sebastian.meyer@slub-dresden.de>
* @package TYPO3
* @subpackage tx_dlf
* @subpackage dlf
* @access public
*/
class tx_dlf_hacks {
class KitodoProductionHacks {
/**
* Hook for \Kitodo\Dlf\Common\Document::__construct()
@ -26,12 +28,12 @@ class tx_dlf_hacks {
*
* @access public
*
* @param SimpleXMLElement &$xml: The XML object
* @param \SimpleXMLElement &$xml: The XML object
* @param mixed $record_id: The record identifier
*
* @return void
*/
public function construct_postProcessRecordId(SimpleXMLElement &$xml, &$record_id) {
public function construct_postProcessRecordId(\SimpleXMLElement &$xml, &$record_id) {
if (!$record_id) {

View File

@ -212,7 +212,7 @@ return array (
'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_documents.thumbnail',
'config' => array (
'type' => 'user',
'userFunc' => 'EXT:dlf/Classes/Hooks/class.tx_dlf_tceforms.php:tx_dlf_tceforms->displayThumbnail',
'userFunc' => 'EXT:dlf/Classes/Hooks/FormEngine.php:FormEngine->displayThumbnail',
),
),
'metadata' => array (

View File

@ -81,7 +81,7 @@ class ext_update {
$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
'tx_dlf_metadata.uid AS uid',
'tx_dlf_metadata',
'tx_dlf_metadata.format=0 AND NOT tx_dlf_metadata.xpath=\'\''.Helper::whereClause('tx_dlf_metadata'),
'tx_dlf_metadata.format=0 AND NOT tx_dlf_metadata.xpath=""'.Helper::whereClause('tx_dlf_metadata'),
'',
'',
''
@ -119,21 +119,52 @@ class ext_update {
}
if ($this->oldIndexRelatedTableNames()) {
$this->renameIndexRelatedColumns();
}
if ($this->solariumSolrUpdateRequired()) {
$this->doSolariumSolrUpdate();
}
if (count($this->oldFormatClasses())) {
$this->updateFormatClasses();
}
return $this->content;
}
/**
* Check for old format classes
*
* @access protected
*
* @return boolean true if old format classes exist
*/
protected function oldFormatClasses() {
$oldRecords = array ();
// Get all records with outdated configuration.
$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
'tx_dlf_formats.uid AS uid,tx_dlf_formats.type AS type',
'tx_dlf_formats',
'tx_dlf_formats.class NOT LIKE "%\\%"'.Helper::whereClause('tx_dlf_formats'),
'',
'',
''
);
while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
$oldRecords[$resArray['uid']] = $resArray['type'];
}
return $oldRecords;
}
/**
* Check for old index related colums
*
@ -189,7 +220,7 @@ class ext_update {
if ($result) {
$message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
'TYPO3\\CMS\\Core\\Messaging\\FlashMessage',
\TYPO3\CMS\Core\Messaging\FlashMessage::class,
$GLOBALS['LANG']->getLL('update.copyIndexRelatedColumnsOkay', TRUE),
$GLOBALS['LANG']->getLL('update.copyIndexRelatedColumns', TRUE),
\TYPO3\CMS\Core\Messaging\FlashMessage::OK,
@ -199,7 +230,7 @@ class ext_update {
} else {
$message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
'TYPO3\\CMS\\Core\\Messaging\\FlashMessage',
\TYPO3\CMS\Core\Messaging\FlashMessage::class,
$GLOBALS['LANG']->getLL('update.copyIndexRelatedColumnsNotOkay', TRUE),
$GLOBALS['LANG']->getLL('update.copyIndexRelatedColumns', TRUE),
\TYPO3\CMS\Core\Messaging\FlashMessage::WARNING,
@ -212,6 +243,43 @@ class ext_update {
}
/**
* Update all outdated format records
*
* @access protected
*
* @return void
*/
protected function updateFormatClasses() {
$oldRecords = $this->oldFormatClasses();
$newValues = array (
'ALTO' => 'Kitodo\\Dlf\\Formats\\Alto',
'MODS' => 'Kitodo\\Dlf\\Formats\\Mods',
'TEIHDR' => 'Kitodo\\Dlf\\Formats\\TeiHeader'
);
foreach ($oldRecords as $uid => $type) {
$sqlQuery = 'UPDATE tx_dlf_formats SET class="'.$newValues[$type].'" WHERE uid='.$uid;
$GLOBALS['TYPO3_DB']->sql_query($sqlQuery);
}
$message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
\TYPO3\CMS\Core\Messaging\FlashMessage::class,
$GLOBALS['LANG']->getLL('update.FormatClassesOkay', TRUE),
$GLOBALS['LANG']->getLL('update.FormatClasses', TRUE),
\TYPO3\CMS\Core\Messaging\FlashMessage::OK,
FALSE
);
$this->content .= $message->render();
}
/**
* Update all outdated metadata configuration records
*
@ -266,7 +334,7 @@ class ext_update {
if (!empty($substUids)) {
$message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
'TYPO3\\CMS\\Core\\Messaging\\FlashMessage',
\TYPO3\CMS\Core\Messaging\FlashMessage::class,
$GLOBALS['LANG']->getLL('update.metadataConfigOkay', TRUE),
$GLOBALS['LANG']->getLL('update.metadataConfig', TRUE),
\TYPO3\CMS\Core\Messaging\FlashMessage::OK,
@ -276,7 +344,7 @@ class ext_update {
} else {
$message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
'TYPO3\\CMS\\Core\\Messaging\\FlashMessage',