public interface ServerExports
Modifier and Type | Method and Description |
---|---|
int |
connectEvent(long resourceId,
long clientSocketId)
Called by the P2J client side, it will inform the server that a server event was generated.
|
long |
createExternal()
Create an external resource to be used by a remote, non P2J, side.
|
long |
createSocket(int id)
Create a socket and associated with the given ID.
|
void |
deleteHandle(long handleId)
Delete the resource associated with the specified handle.
|
int |
getCurrentRow(int browseId)
Get current row in the query.
|
WidgetConfig[] |
getEditorsConfigs(int browseId)
Get configurations of widgets used for in-browse editing (fill-ins, toggle-boxes or
combo-boxes).
|
int[] |
getLegacyTextMetrics(java.lang.String text,
java.lang.String key)
Get the legacy metrics for the given text, using the font specified by the given key.
|
java.lang.String[] |
getProgressStackTrace()
Get the Progress stack trace
|
int |
getRowCount(int browseId)
Get the number of rows iterated by the query (for preselect queries - matches result size,
for adaptive queries - matches the size of the part of the result set the query has already
iterated over).
|
int |
getRowCount(int browseId,
int startRow)
Get number of available rows starting from the given one.
|
BrowseRow[] |
getRows(int browseId,
char searchChar,
int searchColumn,
int viewportTopRow,
int viewportBottomRow,
int rowDisplayTriggerId,
ScreenBuffer[] sb)
This function is used when search by key is performed in a browse.
|
BrowseRow[] |
getRows(int browseId,
int startRowIndex,
int count,
boolean forward,
int rowDisplayTriggerId,
ScreenBuffer[] sb,
RowDisplayStrategy displayStrategy)
Retrieves several subsequent rows from the database.
|
boolean |
getSessionTooltips()
Accesses the SESSION:TOOLTIPS attribute for this session.
|
java.lang.String |
getUiTheme()
Check the directory for the UI
Theme . |
void |
help(int lastKey,
ScreenBuffer[] buffer)
Locates and executes a preconfigured HELP application.
|
void |
initWidgetConfigurations(java.util.Map<java.lang.String,java.util.List<java.lang.String>> configs)
Synchronize the field IDs for the server-side widget configurations with the given one.
|
ServerReturnValue |
invoke(InvocationRequestPayload request)
This API is used when P2J client runs in embedded mode (i.e.
|
ServerReturnValue |
invokeServerEvent(int id)
Called from the client-side, it executes the server-side event by calling
ServerEvent.invoke(int) . |
boolean |
isRowAvailable(int browseId,
int rowIndex)
Determines if the specified browse row is "available", i.e.
|
byte[] |
loadEnvironment(java.lang.String env)
Load the specified environment as resource.
|
void |
moveColumnServer(int browseId,
int src,
int dest)
Implements the server-side MOVE-COLUMN() widget method.
|
void |
publishExternal(java.lang.String event,
long publisher,
java.lang.String[] args)
Notify all subscribers (to the given event) that the event has occurred.
|
ColorTable.EnvironmentColorTable |
readColorTable(java.lang.String envName)
Get color table of the specified environment.
|
FontDetails<?>[] |
readDefaultFonts()
Read the default fonts.
|
FontDetails<?>[] |
readFontTable()
Read the entire font-table.
|
java.util.Map<java.lang.String,int[]> |
readLegacyTextMetrics()
Read the legacy text metrics for all the texts and each font defined in the font table, for
this user.
|
int |
readResponseEvent(long resourceId)
Called by the P2J client side, it will inform the server that a server-event was generated.
|
ColorTableEntry[] |
readSystemColorTable()
Get system colors.
|
FontDetails<?>[] |
readSystemFontTable()
Read the font-table with the name of the legacy system fonts.
|
ScreenBuffer[] |
refresh(int frameId)
Obtains the latest screen buffer associated with the given frame.
|
void |
refreshBuffers(ScreenBuffer[] buff)
Refresh the server-side screen buffer for the given frame.
|
int |
setCurrentRow(int browseId,
int rowIndex)
Inform server about current row in the browse.
|
void |
setThemePreferredFonts(java.util.Map<java.lang.String,java.lang.String> themeFonts,
java.util.Map<java.lang.String,java.lang.String> themeFontAliases)
Set the theme preferred fonts.
|
long |
subscribeExternal(boolean global,
java.lang.Long subscriber,
java.lang.String event,
java.lang.Long publisher)
Create a new subscription to the given event for a specified external resource.
|
ServerReturnValue |
trigger(int triggerId,
int eventId,
int sourceId,
int otherId,
long resourceId,
ScreenBuffer[] sb)
Signals a trigger to the application.
|
void |
unsubscribeExternal(boolean global,
java.lang.Long subscriber,
java.lang.String event,
java.lang.Long publisher)
Delete a subscription to the given event for the specified external resource.
|
void |
updateRow(int browseId,
int rowIndex,
int[] cellIndices,
BaseDataType[] cellValues,
boolean onlyNotifyRowReleased)
Updates selected cells in the given row.
|
ValidationResult |
validate(int sourceId,
ScreenBuffer[] sb)
Signals a validation event to the application.
|
boolean |
validResource(long id)
Check if the resource with the given id is still valid to be used in a WAIT-FOR statement.
|
ServerReturnValue invokeServerEvent(int id)
ServerEvent.invoke(int)
.id
- The id of the server event.boolean validResource(long id)
false
if:
false
.true
id
- The resource id.ServerReturnValue trigger(int triggerId, int eventId, int sourceId, int otherId, long resourceId, ScreenBuffer[] sb)
triggerId
- The trigger to be called.eventId
- The event which was generated.sourceId
- The widget which generated the event.otherId
- The companion widget id (for ENTER/LEAVE).resourceId
- The resource which generated the event.sb
- The editable frames ScreenBuffer
arrayScreenBuffer
representing the latest screen values of all widgets and the
consume flag.ValidationResult validate(int sourceId, ScreenBuffer[] sb)
This signal is used to trigger validation execution on the server.
sourceId
- widget ID of the widget generated the trigger.sb
- The ScreenBuffer
array for current and other editable buffers.ValidationResult
representing the validation
result, error message and screen value changes.void help(int lastKey, ScreenBuffer[] buffer)
lastKey
- The most recent key event codebuffer
- The screen buffer array associated with the FOCUS as before HELP is invoked and
other editable frames.ScreenBuffer[] refresh(int frameId)
frameId
- The frame for which the screen buffer should be returned.ScreenBuffer
array representing the current screen
values of all widgets in the given frame and other editable frames.WidgetConfig[] getEditorsConfigs(int browseId)
browseId
- ID of the browse which should handle the request.null
if the column is not
editable. Return value is null
if the browse is read-only.int getRowCount(int browseId)
browseId
- ID of the browse which should handle the request.int getRowCount(int browseId, int startRow)
browseId
- ID of the browse which should handle the request.startRow
- Initial row to start count rows from.BrowseRow[] getRows(int browseId, int startRowIndex, int count, boolean forward, int rowDisplayTriggerId, ScreenBuffer[] sb, RowDisplayStrategy displayStrategy)
browseId
- ID of the browse which should handle the request.startRowIndex
- Index of the first row to retrieve (0-based).count
- Maximum count of rows to return. -1
for no limit.forward
- true
if rows are retrieved in the forward direction,
false
if rows are retrieved in the backward direction,rowDisplayTriggerId
- Trigger ID of the ROW-DISPLAY trigger. -1
if there is no ROW-DISPLAY
trigger for this browse.sb
- Screen buffer for the ROW-DISPLAY trigger. null
if there is no
ROW-DISPLAY trigger for this browse.displayStrategy
- Specifies type of action for which rows are fetched and defines how rows are
iterated / displayed.null
is returned.BrowseRow[] getRows(int browseId, char searchChar, int searchColumn, int viewportTopRow, int viewportBottomRow, int rowDisplayTriggerId, ScreenBuffer[] sb)
browseId
- ID of the browse which should handle the request.searchChar
- Character to be searched for. Search is performed using only the first character
(in the visual data representation) in the current column. Specifying a character
puts this function in the search mode. This parameter is null
for
non-search mode.searchColumn
- For search mode: 0-based index of the column to be searched.viewportTopRow
- For search mode: 0-based index (in the result set) of the top row in the current
view.viewportBottomRow
- For search mode: 0-based index (in the result set) of the bottom row in the
current view.rowDisplayTriggerId
- Trigger ID of the ROW-DISPLAY trigger. -1
if there is no ROW-DISPLAY
trigger for this browse.sb
- Screen buffer for the ROW-DISPLAY trigger. null
if there is no
ROW-DISPLAY trigger for this browse.null
is returned.void updateRow(int browseId, int rowIndex, int[] cellIndices, BaseDataType[] cellValues, boolean onlyNotifyRowReleased) throws DataValidationException
browseId
- ID of the browse which should handle the request.rowIndex
- Index of the row to update.cellIndices
- Cells for update indexes.cellValues
- Cells for update new values.onlyNotifyRowReleased
- Only notify server that the row has been released. Data is not updated.DataValidationException
- New values don't passed database validation rules.int setCurrentRow(int browseId, int rowIndex)
browseId
- ID of the browse which should handle the request.rowIndex
- 0-based index of the current row.int getCurrentRow(int browseId)
browseId
- ID of the browse which should handle the request.boolean isRowAvailable(int browseId, int rowIndex)
browseId
- ID of the browse which should handle the request.rowIndex
- 0-base index of the target row in the browse model.true
if the row is "available", i.e. it is not deleted.void moveColumnServer(int browseId, int src, int dest)
Repositions a column in the browse widget.
browseId
- ID of the browse which should handle the request.src
- 0-based position of the column to be moved.dest
- 0-based position to which the column is moved.int readResponseEvent(long resourceId)
resourceId
- The resource ID for the socket to which the READ-RESPONSE event belongs.-1
if a event could not be
posted (i.e. the resource is not SENSITIVE).int connectEvent(long resourceId, long clientSocketId)
resourceId
- The resource ID for the server socket to which the CONNECT event belongs.clientSocketId
- The resource ID of the socket created for the new connected accepted by the
server socket.-1
if a event could not be
posted (i.e. the resource is not SENSITIVE).long createSocket(int id)
LowLevelSocketImpl
instance.id
- The ID of the associated LowLevelSocketImpl
instance.SocketImpl
resource.java.lang.String getUiTheme()
Theme
. If
any Theme
is configured in registry (in any scope) it is returned, otherwise
null
is returned so that the client will chose the default.FontDetails<?>[] readSystemFontTable()
FontDetails<?>[] readFontTable()
void setThemePreferredFonts(java.util.Map<java.lang.String,java.lang.String> themeFonts, java.util.Map<java.lang.String,java.lang.String> themeFontAliases)
themeFonts
- The fonts the current installed Theme
on client prefers.themeFontAliases
- The font aliases currently installed Theme
on client prefers.FontDetails<?>[] readDefaultFonts()
int[] getLegacyTextMetrics(java.lang.String text, java.lang.String key)
text
- The text.key
- The font's key.java.util.Map<java.lang.String,int[]> readLegacyTextMetrics()
ColorTable.EnvironmentColorTable readColorTable(java.lang.String envName)
envName
- Environment name. Could be null
if is default environment.ColorTableEntry[] readSystemColorTable()
byte[] loadEnvironment(java.lang.String env)
env
- The INI file source.null
if the environment file could not be
loaded.void initWidgetConfigurations(java.util.Map<java.lang.String,java.util.List<java.lang.String>> configs)
configs
- A map of configurations, having as key a class name and as value a list of field
names (the order in this list gives the field ID).boolean getSessionTooltips()
true
if tooltips are available for this session
false
otherwise.void refreshBuffers(ScreenBuffer[] buff)
buff
- The screen buffer array data to be refreshed. May be null
.java.lang.String[] getProgressStackTrace()
ServerReturnValue invoke(InvocationRequestPayload request)
request
- The details about the request.void deleteHandle(long handleId)
handleId
- The handle ID of the resource.long subscribeExternal(boolean global, java.lang.Long subscriber, java.lang.String event, java.lang.Long publisher)
global
- Flag indicating if the subscription is for global (cross-session) events.subscriber
- The resource to notify when the specified event is published. If null
,
a ExternalResource
will be built and its ID return.event
- The name of the event which is being published.publisher
- The handle representing the program or resource that is the source of the event.
If specified, the named event will only cause a notification if the event source
matches this handle. null
represents the ANYWHERE
option
which means that the events will not be filtered by source.void unsubscribeExternal(boolean global, java.lang.Long subscriber, java.lang.String event, java.lang.Long publisher)
ErrorManager.silentErrorEnable()
/ErrorManager.silentErrorDisable()
bracket, as the UNSUBSCRIBE
statement is executed with a default NO-ERROR
clause.global
- Flag indicating if the search is done in the global (cross-session) event register.subscriber
- The resource whose subscription is to be deleted. Must not be null
.event
- The name of the event which is being published. If this is null
, then
subscriptions to all events will be deleted.publisher
- The procedure or resource handle representing the source of the event.
If specified, the subscription will only be deleted if the event source matches
this handle. null
represents the ALL
option which means
that the events will not be filtered by source. When null
, it means
that the publisher was not set.void publishExternal(java.lang.String event, long publisher, java.lang.String[] args)
All processing is done with silent error mode implicitly enabled.
The subscriptions are fired in the order they were subscribed. Although 4GL documentation specifically states, that "If a named event has multiple subscribers, the order in which the AVM notifies subscribers is undefined.", the actual 4GL implementation (OpenEdge 10.2B) does fire the events in the order the subscriptions get subscribed.
event
- The name of the event which is being published.publisher
- The procedure or resource handle representing the program that is the source of
the event. Must not be null
.args
- The parameters passed to the subscriber. May be null
to represent no
parameters. When null
, it means that no parameters were specified for
this call.long createExternal()