AnsweredAssumed Answered

How to implement makeTranslation?

Question asked by hbf on Sep 27, 2007
Latest reply on Sep 26, 2008 by ostein

I need to make my nodes multilingual from a script and therefore need a way to emulate from script what a user can do by clicking the "Make multilingual" property in the Web Client.

I first thought that it suffices to add the aspect "cm:mlDocument", but this results in an exception. Digging a little deeper I found in projects/web-client/source/java/org/alfresco/web/bean/ml/ that I am supposed to make a call to the Multilingual Content Service:
multilingualContentService.makeTranslation(nodeRef, locale);

Unfortunately, there is no API call (neither in the PHP API – what I am using right now – nor in the JavaScript API) that does this. So I thought I would implement it myself in Alfresco PHP's Node.php.

Alfresco PHP collects, as far as I understand it, the commands you ask it to do in form of CML statements and executes them at save()-time using update(). It seems that CML does not yet support the Multilingual Content Service.

So I guess one would have to start by adding makeTranslation() in some form to CML, right?

Are there any plans for this? Is there a way around this issue (except, programming in Java instead of PHP)?


P.S. Out of curiosity: why did you choose to "buffer" all commands in Alfresco PHP and execute them all at once in the end? Couldn't you have used the Alfresco transaction support directly and forward all calls immediately to the repository?