I like these solutions, but, I wonder if we should actually encode some of
this behavior as part of the DRI forms in the long run? I often wonder why
the Manakin project didn't embrace the Cocoon Forms... The strategy is
similar to what Tim has done...
<map:match pattern="viewform-*">
<map:generate type="jx" src="pages/{1}.xml"/>
* <map:transform type="browser-update"/>
* <map:transform type="i18n"/>
<map:transform src="resources/forms-styling.xsl"/>
<map:transform type="i18n">
* <map:select type="ajax-request">
<map:when test="true">
<map:serialize type="xml"/>
</map:when>
<map:otherwise>
<map:serialize type="html"/>
</map:otherwise>
</map:select>
*</map:match>
See for more ideas...
Previous version of Cocoon AJAX (for reference) *
http://cocoon*.apache.org/2.1/userdocs/*ajax*.html
Cocoon 2.2 Forms Block
http://cocoon.apache.org/2.2/blocks/forms/1.0/489_1_1.html
Cocoon 2.2 AJAX Block (Dojo based)
http://cocoon.apache.org/2.2/blocks/ajax/1.0/1350_1_1.html
I think the basic model would be to Map DRI Widgets to JXTemplates or CForm
Widgets and add a level to the transformation pipeline as Tim has done to
support those tools doing the heavy lifting of inserting the javascript
actions, rather than creating some that is custom to the DSpace comunity...
Mark
--
Mark R. Diggory
http://www.atmire.com
On Thu, Jun 4, 2009 at 9:27 AM, Tim Donohue <[email protected]> wrote:
> Larry,
>
> At Illinois, we are using Scriptaculous (http://script.aculo.us/) with
> the XMLUI to perform autocomplete on our Subject, Publisher and Author
> fields. (For Author, instead of having separate lastname and firstname
> fields, we combine it all in one field which expects 'last, first m'
> format).
>
> We actually add in the necessary Javascript code for each of these
> fields in our Theme by using an XSL which transforms XHTML -> XHTML.
> So, we have our theme's sitemap.xmap setup to do the following:
>
> (1) Run through our normal DRI -> XHTML conversion via XSLT
> (2) If the path matches */*/*/submit/*.continue (i.e. in Submission
> process), run the resulting XHTML through another XSLT to add in the
> autocomplete javascript for the necessary form fields.
>
> On the server side of things, we did have to create a custom Java
> Servlet (which we registered in the web.xml alongside Cocoon), to
> process those AJAX requests and return the properly formatted results.
> So, essentially, our autocomplete functionality is running *outside* of
> Cocoon.
>
> There might be an easier way to do all of this...but, this is
> essentially what we came up with as a relatively quick solution. If it
> is of interest, I am willing to share the code we've written for this.
>
> - Tim
>
> George Hamilton wrote:
> > Hi Larry
> >
> > I implemented a home-brewed (hack) auto complete for the spatial
> > coverage field for our repository.
> >
> > I added the following to the <xsl:template match="dri:field"
> > mode="normalField"> template to add the hidden popup divs to the dom:
> >
> > <xsl:if test="@n='dc_coverage_spatial'">
> > <xsl:attribute name = "autocomplete">off</xsl:attribute>
> > <div class="shadow" id="shadow">
> > <div class="output" id="output">
> > some text
> > </div>
> > </div>
> > <xsl:attribute name="a"><xsl:value-of select="@n"/></xsl:attribute>
> > </xsl:if>
> >
> > Add autocomplete javascript, see
> > http://datashare.edina.ac.uk/dspace/themes/DataShare/auto-complete.js
> > Add an init call to the onload
> >
> > <body onload="init()">
> >
> > Modify the css to align the pop up.
> >
> > .output
> > {
> > font-family:Arial;
> > font-size: 10pt;
> > color:black;
> > padding-left: 3px;
> > padding-top: 3px;
> > border: 1px solid #000000;
> > width: 180px;
> > background: #fff;
> > }
> >
> > .shadow
> > {
> > width: 182px;
> > position: relative;
> > margin-left: -57px;
> > margin-top: -8px;
> > top: 2px;
> > left: 2px;
> > background: #555;
> > }
> >
> > .shadow div
> > {
> > position: relative;
> > top: -2px;
> > left: -2px;
> > }
> >
> >
> > I think that's it. The javascript is based on something I found the web,
> > this URL shows it in action:
> >
> > http://www.vonloesch.de/node/18
> >
> > George
> >
> >
> > Larry Stone wrote:
> >> Has anyone tried to add an "autocomplete" feature to the Manakin UI
> >> (XMLUI)? By "autocomplete", I mean the Web UI trick where a text
> >> field is checked, as you type, against a list of possible completions
> >> and automatically filled in, or completed, by inserting text into the
> >> field or posting a dropdown menu of possible completions. For
> >> example, the AjaxTags library has it under "Autocomplete", see
> http://ajaxtags.sourceforge.net/
> >> -- but that's specifically for a JSP-based UI.
> >>
> >> Autocomplete usually seems to be implemented as part of a
> >> comprehensive Javascript UI toolkit, and most of those are large,
> >> complex, standalone, and/or do not play well when integrated with
> >> another vertical-web-UI-solution like Cocoon. So, do you know of any
> >> such toolkit that _is_ easy to integrate with Cocoon and/or Manakin?
> >> Has anyone developed their own autocomplete?
> >>
> >> I've been experimenting with the Yahoo UI widgets (
> http://developer.yahoo.com/yui/
> >> ); it's well-documented and seems reasonably lightweight and modular,
> >> but it has some drawbacks. I'm hoping there is somebody already at the
> >> top of this learning curve who can see over this swamp from such a
> >> lofty vantage.
> >>
> >> thanks,
> >>
> >> -- Larry
> >>
> >>
> ------------------------------------------------------------------------------
> >> OpenSolaris 2009.06 is a cutting edge operating system for enterprises
> >> looking to deploy the next generation of Solaris that includes the
> latest
> >> innovations from Sun and the OpenSource community. Download a copy and
> >> enjoy capabilities such as Networking, Storage and Virtualization.
> >> Go to: http://p.sf.net/sfu/opensolaris-get
> >> _______________________________________________
> >> DSpace-tech mailing list
> >> [email protected]
> >> https://lists.sourceforge.net/lists/listinfo/dspace-tech
> >>
> >>
> >>
> >
> >
>
> --
> Tim Donohue
> Research Programmer, IDEALS
> http://www.ideals.uiuc.edu/
> University of Illinois
> [email protected] | (217) 333-4648
>
>
> ------------------------------------------------------------------------------
> OpenSolaris 2009.06 is a cutting edge operating system for enterprises
> looking to deploy the next generation of Solaris that includes the latest
> innovations from Sun and the OpenSource community. Download a copy and
> enjoy capabilities such as Networking, Storage and Virtualization.
> Go to: http://p.sf.net/sfu/opensolaris-get
> _______________________________________________
> DSpace-tech mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/dspace-tech
>
------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech