Interstage Portalworks 管理者ガイド
目次 索引 前ページ次ページ

付録F Portletの作成方法について

F.4 Portlet Applicationのパッケージ方法

Portletは、Portlet Applicationという単位で、WARファイル形式でアーカイブされます。これはWeb Applicationの一種で、1つ以上のPortletと単一のPortlet配備記述子(portlet.xml)を含みます。さらに、Servlet、JSP、HTML、またはクラスライブラリ、その他のリソースなども含めることができます。以下に、標準的なPortlet Applicationディレクトリの構成例を示します。

/WEB-INF/web.xml
/WEB-INF/portlet.xml
/WEB-INF/lib/*.jar
/WEB-INF/classes/*/*.class
/WEB-INF/jsp/*.jsp

  1. web.xml
    アプリケーションの名前やServlet定義などを記述します。
  2. portlet.xml
    アプリケーションに含まれるすべてのPortletと関連する定義を記述します。以下に、基本的なportlet.xmlファイルの例を示します。
    <?xml version="1.0" encoding="UTF-8"?>
    <portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd" version="1.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd">

    <portlet>
    <portlet-name>Sample</portlet-name>
    <portlet-class>portlets.Sample</portlet-class>
    <expiration-cache>-1</expiration-cache>
    <supports>
    <mime-type>text/html</mime-type>
    <portlet-mode>VIEW</portlet-mode>
    <portlet-mode>EDIT</portlet-mode>
    <portlet-mode>HELP</portlet-mode>
    </supports>
    <portlet-info>
    <title>Sample Portlet</title>
    </portlet-info>
    </portlet>
    </portlet-app>

    その他の定義可能な項目については、“Java Portlet Specification”の“21章 Packaging and Deployment Descriptor”を参照してください。


目次 索引 前ページ次ページ

All Rights Reserved, Copyright(C) 富士通株式会社 2007