<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2004 The Apache Software Foundation
Licensed  under the  Apache License,  Version 2.0  (the "License");
you may not use  this file  except in  compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed  under the  License is distributed on an "AS IS" BASIS,
WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
implied.

See the License for the specific language governing permissions and
limitations under the License.
-->
<faqs title="Frequently Asked Questions">
<part id="general">
<title>General</title>

  <faq id="releases">
  <question><b>
    Which version of Pluto should I use?
  </b></question>
  <answer>
    Pluto 1.0.1 is the most recent distribution.
    This version of Pluto passes all of the TCK tests.
  </answer>
  </faq>

  <faq id="versions">
  <question><b>
    I've seen references to both Pluto 1.0.1 and Pluto
    1.1.  It seems as though both are being developed
    at the same time.  What is the difference between
    the two versions?
  </b></question>
  <answer>
    <p>You're right.  Pluto 1.0.1 is the current release.  
    Pluto 1.0.x is based off of the code
    base which was originally donated to the ASF by IBM.
    The first release candidate in this series was published
    on October 8, 2004.</p>
    <p>Around the same time that this release occured
    Pluto 1.1.0-ALPHA was imported into our source repository.
    The 1.1.x series is a refactoring/rewrite of Pluto.  It's
    entire purpose is to simplify the container and make it
    easier for both Portlet Developers and Portal Developers
    looking to embed Pluto into their portal to use Pluto.
    The 1.1.x series has made great progress and currently
    passes all of the tests available in the Pluto Testsuite.
    See the <a href="1.1/index.html">Pluto 1.1 documentation</a>
    for more details.
	</p>    
  </answer>
  </faq>

  <faq id="matching">
  <question><b>
    Do Pluto Versions correspond with Portlet Specification
    Versions.
  </b></question>
  <answer>
    No.  See the Pluto home page for a mapping
    of Pluto versions to Portlet Specification versions.
  </answer>
  </faq>

</part>


<part id="portlets">
<title>Portlets and Deployment</title>

  <!-- Java World Portlet -->
  <faq id="javaworld">
  <question><b>
    Why can't I get the Javaworld bookmark example to work with Pluto?
  </b></question>
  <answer>
  <p>The Javaworld examples are based on the <b>Proposed Final Draft</b>
     of JSR-168.  The final specification included several changes,
     including some changes to the xsd.</p>
  <p>Please see the <A href="http://issues.apache.org/eyebrowse/ReadMsg?listName=pluto-user@jakarta.apache.org&amp;msgNo=27">
     message archives</A>for a modified version of this example
     which will work with Pluto.</p>
  </answer>
  </faq>

  <faq id="portal-impl">
  <question><b>
    Is Pluto a fully functional portal implementation?
  </b></question>
  <answer>
   <p>No, Pluto is a Portlet Container. If you are looking for a
      Portal implementation, try checking out
      <a href="http://portals.apache.org/jetspeed-2">Jetspeed</a>.</p>
   <p>Need more information about the difference between a Portal
      and a Portlet Container?  Take a look at
      <A href="#container">this question.</A></p>
   </answer>
   </faq>

  <faq id="admin-portlet-app">
  <question><b>
    How do I use the Admin Portlet Application to deploy custom portlets?
  </b></question>
  <answer>
  <p>
	Click on the Admin link on the Pluto navigation bar and select the Help mode (help link) in the Deploy
	War Admin Portlet. The resulting page will display information on the deployment of custom portlets 
	and troubleshooting issues with deployment. 
  </p>
  </answer>
  </faq>
  
  <faq id="deployment-crash">
  <question><b>
    I deployed a custom portlet and Pluto crashed! What do I do?
  </b></question>
  <answer>
  <p>
	If deployment of a portlet causes an error that breaks Pluto, manually
	undeploy the portlet by removing its record from portletentityregistry.xml, pageregistry.xml and 
	portletcontexts.txt in the webapps/pluto/WEB-INF/data directory and restart Pluto.
  </p>
  <p>
  	Also take a look at the <a href="#logs">log files</a>.
  </p>
  </answer>
  </faq>
</part>

<part id="embed">
<title>Embedding Pluto</title>
  <faq id="embed">
  <question><b>
    I'd like to embed Pluto into my Portal.  How do I start?
  </b></question>
  <answer>
    Take a look at the Developer documentation on the website.
    This has an integration and architecture guide.  Additionally
    we suggest that you look at Jetspeed for an example of how
    it can be done.  We readily admit that this embeding
    documentation may be a little sparse and welcome any
    documentation patches.
  </answer>
  </faq>

  <faq id="services">
  <question><b>
    What are the required services that must be implemented
    by a Portal wanting to embed Pluto?
  </b></question>
  <answer>
    <ul><li>Information Provider</li>
        <li>Factory Manager Service</li>
        <li>Log Services</li></ul>
  </answer>
  </faq>

  <faq id="optional">
  <question><b>
    What services are optional when integrating Pluto?
  </b></question>
  <answer>
    <ul><li>Property Manager Service</li>
        <li>Dynamic Title Service</li></ul>
  </answer>
  </faq>
</part>

<part id="architecture">
<title>Architecture, Design, and Implementation</title>
    <faq id="container">
      <question><b>
        What is the difference between a Portal and a Portlet
        Container?
      </b></question>
      <answer>
        <p>
          This question was answered on the developer list in the following
          way:
        <table>
          <tr><th>Date:</th>
              <th>Tue, 11 Nov 2003 15:21:32 -0600</th></tr>
          <tr><th>From:</th>
              <th>Craig Walls [wallsc.AT.michaels.DOT.com]</th></tr>
          <tr><th>Subject:</th>
              <th>setRenderParameter</th></tr>
          <tr><th>Content-Type:</th>
              <th>text/plain; charset=us-ascii</th></tr>
          <tr><td colspan="2">
          This question seems to come up every other day. Perhaps this should be a FAQ?
          Let me attempt to answer it...
          <BR/>
          <BR/>
          Pluto is a JSR-168 compliant portlet container. That means that it provides a
          place for portlets to reside, but nothing else. Think of it this way: A portlet
          container (which is what Pluto is) is to portlets what an aquarium is to fish.
          <BR/>
          <BR/>
          Pluto comes with a minimal portal implementation. A portal implementation builds
          on top of the base container providing additional features which may vary from
          implementation to implementation. Layout and security are features that may be
          provided by a portal implementation, but they are in addition to what the
          container provides. Using the fish analogy again, a portal is to a portlet
          container what decorations are to an aquarium.
          <BR/>
          <BR/>
          That said, a portlet container provides the basic necessities required for
          portlets to live, just as an aquarium provides water (and a barrier to contain
          the water) for fish. A portal implementation provides extra stuff in addition to
          the portlet container just as an aquarium may have plants, rocks, and tiny
          little treasure chests that open and close. The fish can survive without the
          extras, just as a portlet can survive without security or some fancy layout
          engine. But the fish sure do look much nicer when surrounded with the extra
          stuff, just as portlets are much more useful when used alongside extra portal
          features.
        </td></tr></table>
        </p>
        <p>
          Want a more technical answer?
          <a href="arch.html">architectural overview</a>
          for a more complete description
        </p>
      </answer>
    </faq>
  </part>
  <part id="config">
    <title>Configuration</title>
    <faq id="portal">
      <question><b>
        How do I configure the pluto portal?
      </b></question>
      <answer>
      	<p>
        Firstly, please understand that the pluto portal is only intended to be
        demonstration of how to use pluto-the-container in a portal. The layout
        of the portal is controlled by two files, WEB-INF\data\pageregistry.xml
        and WEB-INF\data\portletentityregistry.xml. An explaination for the
        use of these files follows:
        <p>
        <table>
          <tr><th>Date:</th>
              <th>Tue, 11 Nov 2003 02:05:43 +0800</th></tr>
          <tr><th>From:</th>
              <th>Koh Choong Yong  [dunpanic.AT.mailhost.DOT.net]</th></tr>
          <tr><th>Subject:</th>
              <th>Re: portletentityregistry.xml and pageregistry.xml</th></tr>
          <tr><th>Content-Type:</th>
              <th>charset=ISO-8859-1; format=flowed</th></tr>
          <tr><td colspan="2">
			<p>
			pageregistry.xml describes the layout of the portal in pluto.  If you
			replace the correct sections in the default pageregistry.xml file with
			the following fragment, you will see that the 2 portlets are displayed
			one on top of another instead of side-by-side.  The attribute for
			"value" in the &lt;property&gt; tag is a reference to the application id and
			portlet id in portletentityregistry.xml (see discussion below).
			<source>
	&lt;fragment name="row" type="row"&gt;
	    &lt;fragment name="col1" type="column"&gt;
	        &lt;fragment name="p1" type="portlet"&gt;
	            &lt;property name="portlet" value="3.1"/&gt;
	        &lt;/fragment&gt;
	    &lt;/fragment&gt;

	&lt;/fragment&gt;
	&lt;fragment name="row2" type="row"&gt;
	    &lt;fragment name="col2" type="column"&gt;
	        &lt;fragment name="p2" type="portlet"&gt;
	            &lt;property name="portlet" value="4.1"/&gt;
	        &lt;/fragment&gt;
	    &lt;/fragment&gt;
	&lt;/fragment&gt;
			</source>

			portletentityregistry.xml describes the portlets available in the portal.</p>

			<p>Each &lt;application&gt; tag defines one application (corresponding to one
			web-app on the portal container), which can contain multiple &lt;portlet&gt;
			tags.  The "id" attribute in this tag identifies the application, and it
			does not necessary needs to be numeral.</p>

			<p>The &lt;definition-id&gt; tag within the &lt;application&gt; refers to the name of
			the web-app that contains the portlets in this application.</p>

			<p>Each &lt;portlet&gt; tag defines one portlet.  Similarly the "id" attribute in
			this tag identifies the portlet. Note that the application id
			concatenated with the portlet id will be mapped to the "value" attribute
			in the &lt;proprety&gt; tag in pageregistry.xml</p>

			<p>The &lt;definition-id&gt; within the &lt;portlet&gt; is a concatenated id string
			identifying the portlet within the application.  This is a reference to
			the &lt;portlet-name&gt; tag in the portlet.xml in the respective web-app.  In
			the default setting,
			<source>
	&lt;definition-id&gt;testsuite.TestPortlet2&lt;/definition-id&gt;
            </source>
			the portlet referred to was the TestPortlet2 portlet within the
			testsuite web-app.</p>

			<p>Each &lt;preferences&gt; tag within the &lt;portlet&gt; tag defines name/value pairs
			for the PorletPreferences.  These values can be retrieved within the
			JSPs using the following code fragment:
			<source>
	 PortletPreferences preferences = renderRequest.getPreferences();
	 String testPermanence =  preferences.getValue("TEST_PERMANENCE", "Default");
	 out.println(testPermanence);
			</source></p>
          </td></tr></table>
          </p>
        </p>

      	<p>
        Also note that since Pluto 1.0.1-rc2, another configuration file, portletcontexts.txt, has been 
        included in the Pluto portal. The Portlet Contexts file ($PLUTO_HOME/WEB-INF/data/portletcontexts.txt) 
        lists the webapp 
        contexts for each portlet application that runs in Pluto. Each portlet app has a line in this 
        file corresponding to a path and starting with a slash ('/'). In Tomcat, this path is the value 
        of the 'path' attribute of the 'Context' element in a context XML descriptor in 
        $TOMCAT_HOME/conf/Catalina/localhost (or another 'conf' subdirectory).
        </p>
      </answer>
    </faq>
    <faq id="tomcat5.5">
    	<question><b>How do I make Application Scoped Session Attibutes work? (Do I need to configure Tomcat 5.5 differently?)</b></question>
    	<answer>
    	<p>
    		<p>Application Scoped Session Attibutes only work in Tomcat 5.5.</p>

    		<p>In order to enable them on in Tomcat 5.5, you will need to modify your connector configuration.
    		Specifically, set the parameter "emptySessionPath" to true in your connector config in the server.xml.
    		</p>
    		<source>
	&lt;Connector port="8080" maxThreads="150" minSpareThreads="25"
	 maxSpareThreads="75" enableLookups="false"
	 redirectPort="8443" acceptCount="100"
	 connectionTimeout="20000" disableUploadTimeout="true"
	 <b>emptySessionPath="true"</b> /&gt;
    		</source>

    		<p><b>Note:</b> This setting incorporated into the binary distribution of Pluto since version 1.0.1-RC3..
    		</p>

		</p>
    	</answer>
    </faq>
  </part>

	<part id="problems">
		<title>Common Problems</title>
		<faq id="logs">
			<question><b>Pluto is driving me crazy! How do I find out what went wrong?</b></question>
			<answer>
				<p>
				It's a good idea to check the date-stamped pluto.log file in the logs directory to help debug any problems 
				you are having with Pluto. Other log files in that directory might also be helpful. Look at the timestamp 
				of the log files and check them in reverse chronological order.
				</p>
			</answer>
		</faq>
		<faq id="NullPointerException">
			<question><b>NullPointerException: org.apache.pluto.invoker.impl.PortletInvokerImpl.invoke</b></question>
			<answer>
				<p>This is usually because pluto cannot load classes for a portlet.</p>

				<p>Common causes include:
					<ul>
					<li>Cross context dispatching is not turned on for both the pluto portal and your portlet application</li>
					<li>The Portlet application has not been installed properly. Use the <a href="install.html#Installing_With_Maven">Maven task</a>
					or the <a href="install.html#Using_the_Admin_Portlet_Application">Admin Portlet Application</a> 
					to install the portlet application properly</li>
					</ul>
				</p>
			</answer>
		</faq>
	</part>

</faqs>
