The Jetspeed REST API is an RESTful web services for clients (including AJAX clients) for making HTTP requests to Jetspeed services.
The URLs for the Jetspeed REST API starts with the following:
http://hostname/contextname/services/
Typical use cases:
All Jetspeed REST API requests run through a standard Jetspeed Pipeline request. This means that you can configure your web request with the usual array of Jetspeed components. The default REST services pipeline secures access to all requests. Each service may have its own security constraints. All requests made to a page will use the declarative security constraints configured for that page. REST request actions are enforced under edit or view mode, depending on the nature of the action.
All Jetspeed REST API support dual Message Media Types for Message producers and consumers: 'application/json' and 'application/xml' with help of the underlying Apache CXF 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 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.
You can retrieve WADL 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'.
GET http://localhost:8080/jetspeed/services/portletregistry/application/demo/?_wadl
The Portlet Registry Service is a HTTP request-based API, communicating over a simple REST (Representational State Transfer) protocol, providing information and management functionality on portlet applications and portlet definitions. This service is accessed over HTTP via the "/services/portletregistry" path on the portal URL:
http://hostname/contextname/services/portletregistry/
Entry path | /application/ | ||||||||||||||||||||||||||||||
Description | Get portlet applications based on the path parameter or search query parameter. | ||||||||||||||||||||||||||||||
HTTP Method | GET | ||||||||||||||||||||||||||||||
Parameters |
|
||||||||||||||||||||||||||||||
REST API examples | GET http://localhost:8080/jetspeed/services/portletregistry/application/demo/?_type=json GET http://localhost:8080/jetspeed/services/portletregistry/application/?_type=json&query=demo&begin=0&max=10 |
||||||||||||||||||||||||||||||
JSON Response Example | { "beginIndex":-1, "totalSize":1, "applications":[ { "name":"demo", "contextPath":"/demo", "applicationType":0, "defaultNamespace":"", "revision":2, "checksum":2832348922, "displayNames":[ { "value":"Demoportlets", "lang":"en", "localeString":"en" } ], "descriptions":[ { "value":"Demo Portlets Applications", "lang":"en", "localeString":"en" } ], "metadata": { "fields":[ { "name":"title", "value":"Title 1", "localeString":"en" }, { "name":"title", "value":"Eng Title", "localeString":"en" } ] }, "containerRuntimeOptions":[] } ] } |
||||||||||||||||||||||||||||||
XML Response Example | <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <data> <beginIndex>-1</beginIndex> <totalSize>1</totalSize> <applications> <application> <applicationType>0</applicationType> <checksum>2832348922</checksum> <containerRuntimeOptions/> <contextPath>/demo</contextPath> <defaultNamespace/> <descriptions> <description> <lang>en</lang> <localeString>en</localeString> <value>Demo Portlets Applications</value> </description> </descriptions> <displayNames> <displayName> <lang>en</lang> <localeString>en</localeString> <value>Demoportlets</value> </displayName> </displayNames> <metadata> <fields> <field> <localeString>en</localeString> <name>title</name> <value>Title 1</value> </field> <field> <localeString>en</localeString> <name>title</name> <value>Eng Title</value> </field> </fields> </metadata> <name>demo</name> <revision>2</revision> </application> </applications> </data> |
Entry path | /definition/ | ||||||||||||||||||||||||||||||
Description | Get portlet definitions based on the path parameter or query parameters. | ||||||||||||||||||||||||||||||
HTTP Method | GET | ||||||||||||||||||||||||||||||
Parameters |
|
||||||||||||||||||||||||||||||
REST API examples | 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 |
||||||||||||||||||||||||||||||
JSON Response Example | { "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":[] } ] } ] } |
||||||||||||||||||||||||||||||
XML Response Example | <?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> |
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:
http://hostname/contextname/services/pagelayout/
Entry path | /page/ | ||||||||||||
Description | Get content page of the current request context. | ||||||||||||
HTTP Method | GET | ||||||||||||
Parameters |
|
||||||||||||
HTTP Errors | HTTP Error 403 Forbidden when having no VIEW access on the current content page. | ||||||||||||
REST API examples | GET http://localhost:8080/jetspeed/services/pagelayout/page/?_type=json With the following request header: X-Portal-Path: /jetspeed.psml |
||||||||||||
JSON Response Example | { "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 } ] } } |
||||||||||||
XML Response Example | <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> |
Entry path | /fragment/ | ||||||||||||||||||
Description | Get content fragment based on the fragment ID path parameter. | ||||||||||||||||||
HTTP Method | GET | ||||||||||||||||||
Parameters |
|
||||||||||||||||||
HTTP Errors | HTTP Error 403 Forbidden when having no VIEW access on the current content page. | ||||||||||||||||||
REST API examples | 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 |
||||||||||||||||||
JSON Response Example | { "name":"j2-admin::LoginPortlet", "id":"template-top2.page-template.dashboard-1000.dashboard-1003", "type":"portlet", "locked":false, "properties":{"row":"0","column":"2"} } |
||||||||||||||||||
XML Response Example | <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>2</value> </entry> </properties> </fragment> |
Entry path | /fragment/ | ||||||||||||||||||||||||||||||||||||
Description | Add a content fragment to the content page based on the fragment type path parameter and the portlet name path parameter. | ||||||||||||||||||||||||||||||||||||
HTTP Method | POST | ||||||||||||||||||||||||||||||||||||
Parameters |
|
||||||||||||||||||||||||||||||||||||
HTTP Errors | HTTP Error 403 Forbidden when having no EDIT access on the current content page. | ||||||||||||||||||||||||||||||||||||
REST API examples | POST http://localhost:8080/jetspeed/services/pagelayout/fragment/portlet/demo::PickANumberPortlet/?_type=json With the following request header: X-Portal-Path: /default-page.psml |
||||||||||||||||||||||||||||||||||||
JSON Response Example | { "name":"demo::PickANumberPortlet", "id":"template-top2.page-template.dashboard-1000.P-125fec68f7c-10000", "type":"portlet", "locked":false, "properties":{"row":"2","column":"2"} } |
||||||||||||||||||||||||||||||||||||
XML Response Example | <fragment> <id>template-top2.page-template.dashboard-1000.P-125fec68f7c-10000</id> <locked>false</locked> <name>demo::PickANumberPortlet</name> <type>portlet</type> <properties> <entry> <key>row</key> <value>2</value> </entry> <entry> <key>column</key> <value>2</value> </entry> </properties> </fragment> |
Entry path | /fragment/ | ||||||||||||||||||
Description | Deletes the content fragment of the content page based on the fragment ID path parameter. | ||||||||||||||||||
HTTP Method | DELETE | ||||||||||||||||||
Parameters |
|
||||||||||||||||||
HTTP Errors | HTTP Error 403 Forbidden when having no EDIT access on the current content page. | ||||||||||||||||||
REST API examples | DELETE http://localhost:8080/jetspeed/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 |
||||||||||||||||||
JSON Response Example | { "name":"demo::PickANumberPortlet", "id":"template-top2.page-template.dashboard-1000.P-125fec68f7c-10000", "type":"portlet", "locked":false, "properties":{"row":"2","column":"2"} } |
||||||||||||||||||
XML Response Example | <fragment> <id>template-top2.page-template.dashboard-1000.P-125fec68f7c-10000</id> <locked>false</locked> <name>demo::PickANumberPortlet</name> <type>portlet</type> <properties> <entry> <key>row</key> <value>2</value> </entry> <entry> <key>column</key> <value>2</value> </entry> </properties> </fragment> |
Entry path |
/fragment/{id}/pos/
Note: The '{id}' must be replaced by the fragment ID path parameter. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description | Moves the content fragment based on the query parameters. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
HTTP Method | PUT | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Parameters |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
HTTP Errors | HTTP Error 403 Forbidden when having no EDIT access on the current content page. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
REST API examples | 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 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
JSON Response Example | { "name":"j2-admin::LocaleSelector", "id":"template-top2.page-template.dashboard-1000.dashboard-1007", "type":"portlet", "locked":false, "properties":{"row":"1","column":"2"} } |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
XML Response Example | <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>2</value> </entry> </properties> </fragment> |
Entry path |
/fragment/{id}/mod/
Note: The '{id}' must be replaced by the fragment ID path parameter. |
||||||||||||||||||||||||||||||
Description | |||||||||||||||||||||||||||||||
HTTP Method | PUT | ||||||||||||||||||||||||||||||
Parameters |
|
||||||||||||||||||||||||||||||
HTTP Errors | HTTP Error 403 Forbidden when having no EDIT access on the current content page. | ||||||||||||||||||||||||||||||
REST API examples | 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 |
||||||||||||||||||||||||||||||
JSON Response Example | { "name":"j2-admin::LocaleSelector", "id":"template-top2.page-template.dashboard-1000.dashboard-1007", "type":"portlet", "mode":"View", "state":"Normal", "locked":false, "properties":{"row":"1","column":"2"} } |
||||||||||||||||||||||||||||||
XML Response Example | <fragment> <id>template-top2.page-template.dashboard-1000.dashboard-1007</id> <locked>false</locked> <name>j2-admin::LocaleSelector</name> <type>portlet</type> <mode>View</mode> <state>Normal</state> <properties> <entry> <key>row</key> <value>1</value> </entry> <entry> <key>column</key> <value>2</value> </entry> </properties> </fragment> |
Entry path | /decoration/fragment/ | ||||||||||||||||||
Description | Retrieves decoration of the content fragment based on the fragment ID path parameter. | ||||||||||||||||||
HTTP Method | GET | ||||||||||||||||||
Parameters |
|
||||||||||||||||||
HTTP Errors | HTTP Error 403 Forbidden when having no VIEW access on the current content page. | ||||||||||||||||||
REST API examples | 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 |
||||||||||||||||||
JSON Response Example | { "name":"jetspeed", "basePath":"/decorations/portlet/jetspeed", "actionsOption":"SHOW", "styleSheet":"decorations/portlet/jetspeed/css/styles.css", "baseCSSClass":"jetspeed", "decoratorActions":[ { "name":"Configure", "link":"decorations/portlet/jetspeed/images/config.gif", "action":"http://localhost:8080/jetspeed/services/_ns:YXRlbXBsYXRlLXRvcDIucGFnZS10ZW1wbGF0ZS5kYXNoYm9hcmQtMTAwMC5kYXNoYm9hcmQtMTAwM3xjNA__/", "actionType":"mode", "actionName":"config", "alt":"Configure" }, { "name":"Minimize", "link":"decorations/portlet/jetspeed/images/minimized.gif", "action":"http://localhost:8080/jetspeed/services/_ns:YXRlbXBsYXRlLXRvcDIucGFnZS10ZW1wbGF0ZS5kYXNoYm9hcmQtMTAwMC5kYXNoYm9hcmQtMTAwM3xkMQ__/", "actionType":"state", "actionName":"minimized", "alt":"Minimize" }, { "name":"Maximize", "link":"decorations/portlet/jetspeed/images/maximized.gif", "action":"http://localhost:8080/jetspeed/services/_ns:YXRlbXBsYXRlLXRvcDIucGFnZS10ZW1wbGF0ZS5kYXNoYm9hcmQtMTAwMC5kYXNoYm9hcmQtMTAwM3xkMg__/", "actionType":"state", "actionName":"maximized", "alt":"Maximize" } ] } |
||||||||||||||||||
XML Response Example | <decoration> <name>jetspeed</name> <actionsOption>SHOW</actionsOption> <baseCSSClass>jetspeed</baseCSSClass> <basePath>/decorations/portlet/jetspeed</basePath> <styleSheet>decorations/portlet/jetspeed/css/styles.css</styleSheet> <decoratorActions> <decoratorAction> <action>http://localhost:8080/jetspeed/services/_ns:YXRlbXBsYXRlLXRvcDIucGFnZS10ZW1wbGF0ZS5kYXNoYm9hcmQtMTAwMC5kYXNoYm9hcmQtMTAwM3xjNA__/</action> <actionName>config</actionName> <actionType>mode</actionType> <alt>Configure</alt> <link>decorations/portlet/jetspeed/images/config.gif</link> <name>Configure</name> </decoratorAction> <decoratorAction> <action>http://localhost:8080/jetspeed/services/_ns:YXRlbXBsYXRlLXRvcDIucGFnZS10ZW1wbGF0ZS5kYXNoYm9hcmQtMTAwMC5kYXNoYm9hcmQtMTAwM3xkMQ__/</action> <actionName>minimized</actionName> <actionType>state</actionType> <alt>Minimize</alt> <link>decorations/portlet/jetspeed/images/minimized.gif</link> <name>Minimize</name> </decoratorAction> <decoratorAction> <action>http://localhost:8080/jetspeed/services/_ns:YXRlbXBsYXRlLXRvcDIucGFnZS10ZW1wbGF0ZS5kYXNoYm9hcmQtMTAwMC5kYXNoYm9hcmQtMTAwM3xkMg__/</action> <actionName>maximized</actionName> <actionType>state</actionType> <alt>Maximize</alt> <link>decorations/portlet/jetspeed/images/maximized.gif</link> <name>Maximize</name> </decoratorAction> </decoratorActions> </decoration> |
The Page Management Service is a HTTP request-based API, communicating over a simple REST (Representational State Transfer) protocol, providing information and management functionality on portal page nodes such as pages, folders and links. This service is accessed over HTTP via the "/services/pagemanagement" path on the portal URL:
http://hostname/contextname/services/pagemanagement/
Node: All operations of this service are allowed only to those who has the right to edit the target node. Those who has the right to view only will get the HTTP Error 403 Forbidden.
Entry path | / | ||||||||||||||||||
Description | Get node based on the type parameter and the path parameter. | ||||||||||||||||||
HTTP Method | GET | ||||||||||||||||||
Parameters |
|
||||||||||||||||||
REST API examples | GET http://localhost:8080/jetspeed/services/pagemanagement/.psml/default-page.psml?_type=json |
||||||||||||||||||
JSON Response Example | { "id":"/default-page.psml", "name":"default-page.psml", "type":".psml", "path":"/default-page.psml", "title":"Welcome to Jetspeed", "shortTitle":"Welcome to Jetspeed", "hidden":false, "url":"/default-page.psml", "constraintsEnabled":true, "permissionsEnabled":false, "effectiveDefaultLayoutDecorator":"jetspeed", "effectiveDefaultPortletDecorator":"jetspeed", "dirty":false, "metadata": { "fields":[ { "name":"title", "value":"Welcome to Jetspeed", "localeString":"en" }, { "name":"title", "value":"Bienvenido a Jetspeed 2", "localeString":"es" } ] } } |
||||||||||||||||||
XML Response Example | <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <page> <id>/default-page.psml</id> <name>default-page.psml</name> <type>.psml</type> <path>/default-page.psml</path> <title>Welcome to Jetspeed</title> <shortTitle>Welcome to Jetspeed</shortTitle> <hidden>false</hidden> <url>/default-page.psml</url> <constraintsEnabled>true</constraintsEnabled> <permissionsEnabled>false</permissionsEnabled> <effectiveDefaultLayoutDecorator>jetspeed</effectiveDefaultLayoutDecorator> <effectiveDefaultPortletDecorator>jetspeed</effectiveDefaultPortletDecorator> <dirty>false</dirty> <metadata> <fields> <field> <localeString>fr</localeString> <name>title</name> <value>Bienvenue a Jetspeed</value> </field> <field> <localeString>es</localeString> <name>title</name> <value>Bienvenido a Jetspeed 2</value> </field> </fields> </metadata> </page> |
Entry path | / | ||||||||||||||||||
Description | Delete node based on the type parameter and the path parameter. | ||||||||||||||||||
HTTP Method | GET | ||||||||||||||||||
Parameters |
|
||||||||||||||||||
REST API examples | DELETE http://localhost:8080/jetspeed/services/pagemanagement/.psml/default-page.psml?_type=json |
||||||||||||||||||
JSON Response Example | { "id":"/default-page.psml", "name":"default-page.psml", "type":".psml", "path":"/default-page.psml", "title":"Welcome to Jetspeed", "shortTitle":"Welcome to Jetspeed", "hidden":false, "url":"/default-page.psml", "constraintsEnabled":true, "permissionsEnabled":false, "effectiveDefaultLayoutDecorator":"jetspeed", "effectiveDefaultPortletDecorator":"jetspeed", "dirty":false, "metadata": { "fields":[ { "name":"title", "value":"Welcome to Jetspeed", "localeString":"en" }, { "name":"title", "value":"Bienvenido a Jetspeed 2", "localeString":"es" } ] } } |
||||||||||||||||||
XML Response Example | <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <page> <id>/default-page.psml</id> <name>default-page.psml</name> <type>.psml</type> <path>/default-page.psml</path> <title>Welcome to Jetspeed</title> <shortTitle>Welcome to Jetspeed</shortTitle> <hidden>false</hidden> <url>/default-page.psml</url> <constraintsEnabled>true</constraintsEnabled> <permissionsEnabled>false</permissionsEnabled> <effectiveDefaultLayoutDecorator>jetspeed</effectiveDefaultLayoutDecorator> <effectiveDefaultPortletDecorator>jetspeed</effectiveDefaultPortletDecorator> <dirty>false</dirty> <metadata> <fields> <field> <localeString>fr</localeString> <name>title</name> <value>Bienvenue a Jetspeed</value> </field> <field> <localeString>es</localeString> <name>title</name> <value>Bienvenido a Jetspeed 2</value> </field> </fields> </metadata> </page> |
Entry path | /copy/ | ||||||||||||||||||||||||||||||||||||||||||||||||
Description | Copy node based on the type parameter, the path parameter and the form request parameters | ||||||||||||||||||||||||||||||||||||||||||||||||
HTTP Method | GET | ||||||||||||||||||||||||||||||||||||||||||||||||
Parameters |
|
||||||||||||||||||||||||||||||||||||||||||||||||
REST API examples | POST http://localhost:8080/jetspeed/services/pagemanagement/copy/.psml/default-page.psml?_type=json With the following request form parameters: target=/Examples/default-page.psml&deep=true&merge=true©ids=false |
||||||||||||||||||||||||||||||||||||||||||||||||
JSON Response Example | { "id":"/Examples/default-page.psml", "name":"default-page.psml", "type":".psml", "path":"/Examples/default-page.psml", "title":"Welcome to Jetspeed", "shortTitle":"Welcome to Jetspeed", "hidden":false, "url":"/Examples/default-page.psml", "constraintsEnabled":true, "permissionsEnabled":false, "effectiveDefaultLayoutDecorator":"jetspeed", "effectiveDefaultPortletDecorator":"jetspeed", "dirty":false, "metadata": { "fields":[ { "name":"title", "value":"Welcome to Jetspeed", "localeString":"en" }, { "name":"title", "value":"Bienvenido a Jetspeed 2", "localeString":"es" } ] } } |
||||||||||||||||||||||||||||||||||||||||||||||||
XML Response Example | <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <page> <id>/Examples/default-page.psml</id> <name>default-page.psml</name> <type>.psml</type> <path>/Examples/default-page.psml</path> <title>Welcome to Jetspeed</title> <shortTitle>Welcome to Jetspeed</shortTitle> <hidden>false</hidden> <url>/Examples/default-page.psml</url> <constraintsEnabled>true</constraintsEnabled> <permissionsEnabled>false</permissionsEnabled> <effectiveDefaultLayoutDecorator>jetspeed</effectiveDefaultLayoutDecorator> <effectiveDefaultPortletDecorator>jetspeed</effectiveDefaultPortletDecorator> <dirty>false</dirty> <metadata> <fields> <field> <localeString>fr</localeString> <name>title</name> <value>Bienvenue a Jetspeed</value> </field> <field> <localeString>es</localeString> <name>title</name> <value>Bienvenido a Jetspeed 2</value> </field> </fields> </metadata> </page> |
Entry path | /move/ | ||||||||||||||||||||||||||||||||||||||||||||||||
Description | Move node based on the type parameter, the path parameter and the form request parameters | ||||||||||||||||||||||||||||||||||||||||||||||||
HTTP Method | GET | ||||||||||||||||||||||||||||||||||||||||||||||||
Parameters |
|
||||||||||||||||||||||||||||||||||||||||||||||||
REST API examples | POST http://localhost:8080/jetspeed/services/pagemanagement/move/.psml/default-page.psml?_type=json With the following request form parameters: target=/Examples/default-page.psml&deep=true&merge=true©ids=false |
||||||||||||||||||||||||||||||||||||||||||||||||
JSON Response Example | { "id":"/Examples/default-page.psml", "name":"default-page.psml", "type":".psml", "path":"/Examples/default-page.psml", "title":"Welcome to Jetspeed", "shortTitle":"Welcome to Jetspeed", "hidden":false, "url":"/Examples/default-page.psml", "constraintsEnabled":true, "permissionsEnabled":false, "effectiveDefaultLayoutDecorator":"jetspeed", "effectiveDefaultPortletDecorator":"jetspeed", "dirty":false, "metadata": { "fields":[ { "name":"title", "value":"Welcome to Jetspeed", "localeString":"en" }, { "name":"title", "value":"Bienvenido a Jetspeed 2", "localeString":"es" } ] } } |
||||||||||||||||||||||||||||||||||||||||||||||||
XML Response Example | <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <page> <id>/Examples/default-page.psml</id> <name>default-page.psml</name> <type>.psml</type> <path>/Examples/default-page.psml</path> <title>Welcome to Jetspeed</title> <shortTitle>Welcome to Jetspeed</shortTitle> <hidden>false</hidden> <url>/Examples/default-page.psml</url> <constraintsEnabled>true</constraintsEnabled> <permissionsEnabled>false</permissionsEnabled> <effectiveDefaultLayoutDecorator>jetspeed</effectiveDefaultLayoutDecorator> <effectiveDefaultPortletDecorator>jetspeed</effectiveDefaultPortletDecorator> <dirty>false</dirty> <metadata> <fields> <field> <localeString>fr</localeString> <name>title</name> <value>Bienvenue a Jetspeed</value> </field> <field> <localeString>es</localeString> <name>title</name> <value>Bienvenido a Jetspeed 2</value> </field> </fields> </metadata> </page> |
Entry path | /info/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description | Update node info based on the type parameter, the path parameter and the form request parameters | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
HTTP Method | GET | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Parameters |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
REST API examples | POST http://localhost:8080/jetspeed/services/pagemanagement/info/.psml/default-page.psml?_type=json With the following request form parameters: title=Welcome to Jetspeed-2 Enterprise Portal |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
JSON Response Example | { "id":"/Examples/default-page.psml", "name":"default-page.psml", "type":".psml", "path":"/Examples/default-page.psml", "title":"Welcome to Jetspeed-2 Enterprise Portal", "shortTitle":"Welcome to Jetspeed", "hidden":false, "url":"/Examples/default-page.psml", "constraintsEnabled":true, "permissionsEnabled":false, "effectiveDefaultLayoutDecorator":"jetspeed", "effectiveDefaultPortletDecorator":"jetspeed", "dirty":false, "metadata": { "fields":[ { "name":"title", "value":"Welcome to Jetspeed", "localeString":"en" }, { "name":"title", "value":"Bienvenido a Jetspeed 2", "localeString":"es" } ] } } |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
XML Response Example | <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <page> <id>/Examples/default-page.psml</id> <name>default-page.psml</name> <type>.psml</type> <path>/Examples/default-page.psml</path> <title>Welcome to Jetspeed-2 Enterprise Portal</title> <shortTitle>Welcome to Jetspeed</shortTitle> <hidden>false</hidden> <url>/Examples/default-page.psml</url> <constraintsEnabled>true</constraintsEnabled> <permissionsEnabled>false</permissionsEnabled> <effectiveDefaultLayoutDecorator>jetspeed</effectiveDefaultLayoutDecorator> <effectiveDefaultPortletDecorator>jetspeed</effectiveDefaultPortletDecorator> <dirty>false</dirty> <metadata> <fields> <field> <localeString>fr</localeString> <name>title</name> <value>Bienvenue a Jetspeed</value> </field> <field> <localeString>es</localeString> <name>title</name> <value>Bienvenido a Jetspeed 2</value> </field> </fields> </metadata> </page> |
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 resource providers.
<!-- The internal server factory. Each JAX-RS service component is registered by "resourceProvider" property. --> <bean id="cxfJaxrsServerFactoryBean" class="org.apache.cxf.jaxrs.JAXRSServerFactoryBean"> <meta key="j2:cat" value="default" /> <property name="address" value="/" /> <property name="destinationFactory" ref="cxfDestinationFactory" /> <property name="providers"> <list> <ref bean="jaxrsJsonProvider" /> </list> </property> <property name="resourceProviders"> <list> <bean class="org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider"> <meta key="j2:cat" value="default" /> <constructor-arg ref="jaxrsPortletRegistryService" /> </bean> <bean class="org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider"> <meta key="j2:cat" value="default" /> <constructor-arg ref="jaxrsPageLayoutService" /> </bean> <bean class="org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider"> <meta key="j2:cat" value="default" /> <constructor-arg ref="jaxrsPageManagementService" /> </bean> </list> </property> </bean> <!-- Portlet Registry JAX-RS Service --> <bean id="jaxrsPortletRegistryService" class="org.apache.jetspeed.services.rest.PortletRegistryService"> <meta key="j2:cat" value="default" /> <constructor-arg ref="org.apache.jetspeed.security.SecurityAccessController" /> <constructor-arg ref="org.apache.jetspeed.components.portletregistry.PortletRegistry" /> <constructor-arg ref="org.apache.jetspeed.search.SearchEngine" /> </bean> <!-- Portal Page Layout Management JAX-RS Service --> <bean id="jaxrsPageLayoutService" class="org.apache.jetspeed.services.rest.PageLayoutService"> <meta key="j2:cat" value="default" /> <constructor-arg ref="org.apache.jetspeed.layout.PageLayoutComponent" /> <constructor-arg ref="org.apache.jetspeed.components.portletregistry.PortletRegistry" /> <constructor-arg ref="PortletActionSecurityBehavior" /> </bean> <!-- Portal Page Management JAX-RS Service --> <bean id="jaxrsPageManagementService" class="org.apache.jetspeed.services.rest.PageManagementService"> <meta key="j2:cat" value="default" /> <constructor-arg ref="org.apache.jetspeed.page.PageManager" /> </bean>