[Registry-dev] Custom UIs for media types

Chathura C. Ekanayake chathura at wso2.com
Fri Jul 4 04:08:02 PDT 2008


I added the support for generating custom UIs using XSLT. This 
functionality is provided by the class XSLTBasedUIEnabledHandler, which 
is extended from UIEnabledHandler. Two XSLTs has to be written to 
generate view and edit UIs of the resource content. Then those two XSLTs 
can be provided as properties to the XSLTBasedUIEnabledHandler. Handler 
author should also provide an implementation of EditProcessor to process 
the user input given to the edit UI. Below is a sample configuration.

<handler class="org.wso2.registry.jdbc.handlers.XSLTBasedUIEnabledHandler">

        <property 
name="viewXSLT">/home/chathura/projects/reg-work/samples/view.xslt</property>
        <property 
name="editXSLT">/home/chathura/projects/reg-work/samples/edit.xslt</property>

        <filter 
class="org.wso2.registry.jdbc.handlers.filters.MediaTypeMatcher">
            <property 
name="mediaType">application/vnd.server-config</property>
        </filter>

        <edit 
processor="application/vnd.server-config">org.wso2.registry.jdbc.handlers.samples.custom.ServerConfigEditProcessor</edit>
</handler>

This configuration provides custom UIs for server configuration files 
(identified by the media type application/vnd.server-config). Note that 
users don't have to write any handlers. But ServerConfigEditProcessor 
has to be written by the users.

Thanks,
Chathura

Chathura C. Ekanayake wrote:
> I have completed the first phase of this implementation. Custom UIs are 
> supported by UIEnabledHandler class, which is extended from Hanlder. 
> Handler authors should implement the UIEnabledHandler.getView(...) 
> method to provide a HTML for viewing the resource content. HTML for 
> editing the resource content has to be generated in the 
> UIEnabledHandler.getEdit(...) method. In this way, handler authors get 
> the flexibility to generate custom UIs using whatever method they prefer 
> and UIs can generated for any text based content type. I have tested a 
> sample with this implementation and it worked well.
>
> I am currently working on providing XSLT support for generating UIs. 
> This require some code in handlers with the current implementation. We 
> can generalize the XSLT code and provide a XSLT based UI handler, which 
> the users can use only by configuring the registry.xml.
>
> We also need some nice samples to demonstrate the custom UIs, which is 
> my next step.
>
> Thanks,
> Chathura
>
>
> _______________________________________________
> Registry-dev mailing list
> Registry-dev at wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/registry-dev
>
>   




More information about the Registry-dev mailing list