String userName = queries[1];
TaggingDO taggingDO = null;
ResourceIDImpl resourceIDImpl = resourceDAO.getResourceID(path);
if (resourceIDImpl != null) {
ResourceImpl resourceImpl = resourceDAO.getResourceMetaData(resourceIDImpl);
if (resourceImpl != null) {
TaggingDO[] taggingDOs = tagsDAO.getTagging(resourceImpl, tagName, userName);
taggingDO = taggingDOs[0];
}
}
ResourceImpl resource = new ResourceImpl();
resource.setMediaType(RegistryConstants.TAG_MEDIA_TYPE);
resource.setPath(resourcePath.getCompletePath());
if (taggingDO != null) {
resource.setContent(taggingDO.getTagName());
resource.setAuthorUserName(taggingDO.getTaggedUserName());
final Date taggedTime = taggingDO.getTaggedTime();
resource.setCreatedTime(taggedTime);
resource.setLastModified(taggedTime);
resource.addProperty("resourcePath", taggingDO.getResourcePath());
}
requestContext.setProcessingComplete(true);
return resource;
}