4

We have a new column "Creator" added to Translation manager UI, via GUI extention - to show the name of user who created respective Translation job.

Model.config has:

<cfg:group name="TMOverViewScreen" merger="Tridion.Web.UI.Core.Configuration.Resources.DomainModelProcessor" merge="always">
    <cfg:domainmodel name="TMOverView.Override">
        <cfg:fileset>
        <cfg:file type="script">/Scripts/OverRideTranslationJobList.js</cfg:file>
        </cfg:fileset>

        <cfg:services>
        </cfg:services>
    </cfg:domainmodel>
</cfg:group>

Javascript file has:

tridion.TranslationManager.UI.Model.TranslationJobManager.GetTranslationJobs(filter.conditions, mySuccess, failure);

This fires ajax call to get Translationjobs, and then we are processing list of jobs by adding value to new column in "mysuccess" funciton.

This is running fine in 2013sp1, however not working in Web 8.5. The AJAX response is different in two versions:

For 2013sp1, response:

{
    "d": [{
        "__type": "InvocationResult:#Tridion.Web.UI.Core",
        "Body": "{"d":{"__type":"TranslationJobDTO:#Tridion.TranslationManager.UI.Model.Services.DTO","AddedItems":[{"__type":"TranslationJobDTO.AddedItemDTO:#Tridion.TranslationManager.UI.Model.Services.DTO","AccessDenied":false,"Icon":"T16","ItemType":"tcm:16","TcmUri":"tcm:12-26964"
.........

However, in Web8.5, response is:

{
    "d": [{
        "__type": "InvocationResult:#Tridion.Web.UI.Core",
        "Body": "{"d":"<tm:TranslationJob xmlns:xlink=\\"http:\\\/\\\/www.w3.org\\\/1999\\\/xlink\\" xmlns:tm=\\"http:\\\/\\\/www.tridion.com\\\/TranslationManager\\"><tm:ContextPublicationTitle>200 Content Publication<\\\/tm:ContextPublicationTitle><tm:DisplayState>2<\\\/tm:DisplayState><tm:ErrorSeverityLevel>0<\\\/tm:ErrorSeverityLevel><tm:HasError>false<\\\/tm:HasError><tm:Id>8811
.............

Only problem looks here is "Body" element of AJAX response, is in XML in web8.5 - do we have any way to get it in JSON.

Edit1: (solution by reading Creator from XML) I am able to make it work by reading the Creator from XML.

tridion.TranslationManager.UI.Model.TranslationJobManager.Load(tmId,function(job){

parser1=new DOMParser();
parseJobXml=parser1.parseFromString(job,"text/xml");

var jobCreator = parseJobXml.getElementsByTagName("tm:Creator")[0].textContent;

val.setAttribute('User',jobCreator);
}
2

Message format between model services and browser is not part of public API. And we reserve right to change it.

Using "tridion.TranslationManager.UI.Model.TranslationJobManager.Load" for loading translation job is also not part of public API

What you should be using from beginning is $models.getItem() this method make same call to TM API but it parse response and present it in form of model object just like other items in CME.

This method did not changed between versions.

Examples of using in 2013ps1:

$models.getItem("tm:2-123") 

in Web 8.5:

$models.getItem("tm:0-123-2")

where 123 is ID of translation job.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.