<?xml version='1.0' encoding='UTF-8'?>
<chapter>
  <chapterinfo>
    <keywordset>
      <keyword>a4j:portlet</keyword>
    </keywordset>
  </chapterinfo>
  <table>
    <title>Component identification parameters </title>
    <tgroup cols="2">
      <thead>
        <row>
          <entry>Name</entry>
          <entry>Value</entry>
        </row>
      </thead>
      <tbody>
        <row>
          <entry>component-type</entry>
          <entry>org.ajax4jsf.Portlet</entry>
        </row>
        <row>
          <entry>component-family</entry>
          <entry>org.ajax4jsf.component.Portlet</entry>
        </row>
        <row>
          <entry>component-class</entry>
          <entry>org.ajax4jsf.component.html.HtmlPortlet</entry>
        </row>
      </tbody>
    </tgroup>
  </table>

  <section>
    <title>Creating the Component with a Page Tag</title>
    <para>To create the simplest variant on a page use the following syntax:</para>
    <programlisting role="XML"><![CDATA[<f:view>
	 <a4j:portlet>
	      ...
	 </a4j:portlet>
</f:view>]]></programlisting>
  </section>

  <section>
    <title>Creating the Component Dynamically Using Java</title>
    <programlisting role="JAVA"><![CDATA[
import org.ajax4jsf.component.html.HtmlPortlet;
...
HtmlPortlet myPortlet = new HtmlPortlet();
...]]></programlisting>
  </section>

  <section>
    <title>Details of usage</title>
    <para>
          The main component purpose is realization of possibility to create several instances the same portlet on one page. 
          But clientId of elements should be different for each window. In that case namespace is used for each portlet. 
          The <emphasis role="bold"><property>&lt;a4j:portlet&gt;</property></emphasis> <code>implemets NaimingContainer</code> interface and adds namespace to all componets on a page. 
          All portlet content should be wrapped by <emphasis role="bold"><property>&lt;a4j:portlet&gt;</property></emphasis> for resolving problems mentioned before. 
    </para>

  </section>
  
      
      <section>
            <title>Relevant resources links</title>
            <para>
                  Vizit the <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/portlet.jsf?c=portlet">Portlet page</ulink> at RichFaces LiveDemo for examples of component usage and their sources. 
            </para>
            
            <para>
                  Useful publications: 
            </para>
            <itemizedlist>
                  <listitem>
                        <para>
                              <ulink url="http://www.jboss.com/index.html?module=bb&amp;op=viewtopic&amp;t=107325">Ajax4Jsf Users Forum</ulink> — check the forum for additional information about component usage;
                        </para>
                  </listitem>
                  <listitem>
                        <para>
                              <ulink url="http://anonsvn.jboss.org/repos/ajax4jsf/trunk/samples/portal-echo/">portal-echo application</ulink> — Portlet Sample, could be checked out from JBoss SVN;
                        </para>
                  </listitem>
                  <listitem>
                        <para>
                              <ulink url="http://www.jboss.com/index.html?module=bb&amp;op=viewtopic&amp;t=107325">First snapshot with Portal environment support</ulink> contains usage instructions for the Portlet Sample demo.
                        </para>
                  </listitem>
            </itemizedlist>

  </section>
</chapter>
