svnno****@sourc*****
svnno****@sourc*****
2008年 8月 7日 (木) 16:58:04 JST
Revision: 53
http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=jetspeed-japan&view=rev&rev=53
Author: karma
Date: 2008-08-07 16:58:04 +0900 (Thu, 07 Aug 2008)
Log Message:
-----------
Update translate
Modified Paths:
--------------
jetspeed-2-trans/trunk/ja/xdocs/j1-migration.xml
-------------- next part --------------
Modified: jetspeed-2-trans/trunk/ja/xdocs/j1-migration.xml
===================================================================
--- jetspeed-2-trans/trunk/ja/xdocs/j1-migration.xml 2008-08-06 08:22:57 UTC (rev 52)
+++ jetspeed-2-trans/trunk/ja/xdocs/j1-migration.xml 2008-08-07 07:58:04 UTC (rev 53)
@@ -1031,7 +1031,7 @@
]]>
</source>
</subsection>
- <subsection name='[Persisting State: The Portlet Session] 状態の持続:ポートレットセッション'>
+ <subsection name='[Persisting State: The Portlet Session] 状態の保持:ポートレットセッション'>
<div class="original">
<p>The Portlet API provides built-in support for persistence of Portlet state in the session.
The Portlet Session is similar to the <b>setTemp</b> methods in Turbine/Jetspeed-1, or the session support built into the Servlet API.
@@ -1111,19 +1111,37 @@
]]>
</source>
</subsection>
- <subsection name='Persisting State: User Preferences'>
+ <subsection name='[Persisting State: User Preferences] 状態の保持: ユーザ設定'>
+ <div class="original">
<p>The Portlet API provides a second persistence mechanism: User Preferences. User Preferences are fields of information stored on a per user/per portlet window basis.
The equivalent in Jetspeed-1 is Portlet Instance data, which is stored in the Jetspeed-1 Portlet Registry as name/value pair <b>parameter</b> XML elements.
Looking at the XREG file in Jetspeed-1, we have:
</p>
+ </div>
+ <p>
+ ポートレット API には,第 2 の状態保持メカニズムが準備されています.それはユーザ設定 (User Preferences) です.ユーザ設定は,ユーザ毎 / ポートレット毎に保存される情報欄です.Jetspeed 1 で同等のものは,ポートレットインスタンスデータです.これは,Jetspeed 1 ポートレットレジストリに,名前と値のペアでパラメータとして XML 要素として保存されます.Jetspeed 1 の XREG ファイルで,以下のようなものを見つけることが出来ます.
+ </p>
+<div class="original">
<source>
<![CDATA[
<parameter name="weather_city_info" value="US/IN/Bloomington" hidden="true"/>
]]>
-</source>
+</source>
+</div>
+<source>
+<![CDATA[
+ <parameter name="weather_city_info" value="US/IN/Bloomington" hidden="true"/>
+]]>
+</source>
+ <div class="original">
<p>The Portlet API allows you to define default values for preferences in the portlet.xml deployment descriptor. The user-specific values are stored in the Jetspeed Preferences database.
Here is an example of the default value for a preference as it would be defined in the deployment descriptor:
</p>
+ </div>
+ <p>
+ ポートレット API では,portlet.xml 配備記述子内で,設定のデフォルト値を定義できます.ユーザ固有の値は,Jetspeed 設定データベースに保存されます.以下に,配備記述子に定義される設定のデフォルト値の例を示します.
+ </p>
+<div class="original">
<source>
<![CDATA[
<preference>
@@ -1131,13 +1149,33 @@
<value>Oakland</value>
</preference>
]]>
-</source>
+</source>
+</div>
+<source>
+<![CDATA[
+ <preference>
+ <name>weather_city</name>
+ <value>Oakland</value>
+ </preference>
+]]>
+</source>
+ <div class="original">
<p>Jetspeed-1 provides the <b>PortletInstance</b> interface on every portlet for accessing preference-like information. Whereas the preference information is per-user and per-instance in
Jetspeed-2, in Jetspeed-1 preference information accessed via the PortletInstance interface is only per-instance(per PortletWindow) specific. These values are stored in the PSML file associated
with the PortletWindow. Please note that the values can still be <i>user-specific</i> when you are using the default mechanism for locating pages, which is by user. This means that in Jetspeed-1
preferences (or parameters) are made user-specific by the nature of how pages are retrieved. Since a page is located under a user home directory, then the preference is naturally per user.
</p>
+ </div>
+ <p>
+ Jetspeed 1 は,設定値情報にアクセスするために,ポートレットごとに <b>PortletInstance</b> インターフェースが準備されています.Jetspeed 2 では,設定情報はユーザごと,インスタンスごとであるのに対して,インターフェースの PortletInstance 経由でアクセスされる Jetspeed 1 の設定情報は,インスタンス (ポートレットウィンドウ) ごとに特有なだけとなります.これらの値は,ポートレットウィンドウに関連付けられた PSML ファイルに保存されます.ユーザがページを配置して,そのページに対してデフォルトのメカニズムを使ったとき,この値はユーザ特有であることに注意してください.
+ </p>
+ <div class="original">
<p>With Jetspeed-1, here we can retrieve PortletInstance data:</p>
+ </div>
+ <p>
+ Jetspeed 1 で,PortletInstance データを取得する方法を以下に示します.
+ </p>
+<div class="original">
<source>
<![CDATA[
// where "this" is a Jetspeed-1 Portlet object
@@ -1153,8 +1191,30 @@
this.setAttribute("favoriteColor", "red", rundata);
]]>
</source>
+</div>
+<source>
+<![CDATA[
+ // where "this" is a Jetspeed-1 Portlet object
+ PortletInstance instance = this.getInstance(rundata);
+ String value = instance.getAttribute("favoriteColor", "blue");
+ -- or --
+ this.getAttribute("favoriteColor", "blue", rundata);
+
+ -- we can set preference data the same way in Jetspeed-1
+ PortletInstance instance = this.getInstance(rundata);
+ instance.setAttribute("favoriteColor", "red");
+ -- or --
+ this.setAttribute("favoriteColor", "red", rundata);
+]]>
+</source>
+ <div class="original">
<p>With the Portlet API in Jetspeed-2, we can use the Portlet Preferences in a more direct manner.
Remember that the store() method must always be called after all modifications to the prefs during a request:</p>
+ </div>
+ <p>
+ Jetspeed 2 のポートレット API では,ポートレット設定をもっと直接的な方法で使用できます.
+ </p>
+<div class="original">
<source>
<![CDATA[
PortletPreferences prefs = actionRequest.getPreferences();
@@ -1170,6 +1230,22 @@
Map allPrefs = actionRequest.getPreferences().getMap();
]]>
</source>
+</div>
+<source>
+<![CDATA[
+ PortletPreferences prefs = actionRequest.getPreferences();
+ String color = prefs.getAttribute("favoriteColor", "blue");
+ ...
+ prefs.setAttribute("favoriteColor", "red");
+ prefs.store();
+
+ // note that you can also retrieve multivalues for prefs
+ String values[] = actionRequest.getPreferences().getValues("stocks", defaultValues);
+
+ // or retrieve all preferences as a Map
+ Map allPrefs = actionRequest.getPreferences().getMap();
+]]>
+</source>
</subsection>
</section>
<section name='Registries'>