Edi | Database structure. |
EdiField | EDI Record field structure. |
EdiGrid | Grid structure. |
EdiRec | Database record structure. |
EdiService | Edi service control structure. |
EspAbbrev | Abbreviated ESP Controls. |
EspControl | There are two groups of ESP Control APIs. |
EspParse | ESP page parser structure. |
EspReq | ESP request. |
EspRoute | EspRoute extended route configuration. |
EspSession | ESP session state object. |
void | addHeader(cchar *key, cchar *fmt, ...) |
Add a header to the transmission using a format string. | |
void | alert(cchar *text, cchar *options) |
Display a popup alert message in the client's browser when the web page is displayed. | |
void | anchor(cchar *text, cchar *uri, cchar *options) |
Render an HTML anchor link. | |
void | button(cchar *text, cchar *value, cchar *options) |
Render an HTML button to use inside a form. | |
void | buttonLink(cchar *text, cchar *uri, cchar *options) |
Render an HTML button to use outside a form. | |
void | chart(EdiGrid *grid, cchar *options) |
Render a graphic chart. | |
void | checkbox(cchar *field, cchar *checkedValue, cchar *options) |
Render an input checkbox. | |
EdiRec* | createRec(cchar *tableName, MprHash *data) |
Create a record and initialize field values. | |
void | createSession() |
Create a session state object. | |
void | destroySession() |
Destroy a session state object. | |
void | division(cchar *body, cchar *options) |
Render an HTML division. | |
void | dontAutoFinalize() |
Don't auto-finalize this request. | |
void | dropdown(cchar *field, cchar *choices, cchar *options) |
Render a dropdown selection list. | |
EdiRec* | eReadRecByKey(cchar *tableName, cchar *key) |
Read a record identified by the key value. | |
int | edRemoveColumn(Edi *edi, cchar *tableName, cchar *columnName) |
Remove a column from a table. | |
int | ediAddColumn(Edi *edi, cchar *tableName, cchar *columnName, int type, int flags) |
Add a column to a table. | |
int | ediAddIndex(Edi *edi, cchar *tableName, cchar *columnName, cchar *indexName) |
Add an index to a table. | |
void | ediAddProvider(struct EdiProvider *provider) |
Add a database provider. | |
int | ediAddTable(Edi *edi, cchar *tableName) |
Add a table to a database. | |
int | ediAddValidation(Edi *edi, cchar *name, cchar *tableName, cchar *columnName, cvoid *data) |
Add a validation. | |
int | ediChangeColumn(Edi *edi, cchar *tableName, cchar *columnName, int type, int flags) |
Change a column schema definition. | |
void | ediClose(Edi *edi) |
Close a database. | |
EdiGrid* | ediCreateBareGrid(Edi *edi, cchar *tableName, int nrows) |
Create a bare grid. | |
EdiRec* | ediCreateBareRec(Edi *edi, cchar *tableName, int nfields) |
Create a bare record. | |
EdiRec* | ediCreateRec(Edi *edi, cchar *tableName) |
Create a record. | |
EdiService* | ediCreateService() |
Create the EDI service. | |
void | ediDefineValidation(cchar *name, EdiValidationProc vfn) |
Define a field validation procedure. | |
int | ediDelete(Edi *edi, cchar *path) |
Delete the database at the given path. | |
int | ediDeleteRow(Edi *edi, cchar *tableName, cchar *key) |
Delete a row in a database table. | |
cchar* | ediFormatField(cchar *fmt, EdiField value) |
Format a field value. | |
int | ediGetColumnSchema(Edi *edi, cchar *tableName, cchar *columnName, int *type, int *flags, int *cid) |
Get the column schema. | |
MprList* | ediGetColumns(Edi *edi, cchar *tableName) |
Get a list of column names. | |
cchar* | ediGetField(EdiRec *rec, cchar *fieldName) |
Get a record field. | |
cchar* | ediGetFieldFmt(cchar *fmt, EdiRec *rec, cchar *fieldName) |
Get and format a record field value. | |
EdiField | ediGetFieldSchema(EdiRec *rec, cchar *fieldName) |
Get the record field schema. | |
int | ediGetFieldType(EdiRec *rec, cchar *fieldName) |
Get the data type of a record field. | |
MprList* | ediGetGridColumns(EdiGrid *grid) |
Get a list of grid column names. | |
MprList* | ediGetRecErrors(EdiRec *rec) |
Get record validation errors. | |
int | ediGetTableSchema(Edi *edi, cchar *tableName, int *numRows, int *numCols) |
Get table schema information. | |
MprList* | ediGetTables(Edi *edi) |
Get a list of database tables. | |
char* | ediGetTypeString(int type) |
Convert an EDI type to a string. | |
int | ediLoad(Edi *edi, cchar *path) |
MOB - remove this API Load the database file. | |
int | ediLookupField(Edi *edi, cchar *tableName, cchar *fieldName) |
Lookup a field by name. | |
EdiGrid* | ediMakeGrid(cchar *content) |
Make a grid. | |
MprHash* | ediMakeHash(cchar *fmt, ...) |
Make a hash container of property values. | |
EdiRec* | ediMakeRec(cchar *content) |
Make a record. | |
void | ediManageEdiRec(EdiRec *rec, int flags) |
Manage an EdiRec instance for garbage collection. | |
Edi* | ediOpen(cchar *source, cchar *provider, int flags) |
Open a database. | |
int | ediParseTypeString(cchar *type) |
Parse an EDI type string. | |
EdiGrid* | ediQuery(Edi *edi, cchar *cmd) |
Run a query. | |
cchar* | ediReadField(Edi *edi, cchar *fmt, cchar *tableName, cchar *key, cchar *fieldName, cchar *defaultValue) |
Read a field from the database and format the result. | |
EdiRec* | ediReadOneWhere(Edi *edi, cchar *tableName, cchar *fieldName, cchar *operation, cchar *value) |
Read one record. | |
EdiField | ediReadRawField(Edi *edi, cchar *tableName, cchar *key, cchar *fieldName) |
Read a field from the database. | |
EdiRec* | ediReadRec(Edi *edi, cchar *tableName, cchar *key) |
Read a record. | |
EdiGrid* | ediReadTable(Edi *edi, cchar *tableName) |
Read a table. | |
EdiGrid* | ediReadWhere(Edi *edi, cchar *tableName, cchar *fieldName, cchar *operation, cchar *value) |
Read matching records. | |
int | ediRemoveIndex(Edi *edi, cchar *tableName, cchar *indexName) |
Remove a table index. | |
int | ediRemoveTable(Edi *edi, cchar *tableName) |
Remove a table from the database. | |
int | ediRenameColumn(Edi *edi, cchar *tableName, cchar *columnName, cchar *newColumnName) |
Rename a column. | |
int | ediRenameTable(Edi *edi, cchar *tableName, cchar *newTableName) |
Rename a table. | |
int | ediSave(Edi *edi) |
Save in-memory database contents to disk. | |
EdiRec* | ediSetField(EdiRec *rec, cchar *fieldName, cchar *value) |
Set a record field without writing to the database. | |
EdiRec* | ediSetFields(EdiRec *rec, MprHash *data) |
Set record fields without writing to the database. | |
int | ediUpdateField(Edi *edi, cchar *tableName, cchar *key, cchar *fieldName, cchar *value) |
Write a value to a database table field. | |
int | ediUpdateRec(Edi *edi, EdiRec *rec) |
Write a record to the database. | |
bool | ediValidateRec(EdiRec *rec) |
Validate a record. | |
void | endform() |
Signify the end of an HTML form. | |
void | espAddHeader(HttpConn *conn, cchar *key, cchar *fmt, ...) |
Add a header to the transmission using a format string. | |
void | espAddHeaderString(HttpConn *conn, cchar *key, cchar *value) |
Add a header to the transmission. | |
void | espAlert(HttpConn *conn, cchar *text, cchar *options) |
Display a popup alert message in the client's browser when the web page is displayed. | |
EspSession* | espAllocSession(HttpConn *conn, cchar *id, MprTime lifespan) |
Allocate a new session state object. | |
void | espAnchor(HttpConn *conn, cchar *text, cchar *uri, cchar *options) |
Render an HTML anchor link. | |
void | espAppendHeader(HttpConn *conn, cchar *key, cchar *fmt, ...) |
Append a transmission header. | |
void | espAppendHeaderString(HttpConn *conn, cchar *key, cchar *value) |
Append a transmission header string. | |
void | espAutoFinalize(HttpConn *conn) |
Auto-finalize transmission of the http request. | |
char* | espBuildScript(HttpRoute *route, cchar *page, cchar *path, cchar *cacheName, cchar *layout, char **err) |
Convert an ESP web page into compilable C code. | |
void | espButton(HttpConn *conn, cchar *text, cchar *value, cchar *options) |
Render an HTML button to use inside a form. | |
void | espButtonLink(HttpConn *conn, cchar *text, cchar *uri, cchar *options) |
Render an HTML button to use outside a form. | |
int | espCache(HttpRoute *route, cchar *uri, int lifesecs, int flags) |
Add caching for response content. | |
void | espChart(HttpConn *conn, EdiGrid *grid, cchar *options) |
Render a graphic chart. | |
bool | espCheckSecurityToken(HttpConn *conn) |
Check a security token. | |
void | espCheckbox(HttpConn *conn, cchar *name, cchar *checkedValue, cchar *options) |
Render an input checkbox. | |
bool | espCompile(HttpConn *conn, cchar *source, cchar *module, cchar *cacheName, int isView) |
Compile a view or controller. | |
EdiRec* | espCreateRec(HttpConn *conn, cchar *tableName, MprHash *data) |
Create a record and initialize field values. | |
EspSession* | espCreateSession(HttpConn *conn) |
Create a session object. | |
void | espDefineAction(HttpRoute *route, cchar *targetKey, void *actionProc) |
Define an action. | |
void | espDefineBase(HttpRoute *route, EspProc baseProc) |
Define a base function to invoke for all controller actions. | |
void | espDefineView(HttpRoute *route, cchar *path, void *viewProc) |
Define a view. | |
void | espDestroySession(EspSession *sp) |
Destroy a session state object. | |
void | espDivision(HttpConn *conn, cchar *body, cchar *options) |
Render an HTML division. | |
void | espDropdown(HttpConn *conn, cchar *field, cchar *choices, cchar *options) |
Render a dropdown selection list. | |
void | espEndform(HttpConn *conn) |
Signify the end of an HTML form. | |
char* | espExpandCommand(cchar *command, cchar *source, cchar *module) |
Expand a compile or link command template. | |
void | espFinalize(HttpConn *conn) |
Finalize transmission of the http request. | |
void | espFlash(HttpConn *conn, cchar *kinds, cchar *options) |
Render flash messages. | |
void | espFlush(HttpConn *conn) |
Flush transmit data. | |
void | espForm(HttpConn *conn, EdiRec *record, cchar *options) |
Render an HTML form. | |
MprList* | espGetColumns(HttpConn *conn, EdiRec *rec) |
Get a list of column names. | |
HttpConn* | espGetConn() |
Get the current request connection. | |
MprOff | espGetContentLength(HttpConn *conn) |
Get the receive body content length. | |
cchar* | espGetContentType(HttpConn *conn) |
Get the receive body content type. | |
cchar* | espGetCookies(HttpConn *conn) |
Get the request cookies. | |
Edi* | espGetDatabase(HttpConn *conn) |
Get the current database instance. | |
cchar* | espGetDir(HttpConn *conn) |
Get the default document root directory for the request route. | |
EspRoute* | espGetEspRoute(HttpConn *conn) |
Get the current extended route information. | |
cchar* | espGetFlashMessage(HttpConn *conn, cchar *type) |
Get a flash message. | |
EdiGrid* | espGetGrid(HttpConn *conn) |
Get the current database grid. | |
cchar* | espGetHeader(HttpConn *conn, cchar *key) |
Get an rx http header. | |
MprHash* | espGetHeaderHash(HttpConn *conn) |
Get the hash table of rx Http headers. | |
char* | espGetHeaders(HttpConn *conn) |
Get all the request http headers. | |
int | espGetIntParam(HttpConn *conn, cchar *var, int defaultValue) |
Get a request pararmeter as an integer. | |
cchar* | espGetMethod(HttpConn *conn) |
Get the HTTP method. | |
cchar* | espGetParam(HttpConn *conn, cchar *var, cchar *defaultValue) |
Get a request parameter. | |
MprHash* | espGetParams(HttpConn *conn) |
Get the request parameter hash table. | |
cchar* | espGetQueryString(HttpConn *conn) |
Get the request query string. | |
char* | espGetReferrer(HttpConn *conn) |
Get the referring URI. | |
Edi* | espGetRouteDatabase(HttpRoute *route) |
Get the default database defined on a route. | |
cchar* | espGetSecurityToken(HttpConn *conn) |
Get a unique security token. | |
EspSession* | espGetSession(HttpConn *conn, int create) |
Get a session state object. | |
char* | espGetSessionID(HttpConn *conn) |
Get the session ID. | |
MprHash* | espGetSessionObj(HttpConn *conn, cchar *key) |
Get an object from the session state store. | |
cchar* | espGetSessionVar(HttpConn *conn, cchar *name, cchar *defaultValue) |
Get a session state variable. | |
int | espGetStatus(HttpConn *conn) |
Get the response status. | |
char* | espGetStatusMessage(HttpConn *conn) |
Get the Http response status message. | |
char* | espGetTop(HttpConn *conn) |
Get a relative URI to the top of the application. | |
MprHash* | espGetUploads(HttpConn *conn) |
Get the uploaded files. | |
cchar* | espGetUri(HttpConn *conn) |
Get the request URI string. | |
bool | espHasGrid(HttpConn *conn) |
Test if a current grid has been defined. | |
bool | espHasRec(HttpConn *conn) |
Test if a current record has been defined and save to the database. | |
void | espIcon(HttpConn *conn, cchar *uri, cchar *options) |
Render an HTML icon. | |
void | espImage(HttpConn *conn, cchar *uri, cchar *options) |
Render an HTML image. | |
void | espInput(HttpConn *conn, cchar *field, cchar *options) |
Render an input field as part of a form. | |
bool | espIsEof(HttpConn *conn) |
Test if the receive input stream is at end-of-file. | |
bool | espIsFinalized(HttpConn *conn) |
Test if a http request is finalized. | |
bool | espIsSecure(HttpConn *conn) |
Test if the connection is using SSL and is secure. | |
void | espLabel(HttpConn *conn, cchar *text, cchar *options) |
Render a text label field. | |
void | espMail(HttpConn *conn, cchar *name, cchar *address, cchar *options) |
Render a mail link. | |
EdiGrid* | espMakeGrid(cchar *content) |
Make a grid. | |
MprHash* | espMakeHash(cchar *fmt, ...) |
Make a hash table container of property values. | |
EdiRec* | espMakeRec(cchar *content) |
Make a record. | |
bool | espMatchParam(HttpConn *conn, cchar *var, cchar *value) |
Match a request parameter with an expected value. | |
void | espProgress(HttpConn *conn, cchar *progress, cchar *options) |
Emit a progress bar. | |
void | espRadio(HttpConn *conn, cchar *field, void *choices, cchar *options) |
Render a radio button. | |
EdiGrid* | espReadAllRecs(HttpConn *conn, cchar *tableName) |
Read all the records in table from the database. | |
EdiRec* | espReadRec(HttpConn *conn, cchar *tableName) |
Read the identified record. | |
EdiRec* | espReadRecWhere(HttpConn *conn, cchar *tableName, cchar *fieldName, cchar *operation, cchar *value) |
Read one record. | |
EdiGrid* | espReadRecsWhere(HttpConn *conn, cchar *tableName, cchar *fieldName, cchar *operation, cchar *value) |
Read matching records. | |
ssize | espReceive(HttpConn *conn, char *buf, ssize size) |
Read receive body content. | |
void | espRedirect(HttpConn *conn, int status, cchar *target) |
Redirect the client. | |
void | espRedirectBack(HttpConn *conn) |
Redirect the client back to the referrer. | |
void | espRefresh(HttpConn *conn, cchar *on, cchar *off, cchar *options) |
Control the refresh of web page dynamic elements. | |
int | espRemoveHeader(HttpConn *conn, cchar *key) |
Remove a header from the transmission. | |
bool | espRemoveRec(HttpConn *conn, cchar *tableName, cchar *key) |
Remove a record from a database table. | |
ssize | espRender(HttpConn *conn, cchar *fmt, ...) |
Render a formatted string. | |
ssize | espRenderBlock(HttpConn *conn, cchar *buf, ssize size) |
Render a block of data to the client. | |
ssize | espRenderCached(HttpConn *conn) |
Render cached content. | |
ssize | espRenderError(HttpConn *conn, int status, cchar *fmt, ...) |
Render an error message back to the client and finalize the request. | |
ssize | espRenderFile(HttpConn *conn, cchar *path) |
Render the contents of a file back to the client. | |
ssize | espRenderParam(HttpConn *conn, cchar *name) |
Render the value of a request parameter to the client. | |
ssize | espRenderSafeString(HttpConn *conn, cchar *s) |
Render a safe string of data to the client. | |
ssize | espRenderString(HttpConn *conn, cchar *s) |
Render a string of data to the client. | |
void | espRenderView(HttpConn *conn, cchar *name) |
Render a view template to the client. | |
void | espScript(HttpConn *conn, cchar *uri, cchar *options) |
Render a script link. | |
void | espSecurityToken(HttpConn *conn) |
Generate a security token. | |
bool | espSetAutoFinalizing(HttpConn *conn, bool on) |
Enable auto-finalizing for this request. | |
void | espSetConn(HttpConn *conn) |
Set the current request connection. | |
void | espSetContentLength(HttpConn *conn, MprOff length) |
Define a content length header in the transmission. | |
void | espSetContentType(HttpConn *conn, cchar *mimeType) |
Set the transmission (response) content mime type. | |
void | espSetCookie(HttpConn *conn, cchar *name, cchar *value, cchar *path, cchar *domain, MprTime lifespan, bool isSecure) |
Set a cookie in the transmission. | |
EdiRec* | espSetField(EdiRec *rec, cchar *fieldName, cchar *value) |
Update a record field without writing to the database. | |
EdiRec* | espSetFields(EdiRec *rec, MprHash *data) |
Update record fields without writing to the database. | |
void | espSetFlash(HttpConn *conn, cchar *kind, cchar *fmt, ...) |
Send a flash message. | |
void | espSetFlashv(HttpConn *conn, cchar *kind, cchar *fmt, va_list args) |
Send a flash message. | |
EdiGrid* | espSetGrid(HttpConn *conn, EdiGrid *grid) |
Set the current database grid. | |
void | espSetHeader(HttpConn *conn, cchar *key, cchar *fmt, ...) |
Set a transmission header. | |
void | espSetHeaderString(HttpConn *conn, cchar *key, cchar *value) |
Set a simple key/value transmission header. | |
void | espSetIntParam(HttpConn *conn, cchar *var, int value) |
Set an integer request parameter value. | |
void | espSetParam(HttpConn *conn, cchar *var, cchar *value) |
Set a request parameter value. | |
EdiRec* | espSetRec(HttpConn *conn, EdiRec *rec) |
Set the current database record. | |
int | espSetSessionObj(HttpConn *conn, cchar *key, MprHash *value) |
Set an object into the session state store. | |
int | espSetSessionVar(HttpConn *conn, cchar *name, cchar *value) |
Set a session variable. | |
void | espSetStatus(HttpConn *conn, int status) |
Set a Http response status. | |
void | espShowRequest(HttpConn *conn) |
Show request details. | |
void | espStylesheet(HttpConn *conn, cchar *uri, cchar *options) |
Render a stylesheet link. | |
void | espTable(HttpConn *conn, EdiGrid *grid, cchar *options) |
Render a table. | |
void | espTabs(HttpConn *conn, EdiRec *rec, cchar *options) |
Render a tab control. | |
void | espText(HttpConn *conn, cchar *field, cchar *options) |
Render a text input field as part of a form. | |
void | espTree(HttpConn *conn, EdiGrid *grid, cchar *options) |
Render a tree control. | |
void | espUpdateCache(HttpConn *conn, cchar *uri, cchar *data, int lifesecs) |
Update the cached content for a request. | |
bool | espUpdateField(HttpConn *conn, cchar *tableName, cchar *key, cchar *fieldName, cchar *value) |
Write a value to a database table field. | |
bool | espUpdateFields(HttpConn *conn, cchar *tableName, MprHash *data) |
Write field values to a database row. | |
bool | espUpdateRec(HttpConn *conn, EdiRec *rec) |
Write a record to the database. | |
cchar* | espUri(HttpConn *conn, cchar *target) |
Create a URI. | |
void | finalize() |
Finalize the response. | |
void | flash(cchar *kinds, cchar *options) |
Render flash notices. | |
void | flush() |
Flush transmit data. | |
void | form(void *record, cchar *options) |
Render an HTML form. | |
MprList* | getColumns(EdiRec *rec) |
Get a list of column names. | |
HttpConn* | getConn() |
Get the connection object. | |
MprOff | getContentLength() |
Get the receive body content length. | |
cchar* | getContentType() |
Get the receive body content type. | |
cchar* | getCookies() |
Get the request cookies. | |
Edi* | getDatabase() |
Get the current database instance. | |
cchar* | getDir() |
Get the default document root directory for the request route. | |
EspRoute* | getEspRoute() |
Get the extended route EspRoute structure. | |
cchar* | getField(cchar *field) |
Get a field from the current database record. | |
EdiGrid* | getGrid() |
Get the current database grid. | |
cchar* | getHeader(cchar *key) |
Get an rx http header. | |
cchar* | getMethod() |
Get the HTTP method. | |
cchar* | getQuery() |
Get the HTTP URI query string. | |
EdiRec* | getRec() |
Get the current database record. | |
cchar* | getReferrer() |
Get the referring URI. | |
cchar* | getSessionVar(cchar *name) |
Get a session state variable. | |
cchar* | getTop() |
Get a relative URI to the top of the application. | |
MprHash* | getUploads() |
Get the uploaded files. | |
cchar* | getUri() |
Get the request URI string. | |
bool | hasGrid() |
Test if a current grid has been defined. | |
bool | hasRec() |
Test if a current record has been defined and save to the database. | |
void | icon(cchar *uri, cchar *options) |
Render an HTML icon. | |
void | image(cchar *uri, cchar *options) |
Render an HTML image. | |
void | inform(cchar *fmt, ...) |
Set an informational flash notification message. | |
void | input(cchar *field, cchar *options) |
Render an input field as part of a form. | |
bool | isEof() |
Test if the receive input stream is at end-of-file. | |
bool | isFinalized() |
Test if a http request is finalized. | |
bool | isSecure() |
Test if the connection is using SSL and is secure. | |
void | label(cchar *text, cchar *options) |
Render a text label field. | |
void | mail(cchar *name, cchar *address, cchar *options) |
Render a mail link. | |
EdiGrid* | makeGrid(cchar *content) |
Make a grid. | |
MprHash* | makeHash(cchar *fmt, ...) |
Make a hash table container of property values. | |
EdiRec* | makeRec(cchar *content) |
Make a record. | |
void | notice(cchar *fmt, ...) |
Set an error flash notification message. | |
cchar* | param(cchar *name) |
Get a request parameter. | |
MprHash* | params() |
Get the request parameter hash table. | |
void | progress(cchar *progress, cchar *options) |
Emit a progress bar. | |
void | radio(cchar *field, void *choices, cchar *options) |
Render a radio button. | |
EdiRec* | readRec(cchar *tableName) |
Read the identified record. | |
EdiRec* | readRecByKey(cchar *tableName, cchar *key) |
Read a record identified by key value. | |
EdiRec* | readRecWhere(cchar *tableName, cchar *fieldName, cchar *operation, cchar *value) |
Read one record. | |
EdiGrid* | readRecsWhere(cchar *tableName, cchar *fieldName, cchar *operation, cchar *value) |
Read matching records. | |
EdiGrid* | readTable(cchar *tableName) |
Read all the records in table from the database. | |
ssize | receive(char *buf, ssize size) |
Read receive body content. | |
void | redirect(cchar *target) |
Redirect the client. | |
void | redirectBack() |
Redirect the client back to the referrer. | |
void | refresh(cchar *on, cchar *off, cchar *options) |
Control the refresh of web page dynamic elements. | |
bool | removeRec(cchar *tableName, cchar *key) |
Remove a record from a database table. | |
ssize | render(cchar *fmt, ...) |
Render a formatted string. | |
ssize | renderCached() |
Render cached content. | |
void | renderError(int status, cchar *fmt, ...) |
Render an error message back to the client and finalize the request. | |
ssize | renderFile(cchar *path) |
Render a file back to the client. | |
ssize | renderSafe(cchar *fmt, ...) |
Render a formatted string after HTML escaping. | |
void | renderView(cchar *view) |
Render a view template to the client. | |
void | script(cchar *uri, cchar *options) |
Render a script link. | |
void | securityToken() |
Generate a security token. | |
void | setConn(HttpConn *conn) |
Set the current request connection. | |
void | setContentType(cchar *mimeType) |
Set the transmission (response) content mime type. | |
void | setCookie(cchar *name, cchar *value, cchar *path, cchar *domain, MprTime lifespan, bool isSecure) |
Define a cookie header to send with the response. | |
EdiRec* | setField(EdiRec *rec, cchar *fieldName, cchar *value) |
Update a record field without writing to the database. | |
EdiRec* | setFields(EdiRec *rec, MprHash *data) |
Update record fields without writing to the database. | |
void | setFlash(cchar *kind, cchar *fmt, ...) |
Set a flash notification message. | |
EdiGrid* | setGrid(EdiGrid *grid) |
Set the current database grid. | |
void | setHeader(cchar *key, cchar *fmt, ...) |
Set a transmission header. | |
void | setParam(cchar *name, cchar *value) |
Set a request parameter value. | |
EdiRec* | setRec(EdiRec *rec) |
Set the current database record. | |
void | setSessionVar(cchar *name, cchar *value) |
Set a session state variable. | |
void | setStatus(int status) |
Set a Http response status. | |
void | setTimeout(void *proc, MprTime timeout, void *data) |
Create a timeout event. | |
void | showRequest() |
Show request details. | |
void | stylesheet(cchar *uri, cchar *options) |
Render a stylesheet link. | |
void | table(EdiGrid *grid, cchar *options) |
Render a table. | |
void | tabs(EdiRec *rec, cchar *options) |
Render a tab control. | |
void | text(cchar *field, cchar *options) |
Render a text input field as part of a form. | |
void | tree(EdiGrid *grid, cchar *options) |
Render a tree control. | |
void | updateCache(cchar *uri, cchar *data, int lifesecs) |
Update the cached content for a request. | |
bool | updateField(cchar *tableName, cchar *key, cchar *fieldName, cchar *value) |
Write a value to a database table field. | |
bool | updateFields(cchar *tableName, MprHash *data) |
Write field values to a database row. | |
bool | updateRec(EdiRec *rec) |
Write a record to the database. | |
cchar* | uri(cchar *target) |
Create a URI. |
EdiProvider | Database provider interface. |
EdiValidation | Validation structure. |
EdiValidationProc | Field validation callback procedure. |
Esp | Top level ESP structure. |
EspAction | ESP Action. |
EspProc | Procedure callback. |
EspViewProc | View procedure callback. |
#define | EDI_AUTO_INC 0x1 |
Field flag — Automatic increments on new row. | |
#define | EDI_AUTO_SAVE 0x2 |
Auto-save database if modified in memory. | |
#define | EDI_CREATE 0x1 |
Create database if not present. | |
#define | EDI_INDEX 0x4 |
Field flag — Column is indexed. | |
#define | EDI_KEY 0x2 |
Field flag — Column is the key. | |
#define | EDI_LITERAL 0x8 |
Literal schema in ediOpen source parameter. | |
#define | EDI_NO_SAVE 0x4 |
Prevent saving to disk. | |
#define | EDI_SUPPRESS_SAVE 0x10 |
Temporarily suppress auto-save. | |
#define | EDI_TYPE_BINARY 1 |
Arbitrary binary data. | |
#define | EDI_TYPE_BOOL 2 |
Boolean true|false value. | |
#define | EDI_TYPE_DATE 3 |
Date type. | |
#define | EDI_TYPE_FLOAT 4 |
Floating point number. | |
#define | EDI_TYPE_INT 5 |
Integer number. | |
#define | EDI_TYPE_STRING 6 |
String. | |
#define | EDI_TYPE_TEXT 7 |
Multi-line text. | |
#define | ESP_LIFESPAN (3600 * MPR_TICKS_PER_SEC) |
Default generated content cache lifespan. | |
#define | ESP_LISTEN "4000" |
Default listening endpoint for the esp program. | |
#define | ESP_TOK_INCR 1024 |
Growth increment for ESP tokens. | |
#define | ESP_UNLOAD_TIMEOUT (10) |
Very short timeout for reloading. |
Database structure.
int | flags | Database flags. | |
struct EdiProvider * | provider | Database provider. |
Add a column to a table.
edi | Database handle. |
tableName | Database table name. |
columnName | Database column name. |
type | Column data type. Set to one of EDI_TYPE_BINARY, EDI_TYPE_BOOL, EDI_TYPE_DATE EDI_TYPE_FLOAT, EDI_TYPE_INT, EDI_TYPE_STRING, EDI_TYPE_TEXT. |
flags | Control column attributes. Set to a set of: EDI_AUTO_INC for auto incrementing columns, EDI_KEY if the column is the key column and/or EDI_INDEX to create an index on the column. |
Add an index to a table.
edi | Database handle. |
tableName | Database table name. |
columnName | Database column name. |
indexName | Ignored. Set to null. |
Add a table to a database.
edi | Database handle. |
tableName | Database table name. |
Add a validation.
edi | Database handle. |
name | Validation name. Select from:
|
tableName | Database table name. |
columnName | Database column name. |
data | Argument data for the validator. For example: the "format" validator requires a regular expression. |
Change a column schema definition.
edi | Database handle. |
tableName | Database table name. |
columnName | Database column name. |
type | Column data type. Set to one of EDI_TYPE_BINARY, EDI_TYPE_BOOL, EDI_TYPE_DATE EDI_TYPE_FLOAT, EDI_TYPE_INT, EDI_TYPE_STRING, EDI_TYPE_TEXT. |
flags | Control column attributes. Set to a set of: EDI_AUTO_INC for auto incrementing columns, EDI_KEY if the column is the key column and/or EDI_INDEX to create an index on the column. |
Close a database.
edi | Database handle. |
Create a bare grid.
edi | Database handle. |
tableName | Database table name. |
nrows | Number of rows to reserve in the grid. |
Create a bare record.
edi | Database handle. |
tableName | Database table name. |
nfields | Number of fields to reserve in the record. |
Create a record.
edi | Database handle. |
tableName | Database table name. |
Delete the database at the given path.
edi | Database handle. This is required to identify the database provider. The database should be closed before deleting. |
path | Database path name. |
Delete a row in a database table.
edi | Database handle. |
tableName | Database table name. |
key | Row key column value to delete. |
Format a field value.
fmt | Printf style format string. |
value | Field value. |
Get a list of column names.
edi | Database handle. |
tableName | Database table name. |
Get the column schema.
edi | Database handle. |
tableName | Database table name. |
columnName | Database column name. |
type | Output parameter to receive the column data type. Will be set to one of: EDI_TYPE_BINARY, EDI_TYPE_BOOL, EDI_TYPE_DATE, EDI_TYPE_FLOAT, EDI_TYPE_INT, EDI_TYPE_STRING, EDI_TYPE_TEXT. Set to null if this data is not required. |
flags | Output parameter to receive the column control flags. Will be set to one or more of: EDI_AUTO_INC, EDI_KEY and/or EDI_INDEX Set to null if this data is not required. |
cid | Output parameter to receive the ordinal column index in the database table. Set to null if this data is not required. |
Get a record field.
rec | Database record. |
fieldName | Field in the record to extract. |
Get and format a record field value.
fmt | Record field value. |
rec | Record to examine. |
fieldName | Record field to examine. |
Get the record field schema.
rec | Database record. |
fieldName | Field in the record to extract. |
Get the data type of a record field.
rec | Record to examine. |
fieldName | Field to examine. |
Get a list of grid column names.
grid | Database grid. |
Get record validation errors.
rec | Database record. |
Get a list of database tables.
edi | Database handle. |
Get table schema information.
edi | Database handle. |
tableName | Database table name. |
numRows | Output parameter to receive the number of rows in the table Set to null if this data is not required. |
numCols | Output parameter to receive the number of columns in the table Set to null if this data is not required. |
Convert an EDI type to a string.
type | Column data type. Set to one of EDI_TYPE_BINARY, EDI_TYPE_BOOL, EDI_TYPE_DATE EDI_TYPE_FLOAT, EDI_TYPE_INT, EDI_TYPE_STRING, EDI_TYPE_TEXT. |
MOB - remove this API Load the database file.
edi | Database handle. |
path | Database path name. |
Lookup a field by name.
edi | Database handle. |
tableName | Database table name. |
fieldName | Database column name. |
Make a grid.
content | JSON format content string. The content should be an array of objects where each object is a set of property names and values. |
Make a hash container of property values.
fmt | Printf style format string. |
... | arguments. |
Make a record.
content | JSON format content string. The content should be a set of property names and values. |
Manage an EdiRec instance for garbage collection.
rec | Record instance. |
flags | GC management flag. |
Open a database.
source | Database path name. If using the "mdb" provider with the EDI_LITERAL flag, then the source argument can be set to a literal JSON database content string. |
provider | Database provider. Set to "mdb" for the Memory Database or "sqlite" for the SQLite provider. |
flags | Set to:
|
Parse an EDI type string.
type | Type string set to one of: "binary", "bool", "date", "float", "int", "string" or "text". |
Run a query.
edi | Database handle. |
cmd | Query command to execute. |
Read a field from the database and format the result.
edi | Database handle. |
fmt | Printf style format string to use in formatting the result. |
tableName | Database table name. |
key | Row key column value to read. |
fieldName | Column name to read. |
defaultValue | Default value to return if the field is null or empty. |
Read one record.
edi | Database handle. |
tableName | Database table name. |
fieldName | Database field name to evaluate. |
operation | Comparision operation. Set to "==", "!=", "<", ">", "<=" or ">=". |
value | Data value to compare with the field values. |
Read a field from the database.
edi | Database handle. |
tableName | Database table name. |
key | Row key column value to read. |
fieldName | Column name to read. |
Read a record.
edi | Database handle. |
tableName | Database table name. |
key | Key value of the record to read. |
Read a table.
edi | Database handle. |
tableName | Database table name. |
Read matching records.
edi | Database handle. |
tableName | Database table name. |
fieldName | Database field name to evaluate. |
operation | Comparision operation. Set to "==", "!=", "<", ">", "<=" or ">=". |
value | Data value to compare with the field values. |
Remove a table index.
edi | Database handle. |
tableName | Database table name. |
indexName | Ignored. Set to null. This call will remove the table index. |
Remove a table from the database.
edi | Database handle. |
tableName | Database table name. |
Rename a column.
edi | Database handle. |
tableName | Database table name. |
columnName | Database column name. |
newColumnName | New column name. |
Rename a table.
edi | Database handle. |
tableName | Database table name. |
newTableName | New database table name. |
Save in-memory database contents to disk.
edi | Database handle. |
Set a record field without writing to the database.
rec | Record to update. |
fieldName | Record field name to update. |
value | Value to update. |
Set record fields without writing to the database.
rec | Record to update. |
data | Hash of field names and values to use for the update. |
Write a value to a database table field.
edi | Database handle. |
tableName | Database table name. |
key | Key value for the table row to update. |
fieldName | Column name to update. |
value | Value to write to the database field. |
Write a record to the database.
edi | Database handle. |
rec | Record to write to the database. |
Validate a record.
rec | Record to validate. |
Remove a column from a table.
edi | Database handle. |
tableName | Database table name. |
columnName | Database column name. |
EDI Record field structure.
int | flags | Field flags. Flag mask set to EDI_AUTO_INC, EDI_KEY and/or EDI_INDEX. | |
cchar * | name | Field name. Sourced from the database column name. | |
int | type | Field data type. Set to one of EDI_TYPE_BINARY, EDI_TYPE_BOOL, EDI_TYPE_DATE EDI_TYPE_FLOAT, EDI_TYPE_INT, EDI_TYPE_STRING, EDI_TYPE_TEXT. | |
int | valid | Field validity. Set to true if valid. | |
cchar * | value | Field data value. |
Grid structure.
struct Edi * | edi | Database handle. | |
int | nrecords | Number of records in grid. | |
EdiRec * | records[MPR_FLEX] | Grid records. | |
cchar * | tableName | Base table name for grid. |
Database record structure.
Edi service control structure.
Add a database provider.
Create the EDI service.
Define a field validation procedure.
name | Validation name. |
vfn | Validation callback to invoke when validating field data. |
Abbreviated ESP Controls.
Add a header to the transmission using a format string.
key | Http response header key. |
fmt | Printf style formatted string to use as the header key value. |
... | Arguments for fmt. |
Display a popup alert message in the client's browser when the web page is displayed.
text | Alert text to display. |
options | Extra options. See $EspControl for a list of the standard options.
|
Render an HTML anchor link.
text | Anchor text to display for the link. |
uri | URI link for the anchor. |
options | Extra options. See $EspControl for a list of the standard options. |
Render an HTML button to use inside a form.
text | Button text to display. This text is also used as the name for the form input from this control. |
value | Form input value to submit when the button is clicked. |
options | Extra options. See $EspControl for a list of the standard options. |
Render an HTML button to use outside a form.
text | Button text to display. |
uri | URI to invoke when the button is clicked. |
options | Extra options. See $EspControl for a list of the standard options. |
Render a graphic chart.
grid | Data to display. The data is a grid of data. Use ediCreateGrid or ediReadGrid. |
options | Extra options. See $EspControl for a list of the standard options.
|
Render an input checkbox.
field | Name for the input checkbox. This defines the HTML element name and provides the source of the initial value for the checkbox. The field should be a property of the $espForm current record. If this call is used without a form control record, the actual data value should be supplied via the options.value property. |
checkedValue | Value for which the checkbox will be checked. |
options | Extra options. See $EspControl for a list of the standard options. |
Create a record and initialize field values.
tableName | Database table name. |
data | Hash of field values. |
Create a session state object.
Render an HTML division.
body | HTML body to render. |
options | Extra options. See $EspControl for a list of the standard options. |
Don't auto-finalize this request.
Render a dropdown selection list.
field | Record field name to provide the default value for the list. The field should be a property of the form current record. The field name is used to create the HTML input control name. If this call is used without a form control record, the actual data value should be supplied via the options.value property. |
choices | Choices to select from. This is a JSON style set of properties. For example: espDropdown(conn, "priority", "{ low: 0, med: 1, high: 2 }", NULL). |
options | Extra options. See $EspControl for a list of the standard options. |
Finalize the response.
Render flash notices.
kinds | Space separated list of flash messages types. Typical types are: "error", "inform", "warning". |
options | Extra options. See $EspControl for a list of the standard options.
|
Render an HTML form.
record | Record to use by default to supply form field names and values. |
options | Extra options. See $EspControl for a list of the standard options.
|
Get the connection object.
Get the receive body content length.
Get the receive body content type.
Get the request cookies.
Get the current database instance.
Get the default document root directory for the request route.
Get an rx http header.
key | Name of the header to retrieve. This should be a lower case header name. For example: "Connection". |
Get the HTTP URI query string.
Get the referring URI.
Get a session state variable.
name | Variable name to get. |
Get a relative URI to the top of the application.
Get the uploaded files.
Get the request URI string.
Render an HTML icon.
uri | URI reference for the icon resource. |
options | Extra options. See $EspControl for a list of the standard options. |
Render an HTML image.
uri | URI reference for the image resource. |
options | Extra options. See $EspControl for a list of the standard options. |
Set an informational flash notification message.
fmt | Printf style message format. |
Render an input field as part of a form.
This is a smart input control that will call the appropriate input control based on the database record field data typefield | Name for the input field. This defines the HTML element name and provides the source of the initial value to display. The field should be a property of the form current record. If this call is used without a form control record, the actual data value should be supplied via the options.value property. |
options | Extra options. See $EspControl for a list of the standard options. |
Test if the receive input stream is at end-of-file.
Test if a http request is finalized.
Test if the connection is using SSL and is secure.
Render a text label field.
This renders an output-only text field. Use espText() for input fieldstext | Label text to display. |
options | Extra options. See $EspControl for a list of the standard options. |
Render a mail link.
name | Recipient name to display. |
address | Mail recipient address link. |
options | Extra options. See $EspControl for a list of the standard options. |
Make a grid.
content | JSON format content string. The content should be an array of objects where each object is a set of property names and values. |
Make a hash table container of property values.
fmt | Printf style format string. |
... | arguments. |
Make a record.
content | JSON format content string. The content should be a set of property names and values. |
Set an error flash notification message.
fmt | Printf style message format. |
Get a request parameter.
name | Name of the request parameter to retrieve. |
Get the request parameter hash table.
Emit a progress bar.
progress | Progress percentage (0-100). |
options | Extra options. See $EspControl for a list of the standard options. |
Render a radio button.
This creates a radio button suitable for use within an input formfield | Name for the input radio button. This defines the HTML element name and provides the source of the initial value to display. The field should be a property of the form current record. If this call is used without a form control record, the actual data value should be supplied via the options.value property. |
choices | Choices to select from. This is a JSON style set of properties. For example: espRadio(conn, "priority", "{ low: 0, med: 1, high: 2, }", NULL). |
options | Extra options. See $EspControl for a list of the standard options. |
Read a record identified by key value.
tableName | Database table name. |
key | Key value of the record to read. |
Read one record.
tableName | Database table name. |
fieldName | Database field name to evaluate. |
operation | Comparison operation. Set to "==", "!=", "<", ">", "<=" or ">=". |
value | Data value to compare with the field values. |
Read receive body content.
buf | Buffer to accept content data. |
size | Size of the buffer. |
Redirect the client.
target | New target uri for the client. |
Redirect the client back to the referrer.
Control the refresh of web page dynamic elements.
on | URI to invoke when turning "on" refresh. |
off | URI to invoke when turning "off" refresh. |
options | Extra options. See $EspControl for a list of the standard options.
|
Render a formatted string.
fmt | Printf style formatted string. |
... | Arguments for fmt. |
Render cached content.
Render an error message back to the client and finalize the request.
The output is Html escaped for securitystatus | Http status code. |
fmt | Printf style message format. |
Render a file back to the client.
path | Filename of the file to send to the client. |
... | Arguments for fmt. |
Render a formatted string after HTML escaping.
fmt | Printf style formatted string. |
... | Arguments for fmt. |
Render a view template to the client.
view | view name. |
Render a script link.
uri | Script URI to load. Set to null to get a default set of scripts. See $httpLink for a list of possible URI formats. |
options | Extra options. See $EspControl for a list of the standard options. |
Generate a security token.
Set the current request connection.
conn | The HttpConn connection object to define. |
Set the transmission (response) content mime type.
mimeType | Mime type string. |
Define a cookie header to send with the response.
The Path, Domain, and Expires properties can be set to null for default valuesname | Cookie name. |
value | Cookie value. |
path | Uri path to which the cookie applies. |
domain | String Domain in which the cookie applies. Must have 2-3 "." and begin with a leading ".". For example: domain: .example.com Some browsers will accept cookies without the initial ".", but the spec: (RFC 2109) requires it. |
lifespan | Lifespan of the cookie. (MOB units?). |
isSecure | Boolean Set to "true" if the cookie only applies for SSL based connections. |
Update a record field without writing to the database.
rec | Record to update. |
fieldName | Record field name to update. |
value | Value to update. |
Update record fields without writing to the database.
rec | Record to update. |
data | Hash of field names and values to use for the update. |
Set a flash notification message.
kind | Kind of flash message. |
fmt | Printf style message format. |
Set a transmission header.
key | Http response header key. |
fmt | Printf style formatted string to use as the header key value. |
... | Arguments for fmt. |
Set a request parameter value.
name | Name of the request parameter to set. |
value | Value to set. |
Set a session state variable.
name | Variable name to set. |
value | Value to set. |
Set a Http response status.
status | Http status code. |
Create a timeout event.
proc | Function to invoke. |
timeout | Time in milliseconds to elapse before invoking the timeout. |
data | Argument to pass to proc. |
Show request details.
Render a stylesheet link.
uri | Stylesheet URI to load. Set to null to get a default set of stylesheets. See $httpLink for a list of possible URI formats. |
options | Extra options. See $EspControl for a list of the standard options. |
Render a table.
grid | Data to display. The data is a grid of data. Use ediCreateGrid or ediReadGrid. |
options | Extra options. See $EspControl for a list of the standard options. |
options | Optional extra options. See $View for a list of the standard options.
|
Render a tab control.
The tab control can manage a set of panes and will selectively show and hide or invoke the selected panes. If the "click" option is defined, the selected pane will be invoked via a foreground click. If the "remote" option is defined, the selected pane will be invoked via a background click. If the "toggle" option is defined the selected pane will be made visible and other panes will be hidden. If using show/hide tabs, define the initial visible pane to be of the class "-ejs-pane-visible" and define other panes to be "-ejs-pane-hidden". The control's client side code will toggle these classes to make panes visible or hiddenrec | Tab data for the control. Tab data is a single object where the tab text is the property key and the target to invoke is the property value. |
options | Optional extra options. See $View for a list of the standard options.
|
Render a text input field as part of a form.
field | Name for the input text field. This defines the HTML element name and provides the source of the initial value to display. The field should be a property of the form control record. It can be a simple property of the record or it can have multiple parts, such as: field.field.field. If this call is used without a form control record, the actual data value should be supplied via the options.value property. If the cols or rows option is defined, then a textarea HTML element will be used for multiline input. |
options | Optional extra options. See $View for a list of the standard options.
|
Render a tree control.
grid | Optional initial data for the control. The data option may be used with the refresh option to dynamically refresh the data. The tree data is typically an XML document. |
options | Optional extra options. See $View for a list of the standard options. |
Update the cached content for a request.
uri | Request URI to cache for. |
data | Data to cache. |
lifesecs | Time in seconds to cache the data. |
Write a value to a database table field.
tableName | Database table name. |
key | Key value for the table row to update. |
fieldName | Column name to update. |
value | Value to write to the database field. |
Write field values to a database row.
tableName | Database table name. |
data | Hash of field names and values to use for the update. |
Write a record to the database.
rec | Record to write to the database. |
Create a URI.
target | The URI target. The target parameter can be a URI string or JSON style set of options. The target will have any embedded "{tokens}" expanded by using token values from the request parameters. If the target has an absolute URI path, that path is used directly after tokenization. If the target begins with "~", that character will be replaced with the route prefix. This is a very convenient way to create application top-level relative links. If the target is a string that begins with "{AT}" it will be interpreted as a controller/action pair of the form "{AT}Controller/action". If the "controller/" portion is absent, the current controller is used. If the action component is missing, the "list" action is used. A bare "{AT}" refers to the "list" action of the current controller. If the target starts with "{" it is interpreted as being a JSON style set of options that describe the link. If the target is a relative URI path, it is appended to the current request URI path. If the target is a JSON style of options, it can specify the URI components: scheme, host, port, path, reference and query. If these component properties are supplied, these will be combined to create a URI. If the target specifies either a controller/action or a JSON set of options, The URI will be created according to the route URI template. The template may be explicitly specified via a "route" target property. Otherwise, if an "action" property is specified, the route of the same name will be used. If these don't result in a usable route, the "default" route will be used. These are the properties supported in a JSON style "{ ... }" target:
|
Display a popup alert message in the client's browser when the web page is displayed.
conn | Http connection object. |
text | Alert text to display. |
options | Extra options. See $EspControl for a list of the standard options.
|
Render an HTML anchor link.
conn | Http connection object. |
text | Anchor text to display for the link. |
uri | URI link for the anchor. |
options | Extra options. See $EspControl for a list of the standard options. |
Render an HTML button to use inside a form.
conn | Http connection object. |
text | Button text to display. This text is also used as the name for the form input from this control. |
value | Form input value to submit when the button is clicked. |
options | Extra options. See $EspControl for a list of the standard options. |
Render an HTML button to use outside a form.
conn | Http connection object. |
text | Button text to display. |
uri | URI to invoke when the button is clicked. |
options | Extra options. See $EspControl for a list of the standard options. |
Render a graphic chart.
conn | Http connection object. |
grid | Data to display. The data is a grid of data. Use ediCreateGrid or ediReadGrid. |
options | Extra options. See $EspControl for a list of the standard options.
|
Render an input checkbox.
conn | Http connection object. |
name | Name for the input checkbox. This defines the HTML element name, and provides the source of the initial value for the checkbox. The field should be a property of the $espForm current record. If this call is used without a form control record, the actual data value should be supplied via the options.value property. |
checkedValue | Value for which the checkbox will be checked. |
options | Extra options. See $EspControl for a list of the standard options. |
Render an HTML division.
conn | Http connection object. |
body | HTML body to render. |
options | Extra options. See $EspControl for a list of the standard options. |
Render a dropdown selection list.
conn | Http connection object. |
field | Record field name to provide the default value for the list. The field should be a property of the form current record. The field name is used to create the HTML input control name. If this call is used without a form control record, the actual data value should be supplied via the options.value property. |
choices | Choices to select from. This is a JSON style set of properties. For example: espDropdown(conn, "priority", "{ low: 0, med: 1, high: 2 }", NULL). |
options | Extra options. See $EspControl for a list of the standard options. |
Signify the end of an HTML form.
conn | Http connection object. |
Render flash messages.
conn | Http connection object. |
kinds | Space separated list of flash messages types. Typical types are: "error", "inform", "warning". |
options | Extra options. See $EspControl for a list of the standard options.
|
Render an HTML form.
conn | Http connection object. |
record | Record to use by default to supply form field names and values. |
options | Extra options. See $EspControl for a list of the standard options.
|
Render an HTML icon.
conn | Http connection object. |
uri | URI reference for the icon resource. |
options | Extra options. See $EspControl for a list of the standard options. |
Render an HTML image.
conn | Http connection object. |
uri | URI reference for the image resource. |
options | Extra options. See $EspControl for a list of the standard options. |
Render an input field as part of a form.
This is a smart input control that will call the appropriate input control based on the database record field data typeconn | Http connection object. |
field | Name for the input field. This defines the HTML element name and provides the source of the initial value to display. The field should be a property of the form current record. If this call is used without a form control record, the actual data value should be supplied via the options.value property. |
options | Extra options. See $EspControl for a list of the standard options. |
Render a text label field.
This renders an output-only text field. Use espText() for input fieldsconn | Http connection object. |
text | Label text to display. |
options | Extra options. See $EspControl for a list of the standard options. |
Render a mail link.
conn | Http connection object. |
name | Recipient name to display. |
address | Mail recipient address link. |
options | Extra options. See $EspControl for a list of the standard options. |
Emit a progress bar.
conn | Http connection object. |
progress | Progress percentage (0-100). |
options | Extra options. See $EspControl for a list of the standard options. |
Render a radio button.
This creates a radio button suitable for use within an input formconn | Http connection object. |
field | Name for the input radio button. This defines the HTML element name and provides the source of the initial value to display. The field should be a property of the form current record. If this call is used without a form control record, the actual data value should be supplied via the options.value property. |
choices | Choices to select from. This is a JSON style set of properties. For example: espRadio(conn, "priority", "{ low: 0, med: 1, high: 2, }", NULL). |
options | Extra options. See $EspControl for a list of the standard options. |
Control the refresh of web page dynamic elements.
conn | Http connection object. |
on | URI to invoke when turning "on" refresh. |
off | URI to invoke when turning "off" refresh. |
options | Extra options. See $EspControl for a list of the standard options.
|
Render a script link.
uri | Script URI to load. Set to null to get a default set of scripts. See $httpLink for a list of possible URI formats. |
conn | Http connection object. |
options | Extra options. See $EspControl for a list of the standard options. |
Generate a security token.
conn | Http connection object. |
Render a stylesheet link.
uri | Stylesheet URI to load. Set to null to get a default set of stylesheets. See $httpLink for a list of possible URI formats. |
conn | Http connection object. |
options | Extra options. See $EspControl for a list of the standard options. |
Render a table.
conn | Http connection object. |
grid | Data to display. The data is a grid of data. Use ediCreateGrid or ediReadGrid. |
options | Extra options. See $EspControl for a list of the standard options. |
options | Optional extra options. See $View for a list of the standard options.
|
Render a tab control.
The tab control can manage a set of panes and will selectively show and hide or invoke the selected panes. If the "click" option is defined, the selected pane will be invoked via a foreground click. If the "remote" option is defined, the selected pane will be invoked via a background click. If the "toggle" option is defined the selected pane will be made visible and other panes will be hidden. If using show/hide tabs, define the initial visible pane to be of the class "-ejs-pane-visible" and define other panes to be "-ejs-pane-hidden". The control's client side code will toggle these classes to make panes visible or hiddenconn | Http connection object. |
rec | Tab data for the control. Tab data is be be a single object where the tab text is the property key and the target to invoke is the property value. |
options | Optional extra options. See $View for a list of the standard options.
|
Render a text input field as part of a form.
conn | Http connection object. |
field | Name for the input text field. This defines the HTML element name and provides the source of the initial value to display. The field should be a property of the form control record. It can be a simple property of the record or it can have multiple parts, such as: field.field.field. If this call is used without a form control record, the actual data value should be supplied via the options.value property. If the cols or rows option is defined, then a textarea HTML element will be used for multiline input. |
options | Optional extra options. See $View for a list of the standard options.
|
Render a tree control.
conn | Http connection object. |
grid | Optional initial data for the control. The data option may be used with the refresh option to dynamically refresh the data. The tree data is typically an XML document. |
options | Optional extra options. See $View for a list of the standard options. |
ESP page parser structure.
char * | data | Input data to parse. | |
int | lineNumber | Line number for error reporting. | |
char * | next | Next character in input. | |
MprBuf * | token | Storage buffer for token. |
ESP request.
EspAction * | action | Action to invoke. | |
int | appLoaded | App module already probed. | |
int | autoFinalize | Request is or will be auto-finalized. | |
char * | cacheName | Base name of intermediate compiled file. | |
char * | commandLine | Command line for compile/link. | |
char * | controllerName | Controller name. | |
char * | controllerPath | Path to controller source. | |
char * | entry | Module entry point. | |
EspRoute * | eroute | Extended route info. | |
Esp * | esp | Convenient esp reference. | |
MprHash * | flash | New flash messages. | |
int | lastDomID | Last generated DOM ID. | |
MprHash * | lastFlash | Flash messages from the last request. | |
char * | module | Name of compiled module. | |
EdiRec * | record | Current data record. | |
HttpRoute * | route | Route reference. | |
EspSession * | session | Session data object. | |
int | sessionProbed | Already probed for session store. | |
char * | source | Name of ESP source. | |
char * | view | Path to view. |
Read a record identified by the key value.
tableName | Database table name. |
key | Key value of the record to read. |
Add a header to the transmission using a format string.
conn | HttpConn connection object. |
key | Http response header key. |
fmt | Printf style formatted string to use as the header key value. |
... | Arguments for fmt. |
Add a header to the transmission.
conn | HttpConn connection object. |
key | Http response header key. |
value | Value to set for the header. |
Append a transmission header.
conn | HttpConn connection object. |
key | Http response header key. |
fmt | Printf style formatted string to use as the header key value. |
... | Arguments for fmt. |
Append a transmission header string.
conn | HttpConn connection object. |
key | Http response header key. |
value | Value to set for the header. |
Auto-finalize transmission of the http request.
conn | HttpConn connection object. |
Check a security token.
conn | Http connection object. |
Create a record and initialize field values.
conn | Http connection object. |
tableName | Database table name. |
data | Hash of field values. |
Finalize transmission of the http request.
conn | HttpConn connection object. |
Flush transmit data.
conn | HttpConn connection object. |
Get a list of column names.
conn | HttpConn connection object. |
rec | Database record. If set to NULL, the current database record defined via $form() is used. |
Get the current request connection.
Get the receive body content length.
conn | HttpConn connection object. |
Get the receive body content type.
conn | HttpConn connection object. |
Get the request cookies.
conn | HttpConn connection object. |
Get the current database instance.
Get the default document root directory for the request route.
conn | HttpConn connection object. |
Get the current extended route information.
Get a flash message.
conn | HttpConn connection object. |
type | Type of flash message to retrieve. Possible types include: "error", "inform", "warning", "all". |
Get an rx http header.
conn | HttpConn connection object. |
key | Name of the header to retrieve. This should be a lower case header name. For example: "Connection". |
Get the hash table of rx Http headers.
conn | HttpConn connection object. |
Get all the request http headers.
conn | HttpConn connection object. |
Get a request pararmeter as an integer.
conn | HttpConn connection object. |
var | Name of the request parameter to retrieve. |
defaultValue | Default value to return if the variable is not defined. Can be null. |
Get the HTTP method.
Get a request parameter.
conn | HttpConn connection object. |
var | Name of the request parameter to retrieve. |
defaultValue | Default value to return if the variable is not defined. Can be null. |
Get the request parameter hash table.
conn | HttpConn connection object. |
Get the request query string.
conn | HttpConn connection object. |
Get the referring URI.
conn | HttpConn connection object. |
Get the default database defined on a route.
route | HttpRoute object. |
Get the response status.
conn | HttpConn connection object. |
Get the Http response status message.
conn | HttpConn connection object. |
Get a relative URI to the top of the application.
conn | HttpConn connection object. |
Get the uploaded files.
conn | HttpConn connection object. |
Get the request URI string.
Test if a current grid has been defined.
Test if a current record has been defined and save to the database.
Test if the receive input stream is at end-of-file.
conn | HttpConn connection object. |
Test if a http request is finalized.
conn | HttpConn connection object. |
Test if the connection is using SSL and is secure.
conn | HttpConn connection object. |
Make a grid.
content | JSON format content string. The content should be an array of objects where each object is a set of property names and values. |
Make a hash table container of property values.
fmt | Printf style format string. |
... | arguments. |
Make a record.
content | JSON format content string. The content should be a set of property names and values. |
Match a request parameter with an expected value.
conn | HttpConn connection object. |
var | Name of the request parameter. |
value | Expected value to match. |
Read all the records in table from the database.
conn | HttpConn connection object. |
tableName | Database table name. |
Read the identified record.
conn | HttpConn connection object. |
tableName | Database table name. |
Read matching records.
conn | HttpConn connection object. |
tableName | Database table name. |
fieldName | Database field name to evaluate. |
operation | Comparison operation. Set to "==", "!=", "<", ">", "<=" or ">=". |
value | Data value to compare with the field values. |
Read one record.
conn | HttpConn connection object. |
tableName | Database table name. |
fieldName | Database field name to evaluate. |
operation | Comparison operation. Set to "==", "!=", "<", ">", "<=" or ">=". |
value | Data value to compare with the field values. |
Read receive body content.
conn | HttpConn connection object. |
buf | Buffer to accept content data. |
size | Size of the buffer. |
Redirect the client.
conn | HttpConn connection object. |
status | Http status code to send with the response. |
target | New target uri for the client. |
Redirect the client back to the referrer.
conn | HttpConn connection object. |
Remove a header from the transmission.
conn | HttpConn connection object. |
key | Http response header key. |
Render a formatted string.
conn | HttpConn connection object. |
fmt | Printf style formatted string. |
... | Arguments for fmt. |
Render a block of data to the client.
conn | HttpConn connection object. |
buf | Buffer containing the write data. |
size | Size of the data in buf. |
Render cached content.
conn | HttpConn connection object. |
Render an error message back to the client and finalize the request.
The output is Html escaped for securityconn | HttpConn connection object. |
status | Http status code. |
fmt | Printf style message format. |
Render the contents of a file back to the client.
conn | HttpConn connection object. |
path | File path name. |
Render the value of a request parameter to the client.
conn | HttpConn connection object. |
name | Form variable name. |
Render a safe string of data to the client.
conn | HttpConn connection object. |
s | String containing the data to write. |
Render a string of data to the client.
conn | HttpConn connection object. |
s | String containing the data to write. |
Render a view template to the client.
conn | Http connection object. |
name | view name. |
Enable auto-finalizing for this request.
conn | HttpConn connection object. |
on | Set to "true" to enable auto-finalizing. |
Set the current request connection.
conn | The HttpConn connection object to define. |
Define a content length header in the transmission.
conn | HttpConn connection object. |
length | Numeric value for the content length header. |
Set the transmission (response) content mime type.
conn | HttpConn connection object. |
mimeType | Mime type string. |
Set a cookie in the transmission.
conn | HttpConn connection object. |
name | Cookie name. |
value | Cookie value. |
path | URI path to which the cookie applies. |
domain | String Domain in which the cookie applies. Must have 2-3 "." and begin with a leading ".". For example: domain: .example.com. Some browsers will accept cookies without the initial ".", but the spec: (RFC 2109) requires it. |
lifespan | Duration for the cookie to persist in msec. |
isSecure | Set to "true" if the cookie only applies for SSL based connections. |
Update a record field without writing to the database.
rec | Record to update. |
fieldName | Record field name to update. |
value | Value to update. |
Update record fields without writing to the database.
rec | Record to update. |
data | Hash of field names and values to use for the update. |
Send a flash message.
conn | Http connection object. |
kind | Kind of flash message. |
fmt | Printf style formatted string to use as the message. |
Send a flash message.
conn | Http connection object. |
kind | Kind of flash message. |
fmt | Printf style formatted string to use as the message. |
args | Varargs style list. |
Set the current database grid.
Set a transmission header.
conn | HttpConn connection object. |
key | Http response header key. |
fmt | Printf style formatted string to use as the header key value. |
... | Arguments for fmt. |
Set a simple key/value transmission header.
conn | HttpConn connection object. |
key | Http response header key. |
value | String value for the key. |
Set an integer request parameter value.
conn | HttpConn connection object. |
var | Name of the request parameter to set. |
value | Value to set. |
Set a request parameter value.
conn | HttpConn connection object. |
var | Name of the request parameter to set. |
value | Value to set. |
Set the current database record.
conn | HttpConn connection object. |
rec | Record object to define as the current record. |
Set a Http response status.
conn | HttpConn connection object. |
status | Http status code. |
Show request details.
conn | HttpConn connection object. |
Update the cached content for a request.
conn | HttpConn connection object. |
uri | Request URI to cache for. |
data | Data to cache. |
lifesecs | Time in seconds to cache the data. |
Write a value to a database table field.
conn | HttpConn connection object. |
tableName | Database table name. |
key | Key value for the table row to update. |
fieldName | Column name to update. |
value | Value to write to the database field. |
Write field values to a database row.
conn | HttpConn connection object. |
tableName | Database table name. |
data | Hash of field names and values to use for the update. |
Write a record to the database.
conn | HttpConn connection object. |
rec | Record to write to the database. |
Create a URI.
conn | HttpConn connection object. |
target | The URI target. The target parameter can be a URI string or JSON style set of options. The target will have any embedded "{tokens}" expanded by using token values from the request parameters. If the target has an absolute URI path, that path is used directly after tokenization. If the target begins with "~", that character will be replaced with the route prefix. This is a very convenient way to create application top-level relative links. If the target is a string that begins with "{AT}" it will be interpreted as a controller/action pair of the form "{AT}Controller/action". If the "controller/" portion is absent, the current controller is used. If the action component is missing, the "list" action is used. A bare "{AT}" refers to the "list" action of the current controller. If the target starts with "{" it is interpreted as being a JSON style set of options that describe the link. If the target is a relative URI path, it is appended to the current request URI path. If the target is a JSON style of options, it can specify the URI components: scheme, host, port, path, reference and query. If these component properties are supplied, these will be combined to create a URI. If the target specifies either a controller/action or a JSON set of options, The URI will be created according to the route URI template. The template may be explicitly specified via a "route" target property. Otherwise, if an "action" property is specified, the route of the same name will be used. If these don't result in a usable route, the "default" route will be used. These are the properties supported in a JSON style "{ ... }" target:
|
Get the HTTP method.
EspRoute extended route configuration.
char * | appModuleName | App module name when compiled flat. | |
char * | appModulePath | App module path when compiled flat. | |
char * | cacheDir | Directory for cached compiled controllers and views. | |
char * | compile | Compile template. | |
EspProc | controllerBase | Initialize base for a controller. | |
char * | controllersDir | Directory for controllers. | |
char * | dbDir | Directory for databases. | |
Edi * | edi | Default database for this route. | |
MprList * | env | Environment for compiler. | |
int | keepSource | Preserve generated source. | |
char * | layoutsDir | Directory for layouts. | |
MprTime | lifespan | Default cache lifespan. | |
char * | link | Link template. | |
HttpRoute * | route | Back link to the owning route. | |
char * | searchPath | Search path to use when locating compiler/linker. | |
int | showErrors | Send server errors back to client. | |
char * | staticDir | Directory for static web content. | |
int | update | Auto-update modified ESP source. | |
char * | viewsDir | Directory for views. |
Convert an ESP web page into compilable C code.
route | EspRoute object. |
page | ESP web page script. |
path | Pathname for the ESP web page. This is used to process include directives which are resolved relative to this path. |
cacheName | MD5 cache name. Not a full path. |
layout | Default layout page. |
err | Output parameter to hold any relevant error message. |
Add caching for response content.
route | HttpRoute object. |
uri | URI to cache. If the URI is set to "*" all URIs for that action are uniquely cached. If the request has POST data, the URI may include such post data in a sorted query format. E.g. {uri: /buy?item=scarf&quantity=1}. |
lifesecs | Lifespan of cache items in seconds. If not set to positive integer, the lifesecs will default to the route lifespan. |
flags | Cache control flags. Select ESP_CACHE_MANUAL to enable manual mode. In manual mode, cached content will not be automatically sent. Use $httpWriteCached in the request handler to write previously cached content. Select ESP_CACHE_CLIENT to enable client-side caching. In this mode a "Cache-Control" Http header will be sent to the client with the caching "max-age". WARNING: the client will not send any request for this URI until the max-age timeout has expired. Select HTTP_CACHE_RESET to first reset existing caching configuration for this route. Select HTTP_CACHE_COMBINED, HTTP_CACHE_ONLY or HTTP_CACHE_UNIQUE to define the server-side caching mode. Only one of these three mode flags should be specified. If the HTTP_CACHE_COMBINED flag is set, the request params (query, post data and route parameters) will be ignored and all request for a given URI path will cache to the same cache record. Select HTTP_CACHE_UNIQUE to uniquely cache requests with different request parameters. The URIs specified in $uris should not contain any request parameters. Select HTTP_CACHE_ONLY to cache only the exact URI with parameters specified in $uris. The parameters must be in sorted www-urlencoded format. For example: /example.esp?hobby=sailing&name=john. |
Compile a view or controller.
conn | Http connection object. |
source | ESP source file name. |
module | Output module file name. |
cacheName | MD5 cache name. Not a full path. |
isView | Set to "true" if the source is a view. |
Define an action.
route | Route object. |
targetKey | Target key used to select the action in a HttpRoute target. This is typically a URI prefix. |
actionProc | EspProc callback procedure to invoke when the action is requested. |
Define a base function to invoke for all controller actions.
route | Route object. |
baseProc | Function to call just prior to invoking a controller action. |
Define a view.
route | Http route object. |
path | Path to the ESP view source code. |
viewProc | EspViewPrococ callback procedure to invoke when the view is requested. |
Expand a compile or link command template.
command | Http connection object. |
source | ESP web page source pathname. |
module | Output module pathname. |
ESP session state object.
MprCache * | cache | Cache store reference. | |
char * | id | Session ID key. | |
MprTime | lifespan | Session inactivity timeout (msecs). |
Allocate a new session state object.
conn | Http connection object. |
id | Unique session state ID. |
lifespan | Session lifespan in ticks. |
Create a session object.
conn | Http connection object. |
Destroy a session state object.
sp | Session state object allocated with espAllocSession |
Get a session state object.
conn | Http connection object. |
create | Set to "true" to create a session state object if one does not already exist for this client. |
Get the session ID.
conn | Http connection object. |
Get an object from the session state store.
conn | Http connection object. |
key | Session state key. |
Get a session state variable.
conn | Http connection object. |
name | Variable name to get. |
defaultValue | If the variable does not exist, return the defaultValue. |
Set an object into the session state store.
conn | Http connection object. |
key | Session state key. |
value | Object to serialize. |
Set a session variable.
conn | Http connection object. |
name | Variable name to set. |
value | Variable value to use. |
Get the current database grid.
Get a unique security token.
conn | HttpConn connection object. |
Remove a record from a database table.
conn | HttpConn connection object. |
tableName | Database table name. |
key | Key value of the record to remove. |
Get a list of column names.
rec | Database record. If set to NULL, the current database record defined via $form() is used. |
Get a field from the current database record.
field | Field name to return. |
Get the current database grid.
Get the current database record.
Test if a current grid has been defined.
Test if a current record has been defined and save to the database.
Read the identified record.
tableName | Database table name. |
Read matching records.
tableName | Database table name. |
fieldName | Database field name to evaluate. |
operation | Comparison operation. Set to "==", "!=", "<", ">", "<=" or ">=". |
value | Data value to compare with the field values. |
Read all the records in table from the database.
tableName | Database table name. |
Remove a record from a database table.
tableName | Database table name. |
key | Key value of the record to remove. |
Set the current database grid.
Set the current database record.
Procedure callback.
Field validation callback procedure.
vp | Validation structure reference. |
rec | Record to validate. |
fieldName | Field name to validate. |
value | Field value to validate. |
View procedure callback.
conn | Http connection object. |
Database provider interface.
Validation structure.
cvoid * | data | Allocated data that must be marked for GC. | |
cvoid * | mdata | Non-GC (malloc) data. | |
cchar * | name | Validation name. | |
EdiValidationProc | vfn | Validation callback procedure. |
Top level ESP structure.
MprHash * | actions | Table of actions. | |
EdiService * | ediService | Database service. | |
MprHash * | internalOptions | Table of internal HTML control options. | |
int | inUse | Active ESP request counter. | |
MprThreadLocal * | local | Thread local data. | |
MprMutex * | mutex | Multithread lock. | |
MprCache * | sessionCache | Session state cache. | |
MprHash * | views | Table of views. |
ESP Action.
EspProc | actionProc | Action procedure to run to respond to the request. |