cancel
Showing results for 
Search instead for 
Did you mean: 

multilingual text via the Java API

shay
Champ in-the-making
Champ in-the-making
Hi,

I used the MLText class (with java API) in order to insert some text in different languages:

MLText contentTitle
MLText contentDescription

Map<QName, Serializable> titledProps = new HashMap<QName, Serializable>();
           titledProps.put(ContentModel.PROP_TITLE, contentTitle);
           titledProps.put(ContentModel.PROP_DESCRIPTION, contentDescription);
           nodeService.addAspect(content, ContentModel.ASPECT_TITLED, titledProps);

when i try to read these properties i get these properties as a String instead of MLText:

MLText descriptions = (MLText)galleryProps.get(ContentModel.PROP_DESCRIPTION);

the debugger shows that this property is a String instead of MLText,
   
when i trace the getProperty process via the debugger it looks like this property is MLText  but at the end of the process it gets modified somehow to a String.

is there any other way which i can get these properties as MLText?      

Thanks in advance,
Shay.
2 REPLIES 2

shay
Champ in-the-making
Champ in-the-making
still looking for help about this issue

derek
Star Contributor
Star Contributor
MLPropertyInterceptor.setMLAware(true);
The default behaviour assumes the client knows nothing of ML services.  We'll probably switch this around at some stage, but it will break many clients.