Skip to content

Commit

Permalink
#23934 revert changes
Browse files Browse the repository at this point in the history
  • Loading branch information
erickgonzalez committed Aug 1, 2023
1 parent 51c5abb commit f46945c
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 161 deletions.
3 changes: 1 addition & 2 deletions HOTFIX_TRACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,5 +156,4 @@ This maintenance release includes the following code fixes:
130. https://github.com/dotCMS/core/issues/24415 : Related content doesn't match with Content Language #24415
131. https://github.com/dotCMS/core/issues/23276 : Content detailed page throwing 404 when URL contains a trailing slash. #23276
132. https://github.com/dotCMS/core/issues/21492 : Toggle to Code in WYSIWYG Makes UI Jump #21492
133. https://github.com/dotCMS/core/issues/23948 : Stop redirecting all BE page traffic to edit mode #23948
134. https://github.com/dotCMS/core/issues/23934 : Old Tika Version Pulling Wrong Width from Image for Metadata #23934
133. https://github.com/dotCMS/core/issues/23948 : Stop redirecting all BE page traffic to edit mode #23948
12 changes: 9 additions & 3 deletions dotCMS/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,16 @@ dependencies {
transitive = false
}

felix group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.35'
felix group: 'org.slf4j', name: 'jcl-over-slf4j', version: '1.7.35'
felix(group: 'org.apache.tika', name: 'tika-core', version: '1.19') {
transitive = false
}
felix(group: 'org.apache.tika', name: 'tika-bundle', version: '1.19') {
transitive = false
}

felix group: 'com.dotcms.tika', name: 'com.dotcms.tika', version: '2.7.0'
felix group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.25'
felix group: 'org.slf4j', name: 'jcl-over-slf4j', version: '1.7.25'
felix group: 'com.dotcms.tika', name: 'com.dotcms.tika', version: '0.2'

felix group: 'com.dotcms.samlbundle', name: 'com.dotcms.samlbundle', version: '22.03'
/**** And now the libs we pull in from internal company sources - libs stored in ./plugins, ./bin, ./libs, the starter site, etc. ****/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,27 +88,6 @@ public void Test_Get_Metadata_Property() throws Exception {
assertTrue(fileAssetContent.get(FileAssetAPI.META_DATA_FIELD) instanceof Map);
}

/**
* <b>Method to test:</b> {@link FileMetadataAPI#getFullMetadataNoCache(File, Supplier)}<br>
* <b>Given scenario:</b> Getting metadata from a urlMap<br>
* <b>Expected Result:</b> Some keywords must be present in the metadata
* @throws Exception
*/
@Test
public void Test_Generate_Metadata_From_HtmlPage_Should_Resolve_ExtendedMetadata() throws Exception {
prepareIfNecessary();
final List<String> extendedMetadata = CollectionsUtils.list("metaKeyword", "keywords", "dcSubject",
"title", "dcTitle", "description", "copyright", "ogTitle", "language", "ogUrl", "ogImage");
Metadata metadata = fileMetadataAPI.getFullMetadataNoCache(new
File(FileMetadataAPITest.class.getResource("5-snow-sports-to-try-this-winter").getFile()),
null);
assertNotNull(metadata);
assertTrue(metadata.getMap().keySet().containsAll(extendedMetadata));
assertEquals("5 Snow Sports to Try This Winter", metadata.getMap().get("dcTitle"));
assertEquals("5 Snow Sports to Try This Winter", metadata.getMap().get("title"));

}


/**
* This test evaluates both basic vs full MD
Expand Down

This file was deleted.

16 changes: 0 additions & 16 deletions dotCMS/src/main/java/com/dotcms/tika/TikaUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import com.dotcms.osgi.OSGIConstants;
import com.dotcms.repackage.org.apache.commons.io.FileUtils;
import com.dotcms.repackage.org.apache.commons.io.IOUtils;
import com.dotcms.storage.model.ExtendedMetadataFields;
import com.dotmarketing.business.APILocator;
import com.dotmarketing.business.FactoryLocator;
import com.dotmarketing.exception.DotDataException;
Expand Down Expand Up @@ -397,8 +396,6 @@ public Map<String, Object> getForcedMetaDataMap(final File binFile,
metaMap.putAll(this.buildMetaDataMap());
metaMap.put(FileAssetAPI.CONTENT_FIELD, content);

//Adding missing keys that were excluded in Tika 2.0
includeMissingKeys(metaMap);
} catch (IOException ioExc) {
if (this.isZeroByteFileException(ioExc.getCause())) {
logWarning(binFile, ioExc.getCause());
Expand All @@ -418,19 +415,6 @@ public Map<String, Object> getForcedMetaDataMap(final File binFile,
return metaMap;
}

/**
* This method adds missing keys from Tika 1.x that were excluded in Tika 2.0. For example: keywords and title
* For further details, please visit https://cwiki.apache.org/confluence/display/TIKA/Migrating+to+Tika+2.0.0
* @param metaMap
*/
private static void includeMissingKeys(Map<String, Object> metaMap) {
ExtendedMetadataFields.keyMap().forEach((key, value) -> {
if(metaMap.containsKey(key)){
value.forEach(v -> metaMap.putIfAbsent(v, metaMap.get(key)));
}
});
}

private void parseFallbackAsPlainText(final File binFile, final Map<String, Object> metaMap, final IOException ioExc) {
try {
//On error lets try a fallback operation
Expand Down
1 change: 0 additions & 1 deletion dotCMS/src/main/resources/osgi/osgi-extra.conf
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,6 @@ javax.xml.xpath;version=0.1.0,
net.spy.memcached;version=0.1.0,
net.spy.memcached.internal;version=0.1.0,
net.spy.memcached.transcoders;version=0.1.0,
org.apache.logging.log4j;
org.apache.commons.codec;version=0.1.0,
org.apache.commons.codec.binary;version=0.1.0,
org.apache.commons.codec.digest;version=0.1.0,
Expand Down

0 comments on commit f46945c

Please sign in to comment.