ResourceDAO resourceDAO = registryContext.getDataAccessManager().getDAOManager().
getResourceDAO();
TagsDAO tagsDAO = registryContext.getDataAccessManager().getDAOManager().
getTagsDAO(StaticConfiguration.isVersioningTags());
ResourcePath resourcePath = requestContext.getResourcePath();
if (resourcePath.parameterExists("tags") &&
resourcePath.getParameterValue("tags") == null) {
String path = resourcePath.getPath();
String tagStr = "";
ResourceIDImpl resourceIDImpl = resourceDAO.getResourceID(path);
if (resourceIDImpl != null) {
ResourceImpl resourceImpl = resourceDAO.getResourceMetaData(resourceIDImpl);
if (resourceImpl != null) {
String[] tags = tagsDAO.getTags(resourceImpl);
StringBuffer sb = new StringBuffer(tagStr);
for (String tag : tags) {
sb.append(tag);
}
tagStr = sb.toString();
}
}
ResourceImpl resource = new ResourceImpl();
resource.setMediaType(RegistryConstants.TAG_MEDIA_TYPE);
resource.setContent(tagStr);
resource.setPath(resourcePath.getCompletePath());
resource.addProperty("resourcePath", path);
requestContext.setProcessingComplete(true);
return resource;
}