Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    What is setIsomorphicDir() _really_ supposed to do?

    Based on the Javadoc I assumed that com.smartgwt.client.util.Page.setIsomorphicDir(s) would redefine the URLs for all non-skin resources:

    Specify the root directory for Isomorphic-supplied files.
    This doesn't seem to be the case. I set

    Code:
    String moduleName = GWT.getModuleName();
    Page.setIsomorphicDir(moduleName + "/sc1.0.10/");
    Page.setSkinDir(moduleName + "/sc1.0.10/skins/Enterprise/");
    But the URLs Smart GWT issues are as follows:

    http://server/context/module/sc/modules/ISC_Core.js
    http://server/context/module/sc/skins/Enterprise/load_skin.js
    http://server/context/module/sc/skins/Enterprise/skin_styles.css
    http://server/context/module/sc1.0.10/skins/Enterprise/images/Scrollbar/vscroll_start.png
    The JavaScript and CSS resources are still served from the original URL. Is that a bug or is there some other method I need to call additionally?

    Background: I try to set up caching as per http://www.smartclient.com/smartgwt/javadoc/com/smartgwt/client/docs/Caching.html with the help of URL rewriting.

    P.S. I can't find the class com.isomorphic.servlet.FileDownload documented in the caching docs, where does it come from?

    #2
    We're not sure which resources you're trying to affect, but you can't even call setIsomorphicDir() until after ISC_Core.js is loaded - ISC_Core.js is what *provides* the setIsomorphicDir() API.

    The other resources you mention are affected by the skin dir - see the QuickStart Guide section on custom skins.

    Docs for all server-side classes are in the server-side JavaDoc.

    Comment


      #3
      Originally posted by Isomorphic View Post
      We're not sure which resources you're trying to affect, but you can't even call setIsomorphicDir() until after ISC_Core.js is loaded - ISC_Core.js is what *provides* the setIsomorphicDir() API.
      Yes, I get that. I understand that ISC_Core.js is not affected by setIsomorphicDir(). However, all other ISC_xxx.js files are also loaded from the standard /sc/modules/ path. I expected a modified path for subsequently loaded "modules".
      Furthermore, is there a way to modify the path to ISC_Core.js to profit from the same caching infrastructure?

      Originally posted by Isomorphic View Post
      The other resources you mention are affected by the skin dir
      That's what I expected but as my output shows only the skin images are loaded from the modified path. load_skin.js and skin_styles.css are loaded from the standard path eventhough I set setSkinDir().

      Comment


        #4
        All of the script loads you're considering here happen as a consequence of your GWT <inherits> of SmartGWT modules and skins, all before onModuleLoad() ever executes.

        To affect these things, you use the FileLoader as mentioned in the Caching overview and related docs - a *JavaScript* API. When using the FileLoader, you use the *NoScript versions of SmartGWT modules to prevent the automatic loading of resources (since you'll do it via FileLoader).

        Comment


          #5
          Thanks for the explanations, appreciate it.

          Comment

          Working...
          X