[AJAX XML API Overview] AJAX XML API の概要

The Jetspeed XML AJAX API is an XML-based API provided to AJAX clients for making asynchronous requests to Jetspeed-2 services.

Jetspeed の XML AJAX API は、AJAX クライアントが、非同期のリクエストを Jetspeed 2 サービスに送ることができるようにするための XML ベースの API です。

Typical use cases:

典型的な使用例としては、

  • Page Customization and Portlet Placement - To move, copy, add, or remove portlets on a page
  • Layout Selection - change the layout (number of rows and columns, size of columns) on a page
  • Theme and Decorator Selection - change the page theme and portlet decorators on a page.
  • Portlet Selectors - provide a select-list of portlets to the end user
  • Security Configuration - configure the security constraints or policy on a resource (page, portlet, folder, link, fragment), or portal wide
  • Menu Configuration - create and edit menus for the Jetspeed Site
  • General Administration - all use cases for general administration have not yet been explored.
  • ページのカスタマイズとポートレットの配置 - ページ上でのポートレットの移動、コピー、追加、削除。
  • レイアウトの選択 - ページのレイアウトの変更 (行や列の数の変更、列のサイズの変更)。
  • テーマとデコレータの選択 - ページのテーマやページ上のポートレットのデコレータの変更。
  • ポートレットのセレクタ - エンドユーザへのポートレットの選択リストを提供。
  • セキュリティの設定 - リソース (ページ、ポートレット、フォルダ、リンク、フラグメント) もしくはポータル全体でのセキュリティ制約、またはポリシーの設定。
  • メニューの設定 - Jetspeed サイトのメニューの生成や編集。
  • 全体的な管理 - 全体的な管理を行う全てのユースケースはまだ検討されていません。

[Secured Access] 保証されたアクセス

All AJAX XML API requests run through a standard Jetspeed Pipeline request. This means that you can configure your AJAX request with the usual array of Jetspeed components. The default AJAX pipeline secures access to all requests. Each AJAX action may have its own security constraints. All requests made to a page will use the declarative security constraints configured for that page. AJAX request actions are enforced under edit or view mode, depending on the nature of the action.

AJAX XML API リクエストの全ては、標準の Jetspeed パイプラインリクエストを通して実行されます。これは、通常の Jetspeed コンポーネントの配列を用いて、AJAX リクエストを構成可能であることを意味します。デフォルトの AJAX パイプラインは、全てのリクエストへのアクセスを保証します。AJAX アクションのそれぞれは、自身のセキュリティ制約を持ちます。ページを生成する全てのリクエストは、本来のアクションに依存する、編集もしくは閲覧モードの元で実行されます。

[API] API

The AJAX XML API is simply a HTTP request-based API, communicating over a simple REST (Representational State Transfer) protocol. The API is accessed over HTTP via the "ajaxapi" servlet path on the portal URL:

http://hostname/contextname/ajaxapi

AJAX XML API は、単純な HTTP リクエストベースの API で、単純な REST (Representational State Transfer) プロトコル上での通信を行います。API へは、以下のようなポータル URL パスの "ajaxapi" サーブレット経由で HTTP を使ってアクセスします。

http://hostname/contextname/ajaxapi

[Request Parameters and the Page] リクエストパラメータとページ

Request Parameters specify the requested API action, and additional API parameters. The page that a request is referencing is implied in the HTTP URL. Thus if we are making a request to modify a page, the page is specified in the HTTP URL:

http://localhost:8080/jetspeed/ajaxapi/Public/db-browser.psml
The page location algorithm using standard Jetspeed Profiling rules to locate the page. A page is actually not required in the URL, since the Jetspeed Profiler will locate the page for you. Example:
http://localhost:8080/jetspeed/ajaxapi
goes to the default page for the current user.

リクエストパラメータは、リクエストした API の動作と、追加の API パラメータを指定します。リクエストが参照しているページは、HTTP URL 内に含まれます。なので、もしページを変更するリクエストを作成したい場合、ページは以下のような HTTP URL 内で指定します。

http://localhost:8080/jetspeed/ajaxapi/Public/db-browser.psml
標準の Jetspeed プロファイリングを使ったページの配置アルゴリズムが、ページを配置します。ページは、実際は URL 中には不要です。Jetspeed プロファイラ が、ユーザのためのページを配置するからです。例えば、
http://localhost:8080/jetspeed/ajaxapi
という URL は、現在のユーザのデフォルトページを表示します。

Request Parameters are specific to each API. One request parameter, the "action" parameter, is almost always required, (except in the default case). The default action is "action=getpage" which returns an XML representation of the profile-located page in PSML. (PSML is an XML format). See the table below for specific examples of request parameters.

リクエストパラメータは、API それぞれで固有です。大体の場合、"action" パラメータというリクエストパラメータだけは、必要になります (デフォルトの場合を除く)。デフォルトのアクションは "action=getpage" です。これは、PSML 内のプロファイルが示すページの XML 表現を返します (PSML は XML フォーマットです)。リクエストパラメータのそれぞれの例は以下の表を参照してください。

Here are the APIs currently available:

現時点で利用可能な API を示します。

[Get Page] ページの取得

API:getpage
Component:AjaxGetPage
Description:Get Page retrieves a page from the Page Manager store in PSML format.
Parameters:
pageimplied in the URL
actiongetportlets (optional, this is the default action)
API example:
			
http://localhost:8080/jetspeed/ajaxapi/Public/content.psml
XML Response:
<js>
<status>success</status>
<action>getpage</action>
  <page hidden="false">
  <defaults layout-decorator="tigris" portlet-decorator="tigris"/>
  <name>public.psml</name>
  <path>/Public/public.psml</path>
  <title>Public Share</title>
  <short-title>Public Share</short-title>
  <metadata name="title" xml:lang="es">Carpeta compartida</metadata>
  <fragment id="ps-1000" type="layout" name="jetspeed-layouts::VelocityTwoColumns" decorator="">
    <fragment id="ps-1001" type="portlet" name="rss::RSS" decorator="">
      <property name="row" value="0"/>
      <property name="column" value="0"/>
    </fragment>
	<fragment id="ps-1002" type="portlet" name="demo::BookmarkPortlet" decorator="">
      <property name="row" value="1"/>
      <property name="column" value="1"/>
    </fragment>
	<fragment id="ps-1003" type="portlet" name="jsf-demo::CalendarPortlet" decorator="">
      <property name="row" value="0"/>
      <property name="column" value="1"/>
    </fragment>
	<fragment id="P-1080bff9b03-10000" type="portlet" name="jsf-demo::CalendarPortlet" decorator="">
      <property name="row" value="1"/>
      <property name="column" value="0"/>
    </fragment>
  </fragment>
</page>
</js>
API:getpage
コンポーネント:AjaxGetPage
説明:getpage は、ページマネージャから、PSML に保存されたページを取得します。
パラメータ:
pageURL に含まれます
actiongetportlets (省略可、これがデフォルトのアクションです)
API の例:
			
http://localhost:8080/jetspeed/ajaxapi/Public/content.psml
XML レスポンス:
<js>
<status>success</status>
<action>getpage</action>
  <page hidden="false">
  <defaults layout-decorator="tigris" portlet-decorator="tigris"/>
  <name>public.psml</name>
  <path>/Public/public.psml</path>
  <title>Public Share</title>
  <short-title>Public Share</short-title>
  <metadata name="title" xml:lang="es">Carpeta compartida</metadata>
  <fragment id="ps-1000" type="layout" name="jetspeed-layouts::VelocityTwoColumns" decorator="">
    <fragment id="ps-1001" type="portlet" name="rss::RSS" decorator="">
      <property name="row" value="0"/>
      <property name="column" value="0"/>
    </fragment>
	<fragment id="ps-1002" type="portlet" name="demo::BookmarkPortlet" decorator="">
      <property name="row" value="1"/>
      <property name="column" value="1"/>
    </fragment>
	<fragment id="ps-1003" type="portlet" name="jsf-demo::CalendarPortlet" decorator="">
      <property name="row" value="0"/>
      <property name="column" value="1"/>
    </fragment>
	<fragment id="P-1080bff9b03-10000" type="portlet" name="jsf-demo::CalendarPortlet" decorator="">
      <property name="row" value="1"/>
      <property name="column" value="0"/>
    </fragment>
  </fragment>
</page>
</js>

[Move Absolute] 絶対位置で移動

API:moveabs
Component:AjaxMovePortletAbsolute
Description:Move a portlet on a page to an absolute position specified in the row and col request parameters.
Parameters:
pageimplied in the URL
actionmoveabs
idthe portlet PSML fragment id of the portlet to be moved
rowthe absolute new row location to place the portlet fragment (zero based)
colthe absolute new column location to place the portlet fragment (zero based)
API example:
			
http://localhost:8080/jetspeed/ajaxapi/Public/public.psml?action=moveabs&id=ps-1003&row=0&col=1			
XML Response:
<js>
   <status>success</status>
    <action>moveabs</action>
    <id>ps-1003</id>
	<old_position>
      <col>1</col>
      <row>1</row>
    </old_position>
	<new_position>
      <col>1</col>
      <row>0</row>
    </new_position>
</js>						
API:moveabs
コンポーネント:AjaxMovePortletAbsolute
説明:ページ上のポートレットの絶対位置をリクエストパラメータで指定した row と col に従って移動する。
パラメータ:
pageURL に含まれます
actionmoveabs
id移動させたいポートレットのポートレット PSML フラグメント ID
rowポートレットフラグメントを置きたい位置の絶対的な行位置 (ゼロベース)
colポートレットフラグメントを置きたい位置の絶対的な列位置 (ゼロベース)
API の例:
			
http://localhost:8080/jetspeed/ajaxapi/Public/public.psml?action=moveabs&id=ps-1003&row=0&col=1			
XML レスポンス:
<js>
   <status>success</status>
    <action>moveabs</action>
    <id>ps-1003</id>
	<old_position>
      <col>1</col>
      <row>1</row>
    </old_position>
	<new_position>
      <col>1</col>
      <row>0</row>
    </new_position>
</js>						

[Move Relative] 相対位置で移動

APIs:moveleft, moveright, moveup, movedown
Components:AjaxMovePortletLeft, AjaxMovePortletRight, AjaxMovePortletUp, AjaxMoveDown
Description:Move a portlet on a page relatively one position, based on the action.
Parameters:
pageimplied in the URL
actionmoveleft, moveright, moveup, movedown
idthe portlet PSML fragment id of the portlet to be moved
API example:
			
http://localhost:8080/jetspeed/ajaxapi/Public/public.psml?action=movedown&id=ps-1003
XML Response:
<js>
   <status>success</status>
    <action>movedown</action>
    <id>ps-1003</id>
	<old_position>
      <col>1</col>
      <row>0</row>
    </old_position>
	<new_position>
      <col>1</col>
      <row>1</row>
    </new_position>
</js>						
API:moveleft, moveright, moveup, movedown
コンポーネント:AjaxMovePortletLeft, AjaxMovePortletRight, AjaxMovePortletUp, AjaxMoveDown
説明:アクションを指定して、ページ上のポートレットを相対的なある位置から移動する。
パラメータ:
pageURL に含まれます
actionmoveleft, moveright, moveup, movedown
id移動させたいポートレットのポートレット PSML フラグメント ID
API の例:
			
http://localhost:8080/jetspeed/ajaxapi/Public/public.psml?action=movedown&id=ps-1003
XML レスポンス:
<js>
   <status>success</status>
    <action>movedown</action>
    <id>ps-1003</id>
	<old_position>
      <col>1</col>
      <row>0</row>
    </old_position>
	<new_position>
      <col>1</col>
      <row>1</row>
    </new_position>
</js>						

[Move] 移動

API:move
Component:AjaxMovePortlet
Description:Move a portlet on a page to a cartesian position (x,y,z,width,height) from request parameters.
Parameters:
pageimplied in the URL
actionmove
idthe portlet PSML fragment id of the portlet to be moved
xthe portlet cartesian X position
ythe portlet cartesian Y position
zthe portlte cartesian Z position
widththe width of the portlet
heightthe height cartesian Y position
API example:
			
http://localhost:8080/jetspeed/ajaxapi/Public/public.psml?action=move&id=ps-1003&x=100&y=250&width=200&height=300			
XML Response:
<js>
   <status>success</status>
    <action>move</action>
    <id>ps-1003</id>
	<old_position>
      <x>50</x>
      <y>155</row>
    </old_position>
	<new_position>
      <x>100</x>
      <y>250</y>
    </new_position>
</js>						
API:move
コンポーネント:AjaxMovePortlet
説明:ページ上のポートレットの位置をリクエストパラメータで指定した直交座標系の位置 (x,y,z,幅、高さ) へ移動する。
パラメータ:
pageURL に含まれます
actionmove
id移動させたいポートレット PSML フラグメント ID
xポートレットの直交座標での X 軸の位置
yポートレットの直交座標での Y 軸の位置
zポートレットの直交座標での Z 軸の位置
widthポートレットの幅
heightポートレットの高さ
API の例:
			
http://localhost:8080/jetspeed/ajaxapi/Public/public.psml?action=move&id=ps-1003&x=100&y=250&width=200&height=300			
XML レスポンス:
<js>
   <status>success</status>
    <action>move</action>
    <id>ps-1003</id>
	<old_position>
      <x>50</x>
      <y>155</row>
    </old_position>
	<new_position>
      <x>100</x>
      <y>250</y>
    </new_position>
</js>						

[Add Portlet] ポートレットの追加

API:add
Component:AjaxAddPortlet
Description:Adds a new portlet to the current page. The portlet can be added at a specified row and column. If either the row or column or not specified, defaults to zero respectively.
Parameters:
pageimplied in the URL
actionadd
idThe portlet full name to be placed on the page, using Jetspeed Portlet Naming (PortletApplicationName::PortletName)
rowoptional: the absolute new row location to place the new portlet fragment (zero based)
coloptional: the absolute new column location to place the new portlet fragment (zero based)
API example:
			
http://localhost:8080/jetspeed/ajaxapi/Public/public.psml?action=add&id=jsf-demo::CalendarPortlet
XML Response:
<js>
  <status>success</status>
  <action>add</action>
  <id>jsf-demo::CalendarPortlet</id>
  <new_position>
    <col>0</col>
    <row>0</row>
  </new_position>
</js>
API:add
コンポーネント:AjaxAddPortlet
説明:現在のページに新しいポートレットを追加します。ポートレットは指定する行と列の場所に追加することが可能です。もし、行も列も指定されない場合は、デフォルトでそれぞれ 0 に設定されます。
パラメータ:
pageURL に含まれます
actionadd
idページに配置したいポートレットのフルネーム。Jetspeed のポートレットの命名規則を使って指定します (ポートレットアプリケーション名::ポートレット名)
row省略可: 新しいポートレットフラグメントを置きたい場所の行位置の絶対指定 (ゼロベース)
col省略可: 新しいポートレットフラグメントを置きたい場所の列位置の絶対指定 (ゼロベース)
API の例:
			
http://localhost:8080/jetspeed/ajaxapi/Public/public.psml?action=add&id=jsf-demo::CalendarPortlet
XML レスポンス:
<js>
  <status>success</status>
  <action>add</action>
  <id>jsf-demo::CalendarPortlet</id>
  <new_position>
    <col>0</col>
    <row>0</row>
  </new_position>
</js>

[Remove Portlet] ポートレットの削除

API:remove
Component:AjaxRemovePortlet
Description:Removes a new portlet from the current page.
Parameters:
pageimplied in the URL
actionremove
idthe portlet PSML fragment id of the portlet to be removed
API example:
http://localhost:8080/jetspeed/ajaxapi/Public/public.psml?action=remove&id=ps-1003
XML Response:
<js>
  <status>success</status>
  <action>remove</action>
  <id>jsf-demo::CalendarPortlet</id>
  <new_position>
    <col>0</col>
    <row>0</row>
  </new_position>
</js>
API:remove
コンポーネント:AjaxRemovePortlet
説明:現在のページから新たにポートレットを削除する。
パラメータ:
pageURL に含まれる
actionremove
id削除したいポートレットのポートレット PSML ID
API の例:
			
http://localhost:8080/jetspeed/ajaxapi/Public/public.psml?action=remove&id=ps-1003
XML レスポンス:
<js>
  <status>success</status>
  <action>remove</action>
  <id>jsf-demo::CalendarPortlet</id>
  <new_position>
    <col>0</col>
    <row>0</row>
  </new_position>
</js>

[Get Portlets] ポートレットの取得

API:getportlets
Component:AjaxGetPortlets
Description:Get Portlets retrieves the (sorted) portlet list available to the current subject, filtered the portlet list, and returning portlets which the current subject may view. The Jetspeed (JAAS) security policy enforces this filtering. Portlets are returned in XML format, with name, displayName, and description for each portlet.
Parameters:
pageimplied in the URL
actiongetportlets
filternot yet implemented. A query filter to be defined.
API example:
			
http://localhost:8080/jetspeed/ajaxapi?action=getportlets
XML Response:
<js>
<status>success</status>
<action>getportlets</action>
-
	<portlets>
<portlet name="demo::AttributeScopePortlet" displayName="Attribute Scope Demo" description="$portlet.Description">
        </portlet>
<portlet name="demo::BookmarkPortlet" displayName="Bookmark Portlet" description="Bookmark Portlet">
        </portlet>
<portlet name="demo::BookmarkPortletForXHTMLBasic" displayName="Bookmark Portlet for XHTML Basic" description="Bookmark Portlet for XHTML Basic">
        </portlet>
<portlet name="demo::CSSDemoPortlet" displayName="CSS Demo Portlet" description="$portlet.Description">
        </portlet>
....
<portlet name="rss::RSS" displayName="RSS Portlet" description="RSS Portlet">
        </portlet>
<portlet name="rss::RomeRSS" displayName="Rome RSS Portlet" description="Rome RSS Portlet">
        </portlet>
</portlets>
</js>
API:getportlets
コンポーネント:AjaxGetPortlets
説明:ポートレットの取得は、現在のサブジェクトで利用可能な (ソートされた) ポートレットのリストを返します。ポートレットリストはフィルタリングされ、現在のサブジェクトで表示可能なポートレットが返されます。Jetspeed セキュリティポリシー (JAAS) は、このフィルタリングを実行します。ポートレット (のリスト) は、それぞれのポートレットの名前、表示名、説明の記述された XML フォーマットで返されます。
パラメータ:
pageURL に含まれる
actiongetportlets
filterまだ実装されていません。照会のフィルタを定義します。
API の例:
			
http://localhost:8080/jetspeed/ajaxapi?action=getportlets
XML レスポンス:
<js>
<status>success</status>
<action>getportlets</action>
-
	<portlets>
<portlet name="demo::AttributeScopePortlet" displayName="Attribute Scope Demo" description="$portlet.Description">
        </portlet>
<portlet name="demo::BookmarkPortlet" displayName="Bookmark Portlet" description="Bookmark Portlet">
        </portlet>
<portlet name="demo::BookmarkPortletForXHTMLBasic" displayName="Bookmark Portlet for XHTML Basic" description="Bookmark Portlet for XHTML Basic">
        </portlet>
<portlet name="demo::CSSDemoPortlet" displayName="CSS Demo Portlet" description="$portlet.Description">
        </portlet>
....
<portlet name="rss::RSS" displayName="RSS Portlet" description="RSS Portlet">
        </portlet>
<portlet name="rss::RomeRSS" displayName="Rome RSS Portlet" description="Rome RSS Portlet">
        </portlet>
</portlets>
</js>

[Permissions] パーミッション

API:permissions
Component:AjaxSecurityPermissions
Description:Security Permissions Maintenance to add, update, and remove permissions from the Jetspeed security policy
Parameters:
actionpermissions
methodthe method to execute: must be of value: add | update | remove
typethe type of permission being manipulated: portlet | folder | page
resourcethe name of the portal resource being manipulated
rolescomma-separated list of roles, only valid for methods: add, update
actionscomma-separated list of actions, only valid for methods: add, update
oldactionscomma-separated list of previous actions, only valid for methods: update
API example:
			
http://localhost:8080/jetspeed/ajaxapi?action=permissions&method=add&type=portlet&resource=demo::*&roles=role1,role2,role3&actions=view,edit
XML Response:
<js>
    <status>success</status>
    <action>permissions</action>
    <resource>demo::*</resource> 
    <type>portlet</type> 
    <actions>view,edit</actions>
    <actions>role1,role2,role3</actions>    
</js>
API:permissions
コンポーネント:AjaxSecurityPermissions
説明:Jetspeed のセキュリティポリシーからパーミッションを追加、更新、削除するためのセキュリティパーミッションのメンテナンス。
パラメータ:
actionpermissions
method実行するメソッド: 以下のいずれかの値である必要がある: add | update | remove
type操作するパーミッションのタイプ: portlet | folder | page
resource操作するポータルリソースの名前
rolesカンマ区切りのロールのリスト。以下のメソッドのみ有効: add, update
actionsカンマ区切りのアクションのリスト。以下のメソッドのみ有効: add, update
oldactionsカンマ区切りの前回のアクションのリスト。以下のメソッドのみ有効: update
API の例:
			
http://localhost:8080/jetspeed/ajaxapi?action=permissions&method=add&type=portlet&resource=demo::*&roles=role1,role2,role3&actions=view,edit
XML レスポンス:
<js>
    <status>success</status>
    <action>permissions</action>
    <resource>demo::*</resource> 
    <type>portlet</type> 
    <actions>view,edit</actions>
    <actions>role1,role2,role3</actions>    
</js>

[getmenus] 複数のメニューの取得

API:getmenus
Component:AjaxGetMenus
Description:Retrieves all menus for the current page (implied in URL)
Parameters:
actiongetmenus
page(implied in URL)
API example:
			
http://localhost:8080/jetspeed/ajaxapi/default-page.psml?action=getmenus
XML Response:
<js>
    <status>success</status>
    <action>getmenus</action>    
    <menus>
        <menu type="standard">navigations</menu>
        <menu type="standard">back</menu>
        <menu type="standard">pages</menu>
        <menu type="standard">breadcrumbs</menu>
        <menu type="custom">site-navigations</menu>
        <menu type="custom">additional-links</menu>
        <menu type="custom">page-navigations</menu>
    </menus>
</js>
API:getmenus
コンポーネント:AjaxGetMenus
説明:(URL によって示される) 現在のページの全てのメニューの取得。
パラメータ:
actiongetmenus
page(URLによって示される)
API の例:
			
http://localhost:8080/jetspeed/ajaxapi/default-page.psml?action=getmenus
XML Response:
<js>
    <status>success</status>
    <action>getmenus</action>    
    <menus>
        <menu type="standard">navigations</menu>
        <menu type="standard">back</menu>
        <menu type="standard">pages</menu>
        <menu type="standard">breadcrumbs</menu>
        <menu type="custom">site-navigations</menu>
        <menu type="custom">additional-links</menu>
        <menu type="custom">page-navigations</menu>
    </menus>
</js>

[getmenu] メニューの取得

API:getmenu
Component:AjaxGetMenu
Description:Retrieves the menu definition for a given menu
Parameters:
actiongetmenu
menuname of the menu to retrieve (menu definition may change per page)
API example:
			
http://localhost:8080/jetspeed/ajaxapi?action=getmenu&name=breadcrumbs
XML Response:
<js>
<status>success</status>
<action>getmenu</action>
<menu>
  <name>breadcrumbs</name>
  <title>You are here:</title>
  <short-title>You are here:</short-title>
  <skin>breadcrumbs</skin>
  <url>/default-page.psml</url>
  <hidden>false</hidden>
  <selected>true</selected>
  <option>
    <type>folder</type>
    <title>Root Folder</title>
    <short-title>Root Folder</short-title>
    <skin>breadcrumbs</skin>
    <url>/</url>
    <hidden>false</hidden>
    <selected>true</selected>
  </option>
  <option>
    <type>page</type>
    <title>Welcome to Jetspeed 2</title>
    <short-title>Welcome to Jetspeed 2</short-title>
    <skin>blue</skin>
    <url>/default-page.psml</url>
    <hidden>false</hidden>
    <selected>true</selected>
  </option>
</menu>
</js>
API:getmenu
コンポーネント:AjaxGetMenu
説明:指定したメニューに対するメニュー定義を取得します。
パラメータ:
actiongetmenu
menu取得するメニューの名前。(メニュー定義はページ毎に変化する可能性があります)
API の例:
			
http://localhost:8080/jetspeed/ajaxapi?action=getmenu&name=breadcrumbs
XML Response:
<js>
<status>success</status>
<action>getmenu</action>
<menu>
  <name>breadcrumbs</name>
  <title>You are here:</title>
  <short-title>You are here:</short-title>
  <skin>breadcrumbs</skin>
  <url>/default-page.psml</url>
  <hidden>false</hidden>
  <selected>true</selected>
  <option>
    <type>folder</type>
    <title>Root Folder</title>
    <short-title>Root Folder</short-title>
    <skin>breadcrumbs</skin>
    <url>/</url>
    <hidden>false</hidden>
    <selected>true</selected>
  </option>
  <option>
    <type>page</type>
    <title>Welcome to Jetspeed 2</title>
    <short-title>Welcome to Jetspeed 2</short-title>
    <skin>blue</skin>
    <url>/default-page.psml</url>
    <hidden>false</hidden>
    <selected>true</selected>
  </option>
</menu>
</js>

[window] ウィンドウ

API:getmenus
Component:AjaxChangeWindow
Description:Changes a portlet window's Window State or Portlet Mode
Parameters:
actionwindow
idwindow id of the portlet to be modified
stateA portlet api valid window state or extended window state (normal | maximized | minimized)
modeA portlet api valid portlet mode or extended portlet mode (view | edit | help | print)
pageImplied in URL
API example:
			
http://localhost:8080/jetspeed/ajaxapi?action=window&state=maximized&mode=edit&id=um-2
XML Response:
<js>
  <status>success</status>
  <action>window</action>
  <id>um-2</id>  
  <state>maximized</state>
  <mode>edit</mode>
</js>
API:getmenus
コンポーネント:AjaxChangeWindow
説明:ウィンドウの状態もしくはポートレットモードを変更します。
パラメータ:
actionwindow
id変更するポートレットのウィンドウの id
stateポートレット API で有効なウィンドウの状態もしくは拡張されたウィンドウの状態 (normal | maximized | minimized)
modeポートレット API で有効なポートレットの状態もしくは拡張されたポートレットの状態 (view | edit | help | print)
pageURL によって示される
API の例:
			
http://localhost:8080/jetspeed/ajaxapi?action=window&state=maximized&mode=edit&id=um-2
XML Response:
<js>
  <status>success</status>
  <action>window</action>
  <id>um-2</id>  
  <state>maximized</state>
  <mode>edit</mode>
</js>

[getuseinfo] ユーザ情報の取得

API:getuseinfo
Component:AjaxGetUserInformation
Description:Returns information about the currently logged in user. Can be used for example in AJAX based portlets to retrieve the userinfo in a more robust way. Will return success only if a user is currenly logged in, otherwise will return false.
Parameters:
actiongetuserinfo
API example:
			
http://localhost:8080/jetspeed/ajaxapi?action=getuserinfo
XML Response:
<js>
    <status>success</status>
    <action>userinformation</action>
    <username>admin</username> 
    <type>org.apache.jetspeed.security.impl.UserPrincipalImpl</type>
    <userinfo>
        <user.name.given>Test Dude</user.name.given>
        <user.name.family>Dudley</user.name.family>
    </userinfo>
</js>
API:getuseinfo
コンポーネント:AjaxGetUserInformation
説明:現在ログインしているユーザの情報を返します。例えば、より確実な方法でのユーザ情報の取得のために AJAX ベースのポートレット内で使用可能です。ユーザが現在ログインしている時のみ、成功を返し、そうでなければ失敗を返します。
パラメータ:
actiongetuserinfo
API example:
			
http://localhost:8080/jetspeed/ajaxapi?action=getuserinfo
XML Response:
<js>
    <status>success</status>
    <action>userinformation</action>
    <username>admin</username> 
    <type>org.apache.jetspeed.security.impl.UserPrincipalImpl</type>
    <userinfo>
        <user.name.given>Test Dude</user.name.given>
        <user.name.family>Dudley</user.name.family>
    </userinfo>
</js>

getuserlist

API:getuseinfo
Component:AjaxGetUserList
Description:Provides basic information (username, ip-address, number of sessions and status) about currently logged in users in xml-format. Optionally it can also provide more detailed userinformation, number of guest sessions and include offline users as well.
Parameters:
actiongetuserinfo
userinfoWhether we should include also userinfo (true | false [default])
offlineWhether we should include offline users (true | false [default])
guestWhether we should return also the guest sessions (true | false [default])
allIf set to true, will return every bits and piece there is (true | false [default])

By default the private information (emails, etc..) is protected with RolesSecurityBehavior security, but can be changed in AJAX configuration by altering the protectionScope constructor value to either "all" to protect even the basic information or to "none" when everything will be shown for everyone (not wise on production). The default value "private" will show just the basic information of online/offline users and number of guest sessions, as the "private-offline" will not show even the offline users. Possible protectionScope values are "all", "private-offline", "private" and "none".

API example:
			
http://localhost:8080/jetspeed/ajaxapi?action=getuserlist&userinfo=true&guest=true
XML Response:
<js>
    <status>success</status>
    <action>getuserlist</action>
    <users>
        <user>
            <username>admin</username>
            <sessions>1</sessions>
            <status>online</status>
            <ipaddress>127.0.0.1</ipaddress>
            <userinfo>
                <user.name.given>Test Dude</user.name.given>
                <user.name.family>Dudley</user.name.family>
            </userinfo>
        </user>
        <guests>0</guests>
    </users>
</js>
API:getuseinfo
コンポーネント:AjaxGetUserList
説明:現在ログインしているユーザの基本的な情報 (ユーザ名、IP アドレス、セッション数、ステータス) を XML フォーマットで提供します。オプションで、もっと詳細なユーザ情報であるゲストのセッション数やオフラインのユーザ数を提供することも可能です。
パラメータ:
actiongetuserinfo
userinfouserinfo も含めるべきかどうか。 (true | false [default])
offlineオフラインユーザも含めるべきかどうか。 (true | false [default])
guestゲストユーザのセッション数も返すべきかどうか。 (true | false [default])
alltrue に設定された場合、存在する色々な情報を全て返します。 (true | false [default])

デフォルトでは、プライベート情報 (メールアドレスなど) は RolesSecurityBehavior によるセキュリティによって守られていますが、これは、protectionScope のコンストラクタの値を基本情報すら保護する "all" と設定するか、誰でも全てを見ることができる "none" に変更することにより AJAX の設定 で変更することが可能です。デフォルトの "private" という値は、オンライン/オフラインユーザの基本情報とゲストセッション数だけが見えます。"private-offline" はオフラインユーザの情報が見えなくなります。protectionScope の値は "all", "private-offline", "private", "none" の値を取ることが可能です。

API example:
			
http://localhost:8080/jetspeed/ajaxapi?action=getuserlist&userinfo=true&guest=true
XML Response:
<js>
    <status>success</status>
    <action>getuserlist</action>
    <users>
        <user>
            <username>admin</username>
            <sessions>1</sessions>
            <status>online</status>
            <ipaddress>127.0.0.1</ipaddress>
            <userinfo>
                <user.name.given>Test Dude</user.name.given>
                <user.name.family>Dudley</user.name.family>
            </userinfo>
        </user>
        <guests>0</guests>
    </users>
</js>

[Spring Assembly] Spring アセンブリ

The AjaxRequestService is a Spring component that handles AJAX requests. It is hooked into the AJAX Pipeline for special processing of AJAX request. Here is the Spring Assembly. Each API is configured in the Ajax Service.

AjaxRequestService は、AJAX リクエストを扱う Spring のコンポーネントです。これは、AJAX リクエストの特別な処理のために、AJAX パイプライン内でフックされます。以下が Spring アセンブリです。それぞれの API は Ajax サービス内で設定されます。

	
<bean id="AjaxRequestService" class="org.apache.jetspeed.ajax.AjaxRequestServiceImpl">
    <constructor-arg index="0">
        <map>
            <entry key="move">
                <ref bean="AjaxMove"/>
            </entry>            
            <entry key="moveabs">
                <ref bean="AjaxMovePortletAbsolute"/>
            </entry>
            <entry key="moveleft">
                <ref bean="AjaxMovePortletLeft"/>
            </entry>
            <entry key="moveright">
                <ref bean="AjaxMovePortletRight"/>
            </entry>
            <entry key="moveup">
                <ref bean="AjaxMovePortletUp"/>
            </entry>
            <entry key="movedown">
                <ref bean="AjaxMovePortletDown"/>
            </entry>
            <entry key="add">
                <ref bean="AjaxAddPortlet"/>
            </entry>
            <entry key="remove">
                <ref bean="AjaxRemovePortlet"/>
            </entry>
            <entry key="getportlets">
                <ref bean="AjaxGetPortlets"/>
            </entry>
            <entry key="getpage">
                <ref bean="AjaxGetPage"/>
            </entry>
            <entry key="getpages">
                <ref bean="AjaxGetPages"/>
            </entry>			
            <entry key="getfolder">
                <ref bean="AjaxGetFolder"/>
            </entry>			            
            <entry key="getlink">
                <ref bean="AjaxGetLink"/>
            </entry>			                        
            <entry key="getfolderlist">
                <ref bean="AjaxGetFolderList"/>
            </entry>			                        
            <entry key="getfolders">
                <ref bean="AjaxGetFoldersList"/>
            </entry>			      						
            <entry key="getthemes">
                <ref bean="AjaxGetThemes"/>
            </entry>
            <entry key="getactions">
                <ref bean="AjaxGetActions"/>
            </entry>
            <entry key="window">
                <ref bean="AjaxChangeWindow"/>
            </entry>
            <entry key="getmenus">
                <ref bean="AjaxGetMenus"/>
            </entry>			            
            <entry key="getmenu">
                <ref bean="AjaxGetMenu"/>
            </entry>			            
            <entry key="permissions">
                <ref bean="AjaxSecurityPermissions"/>
            </entry>			                        
            <entry key="constraints">
                <ref bean="AjaxSecurityConstraints"/>
            </entry>			          
            <entry key="updatefolder">
                <ref bean="AjaxUpdateFolder"/>                
            </entry>                          
            <entry key="updatepage">
                <ref bean="AjaxUpdatePage"/>                
            </entry>              
            <entry key="updatelink">
                <ref bean="AjaxUpdateLink"/>                
            </entry>                                                              
            <entry key="getuserinfo">
                <ref bean="AjaxGetUserInformation"/>                
            </entry>
            <entry key="getuserlist">
                <ref bean="AjaxGetUserList"/>                
            </entry>
        </map>
    </constructor-arg>
    <constructor-arg index="1">
        <ref bean="AjaxVelocityEngine"/>
    </constructor-arg>
</bean>
	
<bean id="AjaxRequestService" class="org.apache.jetspeed.ajax.AjaxRequestServiceImpl">
    <constructor-arg index="0">
        <map>
            <entry key="move">
                <ref bean="AjaxMove"/>
            </entry>            
            <entry key="moveabs">
                <ref bean="AjaxMovePortletAbsolute"/>
            </entry>
            <entry key="moveleft">
                <ref bean="AjaxMovePortletLeft"/>
            </entry>
            <entry key="moveright">
                <ref bean="AjaxMovePortletRight"/>
            </entry>
            <entry key="moveup">
                <ref bean="AjaxMovePortletUp"/>
            </entry>
            <entry key="movedown">
                <ref bean="AjaxMovePortletDown"/>
            </entry>
            <entry key="add">
                <ref bean="AjaxAddPortlet"/>
            </entry>
            <entry key="remove">
                <ref bean="AjaxRemovePortlet"/>
            </entry>
            <entry key="getportlets">
                <ref bean="AjaxGetPortlets"/>
            </entry>
            <entry key="getpage">
                <ref bean="AjaxGetPage"/>
            </entry>
            <entry key="getpages">
                <ref bean="AjaxGetPages"/>
            </entry>			
            <entry key="getfolder">
                <ref bean="AjaxGetFolder"/>
            </entry>			            
            <entry key="getlink">
                <ref bean="AjaxGetLink"/>
            </entry>			                        
            <entry key="getfolderlist">
                <ref bean="AjaxGetFolderList"/>
            </entry>			                        
            <entry key="getfolders">
                <ref bean="AjaxGetFoldersList"/>
            </entry>			      						
            <entry key="getthemes">
                <ref bean="AjaxGetThemes"/>
            </entry>
            <entry key="getactions">
                <ref bean="AjaxGetActions"/>
            </entry>
            <entry key="window">
                <ref bean="AjaxChangeWindow"/>
            </entry>
            <entry key="getmenus">
                <ref bean="AjaxGetMenus"/>
            </entry>			            
            <entry key="getmenu">
                <ref bean="AjaxGetMenu"/>
            </entry>			            
            <entry key="permissions">
                <ref bean="AjaxSecurityPermissions"/>
            </entry>			                        
            <entry key="constraints">
                <ref bean="AjaxSecurityConstraints"/>
            </entry>			          
            <entry key="updatefolder">
                <ref bean="AjaxUpdateFolder"/>                
            </entry>                          
            <entry key="updatepage">
                <ref bean="AjaxUpdatePage"/>                
            </entry>              
            <entry key="updatelink">
                <ref bean="AjaxUpdateLink"/>                
            </entry>                                                              
            <entry key="getuserinfo">
                <ref bean="AjaxGetUserInformation"/>                
            </entry>
            <entry key="getuserlist">
                <ref bean="AjaxGetUserList"/>                
            </entry>
        </map>
    </constructor-arg>
    <constructor-arg index="1">
        <ref bean="AjaxVelocityEngine"/>
    </constructor-arg>
</bean>