{"id":976,"date":"2012-10-17T10:27:49","date_gmt":"2012-10-17T08:27:49","guid":{"rendered":"http:\/\/hasselba.ch\/blog\/?p=976"},"modified":"2012-10-17T11:32:25","modified_gmt":"2012-10-17T09:32:25","slug":"quick-n-dirty-controlling-dojo-generation-for-individual-xpages","status":"publish","type":"post","link":"https:\/\/hasselba.ch\/blog\/?p=976","title":{"rendered":"Quick-n-Dirty: Control Dojo generation for individual XPages"},"content":{"rendered":"<p>Another interesting question has been asked on <a title=\"stackoverflow.com: xsp.client.script.libraries=none for individual XPages\" href=\"http:\/\/stackoverflow.com\/questions\/12894956\/xsp-client-script-libraries-none-for-individual-xpages\" target=\"_blank\">stackoverflow.com<\/a>: How to enable or disable the Dojo libraries for individual XPages, not the whole application?<\/p>\n<p>Just adding the parameter as shown below to the XPage won&#8217;t work:<\/p>\n<pre>&lt;xp:this.properties&gt; \r\n &lt;xp:parameter name=\"xsp.client.script.libraries\" value=\"none\" \/&gt;\r\n&lt;\/xp:this.properties&gt;<\/pre>\n<p>The workaround is to add a single line to <em>beforePageLoad<\/em> or <em>beforeRenderResponse<\/em> event:<\/p>\n<pre>facesContext.getRequestParameters().setJsLibrary(0);<\/pre>\n<p>The parameter can be set as the following<\/p>\n<ul>\n<li>&#8222;0&#8220; disables Dojo Framework<\/li>\n<li>&#8222;1&#8220; enables Dojo Framwork<\/li>\n<li>&#8222;2&#8220; enables Dojo Lite Framework<\/li>\n<\/ul>\n<p>If you are using the ExtLib, there is still a problem with the automatically added CSJS libraries. These headers will be added automatically (it is the same result if you are disabling dojo application wide):<\/p>\n<pre id=\"line1\">&lt;script type=\"<a>text\/javascript<\/a>\"&gt;dojo.registerModulePath('extlib', '\/xsp\/.ibmxspres\/.extlib');&lt;\/script&gt;\r\n&lt;script type=\"<a>text\/javascript<\/a>\" src=\"<a href=\"view-source:https:\/\/traveler.judo.eu\/xsp\/.ibmxspres\/.mini\/dojo\/@Eya.js\">\/xsp\/.ibmxspres\/.mini\/dojo\/@Eya.js<\/a>\"&gt;&lt;\/script&gt;<\/pre>\n<p><strong>Edit:<\/strong><\/p>\n<p><del>This can only be removed by disabling the ressource aggregation or disabling the Extension Library for the whole application.<\/del><\/p>\n<p>You can disable it f.e. by adding this to your XPage <em>beforeRenderResponse<\/em> event:<\/p>\n<pre>facesContext.getRequestParameters()\r\n   .setProperty(\"xsp.resources.aggregate\", \"false\")<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Another interesting question has been asked on stackoverflow.com: How to enable or disable the Dojo libraries for individual XPages, not the whole application? Just adding the parameter as shown below to the XPage won&#8217;t work: &lt;xp:this.properties&gt; &lt;xp:parameter name=&#8220;xsp.client.script.libraries&#8220; value=&#8220;none&#8220; \/&gt; &hellip; <a href=\"https:\/\/hasselba.ch\/blog\/?p=976\">Weiterlesen <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36,82,76,74],"tags":[33,8,7,37,91,5,32,3],"class_list":["post-976","post","type-post","status-publish","format-standard","hentry","category-extlib","category-server","category-ssjs","category-xpages","tag-8-5-3","tag-dojo","tag-domino","tag-extension-library","tag-extlib","tag-ssjs","tag-tipp","tag-xpages"],"_links":{"self":[{"href":"https:\/\/hasselba.ch\/blog\/index.php?rest_route=\/wp\/v2\/posts\/976","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hasselba.ch\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hasselba.ch\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hasselba.ch\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hasselba.ch\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=976"}],"version-history":[{"count":24,"href":"https:\/\/hasselba.ch\/blog\/index.php?rest_route=\/wp\/v2\/posts\/976\/revisions"}],"predecessor-version":[{"id":998,"href":"https:\/\/hasselba.ch\/blog\/index.php?rest_route=\/wp\/v2\/posts\/976\/revisions\/998"}],"wp:attachment":[{"href":"https:\/\/hasselba.ch\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=976"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hasselba.ch\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=976"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hasselba.ch\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=976"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}