Console Webservice API

Buffer

Other API in Package

Console

Console System

Internal Console

Method Summary
Buffer addData(Data data)

Adds the Data to this Buffer for subsequent JEXL rendering (see toString() or toFile()).

Buffer addDataList(DataList dataList)

Adds the DataList to this Buffer for subsequent JEXL rendering (see render() or toFile()).

Buffer addDataMap(String id, Data data)

Adds the Data to this Buffer with the given id for subsequent JEXL rendering (see toString() or toFile()).

Buffer addDataMaps(String keyColumn, DataList list)

Extracts the records from the list and registers them in the Buffer using the values in the key column. Limited to 500 records.

Buffer append(String string)

Appends the given string to the buffer and returns the buffer

Buffer append(int int)

Appends the given int to the buffer and returns the buffer

Buffer appendArray(String[] array, String delim)

Appends the elements of array to this buffer, optionally separating them with delim.

Buffer appendFile(File file)

Appends the file content to this buffer and returns the buffer. If the file is not text, the contents are appended as base64.

Buffer appendFragment(Fragment fragment)

Appends the xhtml content of the fragment to this buffer and returns the buffer.

  clearMarkers()

Clears the markers (start and end).

int endMarker(String find)

Finds the first location of the matching string, starting from startMarker and returns the end location or -1 if not found. You must call startMarker before calling this method.

String getElement(String xpath)

Returns the xhtml of the content identified by xpath.

String getMarker()

Returns the content found between startMarker and endMarker, inclusive.

Buffer lf()

Appends a line feed to the buffer and returns the buffer.

Buffer quote()

Appends a quote to the buffer and returns the buffer.

Buffer removeControlChars(boolean all)

Removes all control characters in the range x0000 to x001F inclusive if all is true. If all is false, this will remove all control characters except tab, line feed, and carriage return.

Buffer removeNonAsciiChars()

Removes all characters outside of the UTF-8 C1 Controls and Latin1 Supplement (keeps characters in the range 0-255 decimal).

Buffer removeTags(String blockSeparator)

Removes html tags from buffer content. Optionally can separate block elements with specified block separator string

String render()

Renders the content (requires well-formed XHTML), injecting dynamic content into the output. See Buffer.addDataList, Buffer.appendFragment, etc.

Buffer replace(String find, String replace, boolean all)

Finds occurrences of find and replaces it with replace. If all is true, all occurrences are replaced. Otherwise, the first occurrence is replaced.

Buffer replaceElement(String xpath, String xhtml)

Replaces the element identified with xpath with content defined by xhtml. If xhtml is null, it removes the element. Expects the underlying buffer content to be well-formed xhtml.

  replaceMarker(String replacement)

Replaces the content found between startMarker and endMarker, inclusive.

Buffer setValue(String key, String value)

Adds the key/value pair to the Buffer, over-writing any set that already exists with name key.

int startMarker(String find)

Finds the first location of the matching string relative to the last marker and returns the location or -1 if not found. Resets the end mark.

File toBinaryFile(String fileName, String contentType)

Returns the Base64 content of this Buffer as a File with the specified name and content type. Exception if the buffer content is not Base64 or does not match the contentType.

PacketDataList toDataList(String name)

Creates a PacketDataList from the buffer contents (expected a serialized JSON DataList). See DataList.toJSON. If you pass null or empty for name, the datalist name will be what is already contained in the serialized JSON. Otherwise, the list will get the new name you provide.

PacketDataList toDataList(String name, String columnName, String delim)

Creates a one column PacketDataList from the buffer contents.

PacketDataList toDataList(String name, String varName)

Creates a PacketDataList from the buffer contents (expected a serialized JSON DataList). Targets the list identified by varName.

Fragment toDocumentFragment(String name, boolean tidy)

Creates a Fragment from the buffer content. The content must be well-formed xhtml and be comprised of legal content for a document fragment. Returns null if the content does not conform. If the content is not well-formed and tidy is true, we will attempt to clean it up. The content type should be html, txt, or xml.

File toFile(String fileName)

Returns the content of this Buffer as a File with the specified name. The fileName must have a text-based extension.

ImageFile toImage(String filename, int width, int height)

Renders contents of this buffer as image

Fragment toPageFragment(String name, boolean tidy)

Creates a Fragment from the buffer content. The content must be well-formed xhtml. If the content is not well-formed and tidy is true, we will attempt to clean it up. The content type should be html, txt, or xml. Returns null if the content cannot be parsed.

String toString()

Returns the content of the buffer as a string

String toText()

Returns content of this buffer as text (removes any XML/HTML tags).

Method Detail


Buffer addData(Data data)

Adds the Data to this Buffer for subsequent JEXL rendering (see toString() or toFile()).

Parameters:

  • Data   data Required parameter.

Returns:  Buffer

Since: 11-01-2010

top

Buffer addDataList(DataList dataList)

Adds the DataList to this Buffer for subsequent JEXL rendering (see render() or toFile()).

Parameters:

  • DataList   dataList Required parameter.

Returns:  Buffer

Since: 05-31-2011

top

Buffer addDataMap(String id, Data data)

Adds the Data to this Buffer with the given id for subsequent JEXL rendering (see toString() or toFile()).

Parameters:

  • String   id Required parameter.
  • Data   data Required parameter.

Returns:  Buffer

Since: 11-01-2010

top

Buffer addDataMaps(String keyColumn, DataList list)

Extracts the records from the list and registers them in the Buffer using the values in the key column. Limited to 500 records.

Parameters:

Returns:  Buffer

Since: 11-01-2010

top

Buffer append(String string)

Appends the given string to the buffer and returns the buffer

Parameters:

  • String   string

Returns:  Buffer

Since: 07-11-2008

top

Buffer append(int int)

Appends the given int to the buffer and returns the buffer

Parameters:

  • int   int

Returns:  Buffer

Since: 07-11-2008

top

Buffer appendArray(String[] array, String delim)

Appends the elements of array to this buffer, optionally separating them with delim.

Parameters:

  • String[]   array
  • String   delim

Returns:  Buffer

Since: 06-07-2010

top

Buffer appendFile(File file)

Appends the file content to this buffer and returns the buffer. If the file is not text, the contents are appended as base64.

Parameters:

Returns:  Buffer

Since: 08-24-2010

top

Buffer appendFragment(Fragment fragment)

Appends the xhtml content of the fragment to this buffer and returns the buffer.

Parameters:

Returns:  Buffer

Since: 08-24-2010

top

clearMarkers()

Clears the markers (start and end).

Since: 09-12-2022

top

int endMarker(String find)

Finds the first location of the matching string, starting from startMarker and returns the end location or -1 if not found. You must call startMarker before calling this method.

Parameters:

  • String   find Required parameter.

Returns:  int

Since: 02-05-2022

top

String getElement(String xpath)

Returns the xhtml of the content identified by xpath.

Parameters:

  • String   xpath Required parameter.

Returns:  String

Since: 11-07-2017

top

String getMarker()

Returns the content found between startMarker and endMarker, inclusive.

Returns:  String

Since: 02-05-2022

top

Buffer lf()

Appends a line feed to the buffer and returns the buffer.

Returns:  Buffer

Since: 09-10-2010

top

Buffer quote()

Appends a quote to the buffer and returns the buffer.

Returns:  Buffer

Since: 09-10-2010

top

Buffer removeControlChars(boolean all)

Removes all control characters in the range x0000 to x001F inclusive if all is true. If all is false, this will remove all control characters except tab, line feed, and carriage return.

Parameters:

  • boolean   all

Returns:  Buffer

Since: 11-24-2014

top

Buffer removeNonAsciiChars()

Removes all characters outside of the UTF-8 C1 Controls and Latin1 Supplement (keeps characters in the range 0-255 decimal).

Returns:  Buffer

Since: 03-05-2021

top

Buffer removeTags(String blockSeparator)

Removes html tags from buffer content. Optionally can separate block elements with specified block separator string

Parameters:

  • String   blockSeparator  - optional block separator string.

Returns:  Buffer

Since: 05-31-2011

top

String render()

Renders the content (requires well-formed XHTML), injecting dynamic content into the output. See Buffer.addDataList, Buffer.appendFragment, etc.

Returns:  String

Since: 05-31-2011

top

Buffer replace(String find, String replace, boolean all)

Finds occurrences of find and replaces it with replace. If all is true, all occurrences are replaced. Otherwise, the first occurrence is replaced.

Parameters:

  • String   find
  • String   replace
  • boolean   all

Returns:  Buffer

Since: 07-11-2008

top

Buffer replaceElement(String xpath, String xhtml)

Replaces the element identified with xpath with content defined by xhtml. If xhtml is null, it removes the element. Expects the underlying buffer content to be well-formed xhtml.

Parameters:

  • String   xpath Required parameter.
  • String   xhtml

Returns:  Buffer

Since: 11-07-2017

top

replaceMarker(String replacement)

Replaces the content found between startMarker and endMarker, inclusive.

Parameters:

  • String   replacement

Since: 02-05-2022

top

Buffer setValue(String key, String value)

Adds the key/value pair to the Buffer, over-writing any set that already exists with name key.

Parameters:

  • String   key Required parameter.
  • String   value Required parameter.

Returns:  Buffer

Since: 11-01-2010

top

int startMarker(String find)

Finds the first location of the matching string relative to the last marker and returns the location or -1 if not found. Resets the end mark.

Parameters:

  • String   find Required parameter.

Returns:  int

Since: 02-05-2022

top

File toBinaryFile(String fileName, String contentType)

Returns the Base64 content of this Buffer as a File with the specified name and content type. Exception if the buffer content is not Base64 or does not match the contentType.

Parameters:

  • String   fileName Required parameter.
  • String   contentType Required parameter.

Returns:  File

Since: 05-16-2011

top

PacketDataList toDataList(String name)

Creates a PacketDataList from the buffer contents (expected a serialized JSON DataList). See DataList.toJSON. If you pass null or empty for name, the datalist name will be what is already contained in the serialized JSON. Otherwise, the list will get the new name you provide.

Parameters:

  • String   name

Returns:  PacketDataList

Since: 08-30-2010

top

PacketDataList toDataList(String name, String columnName, String delim)

Creates a one column PacketDataList from the buffer contents.

Parameters:

  • String   name Required parameter.
  • String   columnName Required parameter.
  • String   delim Required parameter.

Returns:  PacketDataList

Since: 06-07-2010

top

PacketDataList toDataList(String name, String varName)

Creates a PacketDataList from the buffer contents (expected a serialized JSON DataList). Targets the list identified by varName.

Parameters:

  • String   name Required parameter.
  • String   varName Required parameter.

Returns:  PacketDataList

Since: 04-19-2012

top

Fragment toDocumentFragment(String name, boolean tidy)

Creates a Fragment from the buffer content. The content must be well-formed xhtml and be comprised of legal content for a document fragment. Returns null if the content does not conform. If the content is not well-formed and tidy is true, we will attempt to clean it up. The content type should be html, txt, or xml.

Parameters:

  • String   name Required parameter.
  • boolean   tidy Required parameter.

Returns:  Fragment

Since: 08-24-2010

top

File toFile(String fileName)

Returns the content of this Buffer as a File with the specified name. The fileName must have a text-based extension.

Parameters:

  • String   fileName Required parameter.

Returns:  File

Since: 11-01-2010

top

ImageFile toImage(String filename, int width, int height)

Renders contents of this buffer as image

Parameters:

  • String   filename  - file name. Required parameter.
  • int   width  - image width. Required parameter. Maximum allowed size of parameter: 5120
  • int   height  - image height. Required parameter. Maximum allowed size of parameter: 5120

Returns:  ImageFile

Since: 06-08-2011

top

Fragment toPageFragment(String name, boolean tidy)

Creates a Fragment from the buffer content. The content must be well-formed xhtml. If the content is not well-formed and tidy is true, we will attempt to clean it up. The content type should be html, txt, or xml. Returns null if the content cannot be parsed.

Parameters:

  • String   name Required parameter.
  • boolean   tidy Required parameter.

Returns:  Fragment

Since: 08-24-2010

top

String toString()

Returns the content of the buffer as a string

Returns:  String

Since: 07-11-2008

top

String toText()

Returns content of this buffer as text (removes any XML/HTML tags).

Returns:  String

Since: 09-28-2012

top
Copyright © 2006 - 2024, ContractPal, Inc. All rights reserved. API Date: Nov 18, 2024 01:04 PM