It's all about the answers!

Ask a question

require an external dojo module not working when loaded from a javascript update site


Guido Schneider (3.3k137699) | asked Apr 10 '15, 10:35 a.m.
Dear All,
we have written a extension for CCM and load this as an updatesite in CCM.
Registering and starting the update site is working. New functions like menu items and new buttons are available in CCM.

Where we have problem is with the Dojo "require" command if the module we request is NOT inside the update side deployed but on an external webserver (same IHS webserver than the jazz server is behind).

Following code is not working. There is no error message seen:

require(
packages: [
                    {
  name: "popup"
                        location: "https://localhost/projects/randomgenerator",
                        main: "popup"
                    }
                ]
            },
            [ "popup" ],
            function(Popup) {
                var popup = new Popup();
               
popup.say();
            }
        );

This is working if I run the whole stuff outside jazz. So Dojo do not have an issue with loading modules which are not stored under his baseurl but on a remote webserver.

If I store the module inside the updatesite so it is loaded below the baseurl of Dojo, all is working.

I have also tried adding the URL to the whitelist of CCM, but this has not helped.

Any idea how I can bring Jazz-Dojo to load my external modules?

regards
Guido


Comments
Jonas Studer commented Apr 13 '15, 4:14 a.m.

Hy Guido,

I also had a lot of trouble with loading external Modules (or loading old ones with AMD).
Maybe this might help.
When I require a module/js-script (notice, Jazz still uses Dojo 1.8.4)
"com.ibm.team.process.web.client.internal.ProcessClient",

I'm getting an error.
E.g. "Unresolved module with id: com.ibm.team.process.web.client.internal.ProcessClient"

But because, most of the Jazz scripts are written under Dojo 1.7 (Pre-AMD Code) it'll get some problems there but just in the console.
You'll get acces to your module through dojo.global
"dojo.global.com.ibm.team.process.web.client.internal.ProcessClient"

Hopefully this will help.
And if the Script is on anothe Server, Withelisting may also be an issue.


Be the first one to answer this question!


Register or to post your answer.