Applications play an important role in each eXo service and so it is necessary for you to further understand about them.

This chapter will help you know how to integrate an application into your portal and how to develop your own application:
* [Application integration|#DEV.WorkWithApplications.ApplicationIntergration]
* [Develop your own applications|#DEV.WorkWithApplications.DevelopeYourOwnApplications]
** [Gadget vs Portlet|#DEV.WorkWithContent.GadgetvsPortlet]
** [Portlet Bridges|#DEV.WorkWithApplications.PortletBridges]
** [Portlet Bridges|#DEV.WorkWithApplications.PortletBridges]

h1. Application integration {anchor:id=DEV.WorkWithApplications.ApplicationIntergration}

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

Here is an example of the portlet configuration inside _pages.xml_:

{code: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>
{code}

Details:

|| XML tag name || Description ||
| {{application-ref}} | The name of the webapp that contains the portlet. |
| {{portlet-ref}} | The name of the portlet. |
| {{title}} | The title of the page in HTML speaking. |
| {{access-permission}} | Define who can access the portlet. |
| {{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}} | Contain a list of _preferences_ 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. To learn more, refer to [eXo JCR and Extension Services Reference|http://platform.demo.exoplatform.org/docs/refguide/html/jcr/index.html]. |


h1. Develop your own applications {anchor:id=DEV.WorkWithApplications.DevelopeYourOwnApplications}

h2. Gadget vs Portlet {anchor:id=DEV.WorkWithContent.GadgetvsPortlet}

It is important to understand distinctions 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 quickly, and mashed up on the client side using the lightweight Web-Oriented Architecture (WOA) technologies, like REST or RSS.

For more information on how to develop gadgets and portlets, see in the GateIn Reference Guide:

* [Portlet development|http://docs.jboss.com/gatein/portal/3.1.0-FINAL/reference-guide/en-US/html_single/index.html#chap-Reference_Guide-Portlet_development]
* [Gadget development|http://docs.jboss.com/gatein/portal/3.1.0-FINAL/reference-guide/en-US/html_single/index.html#chap-Reference_Guide-Gadget_development]

h2. Gadget development quickstart with eXo IDE {anchor:id=DEV.WorkWithApplications}

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

h2. Portlet Bridges {anchor:id=DEV.WorkWithApplications.PortletBridges}

The Portlet Bridge is an adapter for a web framework to the portlet container runtime. It works ideally with framework that does not expose the servlet container with the limited support for the full portlet API.

The JavaTM Specification Request 168 Portlet Specification (JSR 168) standardizes how components for portal servers are developed. This standard has industry backing from major portal server vendors. A Portlet Bridge allows you to create a JSR-168 compliant portlet with very little change on 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]