When we create a gadget we need to create a XML file. This XML file come up with a common format. In this blog post I am going to introduce about this common format.
As shown in above diagram this XML file is wrapped with <Module> tag and inside it there are three sections as Gadget Preferences , User Preferences and Content Section.
<?xml
version="1.0" encoding="UTF-8" ?>
This is the first
line of any gadget which is used to indicate the format of the
document.
In this case it
indicates this document uses XML format with UTF-8 character
encoding.
<module>
This node is use to
wrap gadget preferences,user preferences and content section of the
gadget.
<ModulePrefs>
This section
is used to keep the meta data of the gadget such as
title,author,description etc. And also we can define the dimensions
of the gadget such as height,width etc under this section.
Ex
:
<ModulePrefs title="Bar Chart"
author="WSO2 DAS Server"
height="230"
scrolling="true"
description="A generic Bar Chart gadget, that display
patch-count Vs Month.">
</ModulePrefs>
<UserPrefs>
Under
this section you can store your own configuration values and allow
users to give inputs for the application. This part is an optional
thing.
Ex
:
<UserPref name="dataSource"
display_name="Data Source"
default_value="/portal/gadgets/bar-chart/datasource/dataFile4.jag">
</UserPref>
<Content>
Under this section
you can write your own code of the gadget implementation such as
HTML,Javascript,CSS etc.
Ex : If we use HTML
then the content is defined as shown below.
<Content
type="html">
<![CDATA[
<html>
<head>
</head>
<body >
</body>
</html>
]]>
</Content>
nice , thanks
ReplyDeleteBerita Hari Ini
Berita Nasional
Berita Medan
Berita Internasional
Berita Lifestyle
Berita Kesehatan
Berita Olahraga
Berita Teknologi
Berita Hiburan
Tips
News Cryptocurrency
Download Lagu Mp3
Unduhanku
Stafaband
Streaming Video
Tama Tube
Resep Masakan