[Registry-dev] Custom UIs for media types
Chathura C. Ekanayake
chathura at wso2.com
Mon Jul 7 10:16:50 PDT 2008
Hi Paul / all,
I implemented a sample handler to demonstrate the custom UI
functionality. It generates custom UIs for viewing and editing Axis2
module configuration files (module.xml). All the steps for building and
testing this sample is documented in the readme.txt file included with it.
Currently, handlers are invoked based on the media type of the resource.
Therefore, we have to define a media type to identify module
configuration files. I used "application/am+xml" for this sample (am -->
axis module). I think we have to introduce a handler engagement
mechanism based on the resource content as well. Once it is done, we can
configure this handler to engage based on the content of the xml file,
without defining a new media type. I think we can implement it with the
current filter design. But we have to think of the optimum method to
minimize the effect on normal resources.
Thanks,
Chathura
Chathura C. Ekanayake wrote:
> Hi Paul,
>
> I am working on a sample to demonstrate this functionality. I will
> update this thread once it is complete.
>
> Thanks,
> Chathura
>
> Paul Fremantle wrote:
>
>> Chathura
>>
>> What is the easiest way I can try this out?
>>
>> Paul
>>
>> Chathura C. Ekanayake wrote:
>>
>>
>>> 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
>>>>
>>>>
>>>>
>>>>
>>> _______________________________________________
>>> Registry-dev mailing list
>>> Registry-dev at wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/registry-dev
>>>
>>>
>>>
>>
>>
>
>
> _______________________________________________
> 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