7.5.1 ポートレット配置情報ファイルの作成

拡張レイアウト用のポートレット配置情報ファイルの作成方法について説明します。拡張レイアウト用のポートレット配置情報ファイルは,管理者(運用管理者または部門管理者)が作成します。ポートレット配置情報ファイルを作成することによって,拡張レイアウト(行および列の組み合わせ)を定義できます。

管理者は,次のどれかの方法でポートレット配置情報ファイルを作成します。なお,ポートレット配置情報ファイル名には,HTMLファイルの場合は「homeHTML.html」を,PSML形式の場合は「homeHTML.psml」を指定します。

注※1 タブ形式に拡張レイアウトの画面を表示する場合は,タブ形式のポートレット配置情報ファイルに記述されているタブのタグ,および拡張レイアウトのポートレット配置情報ファイルの内容を組み合わせてポートレット配置情報ファイルを作成する必要があります。

注※2 PSML形式の場合に有効な方法です。

uCosminexus Portal Frameworkが提供しているサンプル(ファイル名:sample1.psml,sample2.psml,およびsample3.psml)は,次のフォルダに格納されています。

{uCosminexus Portal Frameworkインストールディレクトリ}¥samples¥expsml

<この項の構成>
(1) ポートレット配置情報ファイル(HTML)の構造
(2) ポートレット配置情報ファイル(PSML)の構造
(3) ポートレット配置情報ファイルの例

(1) ポートレット配置情報ファイル(HTML)の構造

ポートレット配置情報ファイル(HTML)の構造について説明します。なお,ポートレット配置情報ファイル(HTML)の例については,「7.5.1(3) ポートレット配置情報ファイルの例」を参照してください。

(a) <html>

この文書がHTML文書であることを指定します。なお,この指定は省略できます。指定を省略した場合は,<html>タグ,<head>タグおよび<body>タグは指定されたものとして動作し,<meta>タグのエンコーディングは「UTF-8」が指定されたものとします。

<html>タグ内には,次に示すタグを指定します。

(b) <table controller="tab">

タブ形式のレイアウトを指定します。レイアウトの最上位だけ指定できます。

(c) <table controller="layout">

拡張レイアウト形式であることを指定します。このタグには,次の属性を指定します。

<table controller="layout">タグ内には,<tr>と<td>で行列形式の入れ子,またはエリア(列単位に表示するポートレット)を指定します。

行列形式の入れ子の場合
<tr><td>タグ内に,(c)の<table controller="layout">タグを指定します。
  • <td>のwidth属性
    列形式の場合は,列を表示する幅を<td>タグのwidth属性に比率,またはピクセルで指定します。
  • <td>のheight属性
    行形式の場合は,行を表示する幅を<td>タグのheight属性に比率,またはピクセルで指定します。
エリアの場合
<tr><td>タグ内に,(d)の<table controller="area">を指定します。

(d) <table controller="area">

ポートレットを配置するエリアを指定します。このタグには,次の属性を指定します。

ポートレット定義を指定しない場合でも,<tr>タグと<td>タグの定義は必要です。

<table controller="area">タグ内には,<tr><td>タグで(e)の<span id="entry" />を指定します。

(e) <span id="entry" />

表示するポートレットを指定します。

(2) ポートレット配置情報ファイル(PSML)の構造

ポートレット配置情報ファイル(PSML)の構造について説明します。なお,ポートレット配置情報ファイル(PSML)の例については,「7.5.1(3) ポートレット配置情報ファイルの例」を参照してください。

(a) <?xml version="1.0" encoding="Windows-31J"?>

PSMLファイルは,個別にエンコーディングを指定できます。エンコーディングは,XML宣言文のencodingに指定します。ここでは,「Windows-31J」を指定しています。

(b) <skin>

ポートレットの背景色,ポートレットタイトルバーの色,およびポートレットの間隔のデフォルト値を次の<property>タグで指定します。なお,この指定は省略できます。

(c) <portlets>

行列形式の入れ子,またはエリア(列単位に表示するポートレット)を指定します。

タブ形式の場合
このタグ内に(d)の<controller>タグを指定します。
行列形式の入れ子の場合
このタグ内に(e)の<controller>タグを指定します。
エリアの場合
このタグ内に,エリアであることを指定する(f)の<controller>タグおよびポートレットを表示する(g)の<entry>タグを指定します。

(d) <controller name="org.apache.jetspeed.portal.controllers.CardPortletController">

タブ形式のレイアウトを指定します。レイアウトの最上位だけ指定できます。このタグ内には,次の<parameter>タグを定義します。

(e) <controller name="jp.co.hitachi.soft.portal.portal.controllers.ExtenedRowColumnPortletController">

拡張レイアウト形式,および入れ子の行列形式であることを指定します。このタグ内には,次に示すパラメタ,および(c)の<portlets>タグを指定します。

(f) <controller name=" jp.co.hitachi.soft.portal.portal.controllers.AreaRowColumnPortletController ">

ポートレットを配置するエリアを指定します。このタグ内には,次の<parameter>タグを定義します。

(g) <entry type="ref" parent="sample1">

表示するポートレットを指定します。parent属性には,ポートレット定義ファイル(jetspeed-config.jcfg)のname属性で指定したポートレット名を指定します。ポートレット定義ファイルの詳細は,マニュアル「uCosminexus Portal Framework システム管理者ガイド」を参照してください。

(3) ポートレット配置情報ファイルの例

入れ子が4段ある場合の拡張レイアウトのPSMLファイルについて説明します。

この例で説明する拡張レイアウトの構成を次に示します。

この構成の概要を次の図に示します。

図7-13 入れ子が4段ある場合の拡張レイアウトの概要

[図データ]

図の構成に対応したポートレット配置情報ファイルの例を次に示します。

(a) HTMLの例

図の構成に対応したHTMLファイルの例を次に示します。なお,このHTMLファイルでは,<span>タグで表示するポートレットを指定していますが,概要図ではポートレットを表示していません。

<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=Windows-31J">
</head>
<body>
<table portletpadding="3" controller="layout">
<tr>
 <td width="50%">
  <table controller="area" modification="false" areaid="A00001" areasize="small">
   <tr>
    <td>
     <span id="entry" type="ref" parent="Sample1" />
     <span id="entry" type="ref" parent="Sample2" />
    </td>
   </tr>
  </table>
 </td>
 <td width="50%">
  <table controller="layout">
   <tr>
    <td hight="50%">
     <table controller="area" modification="false" areaid="A00002">
      <tr>
       <td>
        <span id="entry" type="ref" parent="Sample3" />
       </td>
      </tr>
     </table>
    </td>
   </tr>
   <tr>
    <td hight="50%">
     <table controller="layout">
      <tr>
       <td width="50%">
        <table controller="layout">
         <tr>
          <td hight="50%">
           <table controller="area" modification="false" areaid="A00003">
            <tr>
             <td>
              <span id="entry" type="ref" parent="Sample4" />
             </td>
            </tr>
           </table>
          </td>
         </tr>
        <tr>
         <td hight="50%">
          <table controller="area" modification="true" areaid="A00004">
           <tr>
            <td>
            </td>
           </tr>
          </table>
         </td>
        </tr>
       </table>
      </td>
       <td width="50%">
        <table controller="layout">
         <tr>
          <td hight="50%">
           <table controller="area" modification="false" areaid="A00005">
            <tr>
             <td>
              <span id="entry" type="ref" parent="Sample5" />
             </td>
            </tr>
           </table>
          </td>
         </tr>
         <tr>
          <td hight="50%">
           <table controller="area" modification="true" areaid="A00006">
            <tr>
             <td>
             </td>
            </tr>
           </table>
          </td>
         </tr>
        </table>
       </td>
      </tr>
     </table>
    </td>
   </tr>
  </table>
 </td>
</tr>
</table>
</body>
</html>

(b) PSMLの例

図の構成に対応したPSMLファイルの例を次に示します。なお,このPSMLファイルでは,<entry>タグで表示するポートレットを指定していますが,概要図ではポートレットを表示していません。

<?xml version="1.0" encoding="Windows-31J"?>
<portlets>
 <skin>
   <property name="padding" value="3"/>
 </skin>
 <controller name="jp.co.hitachi.soft.portal.portal.controllers.ExtenedRowColumnPortletController">
   <parameter name="mode" value="row"/>
   <parameter name="sizes" value="50%,50%"/>
 </controller>

 <portlets>
   <controller name=" jp.co.hitachi.soft.portal.portal.controllers.AreaRowColumnPortletController">
     <parameter name="modification" value="false"/>
     <parameter name="id" value="A00001"/>
     <parameter name="size" value="small"/>
   </controller>
   <entry type="ref" parent="Sample1"/>
   <entry type="ref" parent="Sample2"/>
 </portlets>

 <portlets>
   <controller name="jp.co.hitachi.soft.portal.portal.controllers.ExtenedRowColumnPortletController">
     <parameter name="mode" value="column"/>
     <parameter name="sizes" value="50%,50%"/>
   </controller>

   <portlets>
     <controller name=" jp.co.hitachi.soft.portal.portal.controllers.AreaRowColumnPortletController">
       <parameter name="modification" value="false"/>
       <parameter name="id" value="A00002"/>
     </controller>
     <entry type="ref" parent="Sample3"/>
   </portlets>

   <portlets>
     <controller name="jp.co.hitachi.soft.portal.portal.controllers.ExtenedRowColumnPortletController">
       <parameter name="mode" value="row"/>
       <parameter name="sizes" value="50%,50%"/>
     </controller>

     <portlets>
       <controller name="jp.co.hitachi.soft.portal.portal.controllers.ExtenedRowColumnPortletController">
         <parameter name="mode" value="column"/>
       </controller>
       <portlets>
         <controller name=" jp.co.hitachi.soft.portal.portal.controllers.AreaRowColumnPortletController">
           <parameter name="modification" value="false"/>
           <parameter name="id" value="A00003"/>
         </controller>
         <entry type="ref" parent="Sample4"/>
       </portlets>
       <portlets>
         <controller name=" jp.co.hitachi.soft.portal.portal.controllers.AreaRowColumnPortletController">
           <parameter name="modification" value="true"/>
           <parameter name="id" value="A00004"/>
         </controller>
       </portlets>
     </portlets>
     <portlets>
       <controller name="jp.co.hitachi.soft.portal.portal.controllers.ExtenedRowColumnPortletController">
         <parameter name="mode" value="column"/>
       </controller>
       <portlets>
         <controller name=" jp.co.hitachi.soft.portal.portal.controllers.AreaRowColumnPortletController">
           <parameter name="modification" value="false"/>
           <parameter name="id" value="A00005"/>
           <entry type="ref" parent="Sample5"/>
         </controller>
       </portlets>
       <portlets>
         <controller name=" jp.co.hitachi.soft.portal.portal.controllers.AreaRowColumnPortletController">
           <parameter name="modification" value="true"/>
           <parameter name="id" value="A00006"/>
         </controller>
       </portlets>
     </portlets>
   </portlets>
 </portlets>
</portlets>