Resizing gadgets

For the purpose of this recipe, we will be using the configuration example to resize the gadget.

Getting ready

Modify the SkypeTalk.xml file of the previous example and add the height field, or use the web console.

How to do it...

Here is an example of the configuration:

   <ModulePrefs author="Cookbook Developer"
                title="Skype Talk"
                directory_title="Skype Talk"
                title_url="http://www.vige.it"
                description="Speak with your friends on Skype."
                thumbnail="images/SkypeTalk.gif"
                height="24">

The following steps show how to do it with the web console:

  1. Go to the Application Registry, click on the Gadgets button, and select the Skype Talk gadget as shown in the following screenshot:
    How to do it...
  2. Set the height to 62 and click on the Save button.
  3. Go to the dashboard. You will see the result as follows:
    How to do it...

Note

By using the gadget, you can only configure the height because the layout and the skin manage all other settings. See Chapter 7, Developing Using Components API for more details. If you need to modify the width too, you could also consider transforming your Gadget into a portlet. In the next recipe, you will see how to do it.

How it works...

As a portal is a combination of windows in a page, only the layout can decide the width of a portlet. GateIn provides a wide series of containers that are simple to install. You can select your container directly from the Edit Page link of the Site Editor or through the pages.xml as a portlet. The definitions of the layouts are in the groovy file: portal/WEB-INF/conf/uiconf/portal/webui/container/ContainerConfigOption.groovy. Here is an example of a two-columns container:

...
column.addSelectItemOption(new SelectItemOption("twoColumns",
        "<container template="system:/groovy/portal/webui/container/UITableColumnContainer.gtmpl">" +
        "  <factory-id>TableColumnContainer</factory-id>" +
        "  <container template="system:/groovy/portal/webui/container/UIColumnContainer.gtmpl"><factory-id>ColumnContainer</factory-id></container>" +
        "  <container template="system:/groovy/portal/webui/container/UIColumnContainer.gtmpl"><factory-id>ColumnContainer</factory-id></container>" +
        "</container>",
        "TwoColumnContainerLayout")) ; 
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.139.105.159