DPML
Resource Management
HomeUtilitiesStationMetro
Transit Repository Tutorial
Tutorial Objectives

The objective of this tutorial is to introduce the concept of a resource respository, to describe the role of local and remote repositories in the Transit system, and to show examples of definition and setup of a private repository.

What is a Repository?

A repository is a resource server. Examples of repositories include the HTTP based DPML Repository accessible under http://repository.dpml.net/classic. Techically this is simply a web server with content structured in terms of groups and resources named using a particular convention. The mapping between an artifact uri and a repository is handled by a Layout object that is declared as part of a resource host definition. A layout implementation translates the artifact uri to to a url relative to the target host structure. Using this model Transit can provide suport for varying repository access and transport strategies.

Creating a repository

Transit's default ResourceHost implementation provides out of the box support for file, http and ftp based respository access. The simplest way to create a new repository is to setup a file based repository. This simply involves the the creation of the repository root directory, adding a group directory under the root, adding a directory named after the content type under the group directory, then adding your resources into the type directories using the naming convention [name]-[version].[type] or [name].[type] in the case of artifacts without a version. You host defintion simply references the root directory using the file: protocol as the repository base directory. Note - the above description is based on the 'classic' layout strategy used across the majority of know repositories and internally within Transit's local cache.

A more typical scenario is the establishment of a company wide repository within a local intranet. For this you need to setup a server (e.g. HTTP) with a file based resource handler then configure Transit by declaring a new remote host and definining the host base url as the http server.