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 Jun 7, 2024
2 parents 8071289 + f9f6600 commit 0c3e629
Show file tree
Hide file tree
Showing 28 changed files with 246 additions and 85 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,13 @@ public String determineSiteId(WebDAVMethod method)

public String determineSiteId(NodeRef rootNodeRef, String path)
{
/**
* edu-sharing fix
* For regular users, an AccessDenied Exception is thrown which might causes a (silent) transaction rollback when a Delete was requested
* Since we don't use different sites anyway, we simply return the default value
*/
return EMPTY_SITE_ID;
/*
SiteService siteService = getServiceRegistry().getSiteService();
String siteId;
try
Expand All @@ -876,6 +883,7 @@ public String determineSiteId(NodeRef rootNodeRef, String path)
siteId = EMPTY_SITE_ID;
}
return siteId;
*/
}

@Deprecated
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ public class FixElasticSearchDeletedNodes extends AbstractJob{
ApplicationContext applicationContext = AlfAppContextGate.getApplicationContext();
ServiceRegistry serviceRegistry = (ServiceRegistry) applicationContext.getBean(ServiceRegistry.SERVICE_REGISTRY);
NodeService nodeService = serviceRegistry.getNodeService();

public static String INDEX_WORKSPACE = "workspace";

@Override
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
execute = Boolean.parseBoolean( (String) jobExecutionContext.getJobDetail().getJobDataMap().get("execute"));
Expand All @@ -75,7 +72,7 @@ private void search(ObjectBuilder<Query> queryBuilder, SearchResultHandler searc
int page = 0;
do{
if(response == null) {
response = search(INDEX_WORKSPACE, queryBuilder, scroll);
response = search(SearchServiceElastic.WORKSPACE_INDEX, queryBuilder, scroll);
}else {
response = scroll(scroll,response.scrollId());
}
Expand Down Expand Up @@ -148,7 +145,7 @@ public void handleSearchHit(Hit<Map> searchHit) throws IOException {

if(execute){
searchServiceElastic.deleteNative(DeleteRequest.of(req->req
.index(INDEX_WORKSPACE)
.index(SearchServiceElastic.WORKSPACE_INDEX)
.id(dbid)));
}
}
Expand Down Expand Up @@ -202,7 +199,7 @@ private void cleanupSubArray(String dbid, Hit<Map> searchHit, List<Map<String, O

if(execute) {
update(UpdateRequest.of(req->req
.index(INDEX_WORKSPACE)
.index(SearchServiceElastic.WORKSPACE_INDEX)
.id(searchHit.id())
.script(src->src.inline(il->il.lang("painless").source("ctx._source.remove(params.get('value'))").params(params)))));
}
Expand All @@ -226,7 +223,7 @@ private void cleanupSubArray(String dbid, Hit<Map> searchHit, List<Map<String, O

if(execute) {
update(UpdateRequest.of(req->req
.index(INDEX_WORKSPACE)
.index(SearchServiceElastic.WORKSPACE_INDEX)
.id(searchHit.id())
.doc(data)));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ public List<NodeRef> searchAll(MetadataSet mds, String query, Map<String, String
.index(WORKSPACE_INDEX)
.scroll(Time.of(time -> time.time("60s")))
.source(src -> src
.filter(filter -> filter.excludes(searchToken.getExcludes()))
.filter(filter -> filter.excludes(appendDefaultExcludes(searchToken.getExcludes())))
)
.size(100)
.query(q -> q
Expand Down Expand Up @@ -400,6 +400,16 @@ public List<NodeRef> searchAll(MetadataSet mds, String query, Map<String, String
return data;
}

private List<String> appendDefaultExcludes(List<String> excludes){
if(excludes == null) excludes = new ArrayList<>();
else excludes = new ArrayList<>(excludes);

if(!excludes.contains("content.fulltext")){
excludes.add("content.fulltext");
}
return excludes;
}

@Override
public SearchResultNodeRef search(MetadataSet mds, String query, Map<String, String[]> criterias,
SearchToken searchToken) throws Throwable {
Expand Down Expand Up @@ -437,7 +447,7 @@ public SearchResultNodeRef search(MetadataSet mds, String query, Map<String, Str

SearchRequest.Builder searchRequestBuilder = new SearchRequest.Builder()
.index(WORKSPACE_INDEX)
.source(src -> src.filter(filter -> filter.excludes(searchToken.getExcludes())));
.source(src -> src.filter(filter -> filter.excludes(appendDefaultExcludes(searchToken.getExcludes()))));

SearchResponse<Map> searchResponseAggregations = null;
if (searchToken.getFacets() != null) {
Expand Down Expand Up @@ -504,8 +514,6 @@ public SearchResultNodeRef search(MetadataSet mds, String query, Map<String, Str
if (searchToken.getSortDefinition() != null) {
searchToken.getSortDefinition().applyToSearchSourceBuilder(searchRequestBuilder);
}
searchRequestBuilder.source(SourceConfig.of(s -> s.filter(f -> f.excludes("content.fulltext"))));


// logger.info("query: "+searchSourceBuilder.toString());
SearchRequest searchRequest = searchRequestBuilder.build();
Expand Down Expand Up @@ -1431,6 +1439,9 @@ private SearchResultNodeRef searchByQuery(BoolQuery query, int skipCount, int ma
searchRequestBuilder.from(skipCount);
searchRequestBuilder.size(maxItems);
searchRequestBuilder.trackTotalHits(new TrackHits.Builder().enabled(true).build());
searchRequestBuilder.source(src -> src
.filter(filter -> filter.excludes(appendDefaultExcludes(new ArrayList<>())))
);
if (sortDefinition != null) {
sortDefinition.applyToSearchSourceBuilder(searchRequestBuilder);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,11 @@ public boolean trackActivityOnNode(NodeRef nodeRef,NodeTrackingDetails details,
nodeService.setProperty(nodeRef.getStoreRef().getProtocol(),nodeRef.getStoreRef().getIdentifier(),nodeRef.getId(),qname,finalValue, false);
policyBehaviourFilter.enableBehaviour(nodeRef);
// change the value in cache
Map<String, Object> cache = new RepositoryCache().get(nodeRef.getId());
RepositoryCache cacheService = new RepositoryCache();
Map<String, Object> cache = cacheService.get(nodeRef.getId());
if(cache!=null) {
cache.put(qname, finalValue);
new RepositoryCache().put(nodeRef.getId(), cache);
}
return null;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ describe('TranslationsService', () => {
);
expect(configurationServiceSpy.calls.mostRecent().args).toEqual([
'supportedLanguages',
['de', 'de-informal', 'en', 'fr', 'it', 'none'], // Translation.DEFAULT_SUPPORTED_LANGUAGES
['de', 'de-informal', 'de-no-binnen-i', 'en', 'fr', 'it', 'none'], // Translation.DEFAULT_SUPPORTED_LANGUAGES
]);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,15 @@ import { ConfigService, LANGUAGES, SessionStorageService } from 'ngx-edu-sharing
import { AppService } from '../services/abstract/app.service';

// 'none' means that only labels should be shown (for dev)
const DEFAULT_SUPPORTED_LANGUAGES = ['de', 'de-informal', 'en', 'fr', 'it', 'none'];
const DEFAULT_SUPPORTED_LANGUAGES = [
'de',
'de-informal',
'de-no-binnen-i',
'en',
'fr',
'it',
'none',
];

@Injectable({ providedIn: 'root' })
export class TranslationsService {
Expand Down Expand Up @@ -129,7 +137,7 @@ export class TranslationsService {
}
if (selectedLanguage === 'none') {
this.translate.setDefaultLang('none');
} else if (selectedLanguage === 'de-informal') {
} else if (selectedLanguage?.startsWith('de-')) {
this.translate.setDefaultLang('de');
} else {
this.translate.setDefaultLang(supportedLanguages[0]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ export class CollectionsMainComponent implements OnDestroy {
this.connector.hasToolPermissionInstant(
RestConstants.TOOLPERMISSION_INVITE_ALLAUTHORITIES,
);
if (this.tabSelected === RestConstants.COLLECTIONSCOPE_TYPE_EDITORIAL) {
if (this.tabSelected === RestConstants.COLLECTIONSCOPE_TYPE_MEDIA_CENTER) {
allowed = allowed && this.adminMediacenters?.length === 1;
} else if (this.tabSelected === RestConstants.COLLECTIONSCOPE_TYPE_EDITORIAL) {
allowed =
Expand Down
3 changes: 2 additions & 1 deletion Frontend/src/app/modules/login/login.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ export class LoginComponent implements OnInit, OnDestroy, AfterViewInit {
} else if (data.currentScope === this.scope) {
if (
data.statusCode === RestConstants.STATUS_CODE_OK &&
params.local !== 'true'
// force redirect when local was NOT requested or redirectFromSSO was enforced
(params.local !== 'true' || params.redirectFromSSO === 'true')
) {
this.goToNext(data);
}
Expand Down
3 changes: 3 additions & 0 deletions Frontend/src/assets/i18n/admin/de-no-binnen-i.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"Konto": "Nutzende Person"
}
6 changes: 6 additions & 0 deletions Frontend/src/assets/i18n/collections/de-no-binnen-i.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"COLLECTIONS": {
"ORDER_COLLECTIONS_INFO": "Betrachtende der Sammlung sehen die enthaltenen Untersammlungen in der festgelegten Reihenfolge.",
"CREATOR": "Ersteller{{GENDER_SEPARATOR}}in"
}
}
32 changes: 32 additions & 0 deletions Frontend/src/assets/i18n/common/de-no-binnen-i.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"NODE": {
"ccm:lifecyclecontributer_publisher": "Herausgeberschaft",
"ccm:lifecyclecontributer_authorFN": "Autorin/Autor",
"ccm:author_freetext": "Weitere Angaben zur Urheberschaft"
},

"LICENSE": {
"LINK_AUTHOR": "Link zur Autorin/zum Autor",
"DESCRIPTION": {
"CC_BY": "Autorin/Autor muss genannt werden."
}
},
"ACCESSIBILITY": {
"AUTHOR": "Autorin/Autor"
},
"NODE_VARIANT": {
"WARNING": {
"NO_LICENSE": "Dieses Material besitzt noch keine Lizenz.\nSetzen Sie sich ggf. mit der Autorin/dem Autor in Verbindung, um Lizenzverstöße zu vermeiden.",
"COPYRIGHT": "Dieses Material besitzt eine Copyright-Lizenz.\nSetzen Sie sich ggf. mit der Autorin/dem Autor in Verbindung, um Lizenzverstöße zu vermeiden.",
"ND": "Dieses Material besitzt eine Non Derivative Lizenz. Diese Lizenz legt fest, dass das Material nicht verändert werden darf.\nSetzen Sie sich ggf. mit der AUtorin/dem Autor in Verbindung, um Lizenzverstöße zu vermeiden."
}
},
"FEEDBACK": {
"CREATOR": "Autorin/Autor {{creator}}"
},
"MDS": {
"AUTHOR_LABEL": "Angaben zur Urheberschaft",
"AUTHOR_FREETEXT": "Weitere Angaben zur Urheberschaft",
"AUTHOR_PERSON": "Beteiligte"
}
}
2 changes: 1 addition & 1 deletion Frontend/src/assets/i18n/common/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@
"Coordinator": "Koordinator",
"CCPublish": "veröffentlichen"
},
"ACCESSIBILITY": {
"ACCESSIB ILITY": {
"LASTMODIFIED": "Letztes Änderungsdatum",
"AUTHOR": "Autor{{GENDER_SEPARATOR}}in",
"SOURCE": "Quelle",
Expand Down
16 changes: 4 additions & 12 deletions Frontend/src/assets/i18n/common/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@
"ADD_TO_SELECTED_COLLECTION": "Add here",
"NO_RECENT_COLLECTIONS": "No recently used collections available"
},
"ADD_TO_RECENT_COLLECTION": "Add to recent collection",
"SEARCH_COLLECTIONS": "Search collection...",
"SUB_CATEGORY_ARIA": "sub category",
"ASK_CC_PUBLISH": "Ask",
"ASK_CC_PUBLISH_SUBJECT": "Request for permissions of element {{name}}",
Expand Down Expand Up @@ -126,7 +124,6 @@
"TOOLPERMISSION_INVITE_STREAM": "The permission to add content to the stream",
"TOOLPERMISSION_INVITE_LINK": "The permission to create content links",
"TOOLPERMISSION_INVITE_HISTORY": "The permission to view the sharing history",
"TOOLPERMISSION_INVITED": "The permission to see the list of invited users",
"TOOLPERMISSION_INVITE_SHARE": "The permission to share content in shared folders",
"TOOLPERMISSION_INVITE_ALLAUTHORITIES": "The permission to share content to all users",
"TOOLPERMISSION_PUBLISH_COPY": "The permission to create published copies of materials",
Expand All @@ -140,7 +137,7 @@
"TOOLPERMISSION_GLOBAL_AUTHORITY_SEARCH_SHARE_SAFE": "Searching and inviting users outside the organization in shared folders in the safe",
"TOOLPERMISSION_COLLECTION_PINNING": "Pinning collections and managing pinned collections",
"TOOLPERMISSION_COLLECTION_CURRICULUM": "Creating curriculum collections (currently not used)",
"TOOLPERMISSION_COLLECTION_FEEDBACK": "Give feedback on other collections",
"TOOLPERMISSION_MATERIAL_FEEDBACK": "Give feedback on other materials",
"TOOLPERMISSION_CONFIDENTAL": "Access to the secure area (safe)",
"TOOLPERMISSION_UNCHECKEDCONTENT": "Show sources like YouTube in your search",
"TOOLPERMISSION_WORKSPACE": "Access to the workspace",
Expand Down Expand Up @@ -309,7 +306,6 @@
},
"NODE_REPORT": {
"TITLE": "Report problem",
"SUBTITLE": "Report an issue or problem",
"REPORT": "report",
"REPORT_INFO": "Report problem with \"{{name}}\"",
"COMMENT": "Provide additional information about the problem that has occurred",
Expand Down Expand Up @@ -409,7 +405,6 @@
"TOAST_DURATION_INFINITE_INFO": "Status messages are not automatically hidden and must be closed manually.",
"TOAST_DURATION_TITLE": "display time",
"TOAST_DURATION_MESSAGE": "Status messages disappear automatically after a specified time or can be closed manually by clicking.",
"SAVED": "Settings have been saved.",
"DISMISS_TOAST": "Hide"
},
"AUTHORITY_TYPE_GROUP": "Group",
Expand Down Expand Up @@ -547,8 +542,8 @@
"EDIT_SIMPLE": "Quick-Edit",
"COLLECTION_EDIT": "Edit",
"COLLECTION_PIN": "Pin collection",
"COLLECTION_FEEDBACK": "Feedback...",
"COLLECTION_FEEDBACK_VIEW": "View feedback",
"MATERIAL_FEEDBACK": "Feedback...",
"MATERIAL_FEEDBACK_VIEW": "View feedback",
"OPEN": "Open",
"DOWNLOAD": "Download",
"DOWNLOAD_ALL": "download zip",
Expand Down Expand Up @@ -616,15 +611,12 @@
"ADD_CHILD_OBJECT_DESCRIPTION": "Create a series by attaching more materials to this object",
"ADD_CHILD_OBJECT_QUOTA_REACHED": "Error while uploading \"{{ name }}\": Upload quota reached",
"ADD_CHILD_OBJECT_VIRUS_DETECTED": "Error while uploading \"{{ name }}\": Virus detected. File was deleted",
"CONFIRM_DISCARD_TITLE": "Discard changes?",
"CONFIRM_DISCARD_MESSAGE": "Close the dialog without saving any changes?",
"REQUIRED_MESSAGE": "Field is required",
"REQUIRED_FOR_PUBLISH_MESSAGE": "Field is required for publishing",
"INDETERMINATE_NOTICE": "Click on the chip in order to add the value \"{{ value }}\" to all elements, or remove it in order to delete it from all elements.",
"SHOW_OPTIONS_BUTTON": "Show options",
"FILTER_FOR": "Filter for \"{{value}}\" ({{count}} matching element(s))",
"FILTER_TREE": "Filter...",
"OPEN_CLOSE_EXTENDED": "Open/close view"
"FILTER_TREE": "Filter..."
},

"SIMPLE_EDIT": {
Expand Down
16 changes: 4 additions & 12 deletions Frontend/src/assets/i18n/common/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@
"ADD_TO_SELECTED_COLLECTION": "Ajouter ici",
"NO_RECENT_COLLECTIONS": "Aucune collection récemment utilisée n'est disponible"
},
"ADD_TO_RECENT_COLLECTION": "Ajouter à la collection récente",
"SEARCH_COLLECTIONS": "Recherche de collection...",
"SUB_CATEGORY_ARIA": "sous-catégorie",
"ASK_CC_PUBLISH": "Demander",
"ASK_CC_PUBLISH_SUBJECT": "Demande de permissions pour l'élément {{name}}",
Expand Down Expand Up @@ -126,7 +124,6 @@
"TOOLPERMISSION_INVITE_STREAM": "L'autorisation d'ajouter du contenu au flux",
"TOOLPERMISSION_INVITE_LINK": "L'autorisation de créer des liens de contenu",
"TOOLPERMISSION_INVITE_HISTORY": "L'autorisation de consulter l'historique des partages",
"TOOLPERMISSION_INVITED": "L'autorisation de voir la liste des utilisateurs invités",
"TOOLPERMISSION_INVITE_SHARE": "L'autorisation de partager du contenu dans des dossiers partagés",
"TOOLPERMISSION_INVITE_ALLAUTHORITIES": "L'autorisation de partager le contenu avec tous les utilisateurs",
"TOOLPERMISSION_PUBLISH_COPY": "L'autorisation de créer des copies publiées du matériel",
Expand All @@ -140,7 +137,7 @@
"TOOLPERMISSION_GLOBAL_AUTHORITY_SEARCH_SHARE_SAFE": "Recherche et invitation d'utilisateur-trices extérieur-es à l'organisation dans des dossiers partagés dans le coffre-fort",
"TOOLPERMISSION_COLLECTION_PINNING": "Épingler des collections et gérer les collections épinglées",
"TOOLPERMISSION_COLLECTION_CURRICULUM": "Création de collections de programmes d'études (actuellement non utilisé)",
"TOOLPERMISSION_COLLECTION_FEEDBACK": "Donner son avis sur d'autres collections",
"TOOLPERMISSION_MATERIAL_FEEDBACK": "Donner son avis sur d'autres ressources",
"TOOLPERMISSION_CONFIDENTAL": "Accès à la zone sécurisée (coffre-fort)",
"TOOLPERMISSION_UNCHECKEDCONTENT": "Afficher des sources telles que YouTube dans votre recherche",
"TOOLPERMISSION_WORKSPACE": "Accès à l'espace de travail",
Expand Down Expand Up @@ -309,7 +306,6 @@
},
"NODE_REPORT": {
"TITLE": "Signaler un problème",
"SUBTITLE": "Signaler une question ou un problème",
"REPORT": "rapport",
"REPORT_INFO": "Signaler un problème avec \"{{name}}\"",
"COMMENT": "Fournir des informations supplémentaires sur le problème rencontré",
Expand Down Expand Up @@ -408,7 +404,6 @@
"TOAST_DURATION_INFINITE_INFO": "Les messages d'état ne sont pas automatiquement masqués et doivent être fermés manuellement.",
"TOAST_DURATION_TITLE": "afficher l'heure",
"TOAST_DURATION_MESSAGE": "Les messages d'état disparaissent automatiquement au bout d'un certain temps ou peuvent être fermés manuellement en cliquant.",
"SAVED": "Les réglages ont été enregistrés.",
"DISMISS_TOAST": "Cacher"
},
"AUTHORITY_TYPE_GROUP": "Groupe",
Expand Down Expand Up @@ -546,8 +541,8 @@
"EDIT_SIMPLE": "Édition rapide",
"COLLECTION_EDIT": "Editer",
"COLLECTION_PIN": "Collection d'épingles",
"COLLECTION_FEEDBACK": "Retour d'information...",
"COLLECTION_FEEDBACK_VIEW": "Voir les commentaires",
"MATERIAL_FEEDBACK": "Retour d'information...",
"MATERIAL_FEEDBACK_VIEW": "Voir les commentaires",
"OPEN": "Ouvrir",
"DOWNLOAD": "Télécharger",
"DOWNLOAD_ALL": "télécharger le zip",
Expand Down Expand Up @@ -615,15 +610,12 @@
"ADD_CHILD_OBJECT_DESCRIPTION": "Créer une série en attachant d'autres ressources à cet objet",
"ADD_CHILD_OBJECT_QUOTA_REACHED": "Erreur lors du téléchargement de \"{{ name }}\" : Quota de téléchargement atteint",
"ADD_CHILD_OBJECT_VIRUS_DETECTED": "Erreur lors du téléchargement de \"{{ name }}\" : Virus détecté. Le fichier a été supprimé",
"CONFIRM_DISCARD_TITLE": "Rejeter les modifications ?",
"CONFIRM_DISCARD_MESSAGE": "Fermer la boîte de dialogue sans enregistrer les modifications ?",
"REQUIRED_MESSAGE": "Le champ est obligatoire",
"REQUIRED_FOR_PUBLISH_MESSAGE": "Le champ est obligatoire pour la publication",
"INDETERMINATE_NOTICE": "Cliquez sur la puce pour ajouter la valeur \"{{ value }}\" à tous les éléments, ou retirez-la pour la supprimer de tous les éléments.",
"SHOW_OPTIONS_BUTTON": "Afficher les options",
"FILTER_FOR": "Filtre pour \"{{value}}\" ({{count}} élément(s) correspondant(s))",
"FILTER_TREE": "Filtre...",
"OPEN_CLOSE_EXTENDED": "Vue ouverte/fermée"
"FILTER_TREE": "Filtre..."
},
"SIMPLE_EDIT": {
"TITLE": "Édition rapide",
Expand Down
Loading

0 comments on commit 0c3e629

Please sign in to comment.