REST API:customPage Resource

REST API:customPage Resource

From LongJump Support Wiki

REST API:customPage Resource
Jump to: navigation, search

Manage custom JSP pages using the REST API.

Contents

Access Permissions

File:Lock-tiny.gif

Users that have the Use Development Features permission can use this resource. 

Get a Custom JSP Page

description

Method
GET
URI
https://na.longjump.com/networking/rest/customPage/{recordId}
Response
<platform>
    <customPage>
        <id>59038680cc06426ebc76eba6a5b75c8a</id>
        <name>TestPage.jsp</name>
        <code><![CDATA[
       <%@ page session="false" import="com.platform.api.*" %>
       <html>
       <body>
       This is test custom page
       <body>
       <html>
       ]]>
        </code>
        <date_created>2010-11-12T13:14:15Z</date_created>
        <created_id type="USER"
         uri="https://{domain}/networking/rest/user/17331c7c353a4b72b956fcf2cd9c828f"
         displayValue="John Doe">17331c7c353a4b72b956fcf2cd9c828f</created_id>
        <date_modified>2010-11-12T13:14:15Z</date_modified>
        <modified_id type="USER"
         uri="https://{domain}/networking/rest/user/17331c7c353a4b72b956fcf2cd9c828f"
         displayValue="John Doe">17331c7c353a4b72b956fcf2cd9c828f</modified_id>
    </customPage>

    <message>
        <code>0</code>
        <description>Success</description>
    </message>
</platform>
See also: REST API:Error Codes

Add a Custom JSP Page

description

Method
POST
URI
https://na.longjump.com/networking/rest/customPage
Request
<platform>
    <customPage>
        <name>TestPage.jsp</name>
        <code><![CDATA[  
       <%@ page session="false" import="com.platform.api.*" %>
       <html>
       <body>
       This is test custom page
       <body>
       <html>
       ]]>
        </code>        
    </customPage>
</platform>
Response
<platform>
    <message>
        <code>0</code>
        <description>Success</description>
        <id>18184374</id>      // ID of the added page
    </message>
</platform>
See also: REST API:Error Codes

Update a Custom JSP Page

description

Method
PUT
URI
https://na.longjump.com/networking/rest/customPage/{record_Id}
Request
<platform>
    <customPage>
        <name>TestPage.jsp</name>
        <code><![CDATA[  
       <%@ page session="false" import="com.platform.api.*" %>
       <html>
       <body>
       This is test custom page
       <body>
       <html>
       ]]>
        </code>        
    </customPage>    
</platform>
Response
<platform>
    <message>
        <code>0</code>
        <description>Success</description>
        <id>18184374</id>   // ID of the updated page
    </message>
</platform>
See also: REST API:Error Codes

Delete a Custom JSP Page

Method
DELETE
URI
https://na.longjump.com/networking/rest/customPage/{recordId}
Response
<platform>
    <message>
        <code>0</code>
        <description>Success</description>
    </message>
</platform>
See also: REST API:Error Codes

Dynamic Search for Custom JSP Pages

Method
GET
URI
https://na.longjump.com/networking/rest/customPage?{query_parameters}
Sample Search
?fieldList=name,id & filter=name contains 'smith' & sortby='id'
(Field names are in the Fields section.)
Query Parameters
  • fieldList - A comma-separated list of field names to retrieve
  • The asterisk (*) wildcard specifies all fields
  • Use the REST API:field Resource to get a complete list of fields
  • Field lists for database views need to specify the object's alias, as well as the field name.
  • filter - Filtering criteria to filter the records
  • pageSize - Number of records to retrieve from the result set in order to make a "page".
  • page - Number of the logical page in a database result set. The first page is page "zero" (0).
Page zero is returned by default, so appending &pageSize=1 to your query returns a single record.
  • getTotalRecordCount returns the number of total records.
    Causes the following structure to be returned, where N is the total number of records:
<platform>
   ...
   <message>
      <code>0</code>
      <description>Success</description>
   </message>

   <!-- added by the query param -->
   <totalRecordCount>N</totalRecordCount>
</platform>
  • sortBy - Field name for primary sort
    Ex: &sortBy=name
  • sortOrder - Sort order of the primary field, either "asc" or "desc" (ascending or descending)
    Ex: &sortOrder="desc"
  • sortBy2 - Field name for secondary sort
  • sortOrder2 - Sort order of the second field, either "asc" or "desc" (ascending or descending)
For more information, see: Specifying Query Parameters in REST APIs
Response
<platform>
    <customPage>
        <id>973f210cf5804381b801700bf9feb52a</id>
        <name>test123.jsp</name>
        <code>"hello world"</code>
        <date_created>2010-11-12T13:14:15Z</date_created>
        <created_id type="USER"
         uri="https://{domain}/networking/rest/user/17331c7c353a4b72b956fcf2cd9c828f"
         displayValue="John Doe">17331c7c353a4b72b956fcf2cd9c828f</created_id>
        <date_modified>2010-11-12T13:14:15Z</date_modified>
        <modified_id type="USER"
         uri="https://{domain}/networking/rest/user/17331c7c353a4b72b956fcf2cd9c828f"
         displayValue="John Doe">17331c7c353a4b72b956fcf2cd9c828f</modified_id>
    </customPage>
   
    <customPage>
        <id>d7c112de00ed44baa0297841fb952633</id>
        <name>UseRes.jsp</name>
        <code><![CDATA[  
<%@ page session="false" import="com.platform.api.*" %>
<html>
<body>
This is test custom page
<body>
<html>
]]>
        </code>        

        ]]>
        </code>
        <date_created>2010-11-12T13:14:15Z</date_created>
        <created_id type="USER"
         uri="https://{domain}/networking/rest/user/17331c7c353a4b72b956fcf2cd9c828f"
         displayValue="John Doe">17331c7c353a4b72b956fcf2cd9c828f</created_id>
        <date_modified>2010-11-12T13:14:15Z</date_modified>
        <modified_id type="USER"
         uri="https://{domain}/networking/rest/user/17331c7c353a4b72b956fcf2cd9c828f"
         displayValue="John Doe">17331c7c353a4b72b956fcf2cd9c828f</modified_id>
    </customPage>

    <message>
        <code>0</code>
        <description>Success</description>
    </message>
    <recordCount>2</recordCount>
</platform>
Note:s
  • The code section is actually encoded with HTML escapes, rather than embedded in a CDATA section.
  • See also: REST API:Error Codes

Fields

NameTypeAttributeRequired During AddDescriptionAdditional Information
id String Read Only Record Id
name String Read Only JSP page name
code String Editable on Add/Update JSP page definition
include_header_files Boolean Editable on Add/Update Whether or not to include CSS files and jQuery javascript libraries in the page header. Default: No With headers included, the page has the same look and feel as the platform, and jQuery widgets can be used without having to import them first.
date_created Data Read Only
created_id Lookup Read Only
date_modified Date Read Only
modified_id Lookup Read Only
Personal tools