Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Two-level metadata: Model and appearance #910

Open
wants to merge 30 commits into
base: master
Choose a base branch
from

Conversation

chrizzor
Copy link
Collaborator

Extended version of pull request #835

@sebastian-meyer sebastian-meyer added the ⚙ feature A new feature or enhancement. label Feb 10, 2023
@sebastian-meyer sebastian-meyer linked an issue Feb 10, 2023 that may be closed by this pull request
6 tasks
@sebastian-meyer
Copy link
Member

Please rebase this to master and resolve the corresponding conflicts.

@sebastian-meyer
Copy link
Member

I've deployed this branch on https://test.dfg-viewer.de for testing. Examples can be found here.

fraschz and others added 13 commits February 21, 2023 12:53
The Metadata object can now hold entry nodes with a new array containing all subentries.
These are fetched from the subentries table.
* Updated the domain model and repositories to comply with the new DB structure.
* Cleaned up all references to the old table name 'tx_dlf_metadata_subentries'.
* Make 'tx_dlf_metadatasubentries' table accessible for some functions in Hooks/Helper class.
* Extbase class mappings have to be hold as TypoScript _and_ PHP config as long as TYPO3 9 support is not dropped.

In addition, create empty repository class to comply with Extbase conventions.
Also provided IsArrayViewHelper and respect sub-arrays when building $metaCObjData.
Add a TypoScript Wrap field for subentries in database and TCA.
When XPath functions like concat() are used, evaluate() returns a string instead of a DOMNodeList.
@sebastian-meyer
Copy link
Member

I've updated https://test.dfg-viewer.de to the current 1e87169, but this leads to errors: example

Unfortunately there are no messages in the admin log pointing to the cause.

@chrizzor
Copy link
Collaborator Author

I have enabled the detailed error output on the system. It seems that there are problems with the assets. Clearing the cache doesn't help.

@sebastian-meyer
Copy link
Member

OK, the problem was the recent renaming of Resources/Public/Javascript to Resources/Public/JavaScript, because the typoscript configuration of https://github.com/slub/dfg-viewer still addresses the old path. I added a symbolic link for the old directory name and the errors were gone.
Furthermore, I had to disable usage of the internal page proxy because of #908

@@ -367,6 +367,7 @@ protected static function processLogical(Document $document, array $logicalUnit)
}
$autocomplete = [];
foreach ($metadata as $index_name => $data) {
// TODO: Include also subentries if available.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these TODOs still relevant? The two-level metadata feature should be implemented completely. So either these TODOs are done (and should be removed) or should be done.

@@ -464,6 +465,7 @@ protected static function processPhysical(Document $document, $page, array $phys
$solrDoc->setField('fulltext', $fullText);
if (is_array($doc->metadataArray[$doc->toplevelId])) {
// Add faceting information to physical sub-elements if applicable.
// TODO: Include also subentries if available.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these TODOs still relevant? The two-level metadata feature should be implemented completely. So either these TODOs are done (and should be removed) or should be done.

Comment on lines 477 to 479
//if ($index_name == 'author') {
//$data = self::removeAppendsFromAuthor($data);
//}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove inactive code.

@@ -559,6 +560,7 @@ class_exists($class)
$queryBuilder->expr()->eq('tx_dlf_metadata.pid', intval($cPid)),
$queryBuilder->expr()->eq('tx_dlf_metadata.l18n_parent', 0),
$queryBuilder->expr()->eq('tx_dlf_metadataformat_joins.pid', intval($cPid)),
//$queryBuilder->expr()->eq('tx_dlf_metadataformat_joins.subentries', 0),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove inactive code.

Comment on lines 626 to 627
// $queryBuilder->expr()->eq('tx_dlf_metadata.l18n_parent', 0),
// $queryBuilder->expr()->eq('tx_dlf_metadataformat_joins.pid', intval($cPid)),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove inactive code.

@@ -624,24 +675,23 @@ class_exists($class)
) {
if (
$resArray['format'] > 0
&& !empty($resArray['xpath_sorting'])
&& !empty($resArray['xpath_sorting']) // TODO: will fail, for subentries
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is bad and should be fixed. ;o)

Comment on lines 90 to 91
// TODO: Sebastian fragen
// TODO: Include also subentries if available.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these TODOs still relevant? The two-level metadata feature should be implemented completely. So either these TODOs are done (and should be removed) or should be done.

? implode($this->settings['separator'], $value)
: $value;

// TODO: This might not be necessary for subentries or needs to be typecasted correctly.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these TODOs still relevant? The two-level metadata feature should be implemented completely. So either these TODOs are done (and should be removed) or should be done.

class MetadataSubentryRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
{

}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add linebreak at end of file.

@@ -80,6 +80,7 @@ public function processDatamap_postProcessFieldArray($status, $table, $id, &$fie
}
break;
// Field post-processing for table "tx_dlf_metadata".
// TODO: Include also subentries if available.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these TODOs still relevant? The two-level metadata feature should be implemented completely. So either these TODOs are done (and should be removed) or should be done.

@sebastian-meyer sebastian-meyer changed the base branch from master to project-slub August 8, 2023 05:28
@sebastian-meyer sebastian-meyer changed the base branch from project-slub to 4.x August 8, 2023 05:30
@sebastian-meyer sebastian-meyer changed the base branch from 4.x to master August 8, 2023 05:30
# Conflicts:
#	Classes/Common/Indexer.php
#	Classes/Common/MetsDocument.php
#	Classes/Domain/Model/MetadataFormat.php
#	Configuration/TCA/tx_dlf_metadataformat.php
#	Resources/Private/Partials/Metadata/Entries.html
#	ext_typoscript_setup.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚙ feature A new feature or enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Metadata grouping/subfields
3 participants