Posted: 2 May 2018 7:57 EDT Last activity: 29 May 2018 7:58 EDT
The IAC/MashUp is being included through a generated HTML snippet that
- includes some JS through a loading activity
- provides a DIV with parameters in which the MashUp iframe is being generated
Customer claims that the included JS on the top level document conflicts with one of their scripts, esp. the $ variable seems to be used from "both" sides. Following the trail of the loading activity, it indeed includes many JS files with a lot of code.
1) Is the observation correct that the Pega JS may collide with JS on the main document?
2) Is there a way to just include the iframe w/o any loading script?
Thanks for looking into the matter. Indeed, the mashup loading activity assembles like half a dozen JS files and the answer to the HTTP request has got a size of ~200kB JS code.
Customer claims that within his own (complex) web UI, the "$" variable gets modified by Pega mashup and the document loading event gets modified (not sure if this is body.onload()). Hence the customer refuses to include the mashup snippet and wants a clear separation of applications by embedding only an iframe w/o any script around it.
It is quite difficult to validate the statements as the JS code is obfuscated/compressed. Certainly, there is a "$(root)." fragment in the JS code and there is a "D.onload=function()" - whatever object "D" represents at this point at runtime...
So is it possible that the mashup JS interferes with other JS frameworks at certain points?
Thanks for the comment! Unfortunately, we already tried with an iframe inside an inframe and it does not work, the layout control gets lost. In addition, it creates more deployment/maintenance effort as the outer iframe have to come from some extra WAR. Hence this situation challenges the Pega position that mashup is an easy and recommended way to bring cases into other applications.
I cannot easily reproduce the error as I don't have access to the respective environment. Customer was given the snippet and replied in a bigger meeting rather angrily that the outer mashup JS interferes with their JS. Customer insisted that only a plain iframe snippet w/o outer JS would be acceptable. Changing code at the outer, consuming application is not possible either as this is kind of a "given product" as well.
So if the mashup actually uses JQuery and JQuery is a widely spread framework, what is Pega's plan to cope with version differences? In the "Java part" for example, Pega repackages public framework/helper JARs with a com.pega prefix for differentiating classes from class loaders perspective.
In-order for mashup to load in the host page, it is required to have some pega bootstrapping JS loaded in the host document upfront which will do the job of parsing the host document for mashup snippets and accordingly rendering mashup gadgets (creating iframe etc...).