WSO2 Governance Registry allows you to add a resource to a collection for more convenient usage of Resources. Each collection or resource created and stored on the repository has an associated media type. However, you also have the option to leave this option unspecified, enforcing the default media type. There are two main ways to configure media types for resources.
- The first method is by means of a one-time configuration, which can be achieved by modifying the
mime.types
file found in the server configuration directory. This may be done just once before the initial start-up of the server. - The second method is to configure the media types via the server administration console. The first method does not apply to collections, and the only available mechanism to configure media types of collections is via the server administration console.
Initially, the system will contain the media types defined in the mime.types
file. The media types defined in this file will be available for resources and a set of default media types will be available for collections.
"Human-readable" media types have shorter names in place of MIME
names (for example, WSDL
is used instead of application/wsdl+xml
). This update was achieved by introducing a new $GREG_HOME/repository/conf/mime.mappings
file. Refer Configuring Registry Files
You can manage media types for resources via the server administration console by editing the properties of the /system/mime.types/index
collection. This collection contains two resources: collection and custom.ui
. To manage media types of collections and custom user interfaces, edit the properties of these two resources.
The following are considered as illegal characters for resource names: ~ ! @ # ; % ^ * ( ) + = { } | \ < > " ', & and 'space' character. Also, if you set anonymous read permission for the resources in tenant mode, you can access them as follows: http://localhost:9763/store/t/{TENANT-DOMAIN}
Follow the below instructions to add a new child entry to a collection.
1. Click "Add Resource."
2. In the "Add Resource" panel, select "Method" from the drop-down menu.
The following methods are available:
Uploading Content from File
1. If this method was selected, specify the following options:
File- The path of the file from which to fetch content (XML, WSDL, JAR, etc.)
Use the "Choose File" button to upload a file.
- Name - The unique name of the resource
- Media type
- Description - A description of the resource
2. Click "Add."
Importing Content from URL
1. If this method was selected, specify the following options:
- URL - The full URL of the resource from which to fetch content
- Name - The unique name of the resource
- Media type
- Description - A description of the resource
2. Click "Add."
Text Content Creation
1. If this method was selected, specify the following options:
- Name - The unique name of the resource
- Media type
- Description - A description of the resource
Content
You can use either "Rich Text Editor" or "Plain Text Editor" to enter the content of a resource.
WSO2 Governance Registry allows you to add external links (hyperlinks) as resources in the registry. To add such a link, create a text resource with the media type application/vnd.wso2-hyperlink
and specify the URL as the resource's content.
2. Click "Add."
Custom Content Creation
1. If this method was selected, choose "Media type" from the drop-down menu:
To add a user profile to the registry, you need to create custom content with the media type application/vnd.wso2-profiles+xml
and provide the user name.
2. Click "Create Content."
See Custom UI Sample and Handler Sample as examples.
See also Running the Custom UI with Registry.