Creating a WebDAV Server Type Extension
Procedure
Result
The server type Connection implementation class is responsible for communication with a remote server.
This includes the following:
- connecting to / disconnecting from server
- deploying modules
- providing and refreshing server elements
- updating server state
- performing server element operations
The simplest form of Connection implementation could look like this:
public class WebDavConnection implements Connection { private final Server server; public WebDavConnection(Server server) { this.server = server; } public void connect() throws ConnectionException { server.setServerState(ServerState.CONNECTED_LITERAL); } public void disconnect() throws ConnectionException { server.setServerState(ServerState.DISCONNECTED_LITERAL); } public boolean isConnected() throws ConnectionException { return server.getServerState() == ServerState.CONNECTED_LITERAL; } public DeploymentStatus deployModule(String url) throws DeploymentException { return new DeploymentSimpleStatus( DeploymentSimpleStatus.Severity.OK, "", null); } public void refreshServerContent() throws ConnectionException { } public Server getServer() { return server; } public Object performServerElementOperation(ServerElement serverElement, Operation operation) throws DeploymentException { return null; } public Object getAdapter(Class adapter) { return null; } }
Although this implementation only changes the server state on a connect or disconnect action, it is sufficient for the purposes of the tutorial.
In TIBCO Business Studio, you should now be able to start the New Server Wizard and choose Web DAV as the Runtime. For example:
If you select Web DAV as the runtime, on the screen that follows, you can view the rendered parameters of the server and the assigned repository. The widgets to capture parameter values are automatically generated using the parameter descriptions provided in the extension.
After clicking the Finish button, you can view the new server created under the Deployment Servers in the Project Explorer. You can also invoke connect and disconnect actions from the context menu and as a result see the server state change.