diff --git a/Backend/alfresco/module/src/main/java/org/edu_sharing/alfresco/webscripts/tracker/PermissionsGet.java b/Backend/alfresco/module/src/main/java/org/edu_sharing/alfresco/webscripts/tracker/PermissionsGet.java index c53b8678d5..c24b39222a 100644 --- a/Backend/alfresco/module/src/main/java/org/edu_sharing/alfresco/webscripts/tracker/PermissionsGet.java +++ b/Backend/alfresco/module/src/main/java/org/edu_sharing/alfresco/webscripts/tracker/PermissionsGet.java @@ -87,7 +87,7 @@ else if (aclIdsJSON.length() == 0) acl.setAces(aces); for(AccessControlEntry entry : accessControlList.getEntries()){ Ace ace = new Ace(); - ace.setAuthority(entry.getAuthority()); + ace.setAuthority(entry.getAuthority().trim()); ace.setPermission(entry.getPermission().getName()); aces.add(ace); Set subPermissions = new HashSet<>(); diff --git a/Backend/services/core/src/main/java/org/edu_sharing/repository/server/jobs/helper/NodeCustomClasses.java b/Backend/services/core/src/main/java/org/edu_sharing/repository/server/jobs/helper/NodeCustomClasses.java new file mode 100644 index 0000000000..f177d52c2c --- /dev/null +++ b/Backend/services/core/src/main/java/org/edu_sharing/repository/server/jobs/helper/NodeCustomClasses.java @@ -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 { + @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 callback = new HttpQueryTool.Callback() { + @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); + } + } + } +} diff --git a/Frontend/.browserslistrc b/Frontend/.browserslistrc new file mode 100644 index 0000000000..40b6552c54 --- /dev/null +++ b/Frontend/.browserslistrc @@ -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 diff --git a/Frontend/src/app/features/dialogs/dialog-modules/add-with-connector-dialog/add-with-connector-dialog-data.ts b/Frontend/src/app/features/dialogs/dialog-modules/add-with-connector-dialog/add-with-connector-dialog-data.ts index 66fbe8af42..5090a00216 100644 --- a/Frontend/src/app/features/dialogs/dialog-modules/add-with-connector-dialog/add-with-connector-dialog-data.ts +++ b/Frontend/src/app/features/dialogs/dialog-modules/add-with-connector-dialog/add-with-connector-dialog-data.ts @@ -8,4 +8,5 @@ export class AddWithConnectorDialogData { export interface AddWithConnectorDialogResult { name: string; type: ConnectorFileType; + window: Window; } diff --git a/Frontend/src/app/features/dialogs/dialog-modules/add-with-connector-dialog/add-with-connector-dialog.component.ts b/Frontend/src/app/features/dialogs/dialog-modules/add-with-connector-dialog/add-with-connector-dialog.component.ts index b6af80b307..cfdc9f6c13 100644 --- a/Frontend/src/app/features/dialogs/dialog-modules/add-with-connector-dialog/add-with-connector-dialog.component.ts +++ b/Frontend/src/app/features/dialogs/dialog-modules/add-with-connector-dialog/add-with-connector-dialog.component.ts @@ -9,6 +9,7 @@ import { AddWithConnectorDialogData, AddWithConnectorDialogResult, } from './add-with-connector-dialog-data'; +import { CordovaService } from '../../../../common/services/cordova.service'; @Component({ selector: 'es-add-with-connector-dialog', @@ -29,6 +30,7 @@ export class AddWithConnectorDialogComponent { constructor( @Inject(CARD_DIALOG_DATA) public data: AddWithConnectorDialogData, private dialogRef: CardDialogRef, + private cordova: CordovaService, ) { this.initDialogConfig(); } @@ -41,7 +43,11 @@ export class AddWithConnectorDialogComponent { if (!this.name.trim()) { return; } - this.dialogRef.close({ name: this.name, type: this.getType() }); + let win: Window; + if (!this.cordova.isRunningCordova()) { + win = window.open(''); + } + this.dialogRef.close({ name: this.name, type: this.getType(), window: win }); } private processConnector(connector: Connector): Connector { diff --git a/Frontend/src/app/main/navigation/create-menu/create-menu.component.ts b/Frontend/src/app/main/navigation/create-menu/create-menu.component.ts index 1257afc09f..753db18658 100644 --- a/Frontend/src/app/main/navigation/create-menu/create-menu.component.ts +++ b/Frontend/src/app/main/navigation/create-menu/create-menu.component.ts @@ -490,19 +490,15 @@ export class CreateMenuComponent implements OnInit, OnDestroy { private async createConnector(connector: Connector, event: AddWithConnectorDialogResult) { const prop = this.nodeHelper.propertiesFromConnector(event); - let win: any; - if (!this.bridge.isRunningCordova()) { - win = window.open(''); - } this.nodeService .createNode((await this.getParent()).ref.id, RestConstants.CCM_TYPE_IO, [], prop, false) .subscribe( (data: NodeWrapper) => { - this.editConnector(data.node, event.type as Filetype, win, connector); + this.editConnector(data.node, event.type as Filetype, event.window, connector); this.onCreate.emit([data.node]); }, (error: any) => { - win.close(); + event.window?.close(); if ( this.nodeHelper.handleNodeError(event.name, error) === RestConstants.DUPLICATE_NODE_RESPONSE diff --git a/Frontend/src/app/modules/stream/stream.component.ts b/Frontend/src/app/modules/stream/stream.component.ts index e0b450a7f6..8e7fe14bb3 100644 --- a/Frontend/src/app/modules/stream/stream.component.ts +++ b/Frontend/src/app/modules/stream/stream.component.ts @@ -404,15 +404,11 @@ export class StreamComponent implements OnInit, AfterViewInit, OnDestroy { private createConnector(connector: Connector, event: AddWithConnectorDialogResult) { const prop = this.nodeHelper.propertiesFromConnector(event); - let win: any; - if (!this.cordova.isRunningCordova()) { - win = window.open(''); - } this.nodeService .createNode(RestConstants.INBOX, RestConstants.CCM_TYPE_IO, [], prop, false) .subscribe( (data: NodeWrapper) => { - this.editConnector(data.node, event.type as Filetype, win, connector); + this.editConnector(data.node, event.type as Filetype, event.window, connector); UIHelper.goToWorkspaceFolder( this.nodeService, this.router, @@ -421,7 +417,7 @@ export class StreamComponent implements OnInit, AfterViewInit, OnDestroy { ); }, (error: any) => { - win.close(); + event.window?.close(); if ( this.nodeHelper.handleNodeError(event.name, error) == RestConstants.DUPLICATE_NODE_RESPONSE