OFBiz
  1. OFBiz
  2. OFBIZ-411

Add initial support for dojotoolkit

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: SVN trunk
    • Labels:
      None

      Description

      Give the option to utilize the dojo toolkit in the ecommerce application as POC as well as pushing ajax usage into OFBiz.

        Activity

        Hide
        Chris Howe added a comment -

        dojoPatch.patch
        To kind of kick start implementation of some sort of ajax toolkit/framework, here is an edition to the e-commerce header that will, if the dojo variable is include dojo.js that should be put in the images/js/ library.
        It will then accept a dojoRequire string array that can be specified at the screen level and cycle through them to include the necessary modules.

        Show
        Chris Howe added a comment - dojoPatch.patch To kind of kick start implementation of some sort of ajax toolkit/framework, here is an edition to the e-commerce header that will, if the dojo variable is include dojo.js that should be put in the images/js/ library. It will then accept a dojoRequire string array that can be specified at the screen level and cycle through them to include the necessary modules.
        Hide
        Jacopo Cappellato added a comment -

        I don't know much of Ajax and dojotoolkit.
        I think it's nice to have this patch and Jira issue here as a kickstart for the ones that want to play with these tools.
        However I don't know if it would be a good idea to commit this patch in svn (and probably it was not intended for this) since it is specifically for one of the Ajax toolkits available and no clear decision has been taken by the community about what tools should be adopted.

        Show
        Jacopo Cappellato added a comment - I don't know much of Ajax and dojotoolkit. I think it's nice to have this patch and Jira issue here as a kickstart for the ones that want to play with these tools. However I don't know if it would be a good idea to commit this patch in svn (and probably it was not intended for this) since it is specifically for one of the Ajax toolkits available and no clear decision has been taken by the community about what tools should be adopted.
        Hide
        Jacques Le Roux added a comment -

        I started to look at it but as I don't know much (not to say nothing) about Ajax I believe I have understood that "Requires" is a method to load components in Ajax. May you teach some about that Chris ? What is this patch intended for exactly ?

        Examples will be the better way I guess...

        Thanks

        Show
        Jacques Le Roux added a comment - I started to look at it but as I don't know much (not to say nothing) about Ajax I believe I have understood that "Requires" is a method to load components in Ajax. May you teach some about that Chris ? What is this patch intended for exactly ? Examples will be the better way I guess... Thanks
        Hide
        Chris Howe added a comment -

        Dojo is decently documented here.
        http://manual.dojotoolkit.org/WikiHome/DojoDotBook/BookIntroduction

        But as far as working it into how things run within OFBiz and the decorator patterns most of the stuff in Dojo to work efficiently need to be loaded into the <head> of a webpage.

        So, to get it to work, Include the following in your screen definition:
        <screen name="myscreen">
        <section>
        <action>
        <set field="dojo" value="true"/> <!-the patch needs to be changed to look for the dojo being equal to true rather than just existing->
        <set field="dojoRequire[]" value="dojoPackage1"/>
        <set field="dojoRequire[]" value="dojoPackage2"/>
        <set field="dojoRequire[]" value="dojoPackage3"/>
        </action>
        <widget>
        <decorator-screen name="main-decorator" location="$

        {parameters.mainDecoratorLocation}

        ">
        <decorator-section name="body">
        <include-screen name="myDojoMarkedUpScreen"/>
        </decorator-section>
        </decorator-screen>
        </widget>
        </section>
        </screen>
        Each of those packages are then available to you.

        Adding a
        <decorator-section-include name="head"/>
        into the decorator might be beneficial as well to put additional javascript for the io interactions.

        Show
        Chris Howe added a comment - Dojo is decently documented here. http://manual.dojotoolkit.org/WikiHome/DojoDotBook/BookIntroduction But as far as working it into how things run within OFBiz and the decorator patterns most of the stuff in Dojo to work efficiently need to be loaded into the <head> of a webpage. So, to get it to work, Include the following in your screen definition: <screen name="myscreen"> <section> <action> <set field="dojo" value="true"/> <!- the patch needs to be changed to look for the dojo being equal to true rather than just existing -> <set field="dojoRequire[]" value="dojoPackage1"/> <set field="dojoRequire[]" value="dojoPackage2"/> <set field="dojoRequire[]" value="dojoPackage3"/> </action> <widget> <decorator-screen name="main-decorator" location="$ {parameters.mainDecoratorLocation} "> <decorator-section name="body"> <include-screen name="myDojoMarkedUpScreen"/> </decorator-section> </decorator-screen> </widget> </section> </screen> Each of those packages are then available to you. Adding a <decorator-section-include name="head"/> into the decorator might be beneficial as well to put additional javascript for the io interactions.
        Hide
        Jacques Le Roux added a comment -

        Thanks for explanations Chris.

        BTW I think that having such informations in Jira is better than having them only in ML.
        We may also retrieve this informations from Nabble (Jira issues are in dev ML) in an unorganized way but have them a little bit organized here.

        Show
        Jacques Le Roux added a comment - Thanks for explanations Chris. BTW I think that having such informations in Jira is better than having them only in ML. We may also retrieve this informations from Nabble (Jira issues are in dev ML) in an unorganized way but have them a little bit organized here.
        Hide
        Jacques Le Roux added a comment -
        Show
        Jacques Le Roux added a comment - This is superseded by http://svn.apache.org/viewvc?view=rev&rev=509719
        Hide
        Chris Howe added a comment -

        Hmm. Seems to still be discussion regarding rev 509719 handling dojo well, but whatever.

        Show
        Chris Howe added a comment - Hmm. Seems to still be discussion regarding rev 509719 handling dojo well, but whatever.
        Hide
        Jacques Le Roux added a comment -

        Sorry Chris,

        Do you want that I reopen this issue ? If debug mode is dojo default mode we must take this into account I guess !

        Show
        Jacques Le Roux added a comment - Sorry Chris, Do you want that I reopen this issue ? If debug mode is dojo default mode we must take this into account I guess !
        Hide
        Chris Howe added a comment -

        I'd like for it to stay open because just adding the dojo.js isn't really adding support, but either way.

        Show
        Chris Howe added a comment - I'd like for it to stay open because just adding the dojo.js isn't really adding support, but either way.
        Hide
        Jacques Le Roux added a comment -

        Reopened, because if debug mode is dojo default we must take it into account ...

        Show
        Jacques Le Roux added a comment - Reopened, because if debug mode is dojo default we must take it into account ...
        Hide
        David E. Jones added a comment -

        I agree with Chris, this really shouldn't be closed yet. The commit mentioned was to solve a different problem.

        Show
        David E. Jones added a comment - I agree with Chris, this really shouldn't be closed yet. The commit mentioned was to solve a different problem.
        Hide
        Marco Risaliti added a comment -

        Now that the standard ajax libary is jQuery, this issue can be closed.

        Show
        Marco Risaliti added a comment - Now that the standard ajax libary is jQuery, this issue can be closed.

          People

          • Assignee:
            Unassigned
            Reporter:
            Chris Howe
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development