Author: woonsan
Date: Mon Jan 4 19:52:16 2010
New Revision: 895757
URL: http://svn.apache.org/viewvc?rev=895757&view=rev
Log:
JS2-1084: Adding documentation on Jetspeed REST API
Modified:
portals/site/jetspeed/jetspeed-2.2/jetspeed-guide-dev/src/site/xdoc/guide-rest-api.xml
Modified:
portals/site/jetspeed/jetspeed-2.2/jetspeed-guide-dev/src/site/xdoc/guide-rest-api.xml
URL:
http://svn.apache.org/viewvc/portals/site/jetspeed/jetspeed-2.2/jetspeed-guide-dev/src/site/xdoc/guide-rest-api.xml?rev=895757&r1=895756&r2=895757&view=diff
==============================================================================
---
portals/site/jetspeed/jetspeed-2.2/jetspeed-guide-dev/src/site/xdoc/guide-rest-api.xml
(original)
+++
portals/site/jetspeed/jetspeed-2.2/jetspeed-guide-dev/src/site/xdoc/guide-rest-api.xml
Mon Jan 4 19:52:16 2010
@@ -61,22 +61,23 @@
All Jetspeed REST API support dual Message Media Types for Message producers
and consumers: 'application/json' and 'application/xml'
with help of the underlying <a href="http://cxf.apache.org">Apache CXF</a>
JAX-RS Server.
Typically, web client applications can use JSON marshaling/unmarshaling by
adding '_type=json' parameter in the request URLs.
-If the parameter is '_type=xml', then the messages are XML messages.
+If the parameter is '_type=xml', then the messages are marshaled/unmarshaled
as XML messages.
If the '_type' parameter is not set by the client, the Jetspeed REST API read
the 'Accept' HTTP request header to decide
which is proper for the web client. Please see the documents of Apache CXF for
details.
</p>
</subsection>
<subsection name='WADL (Web Application Description Language) Support'>
<p>
-You can also retrieve <a href="http://www.w3.org/Submission/wadl/">WADL</a>
description for each service simply by adding '?_wadl' query string.
+You can retrieve <a href="http://www.w3.org/Submission/wadl/">WADL</a>
description for each service simply by adding '?_wadl' query string.
Apache CXF JAX-RS server, on which Jetspeed REST API depends, generates the
WADL description for the service automatically.
For example, you can request the following URL for 'Get Portlet Application'
service of 'Portlet Registry Service'.
<source><![CDATA[
-http://localhost:8080/jetspeed/services/portletregistry/application/demo/?_wadl
+GET
http://localhost:8080/jetspeed/services/portletregistry/application/demo/?_wadl
]]></source>
</p>
</subsection>
</section>
+
<section name='Portlet Registry Service'>
<p>
The Portlet Registry Service is a HTTP request-based API, communicating over a
simple REST (Representational State Transfer) protocol,
@@ -94,8 +95,12 @@
<td>/application/</td>
</tr>
<tr>
- <td>Description:</td>
- <td>Get portlet applications based on the path parameter for
application name.</td>
+ <td>Description</td>
+ <td>Get portlet applications based on the path parameter or search
query parameter.</td>
+ </tr>
+ <tr>
+ <td>HTTP Method</td>
+ <td>GET</td>
</tr>
<tr>
<td>Parameters</td>
@@ -104,12 +109,16 @@
<tr>
<th>Type</th>
<th>Name</th>
+ <th>Required</th>
+ <th>Default value</th>
<th>Example value</th>
<th>Description</th>
</tr>
<tr>
<td>PATH</td>
- <td>name</td>
+ <td></td>
+ <td>No</td>
+ <td></td>
<td>/demo/</td>
<td>
Portlet application name.
@@ -120,36 +129,53 @@
<tr>
<td>QUERY</td>
<td>query</td>
- <td>tool</td>
- <td>Search query string to filter the results.</td>
+ <td>No</td>
+ <td></td>
+ <td>demo</td>
+ <td>
+ Search query string to filter the results.
+ If you want to use multiple terms for the search
query, you need to separate each teram by ' | '.
+ Because the URI should be encoded, the URI query value
can be like 'demo%20%7C%20webcontent' when you try to
+ use query with two terms, 'demo' and 'webcontent'.
+ </td>
</tr>
<tr>
<td>QUERY</td>
<td>begin</td>
+ <td>No</td>
+ <td>-1</td>
<td>0</td>
- <td>The begin index of the page to be selected from the
result.</td>
+ <td>
+ The begin index of the page to be selected from the
result.
+ If the value is -1, then it chooses the search result
from the first index inclusively.
+ </td>
</tr>
<tr>
<td>QUERY</td>
<td>max</td>
+ <td>No</td>
+ <td>-1</td>
<td>10</td>
- <td>The maximum page size to be selected from the
result.</td>
+ <td>
+ The maximum page size to be selected from the result.
+ If the value is -1, then it chooses the search result to
the last index inclusively.
+ </td>
</tr>
</table>
</td>
</tr>
<tr>
- <td>REST API examples:</td>
+ <td>REST API examples</td>
<td>
-<source><![CDATA[
-http://localhost:8080/jetspeed/services/portletregistry/application/demo/?_type=json
+<source><![CDATA[
+GET
http://localhost:8080/jetspeed/services/portletregistry/application/demo/?_type=json
-http://localhost:8080/jetspeed/services/portletregistry/application/?_type=json&query=demo&begin=0&max=10
+GET
http://localhost:8080/jetspeed/services/portletregistry/application/?_type=json&query=demo&begin=0&max=10
]]></source>
</td>
</tr>
<tr>
- <td>JSON Response Example:</td>
+ <td>JSON Response Example</td>
<td>
<source><![CDATA[
{
@@ -201,7 +227,7 @@
</td>
</tr>
<tr>
- <td>XML Response Example:</td>
+ <td>XML Response Example</td>
<td>
<source><![CDATA[
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
@@ -256,13 +282,1222 @@
</subsection>
+<subsection name='Get Portlet Definitions'>
+<table>
+ <tr>
+ <td>Entry path</td>
+ <td>/definition/</td>
+ </tr>
+ <tr>
+ <td>Description</td>
+ <td>Get portlet definitions based on the path parameter or query
parameters.</td>
+ </tr>
+ <tr>
+ <td>HTTP Method</td>
+ <td>GET</td>
+ </tr>
+ <tr>
+ <td>Parameters</td>
+ <td>
+ <table>
+ <tr>
+ <th>Type</th>
+ <th>Name</th>
+ <th>Required</th>
+ <th>Default value</th>
+ <th>Example value</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td>PATH</td>
+ <td></td>
+ <td>No</td>
+ <td></td>
+ <td>
+ /demo/
+ <br/>or<br/>
+ /demo/PickANumberPortlet/
+ </td>
+ <td>
+ Portlet application name (and possibly followed by
portlet definition name).
+ If the portlet application name and portlet definition
name path parameters are not provided, then
+ all portlet definitions are retrieved.
+ Also, if the portlet application name is provided but
portlet definition name is not provided,
+ then all protlet definitions of the portlet
application are retrieved.
+ </td>
+ </tr>
+ <tr>
+ <td>QUERY</td>
+ <td>query</td>
+ <td>No</td>
+ <td></td>
+ <td>admin | management</td>
+ <td>
+ Search query string to filter the results.
+ If you want to use multiple terms for the search
query, you need to separate each teram by ' | '.
+ Because the URI should be encoded, the URI query value
can be like 'admin%20%7C%20management' when you try to
+ use query with two terms, 'admin' and 'management'.
+ </td>
+ </tr>
+ <tr>
+ <td>QUERY</td>
+ <td>begin</td>
+ <td>No</td>
+ <td>-1</td>
+ <td>0</td>
+ <td>
+ The begin index of the page to be selected from the
result.
+ If the value is -1, then it chooses the search result
from the first index inclusively.
+ </td>
+ </tr>
+ <tr>
+ <td>QUERY</td>
+ <td>max</td>
+ <td>No</td>
+ <td>-1</td>
+ <td>10</td>
+ <td>
+ The maximum page size to be selected from the result.
+ If the value is -1, then it chooses the search result to
the last index inclusively.
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>REST API examples</td>
+ <td>
+<source><![CDATA[
+GET
http://localhost:8080/jetspeed/services/portletregistry/definition/?_type=json
+
+GET
http://localhost:8080/jetspeed/services/portletregistry/definition/?_type=json&begin=0&max=5
+
+GET
http://localhost:8080/jetspeed/services/portletregistry/definition/?_type=json&begin=0&max=5&query=admin%20%7C%20management
+
+GET
http://localhost:8080/jetspeed/services/portletregistry/definition/demo/?_type=json
+
+GET
http://localhost:8080/jetspeed/services/portletregistry/definition/demo/?_type=json&begin=0&max=5
+
+GET
http://localhost:8080/jetspeed/services/portletregistry/definition/demo/PickANumberPortlet/?_type=json
+]]></source>
+ </td>
+ </tr>
+ <tr>
+ <td>JSON Response Example</td>
+ <td>
+<source><![CDATA[
+{
+ "beginIndex":-1,
+ "totalSize":1,
+ "definitions":[
+ {
+ "uniqueName":"demo::PickANumberPortlet",
+ "portletName":"PickANumberPortlet",
+ "applicationName":"demo",
+ "portletIcon":"applications-games.png",
+ "portletInfo":
+ {
+ "title":"Pick a Number",
+ "keywords":"fun,game,pick"
+ },
+ "displayNames":[
+ {
+ "value":"Pick a number game",
+ "lang":"en",
+ "localeString":"en"
+ }
+ ],
+ "descriptions":[
+ {
+ "value":"This portlet runs the popular 'Pick A Number' guessing
game. The goal is to guess, in the least number of guesses, a number between
[1..{Range}]",
+ "lang":"en",
+ "localeString":"en"
+ }
+ ],
+ "supports":[
+ {
+ "mimeType":"text/html",
+ "windowStates":[],
+
"portletModes":["view","help","edit","about","edit_defaults","preview","print"]
+ }
+ ],
+ "languages":[
+ {
+ "localeString":"en",
+ "title":"Pick a Number",
+ "keywords":"fun,game,pick"
+ },
+ {
+ "localeString":"fr",
+ "title":"Pick a Number",
+ "keywords":"fun,game,pick"
+ },
+ {
+ "localeString":"ja",
+ "title":"æ°å½ã¦ã²ã¼ã ",
+ "keywords":"fun,game,pick"
+ }
+ ],
+ "metadata":
+ {
+ "fields":[
+ {
+ "name":"title",
+ "value":"Pick a Number",
+ "localeString":"en"
+ },
+ {
+ "name":"creator",
+ "value":"J2 Team",
+ "localeString":"en"
+ }
+ ]
+ },
+ "containerRuntimeOptions":[],
+ "initParams":[
+ {
+ "paramName":"ViewPage",
+ "paramValue":"/WEB-INF/demo/simple/PickANumber.jsp",
+ "descriptions":[]
+ },
+ {
+ "paramName":"HelpPage",
+ "paramValue":"/WEB-INF/demo/simple/PickANumberHelp.jsp",
+ "descriptions":[]
+ },
+ {
+ "paramName":"EditPage",
+ "paramValue":"/WEB-INF/demo/simple/PickANumberEdit.jsp",
+ "descriptions":[]
+ },
+ {
+ "paramName":"portlet-icon",
+ "paramValue":"applications-games.png",
+ "descriptions":[]
+ }
+ ]
+ }
+ ]
+}
+]]></source>
+
+ </td>
+ </tr>
+ <tr>
+ <td>XML Response Example</td>
+ <td>
+<source><![CDATA[
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<data>
+ <beginIndex>-1</beginIndex>
+ <totalSize>1</totalSize>
+ <definitions>
+ <definition>
+ <applicationName>demo</applicationName>
+ <containerRuntimeOptions/>
+ <descriptions>
+ <description>
+ <lang>en</lang>
+ <localeString>en</localeString>
+ <value>
+ This portlet runs the popular 'Pick A Number' guessing game. The
goal is to guess, in the least number of guesses, a number between [1..{Range}]
+ </value>
+ </description>
+ </descriptions>
+ <displayNames>
+ <displayName>
+ <lang>en</lang>
+ <localeString>en</localeString>
+ <value>Pick a number game</value>
+ </displayName>
+ </displayNames>
+ <initParams>
+ <initParam>
+ <descriptions/>
+ <paramName>ViewPage</paramName>
+ <paramValue>/WEB-INF/demo/simple/PickANumber.jsp</paramValue>
+ </initParam>
+ <initParam>
+ <descriptions/>
+ <paramName>HelpPage</paramName>
+ <paramValue>/WEB-INF/demo/simple/PickANumberHelp.jsp</paramValue>
+ </initParam>
+ <initParam>
+ <descriptions/>
+ <paramName>EditPage</paramName>
+ <paramValue>/WEB-INF/demo/simple/PickANumberEdit.jsp</paramValue>
+ </initParam>
+ <initParam>
+ <descriptions/>
+ <paramName>portlet-icon</paramName>
+ <paramValue>applications-games.png</paramValue>
+ </initParam>
+ </initParams>
+ <languages>
+ <language>
+ <keywords>fun,game,pick</keywords>
+ <title>Pick a Number</title>
+ <localeString>en</localeString>
+ </language>
+ <language>
+ <keywords>fun,game,pick</keywords>
+ <title>Pick a Number</title>
+ <localeString>fr</localeString>
+ </language>
+ <language>
+ <keywords>fun,game,pick</keywords>
+ <title>æ°å½ã¦ã²ã¼ã </title>
+ <localeString>ja</localeString>
+ </language>
+ </languages>
+ <metadata>
+ <fields>
+ <field>
+ <localeString>en</localeString>
+ <name>title</name>
+ <value>Pick a Number</value>
+ </field>
+ <field>
+ <localeString>en</localeString>
+ <name>creator</name>
+ <value>J2 Team</value>
+ </field>
+ </fields>
+ </metadata>
+ <portletIcon>applications-games.png</portletIcon>
+ <portletInfo>
+ <keywords>fun,game,pick</keywords>
+ <title>Pick a Number</title>
+ </portletInfo>
+ <portletName>PickANumberPortlet</portletName>
+ <supports>
+ <support>
+ <mimeType>text/html</mimeType>
+ <portletModes>
+ <portletMode>view</portletMode>
+ <portletMode>help</portletMode>
+ <portletMode>edit</portletMode>
+ <portletMode>about</portletMode>
+ <portletMode>edit_defaults</portletMode>
+ <portletMode>preview</portletMode>
+ <portletMode>print</portletMode>
+ </portletModes>
+ <windowStates/>
+ </support>
+ </supports>
+ <uniqueName>demo::PickANumberPortlet</uniqueName>
+ </definition>
+ </definitions>
+</data>
+]]></source>
+ </td>
+ </tr>
+</table>
+</subsection>
+
+
+</section>
+
+<section name='Page Layout Service'>
+<p>
+The Page Layout Service is a HTTP request-based API, communicating over a
simple REST (Representational State Transfer) protocol,
+providing information and management functionality on the layout of the
content page and its content fragments.
+This service is accessed over HTTP via the "/services/pagelayout" path on the
portal URL:
+<source><![CDATA[
+http://hostname/contextname/services/pagelayout/
+]]></source>
+</p>
+
+<subsection name='Get Content Page'>
+<table>
+ <tr>
+ <td>Entry path</td>
+ <td>/page/</td>
+ </tr>
+ <tr>
+ <td>Description</td>
+ <td>Get content page of the current request context.</td>
+ </tr>
+ <tr>
+ <td>HTTP Method</td>
+ <td>GET</td>
+ </tr>
+ <tr>
+ <td>Parameters</td>
+ <td>
+ <table>
+ <tr>
+ <th>Type</th>
+ <th>Name</th>
+ <th>Required</th>
+ <th>Default value</th>
+ <th>Example value</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td>HEADER</td>
+ <td>X-Portal-Path</td>
+ <td>No</td>
+ <td>/</td>
+ <td>/default-page.psml</td>
+ <td>
+ The current portal page path.
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>REST API examples</td>
+ <td>
+<source><![CDATA[
+GET http://localhost:8080/jetspeed/services/pagelayout/page/?_type=json
+
+With the following request header:
+ X-Portal-Path: /jetspeed.psml
+]]></source>
+ </td>
+ </tr>
+ <tr>
+ <td>JSON Response Example</td>
+ <td>
+<source><![CDATA[
+{
+ "name":"default-page.psml",
+ "id":"/default-page.psml",
+ "path":"/default-page.psml",
+ "url":"/default-page.psml",
+ "title":"Dashboard",
+ "shortTitle":"Dashboard",
+ "fragment":
+ {
+ "name":"jetspeed-layouts::VelocityThreeColumns",
+ "properties":{"sizes":"15%,70%,15%"},
+ "id":"template-top2",
+ "type":"layout",
+ "locked":true,
+ "fragments":[
+ {
+ "name":"j2-admin::SpaceNavigator",
+
"properties":{"decorator":"clear","y":"80.0","x":"12.0","jsdesktop":"detached=true"},
+ "id":"template-top2.jsSpaceNavigator",
+ "type":"portlet",
+ "locked":true,
+ "decorator":"clear"
+ },
+ {
+ "name":"j2-admin::PageNavigator",
+
"properties":{"z":"201.0","row":"0","width":"40.0","height":"388.0","column":"0","y":"104.0","x":"1.0"},
+ "id":"template-top2.jsPageNavigator",
+ "type":"portlet",
+ "locked":true
+ },
+ {
+ "name":"jetspeed-layouts::VelocityOneColumn",
+ "properties":{"row":"0","column":"1"},
+ "id":"template-top2.page-template.dashboard-1000",
+ "type":"layout",
+ "locked":false,
+ "fragments":[
+ {
+ "name":"j2-admin::LoginPortlet",
+ "properties":{"row":"0","column":"0"},
+ "id":"template-top2.page-template.dashboard-1000.dashboard-1003",
+ "type":"portlet",
+ "locked":false
+ },
+ {
+ "name":"j2-admin::LocaleSelector",
+ "properties":{"row":"1","column":"0"},
+ "id":"template-top2.page-template.dashboard-1000.dashboard-1007",
+ "type":"portlet",
+ "locked":false
+ }
+ ]
+ },
+ {
+ "name":"j2-admin::JetspeedToolbox",
+ "properties":{"y":"10.0","x":"440.0","jsdesktop":"detached=true"},
+ "id":"template-top2.jsToolbox",
+ "type":"portlet",
+ "locked":true
+ }
+ ]
+ }
+ }
+]]></source>
+
+ </td>
+ </tr>
+ <tr>
+ <td>XML Response Example</td>
+ <td>
+<source><![CDATA[
+<page>
+ <id>/default-page.psml</id>
+ <name>default-page.psml</name>
+ <path>/default-page.psml</path>
+ <shortTitle>Dashboard</shortTitle>
+ <title>Dashboard</title>
+ <url>/default-page.psml</url>
+ <fragment>
+ <id>template-top2</id>
+ <locked>true</locked>
+ <name>jetspeed-layouts::VelocityThreeColumns</name>
+ <type>layout</type>
+ <properties>
+ <entry>
+ <key>sizes</key>
+ <value>15%,70%,15%</value>
+ </entry>
+ </properties>
+ <fragments>
+ <fragment>
+ <decorator>clear</decorator>
+ <id>template-top2.jsSpaceNavigator</id>
+ <locked>true</locked>
+ <name>j2-admin::SpaceNavigator</name>
+ <type>portlet</type>
+ <properties>
+ <entry>
+ <key>decorator</key>
+ <value>clear</value>
+ </entry>
+ <entry>
+ <key>y</key>
+ <value>80.0</value>
+ </entry>
+ <entry>
+ <key>x</key>
+ <value>12.0</value>
+ </entry>
+ <entry>
+ <key>jsdesktop</key>
+ <value>detached=true</value>
+ </entry>
+ </properties>
+ </fragment>
+ <fragment>
+ <id>template-top2.jsPageNavigator</id>
+ <locked>true</locked>
+ <name>j2-admin::PageNavigator</name>
+ <type>portlet</type>
+ <properties>
+ <entry>
+ <key>z</key>
+ <value>201.0</value>
+ </entry>
+ <entry>
+ <key>row</key>
+ <value>0</value>
+ </entry>
+ <entry>
+ <key>width</key>
+ <value>40.0</value>
+ </entry>
+ <entry>
+ <key>height</key>
+ <value>388.0</value>
+ </entry>
+ <entry>
+ <key>column</key>
+ <value>0</value>
+ </entry>
+ <entry>
+ <key>y</key>
+ <value>104.0</value>
+ </entry>
+ <entry>
+ <key>x</key>
+ <value>1.0</value>
+ </entry>
+ </properties>
+ </fragment>
+ <fragment>
+ <id>template-top2.page-template.dashboard-1000</id>
+ <locked>false</locked>
+ <name>jetspeed-layouts::VelocityOneColumn</name>
+ <type>layout</type>
+ <properties>
+ <entry>
+ <key>row</key>
+ <value>0</value>
+ </entry>
+ <entry>
+ <key>column</key>
+ <value>1</value>
+ </entry>
+ </properties>
+ <fragments>
+ <fragment>
+ <id>template-top2.page-template.dashboard-1000.dashboard-1003</id>
+ <locked>false</locked>
+ <name>j2-admin::LoginPortlet</name>
+ <type>portlet</type>
+ <properties>
+ <entry>
+ <key>row</key>
+ <value>0</value>
+ </entry>
+ <entry>
+ <key>column</key>
+ <value>0</value>
+ </entry>
+ </properties>
+ </fragment>
+ <fragment>
+ <id>template-top2.page-template.dashboard-1000.dashboard-1007</id>
+ <locked>false</locked>
+ <name>j2-admin::LocaleSelector</name>
+ <type>portlet</type>
+ <properties>
+ <entry>
+ <key>row</key>
+ <value>1</value>
+ </entry>
+ <entry>
+ <key>column</key>
+ <value>0</value>
+ </entry>
+ </properties>
+ </fragment>
+ </fragments>
+ </fragment>
+ <fragment>
+ <id>template-top2.jsToolbox</id>
+ <locked>true</locked>
+ <name>j2-admin::JetspeedToolbox</name>
+ <type>portlet</type>
+ <properties>
+ <entry>
+ <key>y</key>
+ <value>10.0</value>
+ </entry>
+ <entry>
+ <key>x</key>
+ <value>440.0</value>
+ </entry>
+ <entry>
+ <key>jsdesktop</key>
+ <value>detached=true</value>
+ </entry>
+ </properties>
+ </fragment>
+ </fragments>
+ </fragment>
+</page>
+]]></source>
+ </td>
+ </tr>
+</table>
+</subsection>
+
+
+<subsection name='Get Content Fragment'>
+<table>
+ <tr>
+ <td>Entry path</td>
+ <td>/fragment/</td>
+ </tr>
+ <tr>
+ <td>Description</td>
+ <td>Get content fragment based on the fragment ID path parameter.</td>
+ </tr>
+ <tr>
+ <td>HTTP Method</td>
+ <td>GET</td>
+ </tr>
+ <tr>
+ <td>Parameters</td>
+ <td>
+ <table>
+ <tr>
+ <th>Type</th>
+ <th>Name</th>
+ <th>Required</th>
+ <th>Default value</th>
+ <th>Example value</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td>HEADER</td>
+ <td>X-Portal-Path</td>
+ <td>No</td>
+ <td>/</td>
+ <td>/default-page.psml</td>
+ <td>
+ The current portal page path.
+ </td>
+ </tr>
+ <tr>
+ <td>PATH</td>
+ <td></td>
+ <td>Yes</td>
+ <td></td>
+
<td>/template-top2.page-template.dashboard-1000.dashboard-1003/</td>
+ <td>
+ The ID of the fragment to retrieve.
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>REST API examples</td>
+ <td>
+<source><![CDATA[
+GET
http://localhost:8080/jetspeed/services/pagelayout/fragment/template-top2.page-template.dashboard-1000.dashboard-1003/?_type=json
+
+With the following request header:
+ X-Portal-Path: /jetspeed.psml
+]]></source>
+ </td>
+ </tr>
+ <tr>
+ <td>JSON Response Example</td>
+ <td>
+<source><![CDATA[
+]]></source>
+
+ </td>
+ </tr>
+ <tr>
+ <td>XML Response Example</td>
+ <td>
+<source><![CDATA[
+]]></source>
+ </td>
+ </tr>
+</table>
+</subsection>
+
+<subsection name='Add Content Fragment'>
+<table>
+ <tr>
+ <td>Entry path</td>
+ <td>/fragment/</td>
+ </tr>
+ <tr>
+ <td>Description</td>
+ <td>Add a content fragment to the content page based on the fragment
type path parameter and the portlet name path parameter.</td>
+ </tr>
+ <tr>
+ <td>HTTP Method</td>
+ <td>POST</td>
+ </tr>
+ <tr>
+ <td>Parameters</td>
+ <td>
+ <table>
+ <tr>
+ <th>Type</th>
+ <th>Name</th>
+ <th>Required</th>
+ <th>Default value</th>
+ <th>Example value</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td>HEADER</td>
+ <td>X-Portal-Path</td>
+ <td>No</td>
+ <td>/</td>
+ <td>/default-page.psml</td>
+ <td>
+ The current portal page path.
+ </td>
+ </tr>
+ <tr>
+ <td>PATH</td>
+ <td></td>
+ <td>Yes</td>
+ <td></td>
+ <td>/portlet/demo::PickANumberPortlet/</td>
+ <td>
+ The fragment type and the portlet name to add.
+ The first path part can be either 'portlet' or
'layout',
+ and the second path part must be the portlet name.
+ </td>
+ </tr>
+ <tr>
+ <td>QUERY</td>
+ <td>row</td>
+ <td>No</td>
+ <td>-1</td>
+ <td>0</td>
+ <td>
+ The row position of the added fragment.
+ </td>
+ </tr>
+ <tr>
+ <td>QUERY</td>
+ <td>col</td>
+ <td>No</td>
+ <td>-1</td>
+ <td>0</td>
+ <td>
+ The column position of the added fragment.
+ </td>
+ </tr>
+ <tr>
+ <td>QUERY</td>
+ <td>minrowscol</td>
+ <td>No</td>
+ <td>false</td>
+ <td>true</td>
+ <td>
+ The flag to use the least used column index to add the
fragment.
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>REST API examples</td>
+ <td>
+<source><![CDATA[
+POST
http://localhost:8080/jetspeed/services/pagelayout/fragment/portlet/demo::PickANumberPortlet/?_type=json
+
+With the following request header:
+ X-Portal-Path: /default-page.psml
+]]></source>
+ </td>
+ </tr>
+ <tr>
+ <td>JSON Response Example</td>
+ <td>
+<source><![CDATA[
+]]></source>
+
+ </td>
+ </tr>
+ <tr>
+ <td>XML Response Example</td>
+ <td>
+<source><![CDATA[
+]]></source>
+ </td>
+ </tr>
+</table>
+</subsection>
+
+<subsection name='Delete Content Fragment'>
+<table>
+ <tr>
+ <td>Entry path</td>
+ <td>/fragment/</td>
+ </tr>
+ <tr>
+ <td>Description</td>
+ <td>Deletes the content fragment of the content page based on the
fragment ID path parameter.</td>
+ </tr>
+ <tr>
+ <td>HTTP Method</td>
+ <td>DELETE</td>
+ </tr>
+ <tr>
+ <td>Parameters</td>
+ <td>
+ <table>
+ <tr>
+ <th>Type</th>
+ <th>Name</th>
+ <th>Required</th>
+ <th>Default value</th>
+ <th>Example value</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td>HEADER</td>
+ <td>X-Portal-Path</td>
+ <td>No</td>
+ <td>/</td>
+ <td>/default-page.psml</td>
+ <td>
+ The current portal page path.
+ </td>
+ </tr>
+ <tr>
+ <td>PATH</td>
+ <td></td>
+ <td>Yes</td>
+ <td></td>
+
<td>/template-top2.page-template.dashboard-1000.dashboard-1003/</td>
+ <td>
+ The ID of the fragment to delete.
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>REST API examples</td>
+ <td>
+<source><![CDATA[
+DELETE
http://localhost:8080/collab/services/pagelayout/fragment/template-top2.page-template.dashboard-1000.P-125fac24b80-10000/?_type=json
+
+With the following request header:
+ X-Portal-Path: /default-page.psml
+]]></source>
+ </td>
+ </tr>
+ <tr>
+ <td>JSON Response Example</td>
+ <td>
+<source><![CDATA[
+]]></source>
+
+ </td>
+ </tr>
+ <tr>
+ <td>XML Response Example</td>
+ <td>
+<source><![CDATA[
+]]></source>
+ </td>
+ </tr>
+</table>
+</subsection>
+
+<subsection name='Move Content Fragment'>
+<table>
+ <tr>
+ <td>Entry path</td>
+ <td>
+ /fragment/{id}/pos/
+ <br/><br/>
+ <em>Note: The '{id}' must be replaced by the fragment ID path
parameter.</em>
+ </td>
+ </tr>
+ <tr>
+ <td>Description</td>
+ <td>Moves the content fragment based on the query parameters.</td>
+ </tr>
+ <tr>
+ <td>HTTP Method</td>
+ <td>PUT</td>
+ </tr>
+ <tr>
+ <td>Parameters</td>
+ <td>
+ <table>
+ <tr>
+ <th>Type</th>
+ <th>Name</th>
+ <th>Required</th>
+ <th>Default value</th>
+ <th>Example value</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td>HEADER</td>
+ <td>X-Portal-Path</td>
+ <td>No</td>
+ <td>/</td>
+ <td>/default-page.psml</td>
+ <td>
+ The current portal page path.
+ </td>
+ </tr>
+ <tr>
+ <td>PATH</td>
+ <td></td>
+ <td>Yes</td>
+ <td></td>
+
<td>/template-top2.page-template.dashboard-1000.dashboard-1003/</td>
+ <td>
+ The ID of the fragment to move.
+ </td>
+ </tr>
+ <tr>
+ <td>QUERY</td>
+ <td>layout</td>
+ <td>No</td>
+ <td></td>
+ <td>template-top2.page-template.dashboard-1000</td>
+ <td>
+ The ID of the target layout fragment to which the
content fragment should be moved.
+ If this is not provided, the current parent layout
fragment is used.
+ </td>
+ </tr>
+ <tr>
+ <td>QUERY</td>
+ <td>dir</td>
+ <td>No</td>
+ <td></td>
+ <td>down</td>
+ <td>The moving direction. This can be either 'up', 'down',
'left' or 'right'.</td>
+ </tr>
+ <tr>
+ <td>QUERY</td>
+ <td>row</td>
+ <td>No</td>
+ <td>-1</td>
+ <td>0</td>
+ <td>The row position of the content fragment to move.</td>
+ </tr>
+ <tr>
+ <td>QUERY</td>
+ <td>col</td>
+ <td>No</td>
+ <td>-1</td>
+ <td>0</td>
+ <td>The column position of the content fragment to
move.</td>
+ </tr>
+ <tr>
+ <td>QUERY</td>
+ <td>x</td>
+ <td>No</td>
+ <td>-1</td>
+ <td>20</td>
+ <td>The absolute left position of the content fragment to
move.</td>
+ </tr>
+ <tr>
+ <td>QUERY</td>
+ <td>y</td>
+ <td>No</td>
+ <td>-1</td>
+ <td>20</td>
+ <td>The absolute top position of the content fragment to
move.</td>
+ </tr>
+ <tr>
+ <td>QUERY</td>
+ <td>z</td>
+ <td>No</td>
+ <td>-1</td>
+ <td>1000</td>
+ <td>The Z-INDEX of the content fragment to move.</td>
+ </tr>
+ <tr>
+ <td>QUERY</td>
+ <td>w</td>
+ <td>No</td>
+ <td>-1</td>
+ <td>400</td>
+ <td>The width of the content fragment to move.</td>
+ </tr>
+ <tr>
+ <td>QUERY</td>
+ <td>h</td>
+ <td>No</td>
+ <td>-1</td>
+ <td>300</td>
+ <td>The height of the content fragment to move.</td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>REST API examples</td>
+ <td>
+<source><![CDATA[
+PUT
http://localhost:8080/jetspeed/services/pagelayout/fragment/template-top2.page-template.dashboard-1000.dashboard-1007/pos/?_type=json&col=0&row=0
+
+With the following request header:
+ X-Portal-Path: /default-page.psml
+]]></source>
+ </td>
+ </tr>
+ <tr>
+ <td>JSON Response Example</td>
+ <td>
+<source><![CDATA[
+]]></source>
+
+ </td>
+ </tr>
+ <tr>
+ <td>XML Response Example</td>
+ <td>
+<source><![CDATA[
+]]></source>
+ </td>
+ </tr>
+</table>
+</subsection>
+
+<subsection name='Change the portlet mode and window state on Content
Fragment'>
+<table>
+ <tr>
+ <td>Entry path</td>
+ <td>
+ /fragment/{id}/mod/
+ <br/><br/>
+ <em>Note: The '{id}' must be replaced by the fragment ID path
parameter.</em>
+ </td>
+ </tr>
+ <tr>
+ <td>Description</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>HTTP Method</td>
+ <td>PUT</td>
+ </tr>
+ <tr>
+ <td>Parameters</td>
+ <td>
+ <table>
+ <tr>
+ <th>Type</th>
+ <th>Name</th>
+ <th>Required</th>
+ <th>Default value</th>
+ <th>Example value</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td>HEADER</td>
+ <td>X-Portal-Path</td>
+ <td>No</td>
+ <td>/</td>
+ <td>/default-page.psml</td>
+ <td>
+ The current portal page path.
+ </td>
+ </tr>
+ <tr>
+ <td>PATH</td>
+ <td></td>
+ <td>Yes</td>
+ <td></td>
+
<td>/template-top2.page-template.dashboard-1000.dashboard-1003/</td>
+ <td>
+ The ID of the fragment to modify.
+ </td>
+ </tr>
+ <tr>
+ <td>QUERY</td>
+ <td>mode</td>
+ <td>Yes</td>
+ <td></td>
+ <td>view</td>
+ <td>The portlet mode of the content fragment.</td>
+ </tr>
+ <tr>
+ <td>QUERY</td>
+ <td>state</td>
+ <td>Yes</td>
+ <td></td>
+ <td>normal</td>
+ <td>The window state of the content fragment.</td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>REST API examples</td>
+ <td>
+<source><![CDATA[
+PUT
http://localhost:8080/jetspeed/services/pagelayout/fragment/template-top2.page-template.dashboard-1000.dashboard-1007/mode/?_type=json&mode=view&state=normal
+
+With the following request header:
+ X-Portal-Path: /default-page.psml
+]]></source>
+ </td>
+ </tr>
+ <tr>
+ <td>JSON Response Example</td>
+ <td>
+<source><![CDATA[
+]]></source>
+
+ </td>
+ </tr>
+ <tr>
+ <td>XML Response Example</td>
+ <td>
+<source><![CDATA[
+]]></source>
+ </td>
+ </tr>
+</table>
+</subsection>
+
+<subsection name='Get Decoration of Content Fragment'>
+<table>
+ <tr>
+ <td>Entry path</td>
+ <td>/decoration/fragment/</td>
+ </tr>
+ <tr>
+ <td>Description</td>
+ <td>Retrieves decoration of the content fragment based on the fragment
ID path parameter.</td>
+ </tr>
+ <tr>
+ <td>HTTP Method</td>
+ <td>GET</td>
+ </tr>
+ <tr>
+ <td>Parameters</td>
+ <td>
+ <table>
+ <tr>
+ <th>Type</th>
+ <th>Name</th>
+ <th>Required</th>
+ <th>Default value</th>
+ <th>Example value</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td>HEADER</td>
+ <td>X-Portal-Path</td>
+ <td>No</td>
+ <td>/</td>
+ <td>/default-page.psml</td>
+ <td>
+ The current portal page path.
+ </td>
+ </tr>
+ <tr>
+ <td>PATH</td>
+ <td></td>
+ <td>Yes</td>
+ <td></td>
+
<td>/template-top2.page-template.dashboard-1000.dashboard-1003/</td>
+ <td>
+ The ID of the fragment to retrieve.
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>REST API examples</td>
+ <td>
+<source><![CDATA[
+GET
http://localhost:8080/jetspeed/services/pagelayout/decoration/fragment/template-top2.page-template.dashboard-1000.dashboard-1007/pos/?_type=json
+
+With the following request header:
+ X-Portal-Path: /default-page.psml
+]]></source>
+ </td>
+ </tr>
+ <tr>
+ <td>JSON Response Example</td>
+ <td>
+<source><![CDATA[
+]]></source>
+
+ </td>
+ </tr>
+ <tr>
+ <td>XML Response Example</td>
+ <td>
+<source><![CDATA[
+]]></source>
+ </td>
+ </tr>
+</table>
+</subsection>
</section>
<section name='Spring Assembly'>
<p>
The Jetspeed REST Services are configured in the Spring Assembly.
-Here is the core part of the Spring Assembly. Each service component is
configured in the Ajax Service.
+Here is the core part of the Spring Assembly. Each service component is
configured in the resource providers.
</p>
<source><![CDATA[
<!--