!--a11y-->
Configuring the Client SideOn the client side you need to create a class that implements the com.sap.engine.interfaces.visual_administration.VisualRuntimeControl interface. This interface extends the com.sap.engine.interfaces.visual_administration.RuntimeControl interface that has the following methods:
· public void setEnvironment(String toolName, Object environment) throws UnsupportedEditorException;
· public void show(ManagementInterface serviceManagementInterface);
RuntimeControl Interface Methods
|
Method |
Description |
|
setEnvironment(..) |
Provides a runtime access to its environment. In the
case of the Visual Administrator, the environment object can be cast to the
com.sap.engine.interfaces. |
|
com.sap.engine.interfaces. |
Must be thrown in the setEnvironment()method if the editor is not supported. |
|
show(…) |
Provides the GUI with access to the functionality available on the server. That is, to the implementation of the extended ManagementInterface (you can cast here to your service specific ManagementInterface). The communication between the runtime control and the server is done over the P4 protocol. |
This interface extends the RuntimeControl interface and adds the following additional methods:
· public JButton[] getRuntimeButtons() – your implementation will return any buttons you want to appear above the runtime control.
· public JMenu getRuntimeMenu() – your implementation will return the additional menu (if any) that will appear in the main menu bar of the frame when this method is called.
· public void freeResources() – called when the service is deselected in the cluster tree of the Visual Administrator. Implementing this method you can free all resources allocated on the server side by the runtime control.
· public void setFrame(java.awt.Frame frame) – sets a reference to the main frame of the Visual Administrator.
· public JComponent getRuntimeControlComponent() – called by the Visual Administrator to retrieve the main component of the runtime control, when the service providing it is selected in the cluster tree.
The com.sap.engine.interfaces.visual_administration.EditorViewManager interface represents the environment of the runtime control (see setEnvironment(…) method in the VisualRuntimeControl interface). The EditorViewManager interface has the following methods:
· public void addTask(TaskItem task) – registers a task to be monitored by the administrator. This causes its status to be displayed in the progress bar located in the bottom right corner of the Visual Administrator’s frame. The Administrator is responsible for monitoring the status of the task by regularly invoking TaskItem’s methods.
· public void setControlCached(boolean isCached) - this method is used for caching runtime controls. If a service runtime control is cached in this way, it is created only the first time the user selects the service in the cluster tree. Its show(...) method is executed only the first time. When deselected, the freeResources() is not called for this runtime control. During the next selections made to the service in the cluster tree, the service runtime control is obtained from the local cache of the Visual Administrator. You can set your runtime control to be cached using the setEnvironment(..) method of the com.sap.engine.interfaces.visual_administration.RuntimeControl interface.

|
public void setEnvironment(String editorToolName, Object environment) throws UnsupportedEditorException { ... ... ((EditorViewManager) environment).setControlCached(true); } |
By default, all runtime controls are not cached. They are recreated each time a user chooses the corresponding service elements in the cluster tree.
The com.sap.engine.interfaces.visual_administration.TaskItem interface provides methods and constants for getting the status and progress of a running task. The Visual Administrator invokes interface’s getProgress() and getStatus() methods periodically. The methods and constants defined in the TaskIteminterface are listed below:
· public static final int FINISHED = 0; - represents a finished task
· public static final int RUNNING = 1; - represents a running task
· public static final int ERROR = 2; – represents an error in the task’s execution
· public int getStatus() – returns the status of the task ( RUNNING, FINISHED or ERROR)
· public int getProgress() – returns the current progress of the task [0..100]
· public String getName() – returns the name of the task
· public String getAdditionalInfo() – returns additional information about the task
