if (GeneralConstants.BOOK.equals(type)
|| GeneralConstants.SLIPCASE.equals(type)
|| GeneralConstants.BOOKSHELF.equals(type)) {
// these types may have separate files or directories.
DocumentationContext docContext = getDocumentationContext(documentationNode);
File file = docContext.getFromAttributesMap(File.class);
if (file == null) {
BoostedNode parent = documentationNode.getZoomOut(null)
.getLeft();
if (parent == null) {
String filename = (String) context
.getFromAttributesMap(DocumentationContext.DOCUMENTATION_TARGET_PARAMETER);
if (filename == null)
throw new IllegalStateException(
"No filename in documentation context for key "
+ DocumentationContext.DOCUMENTATION_TARGET_PARAMETER);
Object name = documentationNode.getAttributes().getName();
if (name == null)
throw new IllegalStateException(
"Name not defined in node of type " + type);
file = new File(filename, name.toString());
} else {
setOutputFile(parent);
file = getDocumentationContext(parent)
.getFromAttributesMap(File.class);
Object name = documentationNode.getAttributes().getName();
if (name == null)
throw new IllegalStateException(
"Name not defined in node of type " + type);
file = new File(file, name.toString()); // todo
// internationalization?
}
docContext.getAttributes().getMap().put(File.class, file);
}
}
}