03-26-2020 09:22 AM
Hello
in Alfresco Community v5.1.e we are executing the query in the custom Java based web script and then we take the metadata from the documents returned.
Users using different language settings in Browser which affects values for cm:description property.
Even if we specify in Locale in SearchParameters.java
SearchParameters sp = new SearchParameters(); sp.setLanguage(SearchService.LANGUAGE_FTS_ALFRESCO); sp.addLocale(Locale.GERMAN);
sp.addStore(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE);
String query = "TYPE: "xyz:publishedDocument"
sp.setQuery(query);
...
we do not receive the German version of cm:description property of document.
If we call this GET webscript from Browser always Browser's language settings will be taken, so if English is set in Browser, we won't receive the cm:description values which were set in German, but if German is set in Browser we receive it. So somehow the searchService ignores explicite Locale settings in Java API and always uses Browsers settings.
Do you know where is the problem and how to force searchService to use Locale settings in SearchParameters?
Thanks...
03-27-2020 02:11 AM
03-26-2020 10:55 AM
Hello
if I try to cast the property
MLText versionFolderDescriptionML =
(MLText) nodeService.getProperty(mainDocumentNodeRef, ContentModel.PROP_DESCRIPTION);
we receve
"java.lang.ClassCastException: java.lang.String cannot be cast to org.alfresco.service.cmr.repository.MLText"
03-27-2020 02:11 AM
I found solution on this link:
03-27-2020 02:44 AM
Hi @nenadteo,
Great that you found a solution & thanks for posting it - will help other users.
Thanks again,
Explore our Alfresco products with the links below. Use labels to filter content by product module.