Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
services
t3o sites
extensions.typo3.org
extensions.typo3.org
Commits
c6052948
Commit
c6052948
authored
Jan 29, 2017
by
Thomas Löffler
Browse files
[TASK] Updates indexer and removes obsolete fields in TS
parent
4588a39b
Changes
2
Hide whitespace changes
Inline
Side-by-side
data/typo3/html/typo3conf/ext/ter_fe2/Classes/Solr/Indexqueue/TerIndexer.php
View file @
c6052948
...
...
@@ -14,6 +14,7 @@
*/
use
TYPO3\CMS\Core\Utility\GeneralUtility
;
use
ApacheSolrForTypo3\Solr\IndexQueue\Item
;
/**
* Class Tx_TerFe2_Solr_Indexqueue_TerIndexer
...
...
@@ -46,44 +47,56 @@ class Tx_TerFe2_Solr_Indexqueue_TerIndexer extends \ApacheSolrForTypo3\Solr\Inde
}
/**
* @param \ApacheSolrForTypo3\Solr\IndexQueue\Item $item
* @param int $language
* @return array
* Converts an item array (record) to a Solr document by mapping the
* record's fields onto Solr document fields as configured in TypoScript.
*
* @param Item $item An index queue item
* @param int $language Language Id
* @return Apache_Solr_Document The Solr document converted from the record
*/
public
function
getFullItemRecord
(
\
ApacheSolrForTypo3\Solr\IndexQueue\Item
$item
,
$language
=
0
)
{
$itemRecord
=
parent
::
getFullItemRecord
(
$item
,
$language
);
$itemRecord
[
'minimumTYPO3Version'
]
=
0
;
$itemRecord
[
'maximumTYPO3Version'
]
=
0
;
// get the uid of the extkey information of the extension
$extensionUid
=
$GLOBALS
[
'TYPO3_DB'
]
->
exec_SELECTgetSingleRow
(
'uid'
,
'tx_terfe2_domain_model_extension'
,
'ext_key = '
.
$GLOBALS
[
'TYPO3_DB'
]
->
fullQuoteStr
(
$itemRecord
[
'ext_key'
],
'tx_terfe2_domain_model_extension'
)
);
protected
function
itemToDocument
(
Item
$item
,
$language
=
0
)
{
$document
=
null
;
$itemRecord
=
$this
->
getFullItemRecord
(
$item
,
$language
);
if
(
!
is_null
(
$itemRecord
))
{
$itemIndexingConfiguration
=
$this
->
getItemTypeConfiguration
(
$item
,
$language
);
$document
=
$this
->
getBaseDocument
(
$item
,
$itemRecord
);
$document
=
$this
->
addDocumentFieldsFromTyposcript
(
$document
,
$itemIndexingConfiguration
,
$itemRecord
);
$document
=
$this
->
addSpecialFields
(
$document
,
$itemRecord
);
}
if
(
isset
(
$extensionUid
[
'uid'
]))
{
/**
* @var $extension Tx_TerFe2_Domain_Model_Extension
*/
$extension
=
$this
->
extensionRepository
->
findByUid
(
$extensionUid
[
'uid'
]);
return
$document
;
}
if
(
$extension
instanceof
Tx_TerFe2_Domain_Model_Extension
)
{
$itemRecord
[
'extensionIcon'
]
=
$this
->
getExtensionIcon
(
/**
* @param \Apache_Solr_Document $document
* @param array $itemRecord
* @return \Apache_Solr_Document
*/
public
function
addSpecialFields
(
Apache_Solr_Document
$document
,
array
$itemRecord
)
{
$extension
=
$this
->
extensionRepository
->
findByUid
(
$itemRecord
[
'uid'
]);
if
(
$extension
instanceof
Tx_TerFe2_Domain_Model_Extension
)
{
$document
->
setField
(
'extensionIcon_stringS'
,
$this
->
getExtensionIcon
(
$itemRecord
[
'ext_key'
],
$extension
->
getLastVersion
()
->
getVersionString
()
);
)
);
$typo3Dependency
=
$this
->
getDependencyVersionForPackage
(
$extension
,
'typo3'
);
$itemRecord
[
'minimum
TYPO3Version
'
]
=
$typo3Dependency
[
'minimum'
];
$itemRecord
[
'maximum
TYPO3Version
'
]
=
$typo3Dependency
[
'maximum'
];
$typo3Dependency
=
$this
->
getDependencyVersionForPackage
(
$extension
,
'typo3'
);
$document
->
setField
(
'extensionMin
TYPO3Version
_tIntS'
,
$typo3Dependency
[
'minimum'
]
)
;
$document
->
setField
(
'extensionMax
TYPO3Version
_tIntS'
,
$typo3Dependency
[
'maximum'
]
)
;
$itemRecord
[
'outdated'
]
=
$extension
->
getLastVersion
()
->
getReviewState
()
===
-
2
;
}
$document
->
setField
(
'outdated_boolS'
,
$extension
->
getLastVersion
()
->
getReviewState
()
===
-
2
);
}
return
$
itemRecord
;
return
$
document
;
}
/**
...
...
data/typo3/html/typo3conf/ext/ter_layout/Configuration/TypoScript/Plugins/Solr.ts
View file @
c6052948
...
...
@@ -141,14 +141,6 @@ plugin {
extensionDownloads_intS
=
downloads
#
extensionIcon
is
filled
by
the
ter
indexer
Tx_TerFe2_Solr_Indexqueue_TerIndexer
extensionIcon_stringS
=
TEXT
extensionIcon_stringS
.
field
=
extensionIcon
#
minimumTYPO3Version
and
maximumTYPO3Version
is
filled
by
the
ter
indexer
Tx_TerFe2_Solr_Indexqueue_TerIndexer
extensionMinTYPO3Version_sIntS
=
minimumTYPO3Version
extensionMaxTYPO3Version_sIntS
=
maximumTYPO3Version
extensionHasZipFile_intS
=
SOLR_RELATION
extensionHasZipFile_intS
{
localField
=
last_version
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment