Repository Types

Each server type must be associated with at least one repository type.

There are two pre-defined repository types:

  • Workspace - In this case, the publish action (Phase 1) does nothing, and the inquiry URL is the same as the URL of the Module in the workspace. This repository type is default, and it works well if the server is on the same machine as the client and the server can deploy Modules directly from the Eclipse workspace.
  • Local folder - The repository will be located in a local folder or equivalent (for example mapped network folder, or WebDAV mapped folder). This repository type requires two additional configuration parameters:
    • Publishing folder - a path to the repository folder.
    • Inquiry URL prefix - a prefix of the enquiry URL that can be resolved on the server (the URL server will use this to obtain the module).

If you need to define another type of repository, implement the com.tibco.xpd.deploy.core.repositoryTypes extension point and reference the repository from the serverType extension. You also must provide the implementation of the com.tibco.xpd.deploy.model.extension.RepositoryPublisher interface for the newly defined repository type and provide any additional configuration parameters that are needed:

public interface RepositoryPublisher {
     public void publish(RepositoryConfig config, File file);
     public URL getInquiryUrl(RepositoryConfig config, File file);
}

The publish(RepositoryConfig config, File file) method is responsible for publishing Modules to the repository and will be invoked before deployment. The config parameter references all repository configuration parameters and their values (that were provided when the server was created). The second method: getInquiryUrl(RepositoryConfig config, File file) is for obtaining the inquiry URL corresponding to the file parameter.

If the repository type needs parameters, the values for which should be provided by the user, you should implement a repository configuration wizard page. To do this, extend the com.tibco.xpd.deploy.ui.repositoryConfigWizardPage extension. This extension requires the implementation of the com.tibco.xpd.deploy.ui.wizards.repository.RepositoryConfigWizardPage interface that defines the additional wizard page with configuration details:

public interface RepositoryConfigWizardPage extends IWizardPage {
    void init(RepositoryType type, RepositoryConfig config);
    void transferStateToConfig();
}

The init(RepositoryType type, RepositoryConfig config) method will be invoked before the page is created. This provides the RepositoryConfig reference that can be interrogated for configuration parameters and filled by the user accordingly. The configuration state can also be cached in controls and transferred to the configuration object just before finish. In this case, the appropriate code to transfer the state to the configuration has to be put to the transferStateToConfig() method.