Skip to content

Commit b8d02c6

Browse files
Merge remote-tracking branch 'origin/maven/fixes/9.0' into maven/release/9.0
2 parents a8301b2 + 320fca3 commit b8d02c6

File tree

22 files changed

+224
-91
lines changed

22 files changed

+224
-91
lines changed

Backend/alfresco/module/src/main/java/org/edu_sharing/repository/server/tools/VCardConverter.java

+5
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,11 @@ public static String removeEMails(String vcardString){
171171
*/
172172
public static List<String> cleanupVcard(String vcardString, Function<VCard, VCard> cleanup ){
173173
try{
174+
175+
// fix parser won't unescape \, correctly
176+
// TODO we should use a better lib here maybe https://github.com/mangstadt/ez-vcard/tree/master
177+
vcardString = vcardString.replace("\\,", ",");
178+
174179
VCardEngine engine = new VCardEngine();
175180
// unfortunately, the multi vcard string method is only private, so we need to make it accessible
176181
Method method = engine.getClass().getDeclaredMethod("parseManyInOneVCard", String.class);

Backend/services/core/src/main/java/org/edu_sharing/repository/server/MCAlfrescoAPIClient.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1370,7 +1370,7 @@ public HashMap<String, Object> getPropertiesCached(NodeRef nodeRef, boolean getF
13701370

13711371
// we can cache primary parent here, instead of parentid which differs
13721372
// from the content
1373-
if (nodeType.equals(CCConstants.CCM_TYPE_IO) || nodeType.equals(CCConstants.CCM_TYPE_MAP) || nodeType.equals(CCConstants.CM_TYPE_FOLDER) || nodeType.equals(CCConstants.CCM_TYPE_TOOL_INSTANCE)) {
1373+
if (nodeType.equals(CCConstants.CCM_TYPE_IO) || nodeType.equals(CCConstants.CCM_TYPE_MAP) || nodeType.equals(CCConstants.CM_TYPE_FOLDER) || nodeType.equals(CCConstants.CCM_TYPE_TOOL_INSTANCE) || nodeType.equals(CCConstants.CCM_TYPE_COLLECTION_PROPOSAL)) {
13741374
ChildAssociationRef parentNodeRef = nodeService.getPrimaryParent(nodeRef);
13751375
properties.put(CCConstants.VIRT_PROP_PRIMARYPARENT_NODEID, parentNodeRef.getParentRef().getId());
13761376
}

Backend/services/core/src/main/java/org/edu_sharing/repository/server/importer/ExcelLOMImporter.java

+44-41
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
package org.edu_sharing.repository.server.importer;
22

3-
import java.io.InputStream;
4-
import java.io.Serializable;
5-
import java.net.MalformedURLException;
6-
import java.net.URL;
7-
import java.util.*;
8-
import java.util.stream.Stream;
9-
103
import org.alfresco.model.ContentModel;
114
import org.alfresco.service.ServiceRegistry;
125
import org.alfresco.service.cmr.dictionary.DictionaryService;
@@ -28,6 +21,13 @@
2821
import org.edu_sharing.service.clientutils.WebsiteInformation;
2922
import org.edu_sharing.service.collection.CollectionServiceFactory;
3023

24+
import java.io.InputStream;
25+
import java.io.Serializable;
26+
import java.net.MalformedURLException;
27+
import java.net.URL;
28+
import java.util.*;
29+
import java.util.stream.Stream;
30+
3131

3232
public class ExcelLOMImporter {
3333

@@ -40,9 +40,9 @@ public class ExcelLOMImporter {
4040
DictionaryService dictionaryService = serviceRegistry.getDictionaryService();
4141
NodeService nodeService = serviceRegistry.getNodeService();
4242

43-
String targetFolder = null;
43+
String targetFolder;
4444

45-
InputStream is = null;
45+
InputStream is;
4646

4747
int maxNodesInFolder = 100;
4848

@@ -68,7 +68,7 @@ public ExcelLOMImporter(String targetFolder, InputStream is, Boolean addToCollec
6868
this.is = is;
6969

7070

71-
HashMap<Integer,String> IdxColumnMap = new HashMap<Integer,String>();
71+
HashMap<Integer,String> IdxColumnMap = new HashMap<>();
7272

7373
try{
7474
Workbook workbook = WorkbookFactory.create(this.is);
@@ -85,7 +85,7 @@ public ExcelLOMImporter(String targetFolder, InputStream is, Boolean addToCollec
8585
NodeRef currentFolder = nodeService.getChildByName(targetFolderNodeRef, assocTypeContains, folderName);
8686

8787
if(currentFolder == null){
88-
Map<QName,Serializable> folderProps = new HashMap<QName,Serializable>();
88+
Map<QName,Serializable> folderProps = new HashMap<>();
8989
folderProps.put(QName.createQName(CCConstants.CM_NAME), folderName);
9090
folderProps.put(QName.createQName(CCConstants.CM_PROP_C_TITLE), folderName);
9191
parentFolder = nodeService.createNode(targetFolderNodeRef,assocTypeContains, QName.createQName(folderName), QName.createQName(CCConstants.CCM_TYPE_MAP),folderProps).getChildRef().getId();
@@ -94,15 +94,15 @@ public ExcelLOMImporter(String targetFolder, InputStream is, Boolean addToCollec
9494
try{
9595
currentLevelObjects = apiClient.getChildren(parentFolder);
9696
}catch(Throwable e){
97-
e.printStackTrace();
97+
logger.error(e.getMessage(),e);
9898
}
9999

100-
if(IdxColumnMap.size() > 0){
100+
if(!IdxColumnMap.isEmpty()){
101101
//we got the headers
102-
HashMap<QName,Serializable> toSafe = new HashMap<QName,Serializable>();
102+
HashMap<QName,Serializable> toSafe = new HashMap<>();
103103

104104
String contentUrl = null;
105-
LinkedHashSet<String> collectionsToImportTo = new LinkedHashSet<String>();
105+
LinkedHashSet<String> collectionsToImportTo = new LinkedHashSet<>();
106106
for(Cell cell : row){
107107

108108
int colIdxIdx = cell.getColumnIndex();
@@ -129,35 +129,32 @@ public ExcelLOMImporter(String targetFolder, InputStream is, Boolean addToCollec
129129
String value = cell.getStringCellValue();
130130
if(value == null) continue;
131131
value = value.trim();
132-
if(value.equals("")) continue;
132+
if(value.isEmpty()) continue;
133133

134134
if(columnName != null){
135135
alfrescoProperty = getExcelAlfMap().get(columnName);
136136
}
137137

138138
if(alfrescoProperty != null){
139-
if(alfrescoProperty != null &&
140-
alfrescoProperty.equals(CCConstants.CM_PROP_CONTENT)){
139+
if(alfrescoProperty.equals(CCConstants.CM_PROP_CONTENT)){
141140
contentUrl = value;
142141
}else{
143142
PropertyDefinition propDef = dictionaryService.getProperty(QName.createQName(alfrescoProperty));
144143

145144
if(propDef != null) {
146145
if(propDef.isMultiValued() && !alfrescoProperty.contains("contributer")){
147-
ArrayList<String> multival = new ArrayList<String>();
148-
149-
//String[] vals = value.split(","); StringTool.escape(CCConstants.MULTIVALUE_SEPARATOR)
146+
147+
//String[] vals = value.split(","); StringTool.escape(CCConstants.MULTIVALUE_SEPARATOR)
150148
String[] vals = value.split(StringTool.escape(CCConstants.MULTIVALUE_SEPARATOR));
151-
multival.addAll(Arrays.asList(vals));
149+
ArrayList<String> multival = new ArrayList<>(Arrays.asList(vals));
152150

153151
toSafe.put(QName.createQName(alfrescoProperty), multival);
154152
}else{
155153
toSafe.put(QName.createQName(alfrescoProperty), value);
156154
}
157155
}else {
158156
logger.error("unkown property: " + alfrescoProperty);
159-
continue;
160-
}
157+
}
161158
}
162159
}
163160

@@ -169,20 +166,20 @@ public ExcelLOMImporter(String targetFolder, InputStream is, Boolean addToCollec
169166
String nodeName = addName(toSafe, wwwUrl);
170167
addThumbnail(toSafe, wwwUrl);
171168

172-
if(toSafe.size() > 0 && nodeName != null && !nodeName.trim().equals("")){
169+
if(!toSafe.isEmpty() && nodeName != null && !nodeName.trim().isEmpty()){
173170

174171
//check for valid thumbnail url
175172
boolean createNode = true;
176173
String thumbUrl = (String)toSafe.get(qnameThumbnail);
177174

178-
if((thumbUrl == null || !thumbUrl.startsWith("http")) && (contentUrl == null || contentUrl.trim().equals(""))) {
175+
if((thumbUrl == null || !thumbUrl.startsWith("http")) && (contentUrl == null || contentUrl.trim().isEmpty())) {
179176
logger.error("invalid thumbnail url:" + thumbUrl +" for:" +toSafe.get(QName.createQName(CCConstants.CM_NAME))+" will not safe object");
180177
createNode = false;
181178
}
182179
if(createNode) {
183180
ChildAssociationRef newNode = nodeService.createNode(new NodeRef(MCAlfrescoAPIClient.storeRef,parentFolder),QName.createQName(CCConstants.CM_ASSOC_FOLDER_CONTAINS), QName.createQName(nodeName), QName.createQName(CCConstants.CCM_TYPE_IO),toSafe);
184181

185-
if(contentUrl != null && !contentUrl.trim().equals("")){
182+
if(contentUrl != null && !contentUrl.trim().isEmpty()){
186183
String mimetype = MimeTypes.guessMimetype(contentUrl);
187184
try {
188185
InputStream inputStream = new URL(contentUrl).openConnection().getInputStream();
@@ -277,7 +274,7 @@ private String addName(HashMap<QName, Serializable> toSafe, String wwwUrl) {
277274
return null;
278275
}
279276

280-
HashMap<String,Object> eduProps = new HashMap<String,Object>();
277+
HashMap<String,Object> eduProps = new HashMap<>();
281278
eduProps.put(CCConstants.CM_NAME, nodeName);
282279
eduProps.put(CCConstants.LOM_PROP_GENERAL_TITLE, nodeName);
283280
new DuplicateFinder().transformToSafeName(currentLevelObjects, eduProps);
@@ -288,10 +285,12 @@ private String addName(HashMap<QName, Serializable> toSafe, String wwwUrl) {
288285
private void addToCollections(ChildAssociationRef newNode, LinkedHashSet<String> collectionsForNode, Boolean addToCollection){
289286
String wwwUrl = (String)serviceRegistry.getNodeService().getProperty(newNode.getChildRef(),QName.createQName(CCConstants.CCM_PROP_IO_WWWURL));
290287
String nodeName = (String)serviceRegistry.getNodeService().getProperty(newNode.getChildRef(), ContentModel.PROP_NAME);
291-
if(collectionsForNode != null && collectionsForNode.size() > 1){
288+
if(collectionsForNode != null && !collectionsForNode.isEmpty()){
292289

293290
String parentCollection = collectionsForNode.stream().findFirst().get();
294-
String targetCollection = collectionsForNode.stream().skip(collectionsForNode.size() -1).findFirst().get();
291+
String targetCollection = (collectionsForNode.size() == 1)
292+
? parentCollection
293+
: collectionsForNode.stream().skip(collectionsForNode.size() -1).findFirst().get();
295294
logger.info("collections for node " + String.join("/",collectionsForNode) +" p:"+parentCollection +" c:"+targetCollection);
296295

297296
SearchParameters searchParameters = new SearchParameters();
@@ -306,22 +305,25 @@ private void addToCollections(ChildAssociationRef newNode, LinkedHashSet<String>
306305
//check if there is a parent
307306
NodeRef pathMatchesNodeRef = null;
308307
LinkedHashSet<String> pathsMatch = new LinkedHashSet<>();
309-
for(NodeRef nodeRef : rs.getNodeRefs()){
310-
Path path = serviceRegistry.getNodeService().getPath(nodeRef);
308+
for(NodeRef targetCollectionNodeRef : rs.getNodeRefs()){
309+
310+
Path path = serviceRegistry.getNodeService().getPath(targetCollectionNodeRef);
311311
String displayPath = path.toDisplayPath(serviceRegistry.getNodeService(),serviceRegistry.getPermissionService());
312-
logger.info("checking path for parent collection;\"" + parentCollection + "\";path:"+displayPath +"/"+nodeService.getProperty(nodeRef,ContentModel.PROP_NAME));
313-
if(displayPath.contains(parentCollection)){
312+
String targetCollectionName = (String)nodeService.getProperty(targetCollectionNodeRef,ContentModel.PROP_NAME);
313+
displayPath += "/"+targetCollectionName;
314+
logger.info("checking path for parent collection;\"" + parentCollection + "\";path:"+displayPath);
315+
if(displayPath.contains(parentCollection) && displayPath.endsWith(targetCollection)){
314316
pathsMatch.add(displayPath);
315-
pathMatchesNodeRef = nodeRef;
317+
pathMatchesNodeRef = targetCollectionNodeRef;
316318
}
317319
}
318320

319321
if(pathsMatch.size() > 1){
320322
logger.error("more than one path matches;"+nodeName +";"+newNode.getChildRef()+";" + String.join(";",pathsMatch));
321-
}else if(pathsMatch.size() == 0){
323+
}else if(pathsMatch.isEmpty()){
322324
logger.error("no path matches;"+nodeName +";"+newNode.getChildRef());
323325
}else{
324-
logger.info("adding;" + nodeName +";"+newNode.getChildRef() +";TO;" + pathsMatch.iterator().next() +"/"+nodeService.getProperty(pathMatchesNodeRef,ContentModel.PROP_NAME));
326+
logger.info("adding;" + nodeName +";"+newNode.getChildRef() +";TO;" + pathsMatch.iterator().next());
325327
try {
326328
if(addToCollection) {
327329
CollectionServiceFactory.getLocalService().addToCollection(pathMatchesNodeRef.getId(), newNode.getChildRef().getId(), null, false);
@@ -332,7 +334,7 @@ private void addToCollections(ChildAssociationRef newNode, LinkedHashSet<String>
332334
}
333335
}
334336
}else{
335-
this.logger.info("addToCollections expects two collection to be defined in excelsheet;" + wwwUrl);
337+
this.logger.info("addToCollections expects minimum one collection to be defined in excelsheet;" + wwwUrl);
336338
}
337339
}
338340

@@ -354,10 +356,9 @@ private static String getYoutubeId(String wwwUrl){
354356

355357
URL url = new URL(wwwUrl);
356358
String queryString = url.getQuery();
357-
String id = Stream.of(queryString.split("&")).map(kv -> kv.split("=")).filter(kv -> "v".equalsIgnoreCase(kv[0])).map(kv -> kv[1])
359+
return Stream.of(queryString.split("&")).map(kv -> kv.split("=")).filter(kv -> "v".equalsIgnoreCase(kv[0])).map(kv -> kv[1])
358360
.findFirst()
359361
.orElse("");
360-
return id;
361362
}else{
362363
return null;
363364
}
@@ -369,7 +370,7 @@ private static String getYoutubeId(String wwwUrl){
369370

370371
public HashMap<String, String> getExcelAlfMap() {
371372
if(excelAlfMap == null){
372-
excelAlfMap = new HashMap<String, String>();
373+
excelAlfMap = new HashMap<>();
373374
excelAlfMap.put("catalog", CCConstants.CCM_PROP_IO_REPLICATIONSOURCE);
374375
excelAlfMap.put("identifier", CCConstants.CCM_PROP_IO_REPLICATIONSOURCEID);
375376
excelAlfMap.put("datestamp", CCConstants.CCM_PROP_IO_REPLICATIONSOURCETIMESTAMP);
@@ -385,6 +386,7 @@ public HashMap<String, String> getExcelAlfMap() {
385386
excelAlfMap.put("educationalTypicalAgeRange", CCConstants.CCM_PROP_IO_REPL_EDUCATIONAL_TYPICALAGERANGE);
386387
excelAlfMap.put("lifeCycleContributerAuthor", CCConstants.CCM_PROP_IO_REPL_LIFECYCLECONTRIBUTER_AUTHOR);
387388
excelAlfMap.put("lifeCycleContributerPublisher", CCConstants.CCM_PROP_IO_REPL_LIFECYCLECONTRIBUTER_PUBLISHER);
389+
excelAlfMap.put("lifeCycleContributerSubjectMatterExpert", CCConstants.CCM_PROP_IO_REPL_LIFECYCLECONTRIBUTER_SUBJECT_MATTER_EXPERT);
388390
excelAlfMap.put("metadataContributerProvider", CCConstants.CCM_PROP_IO_REPL_METADATACONTRIBUTER_PROVIDER);
389391
excelAlfMap.put("metadataContributerCreator", CCConstants.CCM_PROP_IO_REPL_METADATACONTRIBUTER_CREATOR);
390392
excelAlfMap.put("technicalFormat", CCConstants.LOM_PROP_TECHNICAL_FORMAT);
@@ -406,6 +408,7 @@ public HashMap<String, String> getExcelAlfMap() {
406408
excelAlfMap.put("licenseValid",CCConstants.CCM_PROP_IO_LICENSE_VALID);
407409
excelAlfMap.put("originUniversity",CCConstants.CCM_PROP_IO_UNIVERSITY);
408410
excelAlfMap.put("metadataset",CCConstants.CM_PROP_METADATASET_EDU_METADATASET);
411+
excelAlfMap.put("authorFreetext",CCConstants.CCM_PROP_AUTHOR_FREETEXT);
409412
excelAlfMap.put("oeh_widgets","{" + CCConstants.NAMESPACE_CCM+"}oeh_widgets");
410413
}
411414
return excelAlfMap;

Backend/services/core/src/main/java/org/edu_sharing/repository/server/importer/OAIPMHLOMImporter.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public void startImport() throws Throwable{
133133

134134
//take identifiers list cause some of the sets don't work: XML-Verarbeitungsfehler: nicht wohlgeformt
135135
String url = this.oai_base_url+"?verb=ListIdentifiers&metadataPrefix="+this.metadataPrefix;
136-
String setUrl = url+"&set="+set;
136+
String setUrl = set.equals("-none-") ? url : url+"&set="+set;
137137
if(this.from != null && this.until != null){
138138
String fromString = OAIConst.DATE_FORMAT.format(this.from);
139139
String untilString = OAIConst.DATE_FORMAT.format(this.until);

Backend/services/core/src/main/java/org/edu_sharing/repository/server/importer/RecordHandlerDublinCoreDMG.java

+7-2
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,13 @@ public void handleRecord(Node nodeRecord, String cursor, String set) throws Thro
7777

7878

7979
String lomCatalogId = null;
80-
if(replicationId != null && replicationId.split(":").length == 3){
81-
lomCatalogId = replicationId.substring(0,replicationId.lastIndexOf(":"));
80+
if(replicationId != null){
81+
if(replicationId.split(":").length == 3) {
82+
lomCatalogId = replicationId.substring(0, replicationId.lastIndexOf(":"));
83+
}
84+
if(replicationId.split(":").length == 2){
85+
lomCatalogId = replicationId.split(":")[0];
86+
}
8287
}
8388

8489
HashMap<String, Object> generalIdentifierToSafeMap = new HashMap<String, Object>();

Backend/services/core/src/main/java/org/edu_sharing/repository/server/jobs/quartz/MigrateDirectPublishedElements.java

+8-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
import java.io.Serializable;
3030
import java.util.Collections;
31+
import java.util.List;
3132
import java.util.Set;
3233
import java.util.stream.Collectors;
3334

@@ -39,6 +40,8 @@ public class MigrateDirectPublishedElements extends AbstractJobMapAnnotationPara
3940

4041
@JobFieldDescription(description = "Single node to migrate")
4142
private String nodeId;
43+
@JobFieldDescription(description = "nodes to explicitly exclude")
44+
private List<String> ignoredNodeIds;
4245
private NodeService nodeService;
4346
private BehaviourFilter policyBehaviourFilter;
4447
private ServiceRegistry serviceRegistry;
@@ -63,14 +66,18 @@ public void executeInternal(JobExecutionContext context) throws JobExecutionExce
6366
runner.setTask(this::migrate);
6467
runner.setRunAsSystem(true);
6568
runner.setThreaded(false);
66-
runner.setLucene("ISNOTNULL:\"ccm:published_handle_id\" AND ISNULL:\"ccm:published_original\" AND NOT ASPECT:\"ccm:collection_io_reference\"");
69+
runner.setLucene("ISNOTNULL:\"ccm:published_handle_id\" AND ISNULL:\"ccm:published_original\" AND NOT ASPECT:\"ccm:collection_io_reference\" AND NOT @ccm\\:published_mode:\"copy\"");
6770
runner.setKeepModifiedDate(false);
6871
runner.setTransaction(NodeRunner.TransactionMode.None);
6972
int count=runner.run();
7073
logger.info("Processed "+count+" nodes");
7174
}
7275

7376
private void migrate(NodeRef ref) {
77+
if(ignoredNodeIds != null && ignoredNodeIds.contains(ref.getId())) {
78+
logger.warn("Node " + ref + " shall be ignored");
79+
return;
80+
}
7481
Serializable handleId = NodeServiceHelper.getPropertyNative(ref, CCConstants.CCM_PROP_PUBLISHED_HANDLE_ID);
7582
if(handleId == null) {
7683
logger.warn("Can not migrate node " + ref + " since it has no handle id");

Backend/services/core/src/main/java/org/edu_sharing/restservices/NodeDao.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,13 @@ public NodeDao copyProperties(NodeDao fromDao) throws DAOException {
213213
.forEach(defaultProps::remove);
214214

215215
for (String prop : defaultProps) {
216-
if (!props.containsKey(prop) && CCConstants.getValidGlobalName(prop) != null) {
216+
if (!props.containsKey(prop) && CCConstants.getValidGlobalName(prop) != null &&
217+
// protected publish props
218+
!Arrays.asList(
219+
CCConstants.CCM_PROP_IO_PUBLISHED_ORIGINAL, CCConstants.CCM_PROP_IO_PUBLISHED_MODE,
220+
CCConstants.CCM_PROP_PUBLISHED_HANDLE_ID, CCConstants.CCM_PROP_IO_PUBLISHED_DATE
221+
).contains(CCConstants.getValidGlobalName(prop))
222+
) {
217223
// delete removed properties
218224
nodeService.removeProperty(getStoreProtocol(), getStoreIdentifier(), getId(), CCConstants.getValidGlobalName(prop));
219225
}

Backend/services/core/src/main/java/org/edu_sharing/service/clientutils/ClientUtilsService.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ public static WebsiteInformation getWebsiteInformation(String url) {
6060
boolean validDomain = DomainValidator.getInstance(false).isValid(domain);
6161
if(!validDomain){
6262
defaultHandling(url, info);
63-
return info;
64-
}
63+
return info;
64+
}
6565

6666
new URL(url);
6767
HttpQueryTool httpQuery = new HttpQueryTool();
@@ -139,6 +139,7 @@ public static WebsiteInformation getWebsiteInformation(String url) {
139139
}
140140
}
141141
}
142+
addDuplicateNodes(url, info);
142143
return info;
143144
} catch (Throwable e) {
144145
logger.info(e.getMessage());

Backend/services/core/src/main/java/org/edu_sharing/service/handleservice/HandleServiceImpl.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public HandleServiceImpl() throws HandleServiceNotConfiguredException{
9595
/**
9696
* config dir: must be writeable
9797
*/
98-
String configDir = config.getString("configDir");
98+
String configDir = (config.hasPath("configDir")) ? config.getString("configDir") : null;
9999
if (configDir != null) {
100100
System.setProperty("net.handle.configDir", configDir);
101101
}

Backend/services/core/src/main/java/org/edu_sharing/service/nodeservice/NodeServiceImpl.java

+4
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,10 @@ public void updateNodeNative(StoreRef store, String nodeId, Map<String, ?> _prop
734734
(m,entry)-> m.put(QName.createQName(entry.getKey()), (Serializable) entry.getValue()),
735735
HashMap::putAll
736736
);
737+
738+
// check that no interceptor has set a previously null variable
739+
propsNull.removeIf(prop -> propsStore.get(prop) != null);
740+
737741
nodeService.setProperties(nodeRef, propsStore);
738742
// do in transaction to disable behaviour
739743
// otherwise interceptors might be called multiple times -> the final update props is enough!

Backend/services/core/src/main/java/org/edu_sharing/service/search/SearchServiceElastic.java

+1
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,7 @@ BoolQuery.Builder getGlobalConditions(List<String> authorityScope, List<String>
685685
BoolQuery.Builder permissionsFilter = QueryBuilders.bool().must(must -> must.bool(queryGlobalConditionsFactory::apply));
686686
String user = serviceRegistry.getAuthenticationService().getCurrentUserName();
687687
permissionsFilter.should(should -> should.match(match -> match.field("owner").query(user)));
688+
permissionsFilter.minimumShouldMatch("1");
688689
for (String permission : permissions) {
689690
permissionsFilter.should(s -> s.bool(bool -> getPermissionsQuery(bool, "permissions." + permission)));
690691
}

0 commit comments

Comments
 (0)