Search in sources :

Example 1 with XStream

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);
    }
}
Also used : XStream(ugh.fileformats.mets.XStream) DocStructType(ugh.dl.DocStructType) Fileformat(ugh.dl.Fileformat) Prefs(ugh.dl.Prefs) DigitalDocument(ugh.dl.DigitalDocument) PreferencesException(ugh.exceptions.PreferencesException) DocStruct(ugh.dl.DocStruct) ConfigOpacDoctype(de.unigoettingen.sub.search.opac.ConfigOpacDoctype)

Aggregations

ConfigOpacDoctype (de.unigoettingen.sub.search.opac.ConfigOpacDoctype)1 DigitalDocument (ugh.dl.DigitalDocument)1 DocStruct (ugh.dl.DocStruct)1 DocStructType (ugh.dl.DocStructType)1 Fileformat (ugh.dl.Fileformat)1 Prefs (ugh.dl.Prefs)1 PreferencesException (ugh.exceptions.PreferencesException)1 XStream (ugh.fileformats.mets.XStream)1