e.addAuthor(a.getLastContributor());
e.setId(baseURL.toString());
//generate meta data
ExtensibleElement extension = e.addExtension(METADATA);
ExtensibleElement childExtension = extension.addExtension(ARCHIVED);
//childExtension.setAttributeValue("type", ArtifactsRepository.METADATA_TYPE_STRING);
childExtension.addSimpleExtension(VALUE, a.isArchived() ? "true" : "false");
childExtension = extension.addExtension(UUID);
childExtension.addSimpleExtension(VALUE, a.getUUID());
childExtension = extension.addExtension(STATE);
childExtension.addSimpleExtension(VALUE, a.getState() == null ? "" : a.getState().getName());
childExtension = extension.addExtension(FORMAT);
childExtension.addSimpleExtension(VALUE, a.getFormat());
childExtension = extension.addExtension(VERSION_NUMBER);
childExtension.addSimpleExtension(VALUE, String.valueOf(a.getVersionNumber()));
childExtension = extension.addExtension(CHECKIN_COMMENT);
childExtension.addSimpleExtension(VALUE, a.getCheckinComment());
List<CategoryItem> categories = a.getCategories();
childExtension = extension.addExtension(CATEGORIES);
for (CategoryItem c : categories) {
childExtension.addSimpleExtension(VALUE, c.getName());
}
org.apache.abdera.model.Content content = factory.newContent();
content.setSrc(UriBuilder.fromUri(baseURL).path("binary").build().toString());
content.setMimeType("application/octet-stream");