cancel
Showing results for 
Search instead for 
Did you mean: 

Wrong locale with the Java Web service

elvo
Champ in-the-making
Champ in-the-making
Hi everyone,

I'm having some issues with my Alfresco Community 3.4d and I'd like to know if I have done something wrong, or forgotten to do something important.

I've installed Alfresco and Share on a server and configured them to suit my needs. No issue here: new aspect, custom properties… Then, I've created some files (with Share) with a title and a description (cm:titled aspect + some of my custom aspects as well). Still no issue. On another computer, I'm using the Alfresco Java Web service client to access those data. Still works like a charm. But then, that's where things get complicated.

I've created some user accounts for my coworkers to create and modify those files (title, description and content among other things). Everything went smoothly in Share. However, whenever I try to access those modification using the Alfresco Web service, I can't see them on title and description. I can however see them on my customized properties (mostly cm:text fields). I was wondering if I had done something wrong in the call but I have bump into something, I believe, is related. When I connect to Alfresco Explorer with my admin account, I can't see the modifications my coworkers have done. However, if I change the Content filter language in my user profile to French (All our Share user account are in French), I can see them.

So I was wondering: is there anyway to disable that feature (although I've already disable the multilingual feature) on mltext fields? Is there anyway to indicate what locale I want the web service to use?

Thanks in advance,
3 REPLIES 3

loftux
Star Contributor
Star Contributor
You have hit one of the most annoying features in Alfresco: https://issues.alfresco.com/jira/browse/ALF-3756
The issue filed there is marked as resolved… it is not.

For documents, you can just skip using those fields, and create your own non multilingual text fields, and update your forms for those fields.
Unfortunately the title and description are "hardcoded" in Share document listings, so you wont see your custom fields there, unless you do some coding. In 4.0 this can be done with mostly config.

elvo
Champ in-the-making
Champ in-the-making
Thank you for your response and for the link.

I think I've found a temporary fix, but I'd like your opinion on it. Looking at the source code of the API (for know I'm only interested in the Web service calls), I've found that there is no call to I18NUtil.setContentLocale to indicate the desired user's locale in any of the implemented Web methods. I've put together a filter for all of the Web service API and forcing the content language to fr (French) and it works. Same thing when I intentionally set the content language in the filter to en (English), even though that's not what I'm interested in right now  Smiley Happy .

I think that solves my problem, but it's not as good as I want it to be. The best way (I think) would be to use the Content Language Filter from the user logged in with the Authentication Web Service. Do you know any way to access the user's preference from a filter with the Web service API?

Thanks in advance,

loftux
Star Contributor
Star Contributor
Sorry, can't give an opinion on your suggested workaround since I havent worked with web services at all. Hopefully someone who has can jump in and give an opinion.
What is good news is that the issue was reopened yesterday Smiley Very Happy so eventually we will get a fix for this.