/*--------------------------------
* der physische Baum wird nur
* angelegt, wenn er noch nicht existierte
* --------------------------------*/
if (physicaldocstruct == null) {
DocStructType dst = this.myPrefs.getDocStrctTypeByName("BoundBook");
physicaldocstruct = this.mydocument.createDocStruct(dst);
/*--------------------------------
* Probleme mit dem FilePath
* -------------------------------- */
MetadataType MDTypeForPath = this.myPrefs.getMetadataTypeByName("pathimagefiles");
try {
Metadata mdForPath = new Metadata(MDTypeForPath);
if (SystemUtils.IS_OS_WINDOWS) {
mdForPath.setValue("file:/" + inProzess.getImagesTifDirectory(false));
} else {
mdForPath.setValue("file://" + inProzess.getImagesTifDirectory(false));
}
physicaldocstruct.addMetadata(mdForPath);
} catch (MetadataTypeNotAllowedException e1) {
} catch (DocStructHasNoTypeException e1) {
}
this.mydocument.setPhysicalDocStruct(physicaldocstruct);
}
if (directory == null) {
checkIfImagesValid(inProzess.getTitel(), inProzess.getImagesTifDirectory(true));
} else {
checkIfImagesValid(inProzess.getTitel(), inProzess.getImagesDirectory() + directory);
}
/*-------------------------------
* retrieve existing pages/images
* -------------------------------*/
DocStructType newPage = this.myPrefs.getDocStrctTypeByName("page");
List<DocStruct> oldPages = physicaldocstruct.getAllChildrenByTypeAndMetadataType("page", "*");
if (oldPages == null) {
oldPages = new ArrayList<DocStruct>();
}