Web API

WebController

Other API in Package

User

Internal Tunnel

Internal Web

Tunnel

Field Summary
ActionBegin

Action, cp-begin, supplied by the system when an application is initially created.

ActionContinue

Action, cp-continue, supplied by the system when an existing application is accessed.

ActionStoreInstall

Action, cp-store-install, supplied by the system when the user has just aquired an item from the store and is now running installer workflow for the first time.

ActionStoreRemove

Action, cp-remove-store, supplied by the system when the user is requesting to be removed from the store and there is a non zero balance on the account.

ActionStoreUpgrade

Action, cp-store-upgrade, supplied by the system when the user has just aquired an upgrade from the store and is now running installer workflow for further configuration



Method Summary
boolean checkCaptcha(String captcha)

Checks the captcha value against the actual value stored on the server. Returns true if they match.

String checkToken(String ssoToken)
⚠Deprecated since 01-11-2021. Use RuntimePal.getAuthToken and call isEnabled

Returns the status of the token: enabled, disabled, none. Enabled means the token can be used for authentication. Requires cloud level configuration and partner settings.

  clearDebugs()

Clears the debug entries.

AjaxResponse createAjaxResponse(Fragment fragment, boolean dynamicRender)

Returns a response to the client using content from the fragment and content type of text/html. Pass true for dynamicRender to execute business logic tags and JEXL constructs.

AjaxResponse createAjaxResponse(String string, boolean renderJexl)

Returns a response to the client using content from the string and content type of text/html. Pass true for renderJexl to execute JEXL constructs.

Buffer createBuffer()

Creates and returns a new Buffer object

Data createData()

Creates and returns an empty Data object

PacketDataList createDataList(String name, String column, String[] array)

Creates a new non persistent PacketDataList and adds the array to the column

PacketDataList createDataList(String name, String[] columns)

Creates a new non persistent PacketDataList and returns it. Maximum column size is 100.

DownloadResponse createDownloadResponse()

Creates a DownloadResponse.

Email createEmail(String emailName)

Creates an Email container using the specified template. Requires enterprise level SMTP and web enabled email in activation key.

Email createEmail(String emailName, String emailSettingsId)

Creates an Email container using the specified template and specified enterprise email settings. Requires enterprise level SMTP and web enabled email in activation key.

FileBuffer createFileBuffer(String type, int limit)

Creates and returns a new FileBuffer object

String createGUID(String prefix)

Creates a Globally Unique ID, alternatively with the specified prefix. Null prefix results in a guid of max length 37. With prefix it is length(prefix)+26

Response createImageResponse(ImageFile image)

Returns an image response.

JSONBuffer createJsonBuffer()

Returns a new JSON Buffer

JSONParser createJsonParser(String jsonString)

Returns a parser for the given JSON string

TextMessage createMessage()

Creates a new Message object. Requires enterprise level SMTP and web enabled email in activation key.

String createMobileLink(PalInfo pal, String action, Data data)

Creates link for mobile application

Payload createPayload()

Creates a new Payload object.

Payload createPayload(String json)

Creates a new Payload object from the JSON encoded string. See Payload.toJson().

Response createPdfResponse(PdfFile pdf)

Returns a pdf response.

ServiceRequest createServiceRequest()

Creates real-time http(s) request object useful for communication with external web services. Requires activation key with Remote Services enabled.

TextEmail createTextEmail(String emailName)

Creates a text-based (body is text as opposed to XHTML) email. Requires enterprise level SMTP and web enabled email in activation key.

  debug(Object message)

Adds a debug message.

  debugData(Data data)

Debugs all the values of the given data object.

  debugList(DataList list)

Debugs the name, all of the columns, and up to 100 rows of data. The output is rendered in the debug messages of Pal Builder. This method is used for development purposes and ignored in deployed pals.

  debugPayload(Payload payload)

Debugs the payload. See comments on debugList and debugData

  debugs(String message, int length)

Adds the debug message but splits it into length character segments. Min length is 20 and max is 150. This debugs only to the server-side debugger.

  dumpDebug()

Forces an immediate flush of the debug log. This can be called once every 10 seconds.

  enableDebugger()

Over-rides default debugger behavior and explicitely turns on full debug information-- use this in a troubleshooting scenario on a deployed Pal.

String getAction()

Returns the action associated with c:button or c:a. Otherwise, returns null.

Browser getBrowser()

Returns a Browser object that contains information about the client browser.

BusinessUtil getBusinessUtil()

Returns a BusinessUtil object.

ChartTool getChartTool()

Creates and returns a chart factory object which can be used to create specific chart types.

ConsoleResponse getConsoleLogin(String palId)

Creates a response (that should be returned) that permits access to Console using presentation in the pal identified by palId. Pass null for palId to use the default login screen.

DateUtil getDateUtil()

Returns a utility for working with dates.

EncryptionUtil getEncryptionUtil()

Returns encryption utility

String getError()

Returns the error, if any.

String getFirstTransactionId()

Returns the ID of first transaction created from this Web Pal.

Formatter getFormatter()

Returns a formatter.

GeoUtil getGeoUtil(String units)

Returns a utility for working with geo-coordinates. Use km for kilometers and m for miles.

String getGlobalSetting(String name)

Returns the global setting identified by name. Returns null if no setting exists with that name.

String getHref()

Returns the href (page) requested by the browser. We give provide the URL decoded full path to the page requested.

String getLastTransactionId()

Returns the ID of last transaction created from this Web Pal.

Logger getLogger()

Returns the Logger for this workflow engine.

Monitor getMonitor()

Returns the workflow monitor.

NavigatorResponse getNavigatorLogin(String palId, String loginPalId)

Routes the user to Navigator, alternately using the default login page of the specified login pal and provides access to the first transaction the user has active role in. A new transaction is created in the case where the user has no transactions for the pal specified.

Page getPage(String name)

Returns the specified page.

RuntimePal getPal()

Returns the active Pal

RuntimePal getPalById(String palId)

Returns the Pal for the specified palId. Pals must belong to the same enterprise and group.

PalInfo getPalInfo(String palId)

The PalInfo for the specified palId.

Pin getPin(String palId, String pin)

Returns the PIN object identified by pin and palId. The Pal must belong to the same enterprise as this web pal.

String[] getPlugins()

Returns the names of all plugins registered in this cloud

QRUtil getQRUtil()

Returns a utility for creating and reading QR codes.

Request getRequest()

Returns the current Request.

String getResourcePath(String resource, String version)

Returns the resource path for the specified resource.

AjaxResponse getSlice(String sliceId)

Returns a response to the client using content from the specified slice. Returns null if no slice is available.

String getStoreId(String palId)

Returns the storeId of the specified pal. The pal must belong to the same enterprise as this pal. Returns null if the pal has not been published to the store.

double getTime()

Returns the difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC for the given server.

String getTimeZone()

Returns the timezone for this thread.

Validator getValidator()

Returns a utility for validating user data.

String getWorker()

Returns the worker (application server) running this workflow. Useful in a multi-worker environment for analyzing performance and for troubleshooting.

String getWorkflowName()

Returns the name of the currently running workflow.

boolean hasEnterprise(String email)

Returns true if a user with the specified email is registered and associated with an enterprise account.

boolean isAction(String action)

Returns true if the action is the specified action

boolean isRegistered(String email)

Returns true if a user with the specified email is registered.

boolean isSecure()

Returns true if this web pal is running on a secure url.

Response redirect(String url)

Provides an http redirect to the specified URL.

boolean register(String firstName, String lastName, String email, String captcha)

Registers the user account with the cloud. Returns false if the captcha does not match or if the email is already registered.

  revertWorkflow()

Reverts the workflow engine to its prior workflow

  setClean(boolean clean)

Sets all dataset operations to clean/not clean. See Dataset.setClean(boolean)

  setDateFormat(String pattern)

Sets the date pattern for displaying dates for this thread.

  setErrorPrefix(String errorPrefix)

Appends this prefix to any workflow generated error message.

  setMaxInactiveInterval(int inactiveTime)

Sets the max inactive time for this user. If no activity occurs in this time, the user will be logged out. Min is 1 second, max is 28800 seconds (8 hours).

  setTimeZone(String timezone)

Sets the timezone for dates created or displayed in this thread.

Response switchToWorkflow(String workflow, String action)

Switches the user to a different workflow file. Workflow must be of the same type. You must immediately return this response.

String toString()

Returns a description of this object.

Method Detail


boolean checkCaptcha(String captcha)

Checks the captcha value against the actual value stored on the server. Returns true if they match.

Parameters:

  • String   captcha

Returns:  boolean

Since: 07-11-2008

top

String checkToken(String ssoToken)

Returns the status of the token: enabled, disabled, none. Enabled means the token can be used for authentication. Requires cloud level configuration and partner settings.

Parameters:

  • String   ssoToken Required parameter. Maximum allowed size of parameter: 255

Returns:  String

Since: 07-31-2018

This method has been deprecated since 01-11-2021. Use RuntimePal.getAuthToken and call isEnabled

top

clearDebugs()

Clears the debug entries.

Since: 08-18-2010

top

AjaxResponse createAjaxResponse(Fragment fragment, boolean dynamicRender)

Returns a response to the client using content from the fragment and content type of text/html. Pass true for dynamicRender to execute business logic tags and JEXL constructs.

Parameters:

  • Fragment   fragment
  • boolean   dynamicRender

Returns:  AjaxResponse

Since: 07-11-2008

top

AjaxResponse createAjaxResponse(String string, boolean renderJexl)

Returns a response to the client using content from the string and content type of text/html. Pass true for renderJexl to execute JEXL constructs.

Parameters:

  • String   string
  • boolean   renderJexl

Returns:  AjaxResponse

Since: 07-11-2008

top

Buffer createBuffer()

Creates and returns a new Buffer object

Returns:  Buffer

Since: 07-11-2008

top

Data createData()

Creates and returns an empty Data object

Returns:  Data

Since: 08-21-2007

top

PacketDataList createDataList(String name, String column, String[] array)

Creates a new non persistent PacketDataList and adds the array to the column

Parameters:

  • String   name Required parameter.
  • String   column Required parameter.
  • String[]   array Required parameter.

Returns:  PacketDataList

Since: 06-10-2016

top

PacketDataList createDataList(String name, String[] columns)

Creates a new non persistent PacketDataList and returns it. Maximum column size is 100.

Parameters:

  • String   name
  • String[]   columns

Returns:  PacketDataList

Since: 10-07-2010

top

DownloadResponse createDownloadResponse()

Creates a DownloadResponse.

Returns:  DownloadResponse

Since: 08-11-2010

top

Email createEmail(String emailName)

Creates an Email container using the specified template. Requires enterprise level SMTP and web enabled email in activation key.

Parameters:

  • String   emailName Required parameter.

Returns:  Email

Since: 10-21-2010

top

Email createEmail(String emailName, String emailSettingsId)

Creates an Email container using the specified template and specified enterprise email settings. Requires enterprise level SMTP and web enabled email in activation key.

Parameters:

  • String   emailName  - email template name. Required parameter.
  • String   emailSettingsId  - if of enterprise email settings. Required parameter.

Returns:  Email

Since: 02-11-2011

top

FileBuffer createFileBuffer(String type, int limit)

Creates and returns a new FileBuffer object

Parameters:

  • String   type Required parameter. Allowed values: zip, jar, ods, odt, xlsx, docx.
  • int   limit  - Max size limit in KB, cannot exceed Max Export size of activation key. Required parameter.

Returns:  FileBuffer

Since: 08-27-2013

top

String createGUID(String prefix)

Creates a Globally Unique ID, alternatively with the specified prefix. Null prefix results in a guid of max length 37. With prefix it is length(prefix)+26

Parameters:

  • String   prefix

Returns:  String

Since: 05-21-2009

top

Response createImageResponse(ImageFile image)

Returns an image response.

Parameters:

Returns:  Response

Since: 08-19-2021

top

JSONBuffer createJsonBuffer()

Returns a new JSON Buffer

Returns:  JSONBuffer

Since: 04-29-2022

top

JSONParser createJsonParser(String jsonString)

Returns a parser for the given JSON string

Parameters:

  • String   jsonString Required parameter.

Returns:  JSONParser

Since: 01-29-2016

top

TextMessage createMessage()

Creates a new Message object. Requires enterprise level SMTP and web enabled email in activation key.

Returns:  TextMessage

Since: 10-21-2010

top

String createMobileLink(PalInfo pal, String action, Data data)

Creates link for mobile application

Parameters:

  • PalInfo   pal  - Pal to create link to. Required parameter.
  • String   action  - action defined in mobile configuration. Required parameter.
  • Data   data  - optional data to pass to action.

Returns:  String

Since: 06-24-2011

top

Payload createPayload()

Creates a new Payload object.

Returns:  Payload

Since: 10-07-2010

top

Payload createPayload(String json)

Creates a new Payload object from the JSON encoded string. See Payload.toJson().

Parameters:

  • String   json Required parameter.

Returns:  Payload

Since: 05-16-2011

top

Response createPdfResponse(PdfFile pdf)

Returns a pdf response.

Parameters:

  • PdfFile   pdf Required parameter.

Returns:  Response

Since: 09-01-2021

top

ServiceRequest createServiceRequest()

Creates real-time http(s) request object useful for communication with external web services. Requires activation key with Remote Services enabled.

Returns:  ServiceRequest

Since: 07-10-2014

top

TextEmail createTextEmail(String emailName)

Creates a text-based (body is text as opposed to XHTML) email. Requires enterprise level SMTP and web enabled email in activation key.

Parameters:

  • String   emailName Required parameter.

Returns:  TextEmail

Since: 10-21-2010

top

debug(Object message)

Adds a debug message.

Parameters:

  • Object   message  - Any object.

Since: 06-17-2024

top

debugData(Data data)

Debugs all the values of the given data object.

Parameters:

Since: 06-04-2019

top

debugList(DataList list)

Debugs the name, all of the columns, and up to 100 rows of data. The output is rendered in the debug messages of Pal Builder. This method is used for development purposes and ignored in deployed pals.

Parameters:

Since: 06-21-2019

top

debugPayload(Payload payload)

Debugs the payload. See comments on debugList and debugData

Parameters:

Since: 04-15-2021

top

debugs(String message, int length)

Adds the debug message but splits it into length character segments. Min length is 20 and max is 150. This debugs only to the server-side debugger.

Parameters:

  • String   message
  • int   length Required parameter. Maximum allowed size of parameter: 150

Since: 07-27-2021

top

dumpDebug()

Forces an immediate flush of the debug log. This can be called once every 10 seconds.

Since: 12-10-2018

top

enableDebugger()

Over-rides default debugger behavior and explicitely turns on full debug information-- use this in a troubleshooting scenario on a deployed Pal.

Since: 08-18-2010

top

String getAction()

Returns the action associated with c:button or c:a. Otherwise, returns null.

Returns:  String

Since: 09-24-2010

top

Browser getBrowser()

Returns a Browser object that contains information about the client browser.

Returns:  Browser

Since: 07-11-2008

top

BusinessUtil getBusinessUtil()

Returns a BusinessUtil object.

Returns:  BusinessUtil

Since: 07-15-2009

top

ChartTool getChartTool()

Creates and returns a chart factory object which can be used to create specific chart types.

Returns:  ChartTool

Since: 03-01-2018

top

ConsoleResponse getConsoleLogin(String palId)

Creates a response (that should be returned) that permits access to Console using presentation in the pal identified by palId. Pass null for palId to use the default login screen.

Parameters:

  • String   palId

Returns:  ConsoleResponse

Since: 04-30-2009

top

DateUtil getDateUtil()

Returns a utility for working with dates.

Returns:  DateUtil

Since: 07-29-2008

top

EncryptionUtil getEncryptionUtil()

Returns encryption utility

Returns:  EncryptionUtil

Since: 11-30-2016

top

String getError()

Returns the error, if any.

Returns:  String

Since: 07-11-2008

top

String getFirstTransactionId()

Returns the ID of first transaction created from this Web Pal.

Returns:  String

Since: 09-19-2008

top

Formatter getFormatter()

Returns a formatter.

Returns:  Formatter

Since: 07-31-2008

top

GeoUtil getGeoUtil(String units)

Returns a utility for working with geo-coordinates. Use km for kilometers and m for miles.

Parameters:

  • String   units Required parameter. Allowed values: km, m.

Returns:  GeoUtil

Since: 08-27-2019

top

String getGlobalSetting(String name)

Returns the global setting identified by name. Returns null if no setting exists with that name.

Parameters:

  • String   name

Returns:  String

Since: 02-17-2011

top

String getHref()

Returns the href (page) requested by the browser. We give provide the URL decoded full path to the page requested.

Returns:  String

Since: 07-11-2008

top

String getLastTransactionId()

Returns the ID of last transaction created from this Web Pal.

Returns:  String

Since: 09-19-2008

top

Logger getLogger()

Returns the Logger for this workflow engine.

Returns:  Logger

Since: 10-19-2020

top

Monitor getMonitor()

Returns the workflow monitor.

Returns:  Monitor

Since: 01-04-2010

top

NavigatorResponse getNavigatorLogin(String palId, String loginPalId)

Routes the user to Navigator, alternately using the default login page of the specified login pal and provides access to the first transaction the user has active role in. A new transaction is created in the case where the user has no transactions for the pal specified.

Parameters:

  • String   palId
  • String   loginPalId

Returns:  NavigatorResponse

Since: 05-15-2014

top

Page getPage(String name)

Returns the specified page.

Parameters:

  • String   name

Returns:  Page

Since: 07-11-2008

top

RuntimePal getPal()

Returns the active Pal

Returns:  RuntimePal

Since: 04-28-2010

top

RuntimePal getPalById(String palId)

Returns the Pal for the specified palId. Pals must belong to the same enterprise and group.

Parameters:

  • String   palId

Returns:  RuntimePal

Since: 04-28-2010

top

PalInfo getPalInfo(String palId)

The PalInfo for the specified palId.

Parameters:

  • String   palId

Returns:  PalInfo

Since: 10-27-2009

top

Pin getPin(String palId, String pin)

Returns the PIN object identified by pin and palId. The Pal must belong to the same enterprise as this web pal.

Parameters:

  • String   palId
  • String   pin

Returns:  Pin

Since: 12-01-2009

top

String[] getPlugins()

Returns the names of all plugins registered in this cloud

Returns:  String[]

Since: 11-28-2022

top

QRUtil getQRUtil()

Returns a utility for creating and reading QR codes.

Returns:  QRUtil

Since: 01-26-2017

top

Request getRequest()

Returns the current Request.

Returns:  Request

Since: 07-11-2008

top

String getResourcePath(String resource, String version)

Returns the resource path for the specified resource.

Parameters:

  • String   resource Required parameter.
  • String   version

Returns:  String

Since: 12-08-2015

top

AjaxResponse getSlice(String sliceId)

Returns a response to the client using content from the specified slice. Returns null if no slice is available.

Parameters:

  • String   sliceId Required parameter.

Returns:  AjaxResponse

Since: 11-23-2022

top

String getStoreId(String palId)

Returns the storeId of the specified pal. The pal must belong to the same enterprise as this pal. Returns null if the pal has not been published to the store.

Parameters:

  • String   palId

Returns:  String

Since: 09-25-2009

top

double getTime()

Returns the difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC for the given server.

Returns:  double

Since: 10-07-2021

top

String getTimeZone()

Returns the timezone for this thread.

Returns:  String

Since: 03-14-2022

top

Validator getValidator()

Returns a utility for validating user data.

Returns:  Validator

Since: 07-11-2008

top

String getWorker()

Returns the worker (application server) running this workflow. Useful in a multi-worker environment for analyzing performance and for troubleshooting.

Returns:  String

Since: 07-05-2021

top

String getWorkflowName()

Returns the name of the currently running workflow.

Returns:  String

Since: 11-13-2009

top

boolean hasEnterprise(String email)

Returns true if a user with the specified email is registered and associated with an enterprise account.

Parameters:

  • String   email

Returns:  boolean

Since: 07-11-2008

top

boolean isAction(String action)

Returns true if the action is the specified action

Parameters:

  • String   action

Returns:  boolean

Since: 09-24-2010

top

boolean isRegistered(String email)

Returns true if a user with the specified email is registered.

Parameters:

  • String   email

Returns:  boolean

Since: 07-11-2008

top

boolean isSecure()

Returns true if this web pal is running on a secure url.

Returns:  boolean

Since: 11-16-2015

top

Response redirect(String url)

Provides an http redirect to the specified URL.

Parameters:

  • String   url Required parameter.

Returns:  Response

Since: 12-02-2009

top

boolean register(String firstName, String lastName, String email, String captcha)

Registers the user account with the cloud. Returns false if the captcha does not match or if the email is already registered.

Parameters:

  • String   firstName
  • String   lastName
  • String   email
  • String   captcha

Returns:  boolean

Since: 07-11-2008

top

revertWorkflow()

Reverts the workflow engine to its prior workflow

Since: 05-24-2019

top

setClean(boolean clean)

Sets all dataset operations to clean/not clean. See Dataset.setClean(boolean)

Parameters:

  • boolean   clean Required parameter.

Since: 06-15-2022

top

setDateFormat(String pattern)

Sets the date pattern for displaying dates for this thread.

Parameters:

  • String   pattern

Since: 10-07-2021

top

setErrorPrefix(String errorPrefix)

Appends this prefix to any workflow generated error message.

Parameters:

  • String   errorPrefix

Since: 10-05-2015

top

setMaxInactiveInterval(int inactiveTime)

Sets the max inactive time for this user. If no activity occurs in this time, the user will be logged out. Min is 1 second, max is 28800 seconds (8 hours).

Parameters:

  • int   inactiveTime  - time in seconds.

Since: 03-20-2018

top

setTimeZone(String timezone)

Sets the timezone for dates created or displayed in this thread.

Parameters:

  • String   timezone

Since: 10-07-2021

top

Response switchToWorkflow(String workflow, String action)

Switches the user to a different workflow file. Workflow must be of the same type. You must immediately return this response.

Parameters:

  • String   workflow  - workflow name. Required parameter.
  • String   action  - user action. Required parameter.

Returns:  Response

Since: 12-07-2010

top

String toString()

Returns a description of this object.

Returns:  String

Since: 07-11-2008

top
Copyright © 2006 - 2024, ContractPal, Inc. All rights reserved. API Date: Dec 03, 2024 10:24 AM