The APIs described in this section are the core of the Websydian Express 2E Developer, it is these APIs that gives the developer the means to interact with the Websydian Express framework and through that to send information to the user's browser and retrieve entered information from the browser.
The APIs are implemented as functions scoped under the file Websydian Express in the delivered 2E model and are imported into your own 2E model by using the YCPYMDLOBJ command.
Read more about the 2E model objects and the import process here.
You can also find basic information about each API in the narrative of the API function.
In the overview, the APIs are listed alphabetically. The following tables provides a functionality based overview of the APIs.
These are the base of the Websydian Express Developer, they include the APIs that are by far the most often used. Together with the Websydian Express runtime these APIs ensures that the developer can write values to the web page, retrieve entered values, transfer data from the function generating the page to the function handling events, and that the page can be sent to the browser.
These APIs are not strictly necessary. To a large degree they are just service functions that we during the development of examples and tutorial has found to be very nice to have. If you do not think they are sufficient or that they do not have the right behavior, you can for most of these APIs just develop your own functions (DateISO2Date7, Date2String, Date72DateISO, Numeric2String, String2Date, and String2Numeric).
These are APIs that all to some degree work on data from the Websydian Express database. The APIs provides the developer with the opportunity to extract information about sessions, users, authorization levels, folder lists, and sites. They also makes it possible for the developer to update the session and user tables used by Websydian Express.
Type: Data/Authorization - DEPRECATED
The API is deprecated.
Do not use this API.
The API will not be copied to your model in version 2.0 or later.
Type: Data/Authorization - DEPRECATED
The API is deprecated.
Do not use this API.
The API will not be copied to your model in version 2.0 or later.
Type: Data/Authorization - DEPRECATED
The API is deprecated.
Do not use this API.
The API will not be copied to your model in version 2.0 or later.
Type: Data/Custom Fields
Set the file position and retrieves a record restricted by the parameters W2E/CustomFieldSiteKey, W2E/CustomFieldEntity, W2E/CustomFieldName, W2E/CustomFieldValue and positioned by W2E/PosCustomFieldInstanc.
To retrieve Custom field values for the user entity, specify "USER" for the W2E/CustomFieldEntity field.
To retrieve Custom field values for the role entity, specify "ROLE" for the W2E/CustomFieldEntity field.
The function returns a field W2E/CustomFieldInstance, which contains the unique identification of a record in the entity specified by the inputfield CustomFieldEntity (If the entity is ROLE - the returned identification is the RoleSurrogate, if the entity is USER - the returned identification is the UserID).
Used together with CustomFldGetNextInstance to retrieve a list of records from a file (specified by W2E/CustomFieldEntity) that has the value specified by the parameter W2E/CustomFieldValue assigned to the custom field specified by the W2E/CustomFieldName parameter.
Type: Data/Custom Fields
Set the file position and retrieves a record restricted by the parameters W2E/CustomFieldEntity, W2E/CustomFieldInstance and positioned by W2E/PosCustomFieldName.
To retrieve Custom field values for the user entity, specify "USER" for the W2E/CustomFieldEntity field.
To retrieve Custom field values for the role entity, specify "ROLE" for the W2E/CustomFieldEntity field.
The inputfield W2E/CustomFieldInstance specifies the unique identification of the record, which the custom fields and their values should be retrieved for (If the entity is ROLE - the identification is the RoleSurrogate, if the entity is USER - the identification is the UserID).
Used together with CustomFldGetNextValue to retrieve a list of the custom fields defined for a record (specified by W2E/CustomFieldEntity and W2E/CustomFieldInstance) and the value assigned to each custom field. The custom fields are retrieved in custom field name order.
Type: Data/Custom Fields
Retrieves the next record from the list defined by CustomFldGetFirstInstance.
To retrieve Custom field values for the user entity, specify "USER" for the W2E/CustomFieldEntity field.
To retrieve Custom field values for the role entity, specify "ROLE" for the W2E/CustomFieldEntity field.
The function returns a field W2E/CustomFieldInstance, which contains the unique identification of a record in the entity specified by the inputfield CustomFieldEntity (If the entity is ROLE - the returned identification is the RoleSurrogate, if the entity is USER - the returned identification is the UserID).
Used together with CustomFldGetFirstInstance to retrieve a list of records from a file that has a specific value for a custom field.
CustomFldGetFirstInstance must always be called before calling CustomFldGetNextInstance.
Type: Data/Custom Fields
Retrieves the next record from the list defined by CustomFldGetFirstValue.
To retrieve Custom field values for the user entity, specify "USER" for the W2E/CustomFieldEntity field.
To retrieve Custom field values for the role entity, specify "ROLE" for the W2E/CustomFieldEntity field.
The inputfield W2E/CustomFieldInstance specifies the unique identification of the record, which the custom fields and their values should be retrieved for (If the entity is ROLE - the identification is the RoleSurrogate, if the entity is USER - the returned is the UserID).
Used together with CustomFldGetFirstValue to retrieve a list of the custom fields and their values defined for a record.
CustomFldGetFirstValue must always be called before calling CustomFldGetNextValue.
Type: Data/Custom Fields
Retrieves the value for a custom field for a specific record.
To retrieve Custom field values for the user entity, specify "USER" for the W2E/CustomFieldEntity field.
To retrieve Custom field values for the role entity, specify "ROLE" for the W2E/CustomFieldEntity field.
The inputfield W2E/CustomFieldInstance specifies the unique identification of the record, which the custom fields and their values should be retrieved for (If the entity is ROLE - the identification is the RoleSurrogate, if the entity is USER - the returned is the UserID).
Use this function when you need to know the information saved for a custom field.
In many cases, it is desirable to use this API to retrieve values for the current user. The identification of this user can be found using the API's GetSessionID and GetSessionData (using the output from GetSessionID as input) - the GetSessionData returns the outputfield W2E/UserID, which identifies the current user for the session. Map this field to W2E/CustomFieldInstance to get values for the current user.
Type: Data/Custom Fields
Sets the value for a custom field for a specific record.
To set Custom field values for the user entity, specify "USER" for the W2E/CustomFieldEntity field.
To set Custom field values for the role entity, specify "ROLE" for the W2E/CustomFieldEntity field.
The inputfield W2E/CustomFieldInstance specifies the unique identification of the record, which the custom fields and their values should be set for (If the entity is ROLE - the identification is the RoleSurrogate, if the entity is USER - the returned is the UserID).
Use this function when you need to change/set the value for a custom field.
In many cases, it is desirable to use this API to set values for the current user. The identification of this user can be found using the API's GetSessionID and GetSessionData (using the output from GetSessionID as input) - the GetSessionData returns the outputfield W2E/UserID, which identifies the current user for the session. Map this field to W2E/CustomFieldInstance to set values for the current user.
Type: Service
Converts a Date7 to an ISO date. If the date is invalid the return code is set to W2E/RC_INVALID_DATE and *loval is returned in DateISO.
Used when you need to convert a Date7 to a DateISO. E.g. before calling the API Date2String.
Type: Service
Converts an ISO date to a formatted string according to a format mask.
The DateMask parameter controls the format of the string according to the
following rules:
yyyy specifies the position of the year.
mm specifies the position of the month.
dd specifies the position of the day
All of these must be present for the mask to be valid.
Apart from yyyy mm dd, you can specify two separator
characters.
If you specify the Condition "Use dataareas" for the mask, the mask will be read from the dataarea WSYDDATMSK. (The value for this dataarea is defined during the installation of Websydian Express).
Used when a DateISO field should be shown on a webpage - either as an output
field or as an input field for an event.
If you need to show a Date7 field as a string, use the
Date72DateISO API before calling this API.
If you use the datemask from the dataarea, and you want to show this datemask to the user, you can retrieve it using the GetDateMask API.
Type: Service
Convert a DateISO to a Date7
Used when an ISO date has been returned by an API (e.g. String2Date) and the date need to be converted to a Date7 before being used to update the database.
Type: Data/Presentation
Deletes the specified property for the specified presentation.
In many cases you will want to delete a property for the current presentation. You can retrieve the identification of this presentation by calling the GetCurrentPresentation API.
Type: Data/Folder List
Retrieves information about the folder list specified by the parameter FolderListID.
Called if information about the folder list is needed by the application. The
FolderListID is a unique identification of a folder list, and is usually
obtained from the session or user data. (E.g. by calling the
SessionGet, UserGet,
UserGetFirst, or UserGetNext
APIs).
Type: Data/Folder List
Sets the file position and retrieves the first folder list that belongs to the site specified by the LimSiteKey parameter. The PosName parameter is used to position the list (Ascending after W2E/Name).
Used in combination with FldrLGetNext to retrieve a list of folder lists for a specific site. FldLGetFirst sets the file position in the folder list table.
Subsequent calls to FldrLGetNext will read the next records (ordered by name in ascending order).
Type: Data/Folder List
Retrieves information about a specific folder list based on the combination of site and name specified in the parameters W2E/Name and W2E/SiteKey (usr).
Used to obtain further information about a folder list in situations where
the name of the folder list have been entered/selected by a user.
The Sitekey used will in most cases identify the current session. This Sitekey
can be found using the GetSessionData API.
Type: Data/Folder List
Retrieves the next folder list in a sequence of folder lists established by an initial call to FldrLGetFirst.
Used in combination with FldrLGetFirst to retrieve a list of folder lists for a specific site.
The function will return the next folder list in the list defined by the W2E/SiteKey
(usr) on the initial call to FldrLGetFirst.
The sequence of folder lists is ordered by name (ascending).
Type: Data/Presentation
This API is used to retrieve the identification of the presentation currently being used and the data for this presentation and the process it belongs to.
Apart from retrieving this information, you can use the returned presentation surrogate to retrieve or set properties for the presentation using the SetPresentationProperty, GetPresentationProperty, DeletePresentationProp, GetFirstPresentationProp, GetNextPresentationProp.
Type: Service
Retrieve the DateMask (formatting) defined for the Websydian Express installation. This information is contained in the dataarea WSYDDATMSK. The information has been specified during the installation of Websydian Express.
If a user should enter a date in the format specified by the DateMask in the dataarea, it is normally a good idea to show the DateMask to the user. By using this API, you can retrieve the value for the DateMask. Using the SetOutput API, you can write the value to the web page.
Type: Service
The GetErrors API makes a set of error messages thrown by another API available as a set of fields.
Call the GetErrors API if you want to retrieve the specific error messages thrown by the APIs that can return more than one error (These can be recognized by having the field W2E/NumErrors as an output parameter - they include UserUpdate, UserCreate, SessionUpdate, SessionCreate).
The NumErrors parameter specifies how many of the 20 error messages that actually contain texts.
Type: Service
Returns the event ID (identification of the event) of the request being handled. The event ID is also the name of the EventHandler program that will handle the request.
In some cases it can be necessary to load a page in different manners depending on the event that has been used to activate the page. This API can be called in the PageGenerator or in service functions to determine which event has originated the request.
Type: Data/Presentation
Retrieves the first property for a presentation.
Specify a presentation surrogate to identify which presentation you want to retrieve properties for. You can specify a start position for the list by providing a value for the input parameter W2E/PosPropName.
This API is used together with GetNextPresentationProp to retrieve a list of all properties specified for a specific presentation. The properties are retrieved in property name order.
Type: Core
Fetches the value of a web input field (input field for an event).
Specifies the name of the input field for the event.
Specifies the field that is to receive the value entered in the input field.
The function is called by the EventHandler. It fetches the value of the
specified web input field. If no web input field with the specified name
exists, a blank value is returned.
The web input values fetched by this API are the values entered by the user in
input fields in the browser.
Type: Data/Presentation
Retrieves the next property for a presentation.
This API is used together with GetFirstPresentationProp to retrieve a list of all properties specified for a specific presentation. The properties are retrieved in property name order.
Type: Core
Gets the value for a parameter set by SetParm/SetGridParm when the HTML page was created. In addition to returning the value, the function also makes it possible to detect if the values have been changed since SetParm/SetGridParm was called.
Specifies the name of the parameter (The same name as used in the SetParm/SetGridParm API call).
Specifies the field that must receive the value of the parameter.
The function is called by the EventHandler.
The function must be called once for each field value set with the
SetParm/SetGridParm API when
the HTML page was generated.
After receiving all the parameters - and before doing any further handling of
the parameters - the ValidateParm API should be
called to ensure the integrity of the data (that they are unchanged compared to
the values written by the PageGenerator).
Type: Data/Presentation
Retrieves information about a presentation. In addition to the presentation information, information about the process the presentation belongs to is also retrieved.
Type: Data/Presentation
Retrieves the value for a property for a presentation.
Properties can be used to specify behavior for the process. This will often be used to retrieve properties for the presentation currently in use. The identification of this presentation can be retrieved using the GetCurrentPresentation API.
Type: Core
Gets the value specified for the parameter on the link generated by a menu service.
Specifies the name of the parameter (the name specified on the menu service link specified in the template.
Specifies the field that must receive the value of the parameter.
The function can be called in a ProcessEntryPoint if the process must be able to retrieve parameters specified on a menu service link.
The function must be called before calling the PageGenerator. Call this API once for each parameter that the business process must be able to retrieve.
Type: Data/Session
Get information about the current session and the site used by the session.
Used to obtain the information most commonly needed about the session specified by the parameter W2E/SessionID. If you want the information about the current session, use the GetSessionID API to obtain the W2E/SessionID.
Type: Data/Session
Retrieves the identification of the session for the request being handled.
Used by the function handling the request.
Fetches the identification of the session associated with the request.
This identification can be used to obtain further information about the session
(e.g. by calling the GetSessionData API). Or you
can use this ID as a foreign key in the database to uniquely identify the
session.
Type: Service
Converts a value from a packed numeric field to a character string.
A number of parameters controls the format of the resulting string:
CND Use Dataareas ('D') = the thousand and decimal separators will be read from the dataareas WSYDTHUSEP and WSYDDECSEP. These values will be used to format the string.
CND Use Dtaaras - no Thousand ('T') = the decimal separator will be read the dataarea WSYDDECSEP. No thousand separator will be inserted.
All other values = The separators specified in the input parameters W2E/ThousandSeparator and W2E/DecimalSeparator will be used.
CND Yes = A 0 will be returned for the integer part of the number if the value of the number is between -1 and 1.
CND No = The integer part of the number will be blank if the value of the number is between -1 and 1. E.g: 0 = '', 0.2 = '.2'.
If W2E/FormatSeparator is "Use Dataareas" or "Use Dataareas - no Thousand" - this parameter is disregarded.
If W2E/FormatSeparator is not "Use Dataareas" or "Use Dataareas - no Thousand" - any value specified for this parameter will be used as thousand separator. If no thousand separator should be used - specify *BLANK as value.
If W2E/FormatSeparator is "Use Dataareas" or "Use Dataareas - no Thousand" - this parameter is disregarded.
If W2E/FormatSeparator is not "Use Dataareas" or "Use Dataareas - no Thousand" and if the number is not an integer - this parameter must be specified. The specified value will be used as decimal separator.
Specifies the number of decimals the resulting string will have (number of digits after decimal point).
Use this function before calling the SetOutput/SetGridOutput APIs when the value of numeric fields should be shown on a web page.
If this value has been used to format a string shown for an input field for an event, it is recommended to use the API String2Numeric to parse the string retrieved by the GetInput API in the EventHandler.
Type: Core
This API generates an HTML page that contains an event that reloads the site.
This event is executed automatically when the page is sent to the browser.
This page is generated by using the delivered WSLOAD template. This template
must be located in a folder in the folder list for the session for the event
to work.
The function is called when the program handling a request must reload the
site. This will for example happen in a custom-made login function,
after the session is updated with the user and roles, the site should be
reloaded so that it reflects the new authorization.
This is done by calling this API.
After calling ReloadSitePage, the calling program should terminate - do not call
the WritePage API, as a page has already been sent to the browser.
Type: Data/Role
Removes the intranet restriction from the specified role.
Calling this API makes the site elements authorized by the specified role available for sessions that originate outside the intranet.
Type: Data/Role
Validates and creates a new Role.
If the input field W2E/ValidateOnly is set to VALIDATE, the function only
performs the validation. If UPDATE is specified, both the validation and the
creation is performed.
The function returns the number of errors encoutered (if any). You can use the
GeErrors API to retrieve a text for each error.
Used if a business process (e.g. a custom Role maintenance suite) needs to create a Role.
Type: Data/Role
Validates whether a Role can be deleted - and deletes the Role if the
validation is successful.
If the inputfield W2E/ValidateOnly is set to VALIDATE, only the validation is
performed. If UPDATE is specified, the validation is performed and the record is
deleted if the validation is successful.
Used if a business process (E.g. a Custom Role maintenance suite) need to
delete a Role.
Pease note that a Role can't be deleted if it is referenced by Users or Site
Elements.
Type: Data/Role
Retrieves information about a specific role.
This can be used if a RoleSurrogate (Unique identification of the role) is known and e.g. the name of the role is needed.
Type: Data/Role
Reads a specific role based on the site and the name of the role.
Can be used to find additional information about a role (e.g. the RoleSurrogate) if only the name of the role is known.
Type: Data/Role
Retrieves the first role for the specified site. The roles are retrieved in role name order. It is possible to position the read by using the input parameter W2E/PosRoleName.
Used together with the API RoleGetNext to retrieve a list of the roles for a Site.
Type: Data/Role
Retrieves the next role for the specified site. The roles are retrieved in role name order. The first role is fetched and the position of the roles are established by calling the RoleGetFirst API.
Used together with the API RoleGetFirst to retrieve a list of the roles specified for a specific site.
You must always call RoleGetFirst before calling RoleGetNext.
Type: Data/Role
Checks whether the Role is allowed to be used by Sessions that does not originate from the Intranet.
Used if you need to check whether the Role is specified as being for intranet use only.
Type: Data/Role
Specifies that the Role can only be assigned to sessions originating in the intranet.
Use this API to specify that the Role should only be available for intranet sessions. When a Role has IntranetOnly set to yes, the role is not assigned to sessions originating outside the intranet, even though the user has the role assigned.
Type: Data/Role
Validates and updates the Role information.
If the inputfield W2E/ValidateOnly is set to VALIDATE, only the validation is
performed. If the value is UPDATE, both validation and update is performed.
Used if a business process (e.g. a custom Role maintenance suite) needs to update a Role.
Type: Data/Session
Adds a role to the specified session. This provides further authority to the session.
Can be used if a business process must add authorization to a session. This can for example be relevant if a user by providing additional information about himself can obtain access to parts of the sites he previously did not have access to.
Type: Data/Session
Validates and creates the session specified in the input.
The parameter W2E/ValidateOnly controls whether the record is updated - or only the validation is performed.
CND VALIDATE = The data will only be validated - no record will be created.
CND UPDATE = If the validation is successful a record will be created
The parameter W2E/NumErrors specifies the number of errors found in the
validation. A text for each of these errors can be obtained by calling the
GetErrors API.
The function sets *Return Code to a non-normal value if errors are found in the
validation or if errors happens in the subsequent update.
Used if the application needs to create a session. E.g. if an external application needs to simultaneously create a Websydian Express session and a session for another system.
Type: Data/Session
Retrieves the most basic information about the session specified by the
parameter W2E/SessionID.
Usage:
Used to obtain the most basic information about the session specified by the parameter W2E/SessionID. This will often be the current session. The W2E/SessionID can for the current session can be found using the GetSessionID API.
The difference between this API and the GetSessionData API is that this function does not resolve information about the site.
Type: Data/Session
The API is deprecated.
Do not use this API.
The API will not be copied to your model in version 2.0 or later.
Type: Data/Session
Retrieves the first role that is assigned to the session. It also sets the position for further reads using the SessionGetNextRole API.
Together with the SessionGetNextRole API this function can be used to create
a list of the roles currently assigned to a session.
This API must always be called before calling the SessionGetNextRole API.
Type: Data/Session
Retrives the next role that is assigned to the session.
Together with the SessionGetFirstRole API, this function can be used to
create a list of the roles currently assigned to a session.
The SessionGetFirstRole must always be called before calling this API.
Type: Data/Session
Sets the *Return Code to *Normal if the specified session is authorized by the specified role. Otherwise the function will return an error.
Used if you want to control functionality in your business processes based on the roles assigned to the session. E.g. only showing certain information if the session has a specific role assigned.
Type: Data/Session
Refreshes the folder list assigned to the session based on the currently assigned roles and user.
This API can be used to let Websydian Express decide on the folder list the
session must use based on the roles and user assigned to the session.
It might be used in cases where you e.g. have assigned additional roles to the
session using the SessionAddRole API.
Type: Data/Session
Removes all roles from the session.
Can be used in custom-made log off functionality to remove all authorization from the session.
Type: Data/Session
Removes a role from a session. If the session does not have the role assigned, nothing happens.
Can be used to reduce the authorization of a session.
Type: Data/Session
Sets the session authorization based on the Anonymous User registered on the
site settings. Roles and folder list are assigned to the Session, the User ID is
set to 0.
If a user is already assigned to the session, an error is returned and no
updates are performed.
Can be used to reset the "anonymous" settings for a session.
Type: Data/Session
Updates the folder list for the session. The folder list is set irrespective of the roles assigned to the session - overriding the normal assignment of folder lists to sessions.
You can use this to change the folder list without updating user or roles for the session.
Type: Data/Session
Sets the user for the session and updates the roles and folder list for the session based on the specified user.
Can be used to implement your own login functionality.
Type: Data/Session
Validates and updates the session specified in the input.
The parameter W2E/ValidateOnly controls whether the record is updated - or only the validation is performed.
CND VALIDATE = The data will only be validated - no record will be created.
CND UPDATE = If the validation is successful a record will be created
The parameter W2E/NumErrors specifies the number of errors found in the validation. A text for each of these errors can be obtained by calling the GetErrors API.
The function sets *Return Code to a non-normal value if errors are found in the validation or if errors happens in the subsequent update.
Used if the application needs to update a session. E.g. in a special login function.
Type: Core
Sets the value for an output field in the grid in an HTML page.
Specifies the name of the template that will be used to create the page.
Specifies the row in the grid that the value must be shown in.
Specifies the name of the replacement marker the value will replace in the template.
The value that will be used to replace the replacement marker.
The function is normally called in the PageGenerator function or in a load grid function called by the PageGenerator.
Type: Core
Writes a parameter to a grid event in the HTML page. The value of the
parameter can be read by the program handling the event.
The parameter value is secured. This means that if it is changed illegally, then
the program handling the event will be able to detect this.
Specifies the name of the template that will be used to create the web page.
Specifies the row in the grid the event which the parameter is written to belongs to.
Specifies the event which the parameter is transferred to. This ID is the source name of the EventHandler function.
Specifies the name of the parameter
Specifies the value of the parameter
The function is called by the PageGenerator or by a Load Grid function that
is called by the PageGenerator.
The function offers the possiblity to transfer parameters from the program
generating the page to the program handling the request. (PageGenerator and
EventHandler).
The function must be called once for each parameter that must be transferred to
the program handling the event.
For each SetGridParm call that is made for an event (in the PageGenerator), a
GetParm call must be made in the EventHandler. These
GetParm calls must be followed by a call to the
ValidateParm API to verify the integrity of the data
received by the GetParm API (check that the retrieved
values are the same as the ones set by the PageGenerator).
Type: Core
Sets the value for an output field in the detail part of an HTML page.
Specifies the name of the template that will be used to create the page.
Specifies the name of the replacement marker the value will replace in the template.
The value that will be used to replace the replacement marker.
The function is typically called in the PagGenerator. The function is called when a value must be specified for an output field or an input field for an event placed in the detail (non-grid) part of the page.
Type: Core
Writes a parameter to a detail event in the HTML page. The value of the parameter can be read by the program handling the event.
The parameter value is secured. This means that if it is changed then the program handling the event will be able to detect this.
Specifies the name of the template that will be used to create the web page.
Specifies the row in the grid the event which the parameter is written to belongs to.
Specifies the event which the parameter is transferred to. This ID is the source name of the EventHandler function.
Specifies the name of the parameter.
Specifies the value of the parameter.
The function is typically called by the PageGenerator.
The function offers the possiblity to transfer parameters from the program generating the page to the program handling the request that is created when the event is activated by a user. (PageGenrator and EventHandler).
The function must be called once for each parameter that must be transferred to the program handling the event.
For each SetParm call that is made for an event (in the PageGenerator), a GetParm call must be made in the EventHandler.
These GetParm calls must be followed by a call to the ValidateParm API to verify the integrity of the data received by the GetParm API (check that the values are the same as the ones set by the PageGenerator).
Type: Data/Presentation
Used to set a property for a presentation programmatically (properties can also be set using the administration interface process maintain presentation (accessed through the business process maintenance)).
Properties can be used to specify behavior for the process. This API will often be used to set properties for the presentation currently in use. The identification of this presentation can be retrieved using the GetCurrentPresentation API.
Type: Data/Site
Retrieve basic information about a Websydian Express site
Can be used in special situations where information from the site is
necessary to execute the application logic.
An example could be that a link reloading the site should be inserted on a page
in certain circumstances. By reading the EntryURL from the site and setting this
using the SetOuput API it is possible for the developer
to create this link.
Type: Service
Converts a formatted datestring to an ISO date - the entered date must conform to the format mask specified in the parameter W2E/DateMask.
W2E/Datemask controls the format according to the following rules:
yyyy specifies the position of the year.
mm specifies the position of the month.
dd specifies the position of the day.
All of these must be present for the mask to be valid.
If you specify the condition (CND) "Use dataareas" (value: 'D') for the mask, the mask will be read from the dataarea WSYDDATMSK. This dataarea contains the date format specified for the Websydian Express installation (specified during the installation).
Used when the value for an ISO date field has been retrieved as a string using the GetInput/GetParm APIs - and the values should be converted to an ISO date before being used to e.g. update the database. This will normally be done in the EventHandler functions.
If your database/business field is a Date7 instead of a DateISO, use the API DateISO2Date7 after calling this API to get the string converted to Date7.
Type: Service
Converts a formatted string into a numeric field based on a number of parameters.
CND Use Dataareas ('D'):
The thousand and decimalseparators will be read from the dataareas WSYDTHUSEP and WSYDDECSEP. These values will be used to parse the string.
All other values:
The values for the parameter fields W2E/ThousandSeparator and W2E/DecimalSeparator will be used to parse the string.
If W2E/Format of InputString is "Use dataareas" this parameter will be disregarded.
If W2E/Format of InputString is not "Use dataareas", the value specified for this parameter will be used as thousand separator when the string is parsed.
If W2E/Format of InputString is "Use dataareas" this parameter will be disregarded.
If W2E/Format of InpuString is not "Use dataareas", this value will be used as decimal separator when the string is parsed.
Use this API in the EventHandler functions when a numeric value is fetched by the GetInput/GetParm functions.
Type: Data/User
Adds a role to the users authorization.
Can be used if a business process needs to add authorization to the user.
This can e.g. be relevant if a user agrees to a disclaimer or gives some
additional information that results in the user gaining additional
authorization.
Note that this is a permanent addition of authorization - if you just want to
add authorization for the current session, use the SessionAddRole API instead.
Type: Data/User
Compares the entered password with the stored value.
Used if a specialized login functionality is developed - or if specific events must be confirmed by the user reentering his password.
Type: Data/User
Change the state of an existing user profile.
CND VALIDATE
The change of status will be validated - but the data will not be updated.
CND UPDATE
The status of the user will be changed to the specified value if the validation is successful.
Used if a specialized user maintenance is developed. E.g. if a special process is developed allowing persons not having access to the Websydian Express administration interface to reactivate users.
Type: Data/User
Creates a user profile for a specific site.
CND VALIDATE
The specified user data will be validated - but the data will not be updated.
CND UPDATE
The user will be created if the validation is successful.
The function returns the unique identification of the created user.
If the validation encounters errors, the *Return Code is set to a non-normal value and the field W2E/NumErrors will contain the number of errors encountered. You can use the GetErrors API to obtain a text for each of these errors.
Used when custom registration of users is developed. E.g. if a user
self-registration process or a specialized registration of users for
several systems is created.
Type: Data/User
Deletes an existing user profile.
CND VALIDATE
It is validated whether the deletion can happen - but the record is not deleted.
CND UPDATE
It is validated whether the deletion can happen. If the validation is successful, the record is deleted.
Used when customized user maintenance functionality is been developed for the application.
Type: Data/User
Retrieve basic information about a specific user profile, based on the unique identification of the user.
Used whenever an application needs information about a specific user. E.g. if
the name of the user presently logged in should be shown on a
page. The identification of a user for a specific session can be found by
calling the GetSessionData API.
Type: Data/User
Sets the file position and retrieves the first user from that position.
The sequence of users will always be limited to users for a specific site (specifed by the W2E/SiteKey (usr) parameter).
By entering a non-zero value for the parameter W2E/LimAuthLevel, the sequence is limited to users having the specified authorization level.
By entering a non-blank value for the parameter W2E/LimFldrListID, the sequence is limited to users having the specified Folder list.
By entering a non-zero value for the parameter W2E/LimCreatedBy, the sequence will be limited to users having been created by the specified user.
By entering a non-blank value for the parameter W2E/LimEMail, the sequence will be limited to users having the specified e-mail.
By entering a value for the parameter W2E/LimStatus the sequence is limited to users in the specified state.
The sequence of users is ordered by login name (ascending).
Used together with the UserGetNext function to retrieve a list of users for a specific site.
Type: Data/User
Retrieves the unique identification of a user profile, based on the combination of the site key and the login name for the user.
Used if the unique identification of the user table is needed for calls to other APIs (e.g. UserUpdate/UserDelete etc.) - but only the LoginName is available.
Type: Data/User
Gets the next occurrence of users in the sequence established by an initial call to UserGetFirst.
Used together with the UserGetFirst function to retrieve a list of users for a specific site. UserGetFirst is used to set the file position. Then UserGetNext is used to fetch further records.
UserGetNext will set *Return Code to W2E/RC_NOT_FOUND when the end of the list is reached.
Type: Data/User
Add 1 to the number of failed logins registered for the user.
Can be used as part of a custom-made login functionality. Call this API if
you register a failed login attempt for a user - and you want to inactivate the
user after a number of failed logins.
Please note that the user is NOT inactivated by this API. When you want to
inactivate the user, call the UserChgStatus API. To obtain the current number of
failed login attempts for a user, use the UserGet API.
Type: Data/User
Checks whether the user is authorized for a specific role.
Use this API if you want to control a business process based on the roles assigned to the user.
You can call the SessionIsRoleAuthorized API if you want to check the roles assigned to the session instead of the roles assigned to the user.
Type: Data/User
Removes all roles for a user.
Can be used if a business process must delete a user. As a user can't be deleted if he has any roles assigned, this API must normally be called before deleting the user.
Type: Data/User
Removes a specific role from a user.
Can be used if a business process must remove authorization from a user.
Type: Data/User
Set the current number of failed logins for a user to zero.
Can be used as part of a custom-made login functionality. Should be called after a successful login by a user.
Type: Data/User
Retrieves the first role for a specific user. Sets the position for retrieving the rest of the roles.
Used together with the UserRoleGetNext API to retrieve a list of the roles assigned to the user (ordered by role name). The beginning of the list can be positioned by specifying a value for the parameter W2E/PosRoleName.
Type: Data/User
Retrieves the next role for a specific user.
Used together with the UserRoleGetFirst API to retrieve a list of the roles
assigned to the user (ordered by role name).
The UserRoleGetFirst API must be called before calling this API.
Type: Data/User
Updates an existing user profile.
CND VALIDATE
The data will only be validated - the user record will not be updated.
CND UPDATE
The data will be validated and the user record will be updated if the validation is successful.
If the validation encounters errors, the *Return Code is set to a non-normal value and the field W2E/NumErrors will contain the number of errors encountered. You can use the GetErrors API to obtain a text for each of these errors.
Used if custom user maintenance is developed.
Type: Data/User
Update the password for a user profile
CND VALIDATE
The data will only be validated - the user record will not be updated.
CND UPDATE
The data will be validated and the user record will be updated if the validation is successful.
Used if a specialized function for changing the password for a user is developed. E.g. a function where the user can change his own password.
This function ensures that the password is stored as a signed value instead of clear text. This is necessary for the basic Websydian Express login functionality to work.
Type: Core
The function checks the integrity of all the parameters that have been fetched using the GetParm method (for the current request).
The API is called by the EventHandler.
The API must be called whenever the event being handled is using secure parameters (parameters set by SetParm/SetGridParm APIs).
The function must be called AFTER the value of each of these parameters has been fetched using the GetParm function.
The function must be called before doing any further handling of the data.
If an error indicating that the signature is wrong is returned by the
function, the handling of the request must be stopped and an error page
shown to the user.
Type: Core
Generates an error page that is sent to the browser.
The function can be called when the program handling a request encounters an error that must interrupt the handling of the request.
After calling WriteErrorPage, the calling program should terminate.
You can change the design of the error page by changing the template WSYDERP.
You do not have to use this API to make an error page. If you want to create your own error page, just create it as a normal PageGenerator function (in this way you have full control over the data being shown on the page).
Type: Service
Writes an entry to the Websydian Express message log.
Used if the application should write a message to the Websydian Express message log.
The messages can be seen using the Message log menu item in the administration interface.
Type: Core
The function generates an HTML page and sends the generated page to the browser.
The page is generated from the HTML template specified by the W2E/TemplateName input parameter.
The function is called by the PageGenerator.
Before calling the WritePage API, the values that is to be used to substitute the replacement markers in the template must have been specified the SetOutput and SetGridOutput APIs.
Any parameters transferred by the events defined for the page must have been set using the SetParm and SetGridParm APIs.
The API's can encounter a number of error conditions. For each of these conditions, the API will return a Condition value in the *Return Code field.
This list shows the File value for each of these conditions - and has a short description of each error.
Returned when an unexpected error has occurred in a low-level function.
Example: An object is missing from the runtime library.
Returned by APIs retrieving data if no record could be found based on the entered selection criteria.
This is not necessarily an error - in many cases, it is quite acceptable that a record does not exist for a specified key.
Returned if an API that has a mandatory input parameter specifying a field name has been called with a blank name.
Solution: Ensure that a value is specified for the field name input parameter.
Returned if an invalid session id (typically 0/blank) has been specified as input or retrieved from a request.
Solution: Ensure that a value is specified for the session id parameter.
Returned if the low level API checking integrity of the received parameters has not been able to find the key used to check the value.
Solution: Check the integrity key site setting for the current site in the administration interface.
Returned if an API that has a mandatory input parameter specifying a template id has been called with a blank id.
Solution: Ensure that a value is specified for the template parameter.
The function validating the parameters retrieved from the request has found that the values of the parameters is not correct.
In a development situation this will typically mean that the SetParameter and the GetParameter calls for the event does not match.
In a production environment, this will typically mean that an attempt to tamper with the parameters for the event has occurred.
Returned if an API that has a mandatory input parameter specifying a row in a grid has been called with an invalid row number (0 or negative row number).
Solution: Specify the current row in the grid for the grid row parameter.
Returned if an API that has a mandatory event id input parameter has been called with a a blank id.
Returned when an API has needed to access information for the current session - but have encountered an error when trying to read the session data.
Check whether the joblog for the application service jobs provides more information.
Returned when an API creating new records in the Websydian Express database has encountered an error that prevented the record from being created.
Check whether the joblog for the application service jobs provides more information.
Returned when an API updating records in the Websydian Express database has encountered an error that prevented the record from being updated.
Check whether the joblog for the application service jobs provides more information.
Returned when an API has been called in the validation mode (ValidateOnly = VALIIDATE) - and the validation has registered one or more errors.
Returned when an API deleting records in the Websydian Express database has encountered an error that prevented the record from being deleted.
Check whether the joblog for the application service jobs provides more information.
Returned when a function reading data from the Websydian Express database has encountered an error when trying to read the data. Please note that this is different from the RC_NOT_FOUND return code (which means that the record has not been found - but no errors occurred during the read).
Check whether the joblog for the application service jobs provides more information.
Returned by the UserCheckPwd function if the entered password does not correspond to the one registered for the user.
A GetNext function has been called without any calls being made to the corresponding GetFirst function.
Solution: Ensure that the corresponding GetFirst... API is called before calling the GetNext... API.
An invalid category has been specified for a call to the WriteLog API.
Solution: Specify one of the valid values for the category (See the values specified for the field "W2E/Category of Message").
The WriteLog API has been called without any message being specified.
Solution: Specify a message to write to the log.
A call to a program/serviceprogram has failed (typically as a PSDS error). More information will often be available in the Websydian Express message log and the OS400 joblog.
A function updating the password for a user have been called with an invalid value (typically blank) for the password.
Solution: Ensure that a valid value is specified for the password.
The service functions used to format numeric or date fields could not read a necessary dataarea.
Solution: Check the library list for the application service jobs. The dataareas WSYDDECSEP and WSYDTHUSEP must be available for the application.
The installation places these dataareas in the express database library.
The same separator character has been specified for the thousand separator and the decimal separator.
Solution: If the separators are specified by the input parameters, ensure that different values are specified for decimal and thousand separator. If "Use dataareas" are specified, ensure that the separators specified in WSYDDECSEP (decimal separator) and WSYDTHUSEP (Thousand separator) are not the same.
The string contains more than one decimal separators. The format function can't format the textstring when more than one decimal separator is specified.
The string contains invalid (non-numeric) characters.
The string contains a thousand separator after the decimal separator.
A negative sign has been found in a position that is not the first in the string.
The error indicates that even though the validation of the string has been successful, the move of the string value to a numeric field has resulted in an error. This error should never be returned.
The string contains a valid number, but the value of the number is to large ( greater than the value that can be containe in a decimal 29.5 field).
The number has digits after the decimal point, but no decimal separator has been specified.
Solution: Either specify a decimal separator in the parameter - or if you specify the "Use Dataareas" option, set a value for the decimal separator in the WSYDDECSEP dataarea found in the database library of Websydian Express.
The parameters specify that a decimal separator should be taken from a data area and the number is large enough for a decimal separator to be needed - but no decimal separator is specified in the data area.
Solution: Specify a value for the thousand separator in the WSYDTHUSEP data area found in the database library.
The specified date was invalid.
The specified datemask was invalid.
An invalid site has been specified.
An API, which needs information about the anonymous user for a site has been called - however, no anonymous user could be found for the site.
An invalid user has been specified.
An invalid folder list has been specified.
An invalid role has been specified.
A user has already been specified for the session. The user can't be changed for an existing session.