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.


Comments
gives an error to me saying "Object expected"
Domino 6.5.4 and IExplorer
Posted by ajit At 09:40:19 PM On 06/22/2007 | - Website - |
I've seen this error as well, and I think that's where I discovered that Dojo isn't successfully handling the application/x-javascript return from the Domino server.
Are you using the &OutputFormat=JSON argument at the end of your ?ReadViewEntries? If so, then you have to use the modified dojo.js file that I've posted that knows how to handle the application/x-javascript returned mime type.
Essentially, without that, dojo.js is treating the return as xml (best I can recall) and failing when it gets to the first @ sign.
Posted by Lance At 03:10:50 AM On 06/23/2007 | - Website - |
Oops, should have read your post more carefully. With Domino 6.5.4, I don't believe the &OutputFormat=JSON is available at all, so if you're using it, the server is probably not returning JSON at all. Verify by just going to that URL directly in your browser (e.g. { Link } )
If you're simply doing ReadViewEntries, then you need to make sure your KW argument object has the mimetype set to text/xml and not application/x-javascript. Then the data variable will contain xml that you'll have to parse with xml dom rather than javascript notation. For example: data.getElementsByTagName('viewentry').
Hope this helps.
Posted by Lance At 03:15:26 AM On 06/23/2007 | - Website - |
I'm not sure what you're referring to, Thomas, can you provide more info? Inside the dojo101.nsf, there's no example pages. Are you referring to something in the 0.43 download?
Thx, and sorry for not understanding.
-Lance
Posted by Lance Spellman At 12:52:00 AM On 01/09/2008 | - Website - |
Posted by Charles Phillips At 11:51:12 AM On 01/15/2008 | - Website - |
Fred
Posted by Fred Janssen At 01:50:40 AM On 07/25/2007 | - Website - |
You're right. In code we created later, we introduced a dojomino.session.js page that is aware of the server version and requests xml or json accordingly. On the script side, we use xml2json to convert everything to json and only do a json processing pass.
- Lance
Posted by Lance Spellman At 12:18:38 AM On 02/22/2008 | - Website - |
Posted by Patrick Kwinten At 02:44:18 AM On 06/12/2007 | - Website - |
{ Link }
Posted by Mac Guidera At 07:58:19 AM On 06/20/2007 | - Website - |
After installing/configuring the dojo043.nsf database I get the correct response in Firefox (1 viewentry in the demoview) but no response in IE7.
Any ideas?
Fred
Posted by Fred Janssen At 01:49:25 AM On 07/25/2007 | - Website - |
why not include a working example in the dojo101.nsf ?
- Thomas
Posted by Thomas At 09:12:51 PM On 01/08/2008 | - Website - |
Posted by Aden At 12:10:44 AM On 02/22/2008 | - Website - |
Posted by LBA At 07:05:56 AM On 04/23/2008 | - Website - |
In the new Dojo11.nsf (based on dojo 1.1), I have included a sample page that works with that version.
Posted by Lance Spellman At 10:09:36 AM On 04/23/2008 | - Website - |
Line 11
Char 69
Error: Conditional Compilation is turned off
Code 0
{ Link }
Any suggestions?
Posted by Mike At 10:18:38 AM On 08/17/2007 | - Website - |
You are correct, this is no longer an issue with 1.x.
Posted by Lance Spellman At 11:00:32 AM On 01/25/2008 | - Website - |
Posted by Patrick Kwinten At 08:42:04 PM On 05/25/2008 | - Website - |