Creating Custom Form Widget with Dojo- Tutorial (in process)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-26-2009 05:56 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2009 12:08 AM
Did you make any progress on the tutorial. I need to implement a custom widget and hitting a brick wall on information of how to do this

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2009 12:10 AM
Where are you stuck? What have you attempted & what's the roadblock?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2009 01:45 AM
I placed it into the root of the alfresco webapp and try calling it but it just displays as straight html and does not call dojo. very frustrating. so I suppose first things first. How do I create a html page and include it in alfresco so that I can use it as a dojo page.
Regards

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2009 03:11 AM
http://docs.dojocampus.org/ will give you an idea of what dojo is. However, alfresco uses a really old version of dojo 0.4.1, I believe. So, most of the apis are out of date.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2009 06:31 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2009 11:58 AM
From http://wiki.alfresco.com/wiki/Creating_XForms_Widgets
"Integrating a custom Dojo widget into Alfresco involves:
1. Adding your custom widget definition to xforms.js (located in the /scripts/ajax/ directory in alfresco.war)
2. Registering the new widget with Alfresco in web-client-config-wcm.xml (located in the /WEB-INF/classes/alfresco/ directory in alfresco.war), giving it a symbolic name as part of that process
3. Updating your Web Form XML Schema(s) to use your custom widget, by putting the widget's symbolic name in the "appearance" annotation of the relevant element(s) "
Digging through those files will let you see how alfresco incorporates dojo code into it's form processor. Another long-standing alfresco bug states that both of these files must be directly edited instead of extended. The alfresco framework hardcoded too many things to allow for simple per widget code extensions.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2009 05:27 PM
Regards

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2009 05:59 PM
basically, how it works is that you have to define a custom appearance (i.e., a new <widget> node in web-client-config-wcm.xml) that will point to your custom dojo javascript class. The new javascript class is added to xforms.js. For syntax, take a look at all of the out of the box <widget> nodes and how they point to a javascript class. Then find that class in xforms.js to see how it is defined.
That's the basic layout of the files.
It'll look something like this:
add:
<widget xforms-type="xf:select1" appearance="mycustom2" javascript-class-name="alfresco.xforms.ComboboxSelect2" />
to web-client-config-wcm.xml
and then add:
alfresco.xforms.ComboboxSelect2 = alfresco.xforms.AbstractSelectWidget.extend({
……
});
to xforms.js
I'm still working on the specific logic of my widget, but that's how you incorporate them into alfresco. I fully agree that alfresco's documentation & existing forum posts are quite lacking.
let me know how that works for you.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-27-2009 01:03 AM
I posted some walkthrough details and some summary information at: http://ecmconsultant.blogspot.com/
