Python MAEApp
debug_on |
Flag: True if debug output should generated, False if not Default value: 0 |
programName |
The program's name, as known to MAE Default value: 'programName not set' |
dbgf |
The file pointer to the debug file Default value: None |
MAX_OFFSET |
Default value: 26 |
cypher |
Default value: "OriginalSoftwareWrittenInBasicOnCommodore64,PortedToTurboPascal,ThenPortedToC/C++,AndNowOntoLinuxAndMySQL." |
db |
Default value: None |
TEXT_FONT_SIZE |
Default value: 12 |
svgStartTag |
Default value: None |
svgEndTag |
Default value: None |
device |
the end-user's device |
table |
the area with a collection of fields in it |
field |
the specific field within that area |
value |
the string to display |
Update/Replace the table and field entry with the value provided
Return value: true if sent successfully
device |
the end-user's device |
text |
the text to put there |
style |
display style for the text |
Replace the display region with the text provided.
Return value: true if sent successfully
device |
the end-user's device |
text |
the text to append |
style |
display style for the text |
Append to the display reagion with the provided text for the user specified
Return value: true if sent successfully
device |
the end-user's device |
text |
the text to append |
style |
display style for the text |
Append to the display reagion with the provided text for the user specified, followed by a line break.
Return value: true if sent successfully
device |
the end-user's device |
text |
the text to append |
Convert the text from wiki text (see wiki2doc) and display to the display region.
Return value: true if sent successfully
device |
the end-user's device |
text |
the text to append |
action |
the message keyword to send when user clicks on text (aka request) |
cbdata |
data to send along with action message |
style |
the preset way to display the text (color, font, etc) |
Append the tagged area with the provided text for the user specified and make it a hot spot that triggers an action.
Return value: true if sent successfully
device |
the end-user's device |
text |
the hint text to show the user |
Provide hint text to the end-user for the display region. Exact implementation up to the end interface, but it may be to display text when the user hovers over the display region.
Return value: true if sent successfully
device |
the end-user's device |
text |
the text on the button |
action |
the message keyword to send when user clicks on text (aka request) |
cbdata |
data to send along with action message |
Append the tagged area with the provided text on a button for the user on the device specified. When clicked, it triggers a a message with the action and callback data.
device |
the end-user's device |
control |
the UI state keyword to update, e.g. strong, emphasis, bold, italic, underline, color:color |
on |
flag to say turn the control on or off |
DEPRECATED - use style() instead. Update the current display style state.
Return value: true if sent successfully
device |
the end-user's device |
newtag |
the new region's name |
styleName |
the preset way to display the text (color, font, etc) |
size |
the number of characters wide for the new region (suggestion) |
Create a new display region inside device's current display region.
Return value: true if sent successfully
device |
the end-user's device |
styleName |
the new region's name |
Set the named display style for device's current display region. See the configured properties of the style in the appropriate end-user display type (e.g. usergw uses HTML CSS).
Return value: true if sent successfully
device |
the end-user's device |
text |
the text for the user to see |
Display a message to get the user's attention.
Return value: true if sent successfully
device |
the end-user's device |
value |
the value to show on the selector |
When a display region contains a selector, set the active selection to the value provided. If the value is not a valid selection, behavior is undefined.
Return value: true if sent successfully
device |
the end-user's device |
from |
name of user whom the message is from |
text |
the message to display |
Send a chat message to the end-user's device.
Return value: true if sent successfully
device |
the end-user's device |
Clear all displayed objects and text from the current display region of the device.
Return value: true if sent successfully
device |
the end-user's device |
Display the objects and text inside the current display region of the device.
Return value: true if sent successfully
device |
the end-user's device |
Hide the objects and text inside the current display region of the device. Make them non-visible.
Return value: true if sent successfully
device |
the end-user's device |
tableName |
the name of the table |
tableType |
the type of table, e.g. left, center, right |
rows |
the number of rows in the table |
columns |
the number of columns in the table |
Create a table display region on the user'd device. It will be setup with the rows and columns specified. Note that referencing one column more to the right will create that column; and referencing one more row below will create that row.
Return value: true if sent successfully
device |
the end-user's device |
name |
the name of the list |
items |
a count of the expected number of list items (suggestion) |
Create a bulleted list that can contains items. Note that adding a list item immediately beyond the end will expand the list.
Return value: true if sent successfully
device |
the end-user's device |
recordName |
the record template's name (this corresponds to a file under .../html/record) |
idmap |
(optional) mapping of template field names to actual ids to use |
values |
key/value paris of id/values to fill in values in the record |
overwrite |
flag: true to replace existing display region, false to append |
Output a record of information using a templte to map old UI ids to new ones. For idmap, the key is the old id and the value is the new id
Return value: true if sent successfully
device |
the end-user's device |
reportName |
the name of the report to output |
table |
the name of the table to ...? |
table_id |
the id for the table ...? |
FUTURE USE. Output a report of information
Return value: true if sent successfully
device |
the end-user's device |
query |
(optional) the question text for the user |
value |
the default value |
promptType |
the type of prompt, e.g. text, yn, int, etc. |
xid |
a transaction id maintained by the calling app (guibroker) |
style |
the style to use for the query |
Present the user with a question and response (text entry) box. The xid parameter ties back to the appropriate response action and callback data to use when replying (see GuiAPI).
Return value: true if sent successfully
device |
the end-user's device |
option0 |
The visible question that is the first option on the list - and the default if no value is given. If the user actually selects this option, the app will be given the value $NA |
options |
the list of options to show the user. They key is show; the value is returned as the reply. |
xid |
a transaction id maintained by the calling app (guibroker) |
selected |
the selected option |
Present the user with a selection of choices. The xid parameter ties back to the appropriate response action and callback data to use when replying (see GuiAPI).
Return value: true if sent successfully
device |
the end-user's device |
query |
(optional) the question text for the user |
value |
the default value |
xid |
a transaction id maintained by the calling app (guibroker) |
style |
the style to use for the query |
Present the user with a selection of choices as checkboxes. The xid parameter ties back to the appropriate response action and callback data to use when replying (see GuiAPI).
Return value: true if sent successfully
device |
the end-user's device |
text |
the initial text in the box |
xid |
a transaction id maintained by the calling app (guibroker) |
style |
the style to use for the query |
saveLabel |
the label on the button for the user to click on to send the revised text |
Present the user with an area to type a lot of text. The xid parameter ties back to the appropriate response action and callback data to use when replying (see GuiAPI).
Return value: true if sent successfully
device |
the end-user's device |
formName |
the name of the form (relates to .../html/form files) |
vars |
key/value paris of id/values to fill in default values |
xid |
a transaction id maintained by the calling app (guibroker) |
Present the user with input form template. The xid parameter ties back to the appropriate response action and callback data to use when replying (see GuiAPI).
Return value: true if sent successfully
device |
the end-user's device |
name |
the name of the screen for reference |
rows |
number of rows in the screen |
columns |
the number of columns in the screen |
Create a terminal screen of the specified size on the user's device.
Return value: true if sent successfully
device |
the end-user's device |
attributes |
a comma separated list of styles, e.g. cursor, bold, underline, reverse, red, blue, etc |
Set the current terminal screen attributes for the next character(s) to be written.
Return value: true if sent successfully
device |
the end-user's device |
row |
the terminal row |
column |
the terminal column |
letter |
a numerical value for the letter to write, e.g. ASCII. Note that letters 0-31 are non-printable. |
amount |
the number of letters to write out (repeating letters) |
Write a character to the terminal screen previously defined at device's display region.
Return value: true if sent successfully
device |
the end-user's device |
menu |
the menu heading that contains menu options |
option |
the menu option text |
command |
the request keyword to send to the app |
Configure the end-user's device with the menu option under the specified menu. When the end-user selects it, the specified command will be sent as a message request of the app.
Return value: true if sent successfully
device |
the end-user's device |
menu |
the menu heading that contains menu options |
option |
the menu option text |
Remove the menu option under the specified menu on the end-user's device.
Return value: true if sent successfully
device |
the end-user's device |
windowName |
the name of the window; it appears as the window's title |
Configure the end-user's device with a window, titled with the name provided.
Return value: true if sent successfully
device |
the end-user's device |
windowName |
the name of the window; it appears as the window's title |
Remove/Close the named window from the end-user's device.
Return value: true if sent successfully
device |
the end-user's device |
indexName |
the name of the index; it appears as the index's title |
Configure the end-user's device with the index (tab).
Return value: true if sent successfully
device |
the end-user's device |
indexName |
the name of the index; it appears as the index's title |
Remove the named index from the end-user's device.
Return value: true if sent successfully
device |
the end-user's device |
title |
the section title |
sectionType |
a comma separated list of section qualities, e.g. collabsable, h2, h3 |
newtag |
the tag for the section (must begin with Section_) |
Add a section the the UI. Sections can be manipulated, for example expanded/collapsed.
Return value: true if sent successfully
device |
the end-user's device |
Collapse the section identified as the current display region.
Return value: true if sent successfully
device |
the end-user's device |
Expand the section identified as the current display region.
Return value: true if sent successfully
device |
the end-user's device |
imageName |
the Image's name (see Image class) |
image_type |
the image type, e.g. svg, gif |
action |
(optional) if specified, then image is a hot spot; when the user clicks on it, a message will be send with this action/request keyword |
cbdata |
(optional) if an action was specified, then image is a hot spot; when the user clicks on it, a message will be send with this callback data |
append |
Add the image or replace the contents of the device's current region. Default: false/replace. |
Display the referenced buffered image that has already been transferred to display channel. If an action is provided, the image can be clicked on to trigger the action with its callback data.
Return value: true if sent successfully
device |
the end-user's device |
image_id |
the image id from the ImageLib library |
action |
(optional) if specified, then image is a hot spot; when the user clicks on it, a message will be send with this action/request keyword |
cbdata |
(optional) if an action was specified, then image is a hot spot; when the user clicks on it, a message will be send with this callback data |
append |
Add the image or replace the contents of the device's current region. Default: false/replace. |
Display the referenced buffered image that has already been transferred to display channel. If an action is provided, the image can be clicked on to trigger the action with its callback data.
Return value: true if sent successfully
device |
the end-user's device |
audioName |
the audio sound's name (or HTML tag, e.g. audio_audioName) |
Play the referenced audio sound.
Return value: true if sent successfully
device |
the end-user's device |
query |
the question/prompt to the user |
fileclass |
a comma separated list of file types, e.g. html, pdf, svg, etc. |
xid |
a transaction id maintained by the calling app (guibroker) |
Request that the user send the app a file.
Return value: true if sent successfully
device |
the end-user's device |
imageName |
the Image's name (see Image class) |
image_type |
the image type, e.g. svg, gif |
Send a file to the end-user's device that has already been transferred to display channel.
Return value: true if sent successfully
device |
the end-user's device |
id |
the image's id in ImageLib |
Pre-fetch and image from ImageLib.
Return value: true if sent successfully
device |
the end-user's device |
imageName |
the Image's name (see Image class) |
image_type |
the image type, e.g. svg, gif |
width |
image width, in pixels |
height |
image height, in pixels |
size |
size of image, in bytes |
binary |
flag set to true if data is binary (hex encoded) |
chunk |
chunk #, starting at 0, increasing with subsequent chunks |
totalChunks |
total number of chunks being sent |
chunksize |
size of this chunk of data, in bytes |
data |
the data of this chunk |
Send a chunk of data to the display chennel (to fit within a message max size).
Return value: true if sent successfully
device |
the end-user's device |
variable |
the end-user device variable to set, e.g. wid (tenant id), pc |
value |
the new value of the variable |
Alter a end-user device built-in variable value.
Return value: true if sent successfully
device |
the end-user's device |
variable |
the end-user device variable to set, e.g. wid (tenant id), pc |
value |
(output) the current value of the variable |
Alter a end-user device built-in variable value.
Return value: true if sent successfully
device |
the end-user's device |
appname |
the app to run |
startParams |
the initial parameters for running that app (app-specific); note that any XML sub-objects will not pass through to new process - only key/value property pairs |
Switch the user from running one app to a different app using the provided parameters.
Return value: true if sent successfully
device |
the end-user's device |
Stop running the current application.
Return value: true if sent successfully
userId |
User datastore's id for user |
action |
Action to take on user's account, e.g disable |
value |
Parameter for action, e.g. T, F |
Take an action on a user's account.
Return value: true if sent successfully
appmode |
Name of appmode, likely the app's name. All URL's for //site/appmode/ will trigger a message using action below |
apptype |
type of behavior to remote client: Ux (asynchronous user experience in browser), Direct (synchronous query gets synchronous response), Pipe (streamed data from remote connection is fed to app by line or binary block) |
action |
name of action to send to app when URL connection established |
contentInputType |
the expected input content payload. A HTTP simple form POSTing sends form-data; a REST call may send json or xml. |
contentOutputType |
the default response content payload, e.g. json, xml |
operations |
a list of HTTP operations allowed. "GET,POST" is typical, but a REST interface may also include PUT, DELETE, or PATCH. The value is a comma separted list. |
msgchannel |
specify if other than the default channel for the calling app. |
privatePages |
true if only authenticated users may access, false if public |
Register an app mode with UserGW. This captures all URL activity for URLs that begin with that appmode.
Return value: true if sent successfully
device |
the end-user's device |
statusCode |
disposition status of the connection: 0- Success, 1- Input error, 2- Invalid, 3- Not authorized, 4- Failure (no output |
contentType |
the output content type, likely json or xml. However a major/minor value is allowed (and passes straight through) |
Declare to UserGW that response output is ready to send.
Return value: true if sent successfully
device |
the end-user's device |
text |
the text to send |
isBinary |
true if text is hexadecimal codes for binary data |
Output text to the connection without modifying the text at all. If the text is binary, it is converted from hex codes to binary before transmission.
Return value: true if sent successfully
device |
the end-user's device) |
Append to the display reagion with the provided text for the user specified
Return value: true if sent successfully
request |
|
params |
text: str |
|
offset: int |
Default value: -1 |
Return str value:
text: str |
|
likeOtherText: str |
Return str value:
text: str |
Return bool value:
text: str |
Return str value:
device |
|
question |
|
prefillAnswer |
|
queryType |
|
cbapp |
|
cbtag |
|
cbdata |
|
style |
device |
|
question |
|
choices |
|
cbtag |
|
cbdata |
|
defaultValue |
device |
|
question |
|
origText |
|
cbtag |
|
cbdata |
|
style |
|
saveButtonLabel |
device |
|
question |
|
cbtag |
|
cbdata |
|
defaultValue |
|
style |
device |
|
formName |
|
formDefaults |
|
cbtag |
|
cbdata |
device |
|
appname |
|
appparams |
device |
|
query |
|
cbtag |
|
cbdata |
|
fileclass |
device |
|
menuname |
|
menuoption |
|
action |
device |
|
keystroke |
|
action |
device |
|
region |
|
action |
device |
|
region |
|
otherapp |
error check
device |
|
region |
|
action |
device |
|
cmd |
|
cmdparams |
request |
|
params |
url: str |
Converts a string to a string usable inside HTML code.
The returned pointer should be free()ed by the calling routine.
Return str value:
url: str |
Operations performed:
change % to %25
change = to nothing
change + to %3b
change space to %20
change # to %23
Return str value:
device |
|
iid |
|
errmsg |
|
action |
|
cbdata |
device |
|
filename |
|
filetype |
|
filecontent |
|
xid |
|
category |
image_id |
|
filename |
|
filetype |
|
filecontent |
|
category |
image_id |
image_id |
|
filecontent |
image_id |
|
category |
image_id |
|
name |
image_id |
|
type |
table |
|
id |
request |
|
params |
device |
|
xid |
|
text |
device |
|
text |
device |
|
cmd |
device |
|
key |
device |
device |
|
direction |
|
x |
|
y |
|
action |
|
cbdata |
device |
|
action |
|
cbdata |
device |
|
fileclass |
|
filetype |
|
imagelibid |
|
xid |
device |
device |
|
value |
device |
|
appparams |
device |
device |
request |
|
params |
name |
|
mode |
|
cbtag |
|
cbdata |
ioId |
|
c |
|
ioChannel |
ioId |
|
text |
|
ioChannel |
ioId |
|
data |
|
ioChannel |
ioId |
|
offset |
|
ioChannel |
ioId |
|
exclusive |
|
wait |
|
ioChannel |
ioId |
|
exclusive |
|
wait |
|
ioChannel |
ioId |
|
ioChannel |
node |
|
ioChannel |
dirResourceId |
|
ioChannel |
node |
|
size |
node |
|
change |
|
size |
maepath |
maepathandfilename |
|
statbuf |
request |
|
params |
|
channel |
objType |
the class of the object to cache |
size: int |
the maximum size allowable for the cache Default value: 0 |
Constructor.
Destructor
newKey: int |
|
newOne |
Add a record to the cache. It must be valid().
Return int value:
key |
Remove a record from the cache
Return bool value:
pos: int |
Remove a record from the cache
Return bool value:
searchKey |
|
fetchIfMissing: bool |
Default value: True |
Locate the cache position (-1 if not found)
Note: Pull into cache if fetchIfNotFound is True
Note: key must be a positive (non-zero) number
Return int value:
searchKey: int |
Check if key exists in list
Return bool value:
key |
Get pointer to data for the key. Check if result is valid().
Note: key must be a positive (non-zero) number
pos: int |
position in cache, from 0+ |
This method allows the class instance to be indexed, e.g. HelloCache[2] to get the second element (not key==2)
Return value: the instance at position
Return the size of the cache when using the len() function
This class abstracts database protocols and allows an app to use this interface to perform database table queries and changes.
This class connects to dbbroker, which actually performs the database manipulation. Note that dbbroker can be configured to connect to a variety of databases; this gets rid of app responsibility for database connection and syntax; an app can simply use the database.
It is safe (and convenient) to create an instance of this class for each table your program uses.
If you have an existing database table and you want to create a class interface to it, consider using genmae like this:
genmae db2h tablename > classname.h
genmae py classname.h > classname.py
Likewise, if you create .h file with the core class variables, you can use genmae to create the SQL code to setup the table, like this:
genmae h2sql classname.h > tablename.sql
Note that database manipulation commands will block program execution until a response from dbbroker is received.
FieldType |
Default value: Enum('FieldType', 'FieldInt', 'FieldTime', 'FieldEnum', 'FieldLogical', 'FieldString', 'FieldFloat', 'FieldDate', 'FieldBinary') |
OK |
DB operation was successful (no error) Default value: 0 |
INVALID_NAME |
DB operation failed - invalid name given Default value: -1 |
OPEN |
DB operation failed - cannot open table Default value: -2 |
INVALID_TYPE |
DB operation failed - invalid field type Default value: -3 |
INVALID_FIELD |
DB operation failed - invalid field name Default value: -4 |
INVALID_REC |
DB operation failed - invalid record id Default value: -5 |
INVALID_ENUM |
DB operation failed - invalid enum Default value: -6 |
INVALID_PARAM |
DB operation failed - invalid parameter Default value: -7 |
LOCKED |
DB operation failed - record locked Default value: -8 |
NOT_SUPPORTED |
DB operation failed - operation not supported Default value: -9 |
FAILED |
DB operation failed - (non-specific) Default value: -10 |
REC_NOT_FOUND |
DB operation failed - record not found Default value: -11 |
ALREADY_EXISTS |
DB operation failed - record already exists Default value: -12 |
INVALID_SCHEMA |
DB operation failed - invalid schema Default value: -13 |
COMM_ERROR |
DB operation failed - communications error Default value: -14 |
CORRUPT_REPLY |
DB operation failed - reply was corrupt (cannot parse) Default value: -15 |
INVALID_CONN |
DB operation failed - invalid connection Default value: -16 |
INVALID_EXPR |
DB operation failed - invalid expression Default value: -17 |
LINEPAYLOADMAX |
Maximum line length to send to dbbroker Default value: 10000 - 100 |
PAYLOADMAX |
Default value: 10000 |
tableName: str |
Default value: |
Constructor to initialize our data structure. This does not yet setup the connection to dbbroker.
Determine status of our connection to database - is it valid?
Return int value: True if connected to db
Get the status of the last request
Return int value: the status of the last request (see codes at top of Datastore.py)
Determine if the status of the last operator was successful.
Return bool value: True if last operation successful, False otherwise.
Determine if the database connection is established and ready.
Return bool value: True if db connection ready
Return human readable status of last request.
Return str value: msg corresponding to last DB request
name: str |
fieldtype |
Return str value:
rcToGetMsgFor: int |
the return code number to look up Default value: 1 |
Get the status message of the specified return code.
Return str value: the text of the error message
tableName: str |
the name of the table to use as the current table. If not successful, check status() for the code or statusMsg() for human readable description. |
Set the currently active table by opening it.
Return int value: the status code of the operation.
tableName: str |
the name of the table to use as the current table. If not successful, check status() for the code or statusMsg() for human readable description. |
Identifical to open(). Set the currently active table by opening it.
Return int value: the status code of the operation.
Check to make sure the database connection is working.
Return bool value: True if db responding to our requests
Pack the database (remove deleted records), if the database supports this.
Otherwise, it is ignored.
Return bool value: True upon success, False upon failure (see statusMsg())
specifiedTable: str |
Signal to close this database table.
@param table name of the table to close; if none, then last table used
Return bool value: True upon success, False upon failure (see statusMsg())
Get the list of defined tables.
Return value: the list of tables in the database
fieldName: str |
name of field for operation |
type |
type of field (string, int, float) |
size: int |
(optional) size of field in bytes |
table: str |
name of table for operation Default value: |
isIndex: bool |
True if this field is an index for the table Default value: False |
Obsolete. Add a field to the named database table.
Return 0 value: field id of new field
fieldName: str |
name of the field for which to get the fieldid |
table: str |
name of table for operation Default value: |
Query field id from field name for the named table.
Return int value: nonzero on success, 0 on failure
fieldName: str |
id of the enum field |
enumName: str |
name/identifier for enum |
enumId: int |
(optional) integer value to use for enum |
table: str |
name of table for operation Default value: |
Obsolete. Add field enumeration to the nanmed table.
Return int value: new enum value
fieldName: str |
id of the enum field |
table: str |
name of table for operation Default value: |
Query a field type (string, float, etc) for the provided field name in the provided table.
Return value: the field type
data |
any data to pre-populate the record |
recno: int |
(optional) id for the record Default value: 0 |
table: str |
name of table for operation Default value: |
Add/Append a new record to the table provided, populated with the data provided.
Return value: new record number added
recno |
number of the record to delete |
table: str |
name of table for operation Default value: |
Delete a record in the named table.
Return bool value: transaction status (see statusMsg())
recno |
number of the record to lock |
table: str |
name of table for operation Default value: |
Lock a record in the named table; prevent other applications from modifying this record until it is unlocked.
Return bool value: transaction status (see statusMsg())
recno |
number of the record to unlock |
table: str |
name of table for operation Default value: |
Unlock a record in the named table, allowing other applications to now modify it.
Return bool value: transaction status (see statusMsg())
recno |
number of the record containing the field |
fieldName: str |
name of the field to clear |
table: str |
name of table for operation Default value: |
clear/empty the value for the field with this field name
Return bool value: transaction status (see statusMsg())
recno |
number of the record in which to set the value |
fieldName: str |
|
value |
the value to set |
table: str |
name of table for operation Default value: |
change a string value identified by field ID
@param field name of the field in which to set the value
Return bool value: transaction status (see statusMsg())
recno |
number of the record in which to set the value |
newValues |
|
table: str |
name of table for operation Default value: |
change several field values at once
@param newValue key/value pairs for new field/value changes
Return bool value: transaction status (see statusMsg())
recno |
number of the record containing the value |
fieldName: str |
name of the field to get |
table: str |
name of table for operation Default value: |
get an int field value identified by field name
Return int value: the int value or -1 if unsuccessful
recno |
number of the record containing the value |
fieldName: str |
name of the field to get |
table: str |
name of table for operation Default value: |
get a string field value identified by field name
Return str value: the string value or zero length string if unsuccessful
recno |
number of the record containing the value |
fieldName: str |
name of the field to get |
table: str |
name of table for operation Default value: |
get a float field value identified by field name
Return float value: the float value or ??? if unsuccessful
recno |
number of the record containing the value |
fieldName: str |
name of the field to get |
table: str |
name of table for operation Default value: |
get an enum value identified by field name
Return str value: the enum value or zero length string if unsuccessful
recno |
number of the record containing the value |
fields |
Default value: [] |
table: str |
name of table for operation Default value: |
get an int field value identified by field name
@param fieldName name of the field to get
Return value: key/value pairs of field/value values from record. Error if empty, check status()/statusMsg().
recno |
number of the record containing the value |
fieldName: str |
name of the field to get |
table: str |
name of table for operation Default value: |
get an enum value as an int identified by field name
Return int value: the enum value or zero length string if unsuccessful
fieldName: str |
name of field to search |
value: str |
enum value to search for |
sortby: str |
Default value: |
table: str |
name of table for operation Default value: |
simple query for enum value by field name
Return list value: list of record numbers matching criteria
fieldName: str |
Name of field to search, paired with the value; alternatively fieldName can be an XMLData object with key/value pairs to search for (if so, value is ignored) |
value: str |
string value to search for Default value: |
sortby: str |
Default value: |
table: str |
name of table for operation Default value: |
simple query for string value by field name
Return list value: list of record numbers matching criteria
criteria |
|
ANDed: bool |
Default value: True |
sortby: str |
Default value: |
table: str |
name of table for operation Default value: |
compound query for a field value
@param list list of field key/value pairs to be searched for
Return list value: list of record numbers matching criteria
expression: str |
using field names, comparison operators, and logic operators, specify which records match the query |
fields: list |
a list of fields to return Default value: 'Id' |
sortby: str |
field name to use to sort the results start with + (default) for ascending sort, - for descending sort Default value: |
table: str |
name of table for operation Default value: |
Using an expression, query records and return the requested fields, sorted if specified.
@param results - (output) a list of records and their fields that matched
Return bool value: True upon success
sortby: str |
Default value: |
table: str |
Default value: |
query for all records in the named (or current) table
Return list value: recList with results which will be empty if unsuccessful
table: str |
the name of the table to query for fields Default value: |
query for all field names and types
Return value: XMLData which will be empty if unsuccessful. Otherwise key is field name, value is field type.
table: str |
the name of the table to query for fields
Default value: |
query for all field names and types
Connect to database server.
In actuality, this only checks to make sure we're connected to the MAE daemon, commhub.
Return bool value: True on success; False on failure
cmd: str |
|
params |
Default value: None |
Send a command for dbbroker that has no parameters. And wait for the reply.
Return bool value: True on success; False on failure
params |
Send data to commhub for DB operation
Return bool value: True if sent; False if failed
Wait for a dbbroker response from commhub.
Return bool value: True if reply received; False if not
text: str |
the text to encode |
commhub wants a comment to have new \n characters, so encode them
text: str |
the text to unencode |
commhub didn't let dbbroker send any \n characters, so unencode them
Super class: dict
This class behaves a lot like the dict class, but with more control over the value types.
Note that all keys are strings.
The HashArray data type is a key-value container.
It is typeless, but a specific type can be asserted (e.g. setBool()) or retrieved (e.g. getBool(), getInt(), etc). It is up the the application to store/retrieve by type consistently.
This data type is very convenient for messaging. Calling the toString() method converts the HashArray into a string. Using the fromString() method or constructor converts it back.
value: str |
Default value: |
separator: str |
Default value: '\n' |
Constructor
other |
Set the properties of the other HashArray into this HashArray, replacing any previous values
Return the number of key-value pairs.
Return int value: # keys in hash array
Determine if there are no key-value pairs in the hash array.
Return bool value: True if there are no key-value pairs, False if there's at least one
key: str |
name of the key to set |
value |
value to set to key |
Assign a value into the dict
key: str |
name of the key to set |
value: bool |
value to set to key |
Assign a boolean value to a key.
key: str |
name of the key to unset |
Remove a key/value pair from the dict
key: str |
name of the key to unset |
Get a string value from the dict key
Return str value:
key: str |
name of the key to unset |
Get a integer value from the dict key
Return int value:
key: str |
name of the key to unset |
Get a floating point value from the dict key
Return float value:
key: str |
name of the key to unset |
Get a double precision floating point value from the dict key. Same as getFloat().
Return float value:
key: str |
name of the key to unset |
Get a boolean value from the dict key
Return bool value:
separator: str |
text that separates each key/value pair. Default value: '\n' |
Serialize the HashArray into a string.
text: str |
a text string to examine |
Examine the text string provided and determine if it's a HashArray or not.
Return bool value: True if text string is a serialized HashArray, False otherwise
text: str |
the text string to decode |
separatorCharacter: str |
the text that separated key/value pairs Default value: '\n' |
Take a text string that was generated by toString() and restore the data inside HashArray.
Return bool value: True if text could be fully decoded.
This class holds a reference to and then ultimately delivers the binary content of an image in the Image Library (the ImageLib table). This class holds the image id, name, category, image type, height and width of the image.
id |
name: str |
|
category: str |
data |
data |
forDB: bool |
id |
Return bool value:
Return str value:
data: str |
Return bool value:
Return int value:
id |
Return str value:
id |
|
height: int |
|
width: int |
Return bool value:
id |
Return str value:
name: str |
|
category: str |
This class represents images within the MAE system.
Images may be drawn by the app or pulled from ImageLib database table.
Drawn images draw into a coordinate system with the size (height, width) and origin specified by the application. For example, to create an image with a coordinate system that is 5 units wide and 4 units tall with the origin(0,0) in the center, you specify setSize(5, 4) and setOrigin(-2.5,-2). How large the image is when it is displayed depends upon the unit size. If you'd like your 5 unit wide image to be 50 pixes wide, then specify setSize(5, 4, 10).
To display an image to the user, see the UserDevice class.
Use this class to communicate with imager, which renders them appropriately for the user.
This data structure abstracts a vector image. The API is used to describe the image. It is not rendered into JPG, PNG, SVG, or other specific image technology until it is ready to be rendered to the end-user. Rendering is performed by the imager daemon.
The API could be richer, but the API must be able to render to each of the ultimate image types.
The Image class may refer to an existing image file in a specific format via ImageLib class, which specifies where to retrieve the image and the image's size.
setSize(double newWidth, double newHeight, int newUnitSize)
Set the canvas dimensions and specify how many pixes per unit. For example, a 4.0x5.0 image where unit size is 10 would create a 40x50 pixel image.
setOrigin(double newOriginX, double newOriginY)
Specify how many units over the origin should be located if (0,0) is the lower left
setWindow(double minX, double minY, double maxX, double maxY, int newUnitSize)
Specify the width and origin implicitly by specifying the window into the view. Use this instead of setSize() setOrigin()
drawBox([[#Point]] corner1, Point corner2, string color, bool fill, string link)
Draw a rectangle with the corners specified. Default color is black. The box may be an outline or solid/fiilled.
An optional link (e.g. URL) may be provided if resulting image supports linking.
drawLine([[#Point]] p1, Point p2, string color, string link)
Draw a line from p1 to p2 of the color specified.
An optional link (e.g. URL) may be provided if resulting image supports linking.
drawCircle([[#Point]] center, double radius, string color, bool fill, string link)
Draw a full circle with the specified center and radius. The default color is black. The circle may be an outline or solid/fiilled.
An optional link (e.g. URL) may be provided if resulting image supports linking.
drawText([[#Point]] start, string text, string color, string link)
Draw text into the image with the lower left corner of the text at the start point.
bool drawArc([[#Point]] center, double startang, double endang, double radius, string color, bool fill)
drawPolygon([[#Point]]List p, string color, bool fill, string link)
Given a series of points, draw the enclosed polygon. The default color is black. The polygon may be an outline or solid/fiilled.
An optional link (e.g. URL) may be provided if resulting image supports linking.
drawPolyline([[#Point]]List p, string color, string link)
Given a series of points, the the line that connects them from start to end. The default color is black.
An optional link (e.g. URL) may be provided if resulting image supports linking.
group_id: int |
this is an application-specific number to differentiate this image name from others; it is used to help create a unique image name for the user's display device Default value: 0 |
imageName: str |
this is the application-specific name given to the image Default value: |
module: str |
this is the application-specific category for the image, such as the application's name Default value: |
Construct an empty image.
Query if the current image is valid.
Return bool value: True if valid; False if invalid
Super class: MAE
This class builds on top of the MAE class. It ensures MAE knows that your MAE task is an app and supports it appropriately. An app is a persistent program servicing user requests via UI.
programName: str |
the name of the task as registered inside MAE |
appchannels: str |
a comma separated list of message channels used. Default is one channel using the program's name. Default value: |
Declare your app MAE instance of this task.