IResponseType thisType = getModelObject().getType();
String typeName = type.getName();
if (typeName.equals("AUDIO") || typeName.equals("SVG") || typeName.equals("UPLOAD"))
titleVisible = true;
if (metadata != null) {
TypeMetadata typeMD = metadata.getType(thisType);
if (typeMD != null) {
if (thisType.getName().equals("SVG") && typeMD.getFragments() != null) {
// Drawing starters - need to convert to URLs.
ArrayList<String> urls = new ArrayList<String>(typeMD.getFragments().size());
for (String frag : typeMD.getFragments()) {
ResourceReference fragResourceRef = ((IRelativeLinkSource)xmlFile).getRelativeReference(frag);
String url = RequestCycle.get().urlFor(fragResourceRef).toString();
if (url != null)
urls.add(url);
else
log.warn("Drawing stamp image does not exist: {}", frag);
}
setStarters(urls);
} else {
// Sentence starters
this.setStarters(typeMD.getFragments());
}
// Template
if (typeMD.getTemplates() != null && !typeMD.getTemplates().isEmpty()) {
String templateRelativePath = typeMD.getTemplates().get(0); // path from xml file
ResourceReference templateResourceRef = ((IRelativeLinkSource)xmlFile).getRelativeReference(templateRelativePath);
this.setTemplateURL(RequestCycle.get().urlFor(templateResourceRef).toString());
}
}
}