<commit_before><?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.
-->

<document>
  
  <properties>
    <title>Deploying Portlet to Pluto Portal</title>
    <author email="zheng.at.apache.D0T.org"><NAME></author>
    <author email="<EMAIL>"><NAME></author>
  </properties>
  
  <body>
    
    <section name="Deploying Portlet to Pluto Portal">
      
      <p>
        There are 3 steps of dpeloyment:
        <ul>
          <li>
            <b>Assembly</b>: All portlet applications must be run through the
            pluto assembler before being deployed. The assembly process injects
            pluto specific information for deployment. Specifically, a servlet
            and servlet mapping are added to the deployment descriptor. This
            servlet will be used to dispatch portlet requests to the portlet
            application.
          </li>
          <li>
            <b>Deployment</b>: After portlet applications are assembled properly
            they must be deployed to the servlet engine within which the portal
            application is running.
          </li>
          <li>
            <b>Publishing</b>: All portlet applications that are to be used
            within the Pluto Portal must be published to the Portal. Publishing
            notifies the Portal Application that a portlet application is bound
            (deployed) to a certain context within the appserver.
          </li>
        </ul>
      </p>
      
      <subsection name="Portlet Assembly using Maven">
        <p>
          Portlet assembly is accomplished during war creation by binding the
          <code>pluto:assemble</code> goal to the process-resources lifecycle.
          An example configuration follows (taken from the pluto-testsuite
          application):
        </p>
        <p>
          <source><![CDATA[
<plugin>
  <artifactId>maven-pluto-plugin</artifactId>
  <version>${pom.version}</version>
  <executions>
    <execution>
      <phase>generate-resources</phase>
      <goals>
        <goal>assemble</goal>
      </goals>
    </execution>
  </executions>
</plugin>
          ]]></source>
        </p>
        <p>
          Once configured within the portlet application's pom, the webapp and
          war artifacts created by the project through Maven will include the
          appropriate resources.
        </p>
      </subsection>
      
      <subsection name="Portlet Assembly using Ant Task">
        <p>TBD</p>
      </subsection>
      
      <subsection name="Portlet Deployment using Maven">
        <p>
          You may deploy your proper-assembled portlet application to appserver
          by using your favorite Maven appserver plugin or by invoking the
          following:
          <source><![CDATA[
$> cd <PORTLET-APP-HOME>
$> maven pluto:deploy
          ]]></source><commit_msg>Updated deploying doc<commit_after><?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.
-->

<document>
  
  <properties>
    <title>Deploying Portlet to Pluto Portal</title>
    <author email="zheng.at.apache.D0T.org"><NAME></author>
    <author email="<EMAIL>"><NAME></author>
  </properties>
  
  <body>
    
    <section name="Deploying Portlet to Pluto Portal">
      
      <p>
        There are 3 steps of dpeloyment:
        <ul>
          <li>
            <b>Assembly</b>: All portlet applications must be run through the
            pluto assembler before being deployed. The assembly process injects
            pluto specific information for deployment. Specifically, a servlet
            and servlet mapping are added to the deployment descriptor. This
            servlet will be used to dispatch portlet requests to the portlet
            application.
          </li>
          <li>
            <b>Deployment</b>: After portlet applications are assembled properly
            they must be deployed to the servlet engine within which the portal
            application is running.
          </li>
          <li>
            <b>Publishing</b>: All portlet applications that are to be used
            within the Pluto Portal must be published to the Portal. Publishing
            notifies the Portal Application that a portlet application is bound
            (deployed) to a certain context within the appserver.
          </li>
        </ul>
      </p>
      
      <subsection name="Portlet Assembly using Maven">
        <p>
          Portlet assembly is accomplished during war creation by binding the
          <code>pluto:assemble</code> goal to the process-resources lifecycle.
          This may be done by adding a <code>plug-in</code> element to the
          <code>build</code> element in your portlet application pom. An example
          configuration follows:
        </p>
        <p>
          <source><![CDATA[
<build>
  ... ...
  <plugins>
    ... ...
    <plugin>
      <artifactId>maven-pluto-plugin</artifactId>
      <version>1.1.0-SNAPSHOT</version>
      <executions>
        <execution>
          <phase>generate-resources</phase>
          <goals>
            <goal>assemble</goal>
          </goals>
        </execution>
      </executions>
    </plugin>
    ... ...
  <plugins>
  ... ...
</build> 
          ]]></source>
        </p>
        <p>
          The <code>pluto:assemble</code> goal will parse your portlet
          application's <code>portlet.xml</code> and update <code>web.xml</code>
          to include the appropriate resources. The updated <code>web.xml</code>
          will reside in your project's <code>target/pluto-resources</code>
          directory.
        </p>
        <p>
          To include the updated <code>web.xml</code> in the final war artifact,
          you should also configure the <code>maven-war-plugin</code> by telling
          it where to find the webapp descriptor. An example configuration
          follows:
          <source><![CDATA[
<build>
  ... ...
  <plugins>
    ... ...
    <plugin>
      <artifactId>maven-war-plugin</artifactId>
      <configuration>
        <webXml>${project.build.directory}/pluto-resources/web.xml</webXml>
      </configuration>
    </plugin>
    ... ...
  <plugins>
  ... ...
</build> 
          ]]></source>
        </p>
      </subsection>
      
      <subsection name="Portlet Assembly using Ant Task">
        <p>TBD</p>
      </subsection>
      
      <subsection name="Portlet Deployment using Maven">
        <p>
          You may deploy your proper-assembled portlet application to appserver
          by using your favorite Maven appserver plugin or by invoking the
          following:
          <source><![CDATA[
$> cd <PORTLET-APP-HOME>
$> maven pluto:deploy
          ]]></source>
{'fraction_non_alphanumeric': 0.09492047203694202, 'fraction_numerical': 0.003719856336582863, 'mean_word_length': 2.199425523184243, 'pattern_counts': {'":': 0, '<': 184, '<?xml version=': 2, '>': 188, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 7}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '358160', 'n_tokens_mistral': 2123, 'n_tokens_neox': 2062, 'n_words': 755}