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...
Solved! Go to Solution.
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"
Hi @nenadteo,
Great that you found a solution & thanks for posting it - will help other users.
Thanks again,
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.