[Registry-dev] Restricted collections
Chathura C. Ekanayake
chathura at wso2.com
Wed Jul 9 02:31:25 PDT 2008
Current handler implementation allows users to write handlers to
restrict the allowed child media types of collections. Axis2 repository
collection is an example of such collection. I think this is a frequent
use case, where users would like to configure collections on the fly
using the UI. We can introduce some UI controls and API methods to
support this functionality. First, from the API side, we can have below
methods in the Collection interface.
void setChildPolicy(String policy);
String getChildPolicy();
void addChildMediaType(String mediaType);
void removeChildMediaType(String mediaType);
String[] getChildMediaTypes();
Below are the allowed values for child policy.
ALLOW_ALL --> No restriction (normal collection).
ALLOW_SELECTED --> Only allow the selected media types given from
addChildMediaType(...) method.
DENY_SELECTED --> Only deny the selected media types given from
addChildMediaType(...) method.
Then you can have a collection with only xml files by calling below methods.
Collection c = registry.newCollection();
c.setChildPolicy(Collection.ALLOW_SELECTED);
c.addChildMediaType("application/xml");
registry.put("/projects/config", c);
On the UI side, we can provide some UI controls in the collection's page
to set the child policy and child media types.
Thoughts...
Thanks,
Chathura
More information about the Registry-dev
mailing list