-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/maven/fixes/9.0' into maven/rele…
…ase/9.0
- Loading branch information
Showing
7 changed files
with
80 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
...s/core/src/main/java/org/edu_sharing/repository/server/jobs/helper/NodeCustomClasses.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package org.edu_sharing.repository.server.jobs.helper; | ||
|
||
import org.alfresco.service.cmr.repository.NodeRef; | ||
import org.alfresco.service.cmr.repository.StoreRef; | ||
import org.apache.log4j.Logger; | ||
import org.edu_sharing.repository.client.tools.CCConstants; | ||
import org.edu_sharing.repository.server.jobs.quartz.BulkEditNodesJob; | ||
import org.edu_sharing.repository.server.tools.HttpQueryTool; | ||
import org.edu_sharing.service.nodeservice.NodeServiceFactory; | ||
import org.edu_sharing.service.nodeservice.NodeServiceHelper; | ||
|
||
import java.io.InputStream; | ||
import java.util.function.Consumer; | ||
|
||
/** | ||
* to be used with @BulkEditNodesJob | ||
*/ | ||
public class NodeCustomClasses { | ||
public static class ImportExternalThumbnail implements Consumer<NodeRef> { | ||
@Override | ||
public void accept(NodeRef nodeRef) { | ||
String thumbUrl = NodeServiceHelper.getProperty(nodeRef, CCConstants.CCM_PROP_IO_THUMBNAILURL); | ||
if (thumbUrl == null) { | ||
Logger.getLogger(BulkEditNodesJob.class).info(nodeRef + " has no " + CCConstants.CCM_PROP_IO_THUMBNAILURL + ", skipping..."); | ||
return; | ||
} | ||
try { | ||
HttpQueryTool.Callback<Throwable> callback = new HttpQueryTool.Callback<Throwable>() { | ||
@Override | ||
public void handle(InputStream is) { | ||
try { | ||
NodeServiceFactory.getLocalService().writeContent(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, nodeRef.getId(), is, | ||
"image/jpeg", null, CCConstants.CCM_PROP_IO_USERDEFINED_PREVIEW); | ||
} catch (Exception e) { | ||
Logger.getLogger(BulkEditNodesJob.class).warn("Thumb fetching failed for " + nodeRef + " " + thumbUrl); | ||
} | ||
} | ||
}; | ||
new HttpQueryTool().queryStream(thumbUrl, callback); | ||
if (callback.getResult() != null) { | ||
Logger.getLogger(BulkEditNodesJob.class).warn("Thumb fetching failed for " + nodeRef + " " + thumbUrl + ": " + callback.getResult()); | ||
} else { | ||
NodeServiceHelper.removeProperty(nodeRef, CCConstants.CCM_PROP_IO_THUMBNAILURL); | ||
Logger.getLogger(BulkEditNodesJob.class).info(nodeRef + " thumb imported: " + thumbUrl); | ||
} | ||
} catch (Throwable t) { | ||
Logger.getLogger(BulkEditNodesJob.class).warn("Thumb fetching failed for " + nodeRef + " " + thumbUrl); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below. | ||
# For additional information regarding the format and rule options, please see: | ||
# https://github.com/browserslist/browserslist#queries | ||
|
||
# For the full list of supported browsers by the Angular framework, please see: | ||
# https://angular.io/guide/browser-support | ||
|
||
# You can see what browsers were selected by your queries by running: | ||
# npx browserslist | ||
|
||
last 2 Chrome versions | ||
last 1 Firefox version | ||
last 2 Edge major versions | ||
Safari >= 15 | ||
last 2 iOS major versions | ||
Firefox ESR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters