i've got question javascript error i'm seeing while migrating old portal6.1 customized theme (where i'm using dojo1.9.1) customized portal8.0 theme (which comes dojo1.7).
i'm working websphere portal 8.0.0.1/cf12 , 'til have been relying on old portal6.1-based customized theme "compass_them_urs". in old theme i've been using dojo1.9.1 third-party module, manually providing dojo1.9 folder structure , manually registering theme. relevant folder structure under compassthemesurs webmodule is:
- compassthemesurs/themes/html/compass_theme_urs/head.jspf
- compassthemesurs/themes/html/compass_theme_urs/default.jsp
- compassthemesurs/themes/html/commonurs/dojo/1.9.1/dijit
- compassthemesurs/themes/html/commonurs/dojo/1.9.1/dojo
- compassthemesurs/themes/html/commonurs/dojo/1.9.1/dojox
- compassthemesurs/themes/html/commonurs/dojo/com/ibm/ <--- copied here old portal6.1 theme
- compassthemesurs/themes/html/commonurs/dojo/ibm/portal <--- copied here old portal6.1 theme
i register/load dojo1.9.1 version theme's head.jspf file defining "dojoconfig" variable prior loading dojo.js.uncompressed.js file so:
<script> var dojoconfig = { baseurl: "/compassthemesurs/themes/html/commonurs/", async: false, tlmsiblingofdojo: false, paths: { "com/ibm": "dojo/com/ibm", "ibm/portal": "dojo/ibm/portal" }, packages: [ { name: "gridx", location: "dojo/gridx-1.3.0" }, { name: "dojo", location: "dojo/1.9.1/dojo" }, { name: "dijit", location: "dojo/1.9.1/dijit" }, { name: "dojox", location: "dojo/1.9.1/dojox" }, { name: "commonjs", location: "js" } ] }; </script> <script src="/compassthemesurs/themes/html/commonurs/dojo/1.9.1/dojo/dojo.js.uncompressed.js" data-dojo-config="isdebug:true, parseonload: false"></script>
my portlets, have been using dojo1.9.1-enhanced customized theme "compass_theme_urs", see no interference of kind version of dojo (i believe v1.4) came old portal6.1. however, i've since created new customized theme, fpmthemeurs8, based on newer portal8.0 theme , seeing interference being used. first issue was:
"error: definealreadydefined"
which makes sense since copied above register/load code old theme's head.jspf file new theme's default.jsp file, , evidently new theme had included dojo1.7 module - making include duplicate error. - commented out line includes dojo.js.uncompressed.js file , error went away.
the next error this:
"networkerror: 404 not found - https://localhost:10060/compassthemesurs/themes/html/commonurs/dojo/com/ibm/bundles/nls/en/resolver.js"
so looked resolver.js file , found under installed portalserver folder here:
c:\opt\ibm\websphere\portalserver\theme\wp.theme.dojo\installedapps\dojo.ear\dojo.war\com\ibm\bundles\nls\en\resolver.js
when view value of "djconfig" variable firebug console see it's been defined as:
var djconfig = { afteronload false baseurl "/wps/portal_dojo/v1.7/dojo/" debugatallcosts false isdebug false locale "en" modulepaths object { com="/wps/thememodules/js/com", ibm="/wps/thememodules/js/ibm"} parseonload false }
which indicates me resolver.js should found under /wps/thememodules/js/com module location. right? ibm has special modules defined under own "com" , "ibm" folder structures, , in old theme able copy 2 folder structures theme , identify them appropriately in "dojoconfig.paths" variable. new portal8.0-based theme i've edited default.jsp defined dojoconfig variable like:
var dojoconfig = { baseurl: "/compassthemesurs/themes/html/commonurs/", async: false, tlmsiblingofdojo: false, packages: [ // supply pointers ibm's modules satisfy resolver.js , other files { name:'com', location:'/wps/thememodules/js/com' }, { name:'ibm', location:'/wps/thememodules/js/ibm' }, // supply pointers locally stored dojo modules { name: "gridx", location: "dojo/gridx-1.3.0" }, { name: "dojo", location: "dojo/1.9.1/dojo" }, { name: "dijit", location: "dojo/1.9.1/dijit" }, { name: "dojox", location: "dojo/1.9.1/dojox" }, // supply pointer common javascript location { name: "commonjs", location: "js" } ] };
to try provide path resolver.js file, still failed similar error:
"networkerror: 404 not found - https://localhost:10060/wps/thememodules/js/com/ibm/bundles/nls/en/resolver.js"
when try locate resolver.js file on portal server, somewhere under c:/opt/ibm/websphere/wp_profile_urs/installedapps/* thought find under "wps" module, don't. hiding?
the highest dojo version comes new portal8.0 default theme dojo1.7. i've been using dojo1.9.1 old portal6.1-based custom theme. expecting adjustment necessary allow existing portlets either adapt built-in dojo1.7, or somehow override dojo1.7 , force dojo1.9.1 used. not sure i'm missing.
in portlet's jsp file specify "require" starts like:
require( // define lib location portlet's modules { packages: [ { name:'lib', location:'${psb.contextpath}/lib' } ] }, [ "commonjs/companysearchformcontroller", // shared search controller "commonjs/compasserrorhandler", // shared error handler "lib/viewappstatuscontroller", // portlet's controller "lib/ursregwizardcontroller", // portlet's controller ... ]...
where "commonjs" defined in dojoconfig in default.jsp , "lib" defined here locally in "require".
do see obvious i'm missing? resolver.js file deployed? change needed in dojoconfig object allow resolver.js found?
thanks insight can provide.
theme modules found @ ibm/websphere/portalserver/theme/wp.theme.modules/webapp/installedapps/thememodule.ear/thememodules.war
.
however, not find resolver.js @ location either. suggest rever changes , @ network tab file comes from.
also, if you're adding custom dojo version, think have add script tag below co:head
dynamic content spot , think have disable theme modules (look @ profiles) use dojo 1.7 make sure isn't loaded.
finally, please note ibm not support dojo 1.9 websphere portal 8 (it in 8.5 though), if there issues , you're going create pmr, first thing they're going ask revert changes dojo version.