⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 deploying.xml.svn-base

📁 portal越来越流行了
💻 SVN-BASE
字号:
<?xml version="1.0" encoding="UTF-8"?><!--Licensed to the Apache Software Foundation (ASF) under one or morecontributor license agreements.  See the NOTICE file distributed withthis 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 withthe License.  You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed  under the  License is distributed on an "AS IS" BASIS,WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  orimplied.See the License for the specific language governing permissions andlimitations under the License.--><document>    <properties>    <title>Deploying Portlet to Pluto Portal</title>  </properties>    <body>        <section name="Deploying Portlet to Pluto Portal">            <p>        There are 2 steps involved in deploying a portlet application in Pluto 1.1 or 2.0:        <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 (web.xml).             This servlet (<code>org.apache.pluto.core.PortletServlet</code>) 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. The current bundled distribution uses            Tomcat 5.5 as the servlet engine.          </li>        </ul>      </p>            <subsection name="Portlet Assembly">        <p>            The maven-pluto-plugin can be used to assemble a portlet application war.            It will place the proper <code>PortletServlet</code> configuration in web.xml.        </p>        <p>                    The custom Maven 2 build shown below requires          a Tomcat context deployment descriptor that has the same name as your          artifactId with an xml extension (e.g. HelloWorldPortlet.xml).        </p>        <p>          To properly assemble your portlet using the Maven 2 plugin,          your project's directory structure and artifact placement must conform to Maven's standard:        </p>        <p>          <source><![CDATA[	HelloWorldPortlet (top level directory)	|- pom.xml (the pom file)	|- src (Subdir containing main subdirectory)	    |- main (Subdir containing java, resources and webapp subdirs)	    	|- java (java source code goes under here)		    |       `- com		    |           `- mycompany		    |               `- portlet		    |                   `- HelloWorldPortlet.java (portlet source)		    |- webapp  (webapp resources (jsp, css, images) go under here)		    	`- jsp 		    		`- HelloWorldPortletView.jsp (for view mode)		    			    		    		`- HelloWorldPortletEdit.jsp (for edit mode)		    			    		    	`- META-INF		    		`- HelloWorldPortlet.xml (Tomcat context deployment descriptor)		    	`- WEB-INF			    	`- portlet.xml (JSR-168 deployment descriptor)			    	`- web.xml (This will be modified by maven-pluto-plugin)          ]]></source>        </p>        <p>        This is an example of what the Tomcat context deployment descriptor will contain:          <source><![CDATA[		<Context path="/HelloWorldPortlet"			docBase="HelloWorldPortlet" 			crossContext="true"/>          ]]></source>        </p>        <p>        To configure the maven-pluto-plugin, you must configure it in your pom.        For easy of setup, use this as you pom file, changing the groupId, artifactId and version        to values appropriate to your custom portlet.          <source><![CDATA[<project xmlns="http://maven.apache.org/POM/4.0.0"         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">    <!-- Change this to something akin to your java package structure -->  <groupId>com.mycompany.portlet</groupId>  <modelVersion>4.0.0</modelVersion>  <!-- Version of this app -->  <version>0.1-alpha1</version>  <!-- Base name of the war file without .war ext -->  <artifactId>HelloWorldPortlet</artifactId>  <packaging>war</packaging>  <name>${pom.artifactId}</name>  <!-- Dependency Version Properties ======================================= -->  <properties>    <!-- Change this to 2.0.0 for Pluto 2.0 or to another appropriate version -->    <pluto.version>1.1.4</pluto.version>    <portlet-api.version>1.0</portlet-api.version>    <servlet-api.version>2.4</servlet-api.version>    <jsp-api.version>2.0</jsp-api.version>    <junit.version>3.8.1</junit.version>  </properties>    <dependencies>    <dependency>      <groupId>javax.portlet</groupId>      <artifactId>portlet-api</artifactId>      <version>${portlet-api.version}</version>      <scope>provided</scope><!-- Prevents addition to war file -->    </dependency>    <dependency>      <groupId>javax.servlet</groupId>      <artifactId>servlet-api</artifactId>      <version>${servlet-api.version}</version>      <scope>provided</scope>    </dependency>    <dependency>      <groupId>junit</groupId>      <artifactId>junit</artifactId>      <version>${junit.version}</version>      <scope>test</scope>    </dependency>    <dependency>      <groupId>org.apache.pluto</groupId>      <artifactId>pluto-util</artifactId>      <version>${pluto.version}</version>      <scope>provided</scope>    </dependency>    <!-- Any other build or deployment dependancies go here -->  </dependencies>  <build>    <finalName>${pom.name}</finalName>    <plugins>      <!-- configure to use Java 6 to compile (change to your JDK) -->       <plugin>          <groupId>org.apache.maven.plugins</groupId>          <artifactId>maven-compiler-plugin</artifactId>          <configuration>              <source>1.6</source>              <target>1.6</target>          </configuration>       </plugin>      <!-- configure maven-war-plugin to use updated web.xml -->      <plugin>        <artifactId>maven-war-plugin</artifactId>        <configuration>          <webXml>${project.build.directory}/pluto-resources/web.xml</webXml>        </configuration>      </plugin>      <!-- bind 'pluto:assemble' goal to 'generate-resources' lifecycle -->      <plugin>        <groupId>org.apache.pluto</groupId>        <artifactId>maven-pluto-plugin</artifactId>        <version>${pluto.version}</version>        <executions>          <execution>            <phase>generate-resources</phase>            <goals>              <goal>assemble</goal>            </goals>          </execution>        </executions>      </plugin>    </plugins>  </build>  </project>          ]]></source>        </p>                <p>            Once configured, the war generated by an 'mvn package' (or install) command will contain            the appropriate pluto configuration.        </p>      </subsection>        <subsection name="Portlet Deployment">           <p>               To deploy a portlet application, simply deploy the application war               using any standard mechanism for your application server.  There are many               maven plugins and ant tasks that can assist with this, or you can use               an administrative web console. This console is the Tomcat manager webapp in the               Pluto bundled distribution and is accessed via the 'Upload and deploy portlet war' link               on the page administration portlet. See the Help link on that portlet for more details.           </p>           <p>           	   In the bundled distribution that uses Tomcat, deployment of an assembled war can simply           	   be done by dropping the war into the webapps directory. You can automatically achive this           	   by adding the following code within the plugins section of your maven pom.xml:           </p>          <source><![CDATA[       <plugin>        <artifactId>maven-antrun-plugin</artifactId>        <executions>          <execution>            <phase>integration-test</phase>            <configuration>              <tasks>                  <property environment="env"/>                   <!-- This assumes that you have set a CATALINA_HOME environmental variable -->                  <property name="pluto.home" value="${env.CATALINA_HOME}"/>                  <copy file="target/${pom.name}.war" todir="${pluto.home}/webapps"/>              </tasks>            </configuration>            <goals>              <goal>run</goal>            </goals>          </execution>        </executions>      </plugin>                    ]]></source>           <p>              Once the pom.xml file has been updated with this plugin, you can run the full build              and deployment using the command: mvn integration-test. The code assumes that you have set              the environmental variable CATALINA_HOME to the Pluto home directory. If that has not been              done, just set pluto.home from the command line with the -D flag. The command line would              then be: mvn -Dpluto.home=C:/pluto integration-test.           </p>                   </subsection>                  <subsection name="Portlet Publishing">        <p>        As soon as the portlet application (war) is deployed to the servlet container        the portlet application will be available to the portal and can be added to        pages using the page administration portlet. See the help mode in this portlet        for details on its use.        </p>                <p><b>Portal Page Configuration</b></p>        <p>          If you'd like for your page configuration to be consistent throughout          restarts of the application server (currently placements made through          the page administration portlet is not persistent), you should then configure the page          layout in the portal-driver configuration file (pluto-portal-driver-config.xml).        </p>        <p>          The page can then be configured by adding a <code>page</code> child element of the <code>render-config</code>           element, like this:          <source><![CDATA[<render-config default="Test Page">  ... ...  <page name="Your Portal Page Name" uri="/WEB-INF/fragments/portlet.jsp">    <portlet context="/your_portlet_app_context_path"             name="your_portlet_1"/>    <portlet context="/your_portlet_app_context_path"             name="your_portlet_2"/>  </page></render-config>          ]]></source>        </p>        <p>          The <code>uri</code> attribute defines the theme of your portal page.          If you use <code>/WEB-INF/fragments/portlet.jsp</code> (which is the          default theme of Pluto Testsuite portlet app), your portlets will be          displayed in two columns. You can clone this file to customize your layout.          If you do so, make sure the <code>uri</code> attribute points to the new file.        </p>      </subsection>          </section>      </body>  </document>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -