Hi,

This is to update the progress of Gadget Tag Lib implementation-which is a
one task out of Gadget Server re-designing based on the Jaggery framework.Now
a user can embed a gadget to a web page by using  this jsp tag library.

It can be done either from Carbon UI related jsp page or from a jsp in a
web-app,once after located the jaggery .jar inside lib/api directory.

By using  this tag library, a user can get following functionalities.

1.Can embed the gadget to a custom page either in carbon UI level or in a
web-app.
2.Can pass user preferences values which requires to personalize a gadget.
3.Can pass parameters required in open-social gadgets in-order to connect
with server [This is not yet test properly]

To use this taglib ;

1.In Carbon UI jsp pages-
           --Install the feature 'org.wso2.carbon.gadget.initializer.feature
'
           --Import the taglib to the web page as follows;
           <%@ taglib uri="
http://wso2.org/projects/carbon/taglibs/gadgettags.jar";  prefix="gadget" %>
           --Then add the gadget tag to the page.

2.In a web-app-
            --Copy the Jaggery related .jar files into lib/api directory.
            --Import the taglib to the web page as follows;
            <%@ taglib uri="http://wso2.org/jaggery/bsftags"; prefix="gadget"
%>
            --Then add the gadget tag to the jsp page in the webapp.

Following are the attributes that pass through the gadget lib.

1.gadgetUrl -URL of the gadget xml file [*required* String attribute]
2.gadgetId -Id of the gadget [*required* int attribute]
3.applyDefaultStyle -Whether to apply default style or not [*optional* and
default value has set to true].If this set to true-output of the taglib is
a html div element consists with iframe.If set to
                              false-output will be just the iframe.
4.gadgetTitle-Title of the gadget[*optional*]
5.userPrefsList-List of user preferences values [*optional*](format of this
input-"userPrefName1:userPrefValue1 ,"userPrefName2:userPrefValue2")
6.container-The container name on which gadget rendered [*optional*]
7.owner -The author of the gadget [*optional*]-(This is useful in
opensocial gadgets)
8.viewer-The viewer of the gadget [*optional*]-(This is useful in
opensocial gadgets)
9.appId-The application Id on which  gadget load [*optional*]-(This is
useful in opensocial gadgets.eg:appId="GS")
10.view-The format that gadget need to be shown[*optiona*l]
11.country-The country code,which is used in gadget iframe url pass to
shindig[*optional*](default value is 'ALL')
12.language-The language,which is used in gadget iframe url pass to shindig[
*optional*](default value is 'ALL')


A sample gadget tag for a simple gadget with user preferences is shown
below.

<gadget:gadget
                    gadgetUrl="
http://hosting.gmodules.com/ig/gadgets/file/105585409988857842421/userpref.xml";

                    gadgetId="1"
                    gadgetTitle="Date and Time"

 userPrefsList="myname:lalaji,mychoice:true,mycolor:red"
/>

The code related to gadget taglib has committed to carbon trunk,under the
jaggery component and gadgets component.

Appreciate any concerns and feedback regarding this.

Thanks;

Best Regards;
-- 
Lalaji Sureshika

Software Engineer
WSO2 Inc.
_______________________________________________
Carbon-dev mailing list
[email protected]
http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev

Reply via email to