use of ugh.fileformats.mets.XStream in project goobi-workflow by intranda.
the class ProzesskopieForm method createNewFileformat.
/* =============================================================== */
private void createNewFileformat() throws TypeNotAllowedForParentException, TypeNotAllowedAsChildException {
Prefs myPrefs = this.prozessKopie.getRegelsatz().getPreferences();
try {
DigitalDocument dd = new DigitalDocument();
Fileformat ff = new XStream(myPrefs);
ff.setDigitalDocument(dd);
/* BoundBook hinzufügen */
DocStructType dst = myPrefs.getDocStrctTypeByName("BoundBook");
DocStruct dsBoundBook = dd.createDocStruct(dst);
dd.setPhysicalDocStruct(dsBoundBook);
ConfigOpacDoctype configOpacDoctype = co.getDoctypeByName(this.docType);
/* Monographie */
if (!configOpacDoctype.isPeriodical() && !configOpacDoctype.isMultiVolume()) {
DocStructType dsty = myPrefs.getDocStrctTypeByName(configOpacDoctype.getRulesetType());
DocStruct ds = dd.createDocStruct(dsty);
dd.setLogicalDocStruct(ds);
this.myRdf = ff;
} else /* periodica */
if (configOpacDoctype.isPeriodical() || configOpacDoctype.isMultiVolume()) {
DocStructType anchor = myPrefs.getDocStrctTypeByName(configOpacDoctype.getRulesetType());
DocStruct ds = dd.createDocStruct(anchor);
dd.setLogicalDocStruct(ds);
DocStructType dstyvolume = myPrefs.getDocStrctTypeByName(configOpacDoctype.getRulesetChildType());
DocStruct dsvolume = dd.createDocStruct(dstyvolume);
ds.addChild(dsvolume);
this.myRdf = ff;
}
// } catch (TypeNotAllowedForParentException e) {
// log.error(e);
// } catch (TypeNotAllowedAsChildException e) {
// log.error(e);
} catch (PreferencesException e) {
log.error(e);
}
}
Aggregations