I am involved in the webwork project, and I am attempting to
investigate how to package dojo and our custom extensions such that these
things are possible :
1) dojo widgets
and modules are available
2) webwork custom
widgets and modules are available and separately deployable
3) the user can
use their own custom widgets and modules
I was hoping to be able to package our widgets modules into
a separate build. The reason for this is to allow the user to make their
own dojo profile build, then include that instead of ours, and still be able to
include our build.
I believe that currently dojo only supports a single
baseRelativePath for loading modules and templates, which means that the widget
templates and custom modules need to be packaged under a single parent
folder. Is it possible to change this, to support a more java classpath like
idea ?
An example deployment scenario could be :
Deploy our bundled dojo profile build - __package.__.js and its
src folder - into /webwork/dojo/profile
Deploy webwork custom dojo extensions – into
/webwork/dojo/custom
These
can be packaged or deployed as individual files
WebWork User creates their custom widgets and modules and
deploy into /widgets – either as a compressed __package__.js, or
individual sources
The HTML file could could look like this :
<script type="text/javascript">
// Dojo configuration
djConfig = {
// allow multiple
resource loading paths for modules and widget resources
baseRelativePaths: ["/webwork/dojo/profile",
"/webwork/dojo/custom", "/dojoStuff"],
isDebug: true
};
</script>
<!—- include the webwork bundled dojo
profile build -->
<script language="JavaScript" type="text/javascript" src="/webwork/dojo/profile/__package__.js"></script>
<!—- use a webwork custom module from within
webwork/dojo/custom -->
<script language="JavaScript" type="text/javascript">
dojo.hostenv.loadModule("webwork.util");
webwork.util.foo();
</script>
<!—- use the user’s custom module from
within /dojoStuff -->
<script language="JavaScript" type="text/javascript">
dojo.hostenv.loadModule("project.utils");
project.utils.bar();
</script>
To summarise and outline what would like :
1) ClassPath
like resource framework to be able to load resources from multiple resource paths
– widget html / css / custom files
a. This could
even include the ability to package resources into the __package__.js file
2) Provide a stand
alone packager tool for dojo users to build their own packages
I would be happy with the ability to specify multiple base
relative paths for the time being J
Cameron