Class ImagerAPI

Index Home MAE > MAE Architecture > MAE Data Types > Class Index > Class ImagerAPI

Summary
Public Methods
static bool sendImage(device, iid, errmsg, action, cbdata)
static bool saveToImageLib(device, filename, filetype, filecontent, xid, category)
static bool saveToImageLib(image_id, filename, filetype, filecontent, category)
static bool updateImageLib(image_id)
static bool saveToImageLib(image_id, filecontent)
static bool setImageCategory(image_id, category)
static bool setImageName(image_id, name)
static bool setImageType(image_id, type)
static XMLData newImage(table, id)
static bool send(request, params)

#include <ImagerAPI.h >

Summary

This class is used by other apps to send messages to the imager channel.

Use this interface instead of sending messages directly to ensure message keywords are spelled correctly, all parameters are specified, and error checked.

The receiving app defined this interface to ensure it receives the messages correctly.

Public Methods

static bool sendImage(device, iid, errmsg, action, cbdata)

UserDevice& device

the end-user's device

const string& iid

image id

const string& errmsg

If the image cannot be rendered, output this error message

const string& action

(optional)  the message keyword to send when user clicks on text (aka request)

const XMLData& cbdata

(optional)  data to send along with action message


Render an image to the end-user's device

Return value: true if sent successfully

static bool saveToImageLib(device, filename, filetype, filecontent, xid, category)

UserDevice& device

the end-user's device

const string& filename

the image's filename

const string& filetype

the images file type, e.g. svg, jpeg, etc.

const string& filecontent

the raw content of the image

int xid

upload transaction id

const string& category

the category for the image

Default value: ""


Save the image (in filecontent) to the image library (ImageLib).

Return value: true if sent successfully

static bool saveToImageLib(image_id, filename, filetype, filecontent, category)

ImageLibId image_id

the (already assigned) ImageLib id for the image

const string& filename

the filename to use for the image

const string& filetype

the file type of the image, e.g. svg, jpeg, etc

const string& filecontent

the raw data of the image

const string& category

the category for the image

Default value: ""


Save the image to the ImageLib along with metadata about the image.

Return value: true if sent successfully

static bool updateImageLib(image_id)

ImageLibId image_id

the ImageLib id for the image


FUTURE USE. Update an image in ImageLib, specified by the provided id.

Return value: true if sent successfully

static bool saveToImageLib(image_id, filecontent)

ImageLibId image_id

the (already assigned) ImageLib id for the image

const string& filecontent

the raw data of the image


Save/Update the image stored in the ImageLib.

Return value: true if sent successfully

static bool setImageCategory(image_id, category)

ImageLibId image_id

the ImageLib id for the image

const string& category

the new category for the image


Set the image category for the specified image.  Categories are useful for organizing images.

Return value: true if sent successfully

static bool setImageName(image_id, name)

ImageLibId image_id

the ImageLib id for the image

const string& name

the new image filename


Set the image filename as stored in ImageLib.

Return value: true if sent successfully

static bool setImageType(image_id, type)

ImageLibId image_id

the ImageLib id for the image

const string& type

the new image file type


Set the image file type as stored in ImageLib.

Return value: true if sent successfully

static XMLData newImage(table, id)

const string& table

the image table

DbRecNum id

the id in the table


Assign a new image id to an existing image.

Return value: XMLData["iid"] - the new image id

static bool send(request, params)

const string& request

the request keyword

const XMLData& params

the data (parameter payload)

Default value: XMLData("")


Send an API message to channel imager.