Setting up Dojo with Domino
Category dojo tutorial introduction setup
Bookmark :
This is a tutorial for getting Dojo setup in your Domino environment. You can either download the Dojo 0.4.3 db from this site, or follow the instructions for getting Dojo from the Dojo site, importing the files into your Notes database via WebDAV, and then writing a simple "HelloDojo" page to validate that everything is working correctly. More...
Bookmark :
This is a tutorial for getting Dojo setup in your Domino environment. You can either download the Dojo 0.4.3 db from this site, or follow the instructions for getting Dojo from the Dojo site, importing the files into your Notes database via WebDAV, and then writing a simple "HelloDojo" page to validate that everything is working correctly. More...
- You can go to the downloads section of this site where the Dojo 0.4.3 database has been provided with the Dojo files put into File Resources already, and with the modified dojo.js that handles application/x-javascript mime type. There's also a test page "HelloDojo" that does an AJAX call to a view in the db to get the viewentry count. That should validate that you're up and running correctly, and you can ignore all the following steps

- Go to http://dojotoolkit.org and click the download button for the latest release. At the time of this writing, it is version 0.4.3. It is a tar.gz file, which if you're using a Mac, you've probably already got the tools you need to unzip it. If you're running Windows, you may not, so you'll need to locate a program that can handle it, like PowerArchiver or WinZip.
- If you decide to go the "do it yourself route", you'll probably want to setup WebDAV. For information on how to do that, see Jake Howlett's excellent article. A couple of items that are buried in comments that you need to pay attention to:
- Be sure and go to Database Properties, Design Tab, and turn on Design Locking.
- Not sure how valid this is, but put the database in a subdirectory...not the root
- The default Dojo download (dojo.js) does not support the application/x-javascript mimetype. This limits your ability to run ?ReadViewEntries&OutputFormat=JSON as the Domino server outputs a content-type of application/x-javascript for those calls. Get the modified dojo.js file from this site and replace the default.
- Create a Page element, set the content-type to HTML
- Paste in the following code:
-
<html>
<head>
<script type="text/javascript" src="dojo.js"></script>
<script type="text/javascript">
function getViewCount() {var kw = {url: 'demoview?ReadViewEntries&OutputFormat=JSON&count=1',method: 'GET',mimetype: 'application/x-javascript',load: function(type, data, evt) {dojo.byId('showresults').innerHTML = data.@toplevelentries + " viewentry in the demoview";
}
};
dojo.io.bind(kw);
}
dojo.addOnLoad(getViewCount);
</script>
</head>
<body>
<div id="showresults"></div>
</body>
</html>
- Create a form called Demo and create a document with that form.
- Create a view called demoview with a select formula that selects docs created with that form (e.g. Select Form="Demo")
- Go to your browser and open HelloDojo Page
- You should get the output "1 viewentry in demoview" or however many docs you created.

