Ticket #895 (closed task: fixed)

Opened 9 months ago

Last modified 7 months ago

Upgrade to Dojo 1.1

Reported by: rich Assigned to: jkirton
Priority: critical Milestone: 0.9.0
Component: ambra Version: 0.8.2.1
Keywords: dojo Cc:
Blocking: Blocked By:

Description

Upgrade to Dojo 1.1. Release notes: http://dojotoolkit.org/book/dojo-1-1-release-notes

Dependency Graph

Change History

04/03/08 15:20:00 changed by amit

  • priority changed from medium to critical.

If this has performance implications.

04/03/08 15:28:16 changed by rich

  • summary changed from Uprade to Dojo 1.1 to Upgrade to Dojo 1.1.

04/10/08 14:40:51 changed by jkirton

  • blocking changed.
  • blockedby changed.

Estimated completion time: 2wks

04/18/08 14:59:05 changed by jkirton

  • status changed from new to assigned.

05/02/08 16:01:12 changed by jkirton

(In [5581]) addresses #895 Dojo upgrade (0.4.3 -> 1.1) - INITIAL COMMIT.

Not everything is fully functional yet but this changeset represents the lion's share of work for this upgrade. Of note: 1) Abandoned fine grained "dojoRequire_{xxx}.ftl" include files opting simply for 2 versions:

a) dojoRequire_default.ftl - This is a minimal set of js dependencies targeted for the home page and non-functional related pages. b) dojoRequire_full.ftl - This is the full set of js dependencies targeted for the article pages and adjacent supporting pages (annotation, comment, rating editing, slideshow, et al.).

The ultimate plan here is to create a js resource deploy script that compresses all js dependencies into a single compressed file to be used for production. Dojo 1.1 has a tool for this.

2) All core api changes have been propagated. The majority of the work yet to be completed lay in our custom dojo widgets namely:

a) annotation_add.ftl b) commentDialog.ftl c) loadingCycle.ftl d) ratingDialog.ftl

The site is navigable and articles are viewable. Annotations, Comments, Ratings are currently only viewable. No editing functionality for these article decorations currently works. My goal to to have this upgrade completed by end of next week (5/9/08).

05/07/08 12:19:36 changed by jkirton

(In [5658]) addresses addresses #895 - Dojo upgrade (0.4.3 -> 1.1)

1) Created new project "js" under the plos/libs dir. 2) Added source version of the dojo 1.1 library under the newly created "js" project that shall now serve as the sole place for the dojo library to reside in our source tree. This sets the stage for custom dojo builds.

05/07/08 13:13:16 changed by jkirton

(In [5661]) addresses addresses #895 - Dojo upgrade (0.4.3 -> 1.1)

Removed the dojo library from the webapp project. Its new home is in the new /plos/libs/js project. Note that the dojo/_firebug dir remains for the sole purpose of debugging.

05/07/08 13:37:06 changed by jkirton

(In [5664]) addresses #895 - Dojo upgrade (0.4.3 -> 1.1).

1) Moved the topaz widget library from the webapp to the new libs/js project as a sibling to the dojo library. This provision is necessary in order to perform a dojo build that incorporates our custom widgets.

2) Added ambra.profile.js - This is the dojo custom build "make" file.

To invoke the dojo custom build:


1) cd to the .../js/src/main/scripts/dojo-release-1.1.0-src/util/buildscripts dir 2) Invoke either build.bat or build.sh with the following command line args:

build.bat.sh profileFile=../../../ambra.profile.js action=release releaseName=ambra releaseDir=../../../../../../target/ localeList=en-us

What results is the custom dojo build output that is put under the js/target dir. The following resultant files now need to be copied over to the webapp project:

js/target/ambra/dojo.js (the production version) js/target/ambra/dojo.js.uncompressed.js (the dev version) js/target/ambra/ambra.js (the production version) js/target/ambra/ambra.js.uncompressed.js (the dev version)

The following manual intervention is now required in the copied ambra.js as well as ambra.js.uncompressed.js:

1) Paste:

dojo.provide("dojo.nls.ambra_xx");dojo.provide("dijit.nls.loading");dijit.nls.loading._built=true;dojo.provide("dijit.nls.loading.xx");dijit.nls.loading.xx={"loadingState":"Loading...","errorState":"Sorry, an error occurred"};dojo.provide("dijit.nls.common");dijit.nls.common._built=true;dojo.provide("dijit.nls.common.xx");dijit.nls.common.xx={"buttonOk":"OK","buttonCancel":"Cancel","buttonSave":"Save","itemClose":"Close"}; dojo.provide("dojo.nls.ambra_ROOT");dojo.provide("dijit.nls.loading");dijit.nls.loading._built=true;dojo.provide("dijit.nls.loading.ROOT");dijit.nls.loading.ROOT={"loadingState":"Loading...","errorState":"Sorry, an error occurred"};dojo.provide("dijit.nls.common");dijit.nls.common._built=true;dojo.provide("dijit.nls.common.ROOT");dijit.nls.common.ROOT={"buttonOk":"OK","buttonCancel":"Cancel","buttonSave":"Save","itemClose":"Close"}; dojo.provide("dojo.nls.ambra_en");dojo.provide("dijit.nls.loading");dijit.nls.loading._built=true;dojo.provide("dijit.nls.loading.en");dijit.nls.loading.en={"loadingState":"Loading...","errorState":"Sorry, an error occurred"};dojo.provide("dijit.nls.common");dijit.nls.common._built=true;dojo.provide("dijit.nls.common.en");dijit.nls.common.en={"buttonOk":"OK","buttonCancel":"Cancel","buttonSave":"Save","itemClose":"Close"}; dojo.provide("dojo.nls.ambra_en-us");dojo.provide("dijit.nls.loading");dijit.nls.loading._built=true;dojo.provide("dijit.nls.loading.en_us");dijit.nls.loading.en_us={"loadingState":"Loading...","errorState":"Sorry, an error occurred"};dojo.provide("dijit.nls.common");dijit.nls.common._built=true;dojo.provide("dijit.nls.common.en_us");dijit.nls.common.en_us={"buttonOk":"OK","buttonCancel":"Cancel","buttonSave":"Save","itemClose":"Close"};

just before the last line in the file which is:

dojo.i18n._preloadLocalizations("dojo.nls.ambra", ["xx","ROOT","en","en-us"]);

This "interns" the needed locale stuff (avoiding http requests). Obviously, we will want to avoid this manual step and am looking into how. But for now..

Automation through maven is next..

05/07/08 14:24:48 changed by jkirton

(In [5665]) addresses #895 - Dojo upgrade (0.4.3 -> 1.1). Updated ambra.xml and defaults.xml based on prior dojo related changesets. Should have been included in r5664.

05/07/08 15:07:27 changed by jkirton

(In [5667]) addresses #895 - Dojo upgrade (0.4.3 -> 1.1). Forgot to update defaults-dev.xml in the webapp project. Should have been included in the last commit.

05/08/08 10:52:51 changed by jkirton

(In [5684]) addresses #895 - Dojo upgrade (0.4.3 -> 1.1). Re-named the topaz dir to ambra for our dojo custom widgets and propagated the necessary changes.

05/08/08 16:07:47 changed by jkirton

(In [5686]) addresses #895 - Dojo upgrade (0.4.3 -> 1.1).

  • Merged formSetup_article.js, config_article.js and init_article.js into one js file: init_article.js since we are only using all 3 for the fetch article action page. Re-organized this merged file for better maintainability.
  • Propagated the above merge to the affected config xml files.

05/13/08 09:19:20 changed by jkirton

(In [5721]) addresses #895 - dojo 1.1 upgrade Re-named dojo-release-1.1.0-src dir to dojo so this dir remains immune to version upgrades adding version.txt that indicates the version.

05/13/08 12:05:54 changed by jkirton

(In [5723]) addresses #895 - dojo 1.1 upgrade Upgraded dojo from 1.1.0 to 1.1.1. This is a "drop in" replacement with critical bug fixes per the dojo site. Verified and tested.

05/13/08 12:10:22 changed by jkirton

(In [5724]) addresses #895 - dojo 1.1 upgrade Re-named topaz.js to general.js and propagated the change accordingly. Modified the RegionalDialog? template (RegionalDialog?.html) making it dojo 1.1+ worthy.

05/13/08 12:24:00 changed by jkirton

(In [5726]) addresses #895 - dojo 1.1 upgrade Upgraded dojo from 1.1.0 to 1.1.1 in the webapp.

05/13/08 12:27:56 changed by jkirton

(In [5727]) addresses #895 - dojo 1.1 upgrade Minor code clean up and eliminated a hot debug alert statement.

05/13/08 12:34:45 changed by jkirton

(In [5728]) addresses #895 - dojo 1.1 upgrade Added needed dijit.css css resource which is called on by dojo. Updated ambra.js.uncompressed.js based on the dojo 1.1.0 -> 1.1.1 version upgrade.

05/14/08 09:03:46 changed by jkirton

(In [5735]) addresses #895 - dojo 1.1 upgrade Minor tweaks for init_article.js:

  • Removed spurious return statements.
  • Robustified a bit of the addOnLoad() code.

05/14/08 15:28:22 changed by jkirton

(In [5740]) addresses #895 minor enhancement in the js init routine for the article right hand column's nav section: ensure we have non-null dom refs.

05/14/08 15:52:14 changed by jkirton

(In [5742]) addresses #895 Less than glamorous hack fix for --IE-- dojo 1.1 article page rendering: Introduced a 1 second timeout targeting only the view article page to ensure the dom tree as well as dojo's widgets are loaded before the article page initialization routine executes. This timout only occurrs when the browser is IE. Note this 1s latency does not prevent the page from being viewable but does prevent the user from interacting with the page.

05/15/08 10:34:14 changed by jkirton

(In [5754]) addresses #895 Minor html code clean up for the comment and rating dialog templates.

05/15/08 10:38:11 changed by jkirton

(In [5755]) addresses #895 - dojo 1.1 upgrade multi-comment dialog display fixed.

05/15/08 12:53:35 changed by jkirton

(In [5756]) addresses #895 Fixed json correction annotation retrieval to exclude advised object constructs as this leads to error. Note: this is the default case but since we were overriding it specifically for formal correction retrieval to exclude 'annotations', these defaults were ignored. The fix was to copy the default exclude properties in addition to desired the 'annotation' override for formal correction json retrieval.

05/15/08 13:51:17 changed by jkirton

(In [5757]) addresses #895 - dojo 1.1 upgrade Fix advanced search start page js init routine by fixing the form enable/disable methods in formUtil.js.

05/16/08 14:56:33 changed by jkirton

(In [5769]) addresses #895, #910 Moved jumpToElement() method to the general.js module for accessibility beyond the article view page. This eliminates a js error that was occurring for form submission to the editPrefsAlerts action.

05/16/08 14:56:36 changed by jkirton

(In [5770]) addresses #895, #910 Moved jumpToElement() method to the general.js module for accessibility beyond the article view page. This eliminates a js error that was occurring for form submission to the editPrefsAlerts action.

05/20/08 14:37:41 changed by jkirton

(In [5796]) addresses #895 Initial stub of the the dojo custom build script (dojoBuild.groovy) along with *incomplete* maven integration.

Currently, dojoBuild.groovy is invoked via the groovy maven plugin at the generate-sources phase of maven's default life-cycle. Note, no files are included in the jar (which is the packaging directive).

TODO: Figure out how to deploy the built js files down to the webapp.

05/23/08 10:43:10 changed by jkirton

  • status changed from assigned to closed.
  • resolution set to fixed.

(In [5807]) fixes #895 Finished remaining tasks relating to the dojo 1.1 library upgrade:

1) Integrated the dojo build process into the maven build life-cycle:

a) A zip file of the built dojo js files is created at the generate-sources phase for the plos/libs/js project. b) This zip file is then un-packed to the webapp's javascript dir during its generate-sources build phase.

2) Updated config xml file js reource paths based on the changed dir structure of the javascript dir. 3) Removed dojo based js files from the webapp project since these files are now generated for us based on the dojo build.

05/23/08 11:31:25 changed by jkirton

(In [5808]) addresses #895 Added explicit dependency callout for ambra-js to ensure the build order is correct. This should fix build failures for those that don't already have the ambra-js in their local repo.

05/23/08 15:31:58 changed by jkirton

(In [5810]) addresses #895 Added new config key:

ambra.freemarker.dojo.debug flag

and propagated to the presentation layer for use by our dojo library implementation. This flag dicates whether or not

  • dojo.js or dojo.js.uncompressed.js
  • ambra.js or ambra.js.uncompressed.js

get served up respectively.

06/09/08 17:29:31 changed by jkirton

(In [5895]) addresses #895, #735

Eliminated dynamic drive tab widget from browseVolume.ftl opting for dojo's TabContainer? widget.

Consequently, added TabContainer? dojo widget dependency callout in ambra-profile.js so the custom dojo build includes the necessary js code.

Removed dijit.css from the webapp project since now all dojo specific CSS stuff is packaged in the dojo build zip file and correspondingly un-packaged in the webapp. Nicely, these were maven only adjustments and dojoBuild.groovy is un-altered.

** So now the dojo build process unpacks js AND CSS resources into the webapp project. **

Added dojo tundra CSS theme dependency to the NTD journal home page for the TabContainer? widget to look presentable. Some CSS tweaks are now required to finalize it.