Create a page
/v1/portal/pages
Creates a page and returns information about the newly created page. Note: After a new page is created, this page has to be inserted into the NavigationNode as a childNode, then only the page will be visible in the Portal
To do this follow these steps:
- Query the portal to get the navigationnodes id. Use the REST API, Retrieve Portal Details by Short ID. In the response obtained search for navigationnodes URL, the URL will be something like : "http://host:port/rest/api/v1/portal/navigationnodes/AjY?utoken=". Here Ajy is the navigationNodeId. Note down this id.
- Next, insert the navigationNode as the childNode using the REST API Add Child Node To The Navigation Node here id is the navigationNodeId, which we noted down in the earlier step.
Request
- application/json
object
-
created(optional):
string(date-time)
-
creator(optional):
string
-
currentVersionId(optional):
string
-
description(optional):
string
-
deviceGroup(optional):
string
-
documentRef(optional):
string
-
fileName(optional):
string
-
id(optional):
string
-
inputFileName(optional):
string
-
keywords(optional):
string
-
link(optional):
array link
-
linkStates(optional):
array linkStates
-
locale(optional):
object Locale
-
locked(optional):
boolean
-
lockedBy(optional):
string
-
lockedDate(optional):
string(date-time)
-
modified(optional):
string(date-time)
-
modifier(optional):
string
-
name(optional):
string
-
namespace(optional):
string
-
newVersionId(optional):
string
-
overridePolicy(optional):
boolean
-
pageDefinitionPath(optional):
string
-
pagePath(optional):
string
-
pageStyle(optional):
string
-
pageStyleBean(optional):
object Linked
-
pageViewType(optional):
string
Allowed Values:
[ "JSF", "JSPX" ]
-
permissionClass(optional):
string
-
publishedBy(optional):
string
-
publishedDate(optional):
string(date-time)
-
publishedVersion(optional):
integer(int32)
-
resourceType(optional):
string
-
securityId(optional):
string
-
shortId(optional):
string
-
sourcePageDefinitionPath(optional):
string
-
sourcePath(optional):
string
object
-
country(optional):
string
-
displayCountry(optional):
string
-
displayLanguage(optional):
string
-
displayName(optional):
string
-
displayScript(optional):
string
-
displayVariant(optional):
string
-
iSO3Country(optional):
string
-
iSO3Language(optional):
string
-
language(optional):
string
-
script(optional):
string
-
unicodeLocaleAttributes(optional):
array unicodeLocaleAttributes
-
unicodeLocaleKeys(optional):
array unicodeLocaleKeys
-
variant(optional):
string
object
-
accessible(optional):
boolean
-
annotatedExceptionTypes(optional):
array annotatedExceptionTypes
-
annotatedParameterTypes(optional):
array annotatedParameterTypes
-
annotatedReceiverType(optional):
object reflect.AnnotatedType
-
annotatedReturnType(optional):
object reflect.AnnotatedType
-
bridge(optional):
boolean
-
default(optional):
boolean
-
defaultValue(optional):
integer
-
genericExceptionTypes(optional):
array genericExceptionTypes
-
genericParameterTypes(optional):
array genericParameterTypes
-
genericReturnType(optional):
object reflect.Type
-
modifiers(optional):
integer(int32)
-
name(optional):
string
-
parameterCount(optional):
integer(int32)
-
parameters(optional):
array parameters
-
synthetic(optional):
boolean
-
typeParameters(optional):
array typeParameters
-
varArgs(optional):
boolean
object
-
annotatedType(optional):
object reflect.AnnotatedType
-
declaringExecutable(optional):
object reflect.Executable
-
implicit(optional):
boolean
-
modifiers(optional):
integer(int32)
-
name(optional):
string
-
namePresent(optional):
boolean
-
parameterizedType(optional):
object reflect.Type
-
synthetic(optional):
boolean
-
varArgs(optional):
boolean
object
-
accessible(optional):
boolean
-
annotatedExceptionTypes(optional):
array annotatedExceptionTypes
-
annotatedParameterTypes(optional):
array annotatedParameterTypes
-
annotatedReceiverType(optional):
object reflect.AnnotatedType
-
annotatedReturnType(optional):
object reflect.AnnotatedType
-
genericExceptionTypes(optional):
array genericExceptionTypes
-
genericParameterTypes(optional):
array genericParameterTypes
-
modifiers(optional):
integer(int32)
-
name(optional):
string
-
parameterCount(optional):
integer(int32)
-
parameters(optional):
array parameters
-
synthetic(optional):
boolean
-
typeParameters(optional):
array typeParameters
-
varArgs(optional):
boolean
Response
- application/json
400 Response
403 Response
Examples
You can create a portal page using REST API. It is a 3 step process. First we have to create a page, then obtain the navigation node Id of the portal, and then add the Page as a childNode to this Navigation Node.
First Step: To create a portal page submit a POST request on the REST resource and you must specify the following required parameters in the request body:
Use the following format to submit a POST request using cURL:
curl -i -X POST -H 'Content-Type: application/json' -d @create-page.json http://host:port/rest/api/v1/portal/portals/{shortId}/pages?utoken=
-
create-page.json
is the JSON file containing the request body for the request. -
hostname:port
is the name of the host and the IP port where Oracle WebCenter Portal is running. For example,example.com:8888.
-
utoken
is the API token for accessing the portal APIs. For example,utoken=utoken=abcdIC05zgjZoqCF8ShWL42AhTVvq-fc8uFshnw%2A%2A
. For more information, see Authentication.
Example of a Request Body
The following is the sample of the create-page.json
file containing the body for the request and shows how to create a page using the Blank pageStyle:
{ "name": "RestPage", "reference": { "name": "Blank", "namespace": "pageStyle" }, "description": "A Simple Json Page" },
HTTP Status Code
HTTP_STATUS = 201 Created
Example of Response Body
{ "resourceType": "urn:oracle:webcenter:portal:page", "pageStyleBean": { "links": [ { "href": "http://hostname:port/rest/api/v1/portal/pages/Eeg/pageStyle?utoken=IPrUJFYBs44bC7kRXuWBmcVx_g21KtAEu7Hmkun0sA9O_w%2A%2A", "rel": "alternate", "resourceType": "urn:oracle:webcenter:portal:pagestyle", "capabilities": "urn:oracle:webcenter:read urn:oracle:webcenter:delete" }, { "href": "http://hostname:port/rest/api/v1/portal/pagestyles/FQ?utoken=IPrUJFYBs44bC7kRXuWBmcVx_g21KtAEu7Hmkun0sA9O_w%2A%2A", "rel": "self", "resourceType": "urn:oracle:webcenter:portal:pagestyle", "capabilities": "urn:oracle:webcenter:read urn:oracle:webcenter:delete urn:oracle:webcenter:update" } ], "resourceType": "urn:oracle:webcenter:portal:pagestyle", "portalName": "DefaultGroupSpace", "namespace": "pageStyle", "name": "Blank" }, "overridePolicy": false, "publishedVersion": 0, "permissionClass": "oracle.webcenter.security.auth.NavigationResourcePermission", "locked": false, "pageStyle": "/oracle/webcenter/siteresources/scopedMD/s8bba98ff_4cbb_40b8_beee_296c916a23ed/pageStyle/gsr1b60e8a7_2e23_48ff_9571_31ede592de01/TemplateBlank.jspx", "fileName": "Page721a8c93_76a8_4f83_951d_7692acabfc8c.jspx", "pageDefinitionPath": "/pageDefs/oracle/webcenter/page/scopedMD/sda24fbda_d8cf_4013_b696_df9cce7589aa/Page721a8c93_76a8_4f83_951d_7692acabfc8cPageDef.xml", "pageViewType": "JSPX", "sourcePath": "/oracle/webcenter/siteresources/scopedMD/s8bba98ff_4cbb_40b8_beee_296c916a23ed/pageStyle/gsr1b60e8a7_2e23_48ff_9571_31ede592de01/TemplateBlank.jspx", "pagePath": "/oracle/webcenter/page/scopedMD/sda24fbda_d8cf_4013_b696_df9cce7589aa/Page721a8c93_76a8_4f83_951d_7692acabfc8c.jspx", "description": "Vertically stacked content in a single column", "creator": "weblogic", "modifier": "weblogic", "securityId": "serviceID=oracle.webcenter.page,scopeID=sda24fbda_d8cf_4013_b696_df9cce7589aa,resourceID=sda24fbda_d8cf_4013_b696_df9cce7589aa", "shortId": "Eeg", "modified": "2021-01-11T10:53:20.427Z", "created": "2021-01-11T10:53:20.182Z", "namespace": "pageStyle", "currentVersionId": "4ddf1a55-a08c-4857-933f-a9970e4af71f", "locale": "en_US", "id": "721a8c93-76a8-4f83-951d-7692acabfc8c", "name": "RestPage" }
Second Step: To obtain the navigation node Id of the portal, run the cURL command to get details of the portal. In the response, search for navigationRootNode. Get the id of the navigationnodes, the id is in the URL. In the response, the shortId for NavigationNode is AjY in the response shown below.
Use the following format to submit a GET request using cURL:
curl -i -X GET http://host:port/rest/api/v1/portal/portals/{shortId}?utoken= -H 'Content-Type: application/json'Example of Response Body
{ "navigationRootNode": { "links": [ { "href": "http://host:port/rest/api/v1/portal/portals/AjQ/navigationRootNode?utoken=", "rel": "alternate", "resourceType": "urn:oracle:webcenter:portal:navigationnode", "capabilities": "urn:oracle:webcenter:read urn:oracle:webcenter:delete" }, { "href": "http://host:port/rest/api/v1/portal/navigationnodes/AjY?utoken=", "rel": "self", "resourceType": "urn:oracle:webcenter:portal:navigationnode", "capabilities": "urn:oracle:webcenter:read urn:oracle:webcenter:delete urn:oracle:webcenter:update" } ], "resourceType": "urn:oracle:webcenter:portal:navigationnode", "portalName": "RestPortal1", "namespace": "", "name": "root" } }
Third Step: Add the newly created Page to the Navigation Node. In the cURL command, insertNavigationNode.json
is the JSON file containing the request body for the request. hostname:port
is the name of the host and the IP port where Oracle WebCenter Portal is running. For example, example.com:8888
. utoken
is the API token for accessing the portal APIs. For example, utoken=utoken=abcdIC05zgjZoqCF8ShWL42AhTVvq-fc8uFshnw%2A%2A
.
Use the following format to submit a POST request using cURL:
curl -i -X POST -H 'Content-Type: application/json'-d @insertNavigationNode.json http://host:portal/rest/api/v1/portal/navigationnodes/{navigation-node-shortId}/childNodes?utoken=Example of Request Body
{ "name": "RestPage", "namespace": "pageStyle", "portalName": "RestPortal" },Example of Response Body
{ "resourceType": "urn:oracle:webcenter:portal:page", "pageStyle": "/oracle/webcenter/siteresources/scopedMD/s8bba98ff_4cbb_40b8_beee_296c916a23ed/pageStyle/gsr1b60e8a7_2e23_48ff_9571_31ede592de01/TemplateBlank.jspx", "overridePolicy": false, "permissionClass": "oracle.webcenter.security.auth.NavigationResourcePermission", "locked": false, "fileName": "Page662d449a_b506_42a5_83a9_ef59eb87d27b.jspx", "publishedVersion": 0, "pageStyleBean": { "links": [ { "href": "http://slc14url.us.oracle.com:8888/rest/api/v1/portal/pages/Eeg/pageStyle?utoken=IEM4UE4n8YG6ZA8fay8b18oTSMmgI8qC7cKAy6vzPqfz_w%2A%2A", "rel": "alternate", "resourceType": "urn:oracle:webcenter:portal:pagestyle", "capabilities": "urn:oracle:webcenter:read urn:oracle:webcenter:delete" }, { "href": "http://slc14url.us.oracle.com:8888/rest/api/v1/portal/pagestyles/FQ?utoken=IEM4UE4n8YG6ZA8fay8b18oTSMmgI8qC7cKAy6vzPqfz_w%2A%2A", "rel": "self", "resourceType": "urn:oracle:webcenter:portal:pagestyle", "capabilities": "urn:oracle:webcenter:read urn:oracle:webcenter:delete urn:oracle:webcenter:update" } ], "resourceType": "urn:oracle:webcenter:portal:pagestyle", "namespace": "pageStyle", "portalName": "DefaultGroupSpace", "name": "Blank" }, "pageDefinitionPath": "/pageDefs/oracle/webcenter/page/scopedMD/s7edf2c3d_f10c_4db4_a961_297ca6c2f806/Page662d449a_b506_42a5_83a9_ef59eb87d27bPageDef.xml", "sourcePath": "/oracle/webcenter/siteresources/scopedMD/s8bba98ff_4cbb_40b8_beee_296c916a23ed/pageStyle/gsr1b60e8a7_2e23_48ff_9571_31ede592de01/TemplateBlank.jspx", "pagePath": "/oracle/webcenter/page/scopedMD/s7edf2c3d_f10c_4db4_a961_297ca6c2f806/Page662d449a_b506_42a5_83a9_ef59eb87d27b.jspx", "pageViewType": "JSPX", "description": "Vertically stacked content in a single column", "created": "2021-01-13T08:29:18.195Z", "namespace": "pageStyle", "modifier": "weblogic", "creator": "weblogic", "currentVersionId": "67b0193d-5d2b-45d3-aedb-658330a17775", "modified": "2021-01-13T08:29:18.295Z", "securityId": "serviceID=oracle.webcenter.page,scopeID=s7edf2c3d_f10c_4db4_a961_297ca6c2f806,resourceID=s7edf2c3d_f10c_4db4_a961_297ca6c2f806", "name": "RestPage4", "id": "662d449a-b506-42a5-83a9-ef59eb87d27b", "locale": "en_US", "shortId": "Eeg" } } ] }