throw new CreatorException(e);
}
ParentChildCreatorInterface creator = type.getCreator();
SiteTree siteTree;
try {
log.debug("Get sitetree of area: " + area);
siteTree = publication.getTree(area);
} catch (Exception e) {
throw new CreatorException(e);
}
Label[] labels = new Label[1];
labels[0] = new Label(childName, language);
try {
siteTree.addNode(
parentId,
creator.generateTreeId(childId, childType),
labels,
visibleInNav);
} catch (Exception e) {
throw new CreatorException(e);
}
File doctypesDirectory =
new File(
publication.getDirectory(),
DocumentTypeBuilder.DOCTYPE_DIRECTORY);
try {
DocumentIdToPathMapper mapper = publication.getPathMapper();
log.debug("Parent directory: " + mapper.getFile(publication, "authoring", parentId, language));
creator.create(
publication,
new File(doctypesDirectory, "samples"),
mapper.getDirectory(publication, "authoring", parentId, language),
//new File(authoringDirectory, parentId),
parentId,
childId,
childType,
childName,
language,
Collections.EMPTY_MAP);
} catch (Exception e) {
throw new CreatorException(e);
}
// commit (sort of)
try {
siteTree.save();
} catch (Exception e) {
throw new CreatorException(e);
}
}