svnno****@sourc*****
svnno****@sourc*****
2008年 6月 26日 (木) 13:54:57 JST
Revision: 47
http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=jetspeed-japan&view=rev&rev=47
Author: karma
Date: 2008-06-26 13:54:57 +0900 (Thu, 26 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-18 10:23:43 UTC (rev 46)
+++ jetspeed-2-trans/trunk/ja/xdocs/j1-migration.xml 2008-06-26 04:54:57 UTC (rev 47)
@@ -307,23 +307,43 @@
<li><a href='http://www.springframework.org/docs/reference/portlet.html'>Spring Portlet MVC</a></li>
</ul>
</subsection>
- <subsection name='Converting the Portlet Init Java Code'>
+ <subsection name='[Converting the Portlet Init Java Code] ポートレットの Init Java コードの変換'>
+ <div class="original">
<p>
The Portlet Source code handles the <b>Init</b> phase of a portlet lifecycle.
The init phase is very similar in both the Java Portlet API and in Jetspeed 1.
Here we have an example of the init method of a Jetspeed-1 portlet:
</p>
+ </div>
+ <p>
+ ポートレットのソースコードは,ポートレットのライフサイクルの <b>Init</b> フェーズを扱います.Init フェーズは Java Portlet API と Jetspeed 1 で非常に良く似ています.ここに Jetspeed 1 ポートレットの init メソッドの例を挙げてみます.
+ </p>
+ <div class="original">
<source>
<![CDATA[
public void init() throws PortletException
{
}
]]>
+ </source>
+ </div>
+ <source>
+<![CDATA[
+ public void init() throws PortletException
+ {
+ }
+]]>
</source>
+ <div class="original">
<p>
The equivalent method in the Portlet API (Jetspeed-2) would be, note the difference being the PortletConfig parameter
(although the exception classes are named the same, they are entirely different classes, one from Jetspeed-1, the other from the Portlet API):
</p>
+ </div>
+ <p>
+ Portlet API (Jetspeed 2) にも同等のメソッドがあって,PortletConfig パラメータの存在が違うことに注意してください (例外クラスが同じ名前ですが,まったく違うクラスです.片方は Jetspeed 1 のもの,他方は Portlet API のものです).
+ </p>
+ <div class="original">
<source>
<![CDATA[
public void init(PortletConfig config)
@@ -331,14 +351,37 @@
{
}
]]>
- </source>
+ </source>
+ </div>
+ <source>
+<![CDATA[
+ public void init(PortletConfig config)
+ throws PortletException
+ {
+ }
+]]>
+ </source>
+ <div class="original">
<p>In Jetspeed-1, you would normally access Turbine Services with static acccessors, for example:</p>
+ </div>
+ <p>Jetspeed 1 では,通常,静的なアクセサで Turbine サービスにアクセスします.例えば,</p>
+<div class="original">
<source>
<![CDATA[
JetspeedSecurity.addUser(user);
]]>
-</source>
+</source>
+</div>
+<source>
+<![CDATA[
+ JetspeedSecurity.addUser(user);
+]]>
+</source>
+ <div class="original">
<p>In Jetspeed-2, Jetspeed Services the standard way to access Jetspeed Services is to get a handle in the init phase, for example:</p>
+ </div>
+ <p>Jetspeed 2 では,Jetspeed サービスにアクセスする標準的な方法は,init フェーズでハンドルを取得します.</p>
+<div class="original">
<source>
<![CDATA[
private UserManager userManager;
@@ -353,22 +396,51 @@
}
}
]]>
-</source>
+</source>
+</div>
+<source>
+<![CDATA[
+ private UserManager userManager;
+...
+ public void init(PortletConfig config)
+ throws PortletException
+ {
+ userManager = (UserManager)getPortletContext().getAttribute(CommonPortletServices.CPS_USER_MANAGER_COMPONENT);
+ if (null == userManager)
+ {
+ throw new PortletException("Failed to find the User Manager on portlet initialization");
+ }
+ }
+]]>
+</source>
</subsection>
- <subsection name='Converting the Portlet getContent Java Code'>
+ <subsection name='[Converting the Portlet getContent Java Code] ポートレットの getContent Java コードの変換'>
+ <div class="original">
<p>
In Jetspeed-1, the <b>getContent</b> method renders the content of your portlet. The render phase of Jetspeed-1 is implemented
by the getContent method of your Portlet as defined by the Jetspeed-1 Portlet interface.
</p>
+ </div>
+ <p>
+ Jetspeed 1 では,<b>getContent</b> メソッドは,ポートレットのコンテンツを描画します.Jetspeed 1 の描画フェーズは,Jetspeed 1 ポートレットインターフェースで定義されたポートレットの getContent メソッドによって実装されています.
+ </p>
+<div class="original">
<source>
<![CDATA[
public ConcreteElement getContent(RunData rundata);
]]>
-</source>
+</source>
+</div>
+<div class="original">
<p>The only parameter passed in to the getContent method is a <b>RunData</b> parameter. RunData is a part of the <a href='http://jakarta.apache.org/turbine/'>Turbine web framework</a>.
RunData is basically a wrapper around the Servlet request and response, along with other Turbine-specific information.
When writing portlets for Jetspeed-2, you write to the Portlet API.
</p>
+</div>
+<p>
+getContent メソッドが処理するたった一つのパラメータは <b>RunData</b> パラメータです.RunData は <a href='http://jakarta.apache.org/turbine/'>Turbine ウェブフレームワーク</a> の一部分です.RunData は基本的に,他の Turbine 特有の情報と一緒に,サーブレットのリクエストとレスポンスを包むラッパーです.Jetspeed 2 に対するポートレットを書く時は,Portlet API を使って書きます.
+</p>
+<div class="original">
<source>
<![CDATA[
public void doView(RenderRequest request, RenderResponse response)
@@ -377,7 +449,18 @@
response.setContentType("text/html");
...
]]>
-</source>
+</source>
+</div>
+<source>
+<![CDATA[
+public void doView(RenderRequest request, RenderResponse response)
+throws PortletException, IOException
+{
+ response.setContentType("text/html");
+ ...
+]]>
+</source>
+<div class="original">
<p>The <b>doView</b> method is the Portlet API equivalent of the <b>getContent</b> method of the Jetspeed-1 API.
The Portlet API has the concept of <b>portlet modes</b>. There are three default portlet modes <b>view, edit, and help</b>.
For each of these modes, there are three methods you can override in your portlet: <b>doView, doEdit and doHelp</b>.
@@ -387,6 +470,10 @@
yourself by reading the Portlet specification as well as any articles or books on the subject. A good book to get started on the Portlet API
is <a href='http://www.manning.com/hepper/'>Portlets and Apache Portals</a>.
</p>
+</div>
+<p>
+<b>doView</b> メソッドは,Jetspeed 1 API の <b>getContent</b> メソッドと同等の,ポートレット API のメソッドです.ポートレット API は <b>ポートレットのモード</b> の概念を持ちます.<b>view, edit, help</b> の 3 つのデフォルトのポートレットモードがあります.これらのモードそれぞれに対して,あなたのポートレットがオーバーライド出来る 3 つのメソッドがあります.<b>doView, doEdit, doHelp</b> です.Jetspeed 1 では,RunData パラメータ 1 つだったところが,ポートレットAPI では,より Servlet API 的な <b>RenderRequest</b> と <b>RenderResponse</b> の 2 つのパラメータを持つことに注意してください.あなたのアプリケーションを移行する最も大きな部分の 1 つが RunData を RenderRequest と RenderReponse に変換する事でしょう.移行を始める前に,Portlet API のトレーニングコースを受講するか,ポートレット仕様を自分で読んだ上に,関連する記事や書籍を読んで,API を学ぶ事をおすすめします.ポートレット API を学び始めるのに良い書籍に,<a href='http://www.manning.com/hepper/'>Portlets and Apache Portals</a> があります.
+</p>
<p>When rendering content, Jetspeed 1 makes use of a HTML construction kit called <b>ECS</b>. All rendering goes through Turbine and ECS.
The return type of the getContent method is a <b>ConcreteElement</b>, which is defined in the ECS API. Here is the typical way to
generate output from a portlet in Jetspeed-1: