svnno****@sourc*****
svnno****@sourc*****
2008年 6月 27日 (金) 19:03:43 JST
Revision: 49
http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=jetspeed-japan&view=rev&rev=49
Author: karma
Date: 2008-06-27 19:03:43 +0900 (Fri, 27 Jun 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-06-26 09:12:19 UTC (rev 48)
+++ jetspeed-2-trans/trunk/ja/xdocs/j1-migration.xml 2008-06-27 10:03:43 UTC (rev 49)
@@ -727,7 +727,8 @@
]]>
</source>
</subsection>
- <subsection name='Converting a Turbine Action'>
+ <subsection name='[Converting a Turbine Action] Turbine アクションの変換'>
+<div class="original">
<p>The Portlet API defines several phases of execution during the processing of a portlet page. The action phase is designed to be executed
before the render phase of a portlet. There can only be one action phase targeting only one portlet. Once the action phase completes, then
the render phase for all portlets on a page can be executed. Thus the action phase is said to be a <i>blocking</i> phase, meaning that it must
@@ -737,16 +738,38 @@
action, the Portlet API has an entry point for all actions to come through as a method on your portlet. Frameworks such as the Spring MVC
framework provide better abstractions for modeling one method per action.
</p>
+</div>
+<p>
+ポートレット API は,ポートレットページの処理の間の実行フェーズをいくつか定義しています.アクションフェーズは,ポートレットの描画フェーズの前に実行されるように設計されています.1 つのポートレットだけを対象にした,1 つのアクションフェーズしか存在出来ません.アクションフェーズが完了すると,ページ上の全てのポートレットの描画フェーズが実行出来ます.したがって,アクションフェーズは<i>ブロッキング</i>フェーズと言えます.これは,ページ上の各ポートレットの描画フェーズが始まる前に完了していなければいけない事を意味します.アクションは通常,MVC フレームワークの <i>Model</i> を操作する,ある種のユーザとの対話のようなものです.それは,ユーザがフォームに入力を行い,モデルが更新されたり,レコードが追加されたり消去されたりするというようなものです.このアクションの概念は,Turbine と Jetspeed 1 から Jetspeed 2 とポートレット API への移植をかなりうまく行います.Turbine がアクションごとに 1 クラスという概念を持つのに対して,ポートレット API は,全てのアクションを,ポートレットのメソッドを通して行うエントリポイントを持ちます.Spring MVC フレームワークのようなフレームワークは,アクションごとに一つのメソッドを持つモデルに対する,より良い抽象概念を提供します.
+</p>
+<div class="original">
<p>Lets again look at the WeatherPortlet with Jetspeed-1. First the xreg defines the actions:</p>
+</div>
+<p>
+ここで再び Jetspeed 1 の WeatherPortlet を見ましょう.まず,xreg がアクションを定義します.
+</p>
+<div class="original">
<source>
<![CDATA[
<parameter name="action" value="portlets.WeatherAction" hidden="true"/>
]]>
</source>
+</div>
+<source>
+<![CDATA[
+ <parameter name="action" value="portlets.WeatherAction" hidden="true"/>
+]]>
+</source>
+<div class="original">
<p>
We must then implement the action class which are usually placed in the Jetspeed-1 webapp class loader space.
Here is the code for the WeatherAction, which extends a Jetspeed-1 framework class VelocityPortletAction:
</p>
+</div>
+<p>
+通常,Jetspeed 1 の webapp クラスローダ空間に置かれるアクションクラスを実装する必要があります.ここに WeatherAction のコードを示します.これは,Jetspeed 1 のフレームワーククラスである VelocityPortletAction を継承したものです.
+</p>
+<div class="original">
<source>
<![CDATA[
public class WeatherAction extends VelocityPortletAction
@@ -773,6 +796,35 @@
}
]]>
</source>
+</div>
+
+<source>
+<![CDATA[
+public class WeatherAction extends VelocityPortletAction
+{
+
+ protected void buildNormalContext( VelocityPortlet portlet,
+ Context context,
+ RunData rundata )
+ {
+
+ String cityInfo = PortletConfigState.getParameter(portlet, rundata, WEATHER_CITY_INFO, null);
+ //if (cityInfo == null)
+ //{
+ String city = portlet.getPortletConfig().getInitParameter(WEATHER_CITY);
+ String state = portlet.getPortletConfig().getInitParameter(WEATHER_STATE);
+ String station = portlet.getPortletConfig().getInitParameter(WEATHER_STATION);
+ cityInfo = getCityInfo(city, state, station);
+ //}
+ context.put(WEATHER_CITY_INFO, cityInfo);
+ //PortletConfigState.setInstanceParameter(portlet, rundata, WEATHER_CITY_INFO, cityInfo);
+
+ String style = PortletConfigState.getParameter(portlet, rundata, WEATHER_STYLE, "infobox");
+ context.put(WEATHER_STYLE,style);
+ }
+]]>
+</source>
+
<p>
In Jetspeed-1 there is some really bad architecture interfering with easily writing portlets.
Here in our action, we are actually implementing the <b>View</b> portion of our code by populating the