Translation Manager Retrieval for Preview AppData Context

Context

Few months ago I worked in a project, in a customization of the default translation process of Translation Manager.

Back then, everything was working good for them, but one day they came with this idea “We want to be able to review the content in Tridion before the Translation Job is completed”. so that mean that they wanted to have in Tridion the translated content from the Translation Management System (TMS) before the TM Workflow is completed (the Translation Job is marked as Completed).

Because of the requirements of the client, the previous implementation was quite complex, having different event system already running in their box.

Solution

In order to support this scenario, Tridion has a Translation Manager hotfix that needs to be installed. the hotfix is “Hotfix TT88617“. after you install in the box where TM is running, you need to execute some steps in the TMS side. Basically a new manual activity called “Translated Content Retrieval for Preview” needs to be created in the Translation workflow. so, a very basic workflow would be :

TM-workflow

 

Custom Implementation

Because of the previous complex implementation and having in mind that we wanted to let the user to review the translated content in Tridion. and because this content was already in translation process, we were not able to see the translated content in CME graphic interface. So the solution was to publish the translated content (the current minor version) into the staging (Presentation Server), that way they user could hit the page and see its translated content.

Well, that was the solution in paper, after that we needed to design it and then implement it, here is a very high level design of the solution.

solution-design

The green boxes were executed in Event system context, the blue ones, in Automatic workflow activities in Tridion.

so, in a nutshell, we created a event system component that was listening for the save event for the components. In that event we validated that the execution was in a translated context, if so, we validated that it was the “Retrieval for Preview” step and not the final step (completed). if the execution met this validations we would publish the content.

we are not going to go in details about the whole implementation, instead we will focus in once specific part of this, the validation to know if the execution was either in the “Retrieval for Preview” or the translation Job was completed. because both scenarios had the exactly the same context.

In order to validate this, we needed to use Core Services to retrieve the application Data, this is an example :

app-data

once we were able to get the appData we needed to go through it and locate the value of the RetrieveReasons attribugte and validate if the values was “Review”

validation

 

Hope if was helpful.