eXo Platform 3.0

- Prev
- Next

## Chapter 6. Working with Applications

## Application integration

To add a portlet to one of your portal's pages, you should configure the `pages.xml` file located in `/war/src/main/webapp/WEB-INF/conf/sample-ext/portal/portal/classic/`.

Here is an example of a portlet configuration inside `pages.xml`:

    <portlet-application>
      <portlet>
        <application-ref>presentation</application-ref>
        <portlet-ref>SingleContentViewer</portlet-ref>
        <preferences>
          <preference>
            <name>repository</name>
            <value>repository</value>
            <read-only>false</read-only>
          </preference>
          <preference>
            <name>workspace</name>
            <value>collaboration</value>
            <read-only>false</read-only>
          </preference>
          <preference>
            <name>nodeIdentifier</name>
            <value>/sites content/live/acme/web contents/site artifacts/Introduce</value>
            <read-only>false</read-only>
          </preference>
          <!-- ... -->
        </preferences>
      </portlet>
      <title>Homepage</title>
      <access-permissions>Everyone</access-permissions>
      <show-info-bar>false</show-info-bar>
      <show-application-state>false</show-application-state>
      <show-application-mode>false</show-application-mode>
    </portlet-application>

Here are the details about this configuration:

XML tag name | Description | Example
--- | --- | ---
`application-ref` | The name of the webapp that contains the portlet |
`portlet-ref` | The name of the portlet |
`title` | The title of the page, HTML speaking |
`access-permission` | Who can access the portlet | :platform/users (membership:group)
`show-info-bar` | Show the top bar with the portlet title |
`show-application-state` | Show the collapse/expand icons |
`show-application-mode` | Show the change portlet mode icon |
`preferences` | Contains a list of `preference` specific to each portlet. Each `preference` has a `name` and a `value`. You can also lock it by setting the `read-only` element to true. CF reference guide. |

## Developing your own applications

### Gadget vs Portlet

It is important to understand the distinction between Gadgets and Portlets. Portlets are user interface components that provide fragments of markup code from the server-side, while gadgets generate dynamic web content on the client-side. With Gadgets, small applications can be built relatively quickly, and mashed up on the client-side using lightweight Web Oriented Architecture (WOA) technologies, like REST or RSS.

More information about developing gadgets and portlets can be found in the GateIn Reference Guide:

- Portlet development

- Gadget development

### Gadget development quick-start with IDE

eXo Platform facilitates easy gadget development, via its powerful, web-based IDE. You can learn more about the basic principles of Gadget development at http://code.google.com/apis/gadgets/docs/gs.html.

### Portlet Bridges

A Portlet Bridge allows you to create a JSR-168 compliant portlet with very little change to your existing web application.

For example, the JSF Bridge allows you to transparently deploy your existing JSF Applications as a Portlet Application or Web Application.

http://wiki.apache.org/myfaces/PortletBridge

The JBoss implementation of the Portlet Bridge has enhancements to support other web frameworks such as RichFaces and Seam.

http://jboss.org/portletbridge/docs.html

- Prev
- Up
- Home
- Next