| <?xml version="1.0" encoding="UTF-8"?> |
| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You 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. |
| --> |
| |
| <document> |
| |
| <properties> |
| <title>Embedding the Pluto Container</title> |
| </properties> |
| |
| <body> |
| |
| <section name="Embedding the Pluto Container"> |
| |
| <p> |
| This document is currently <b>very</b> breif. Please feel free to submit |
| patches. |
| </p> |
| |
| <subsection name="Steps for Embedding Pluto"> |
| <p> |
| <b>Step 1:</b> Implement <code>org.apache.pluto.PortletContainerServices</code> |
| </p> |
| <p> |
| <b>Step 2:</b> Manage the Portlet Container Lifecycle: |
| <ul> |
| <li> |
| Create an instance of the container: |
| <source><![CDATA[ |
| // |
| // Step 1) Create and instance of the PortletContainerService |
| // |
| PortletContainerServices impl = . . . |
| |
| // |
| // Step 2) Request a new container from the container factory |
| // |
| PortletContainerFactory factory = |
| PortletContainerFactory.getInstance(); |
| |
| PortletContainer container = factory.createContainer( |
| "My Container Name", impl |
| ); |
| |
| // |
| // Step 3) Initialize the Container with the embedding |
| // application's ServletContext |
| // |
| container.init(ctx); |
| ]]></source> |
| </li> |
| <li>Destroy the Container during Shutdown.</li> |
| </ul> |
| </p> |
| <p> |
| <b>Step 3:</b> Invoke the Container as necessary: |
| <source><![CDATA[ |
| // Load a portlet |
| container.doLoad(portletWindow, request, response); |
| // Process a Portlet Action |
| container.doAction(portletWindow, request, response); |
| // Render a portlet |
| container.doRender(portletWindow, request, response); |
| ]]></source> |
| </p> |
| |
| </subsection> |
| |
| </section> |
| |
| </body> |
| |
| </document> |
| |