Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/maven/fixes/9.0' into maven/rele…
Browse files Browse the repository at this point in the history
…ase/9.0
  • Loading branch information
metaventis-build committed Dec 2, 2024
2 parents 62a0f6b + 8f0ef84 commit 473edf0
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> subPermissions = new HashSet<>();
Expand Down
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);
}
}
}
}
16 changes: 16 additions & 0 deletions Frontend/.browserslistrc
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
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ export class AddWithConnectorDialogData {
export interface AddWithConnectorDialogResult {
name: string;
type: ConnectorFileType;
window: Window;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -29,6 +30,7 @@ export class AddWithConnectorDialogComponent {
constructor(
@Inject(CARD_DIALOG_DATA) public data: AddWithConnectorDialogData,
private dialogRef: CardDialogRef<AddWithConnectorDialogData, AddWithConnectorDialogResult>,
private cordova: CordovaService,
) {
this.initDialogConfig();
}
Expand All @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 2 additions & 6 deletions Frontend/src/app/modules/stream/stream.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down

0 comments on commit 473edf0

Please sign in to comment.