~ralf-claussnitzer-deactivatedaccount/goobi-production/1.10.x

« back to all changes in this revision

Viewing changes to Goobi/src/de/sub/goobi/metadaten/copier/CopierData.java

  • Committer: Henning Gerhardt
  • Date: 2014-11-14 12:28:25 UTC
  • mfrom: (520.2.15)
  • Revision ID: git-v1:a20401d39141649b31d2f22e3ebdcd95fabd26ad
Merge remote-tracking branch 'matthias-ronge/issue_172' into 1.10.x

Conflicts:
        Goobi/src/de/sub/goobi/metadaten/copier/MetadataPathSelector.java

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
 */
39
39
package de.sub.goobi.metadaten.copier;
40
40
 
 
41
import java.sql.SQLException;
 
42
 
41
43
import ugh.dl.DigitalDocument;
42
44
import ugh.dl.DocStruct;
43
45
import ugh.dl.Fileformat;
44
46
import ugh.dl.Prefs;
45
47
import ugh.exceptions.PreferencesException;
46
48
import de.sub.goobi.beans.Prozess;
 
49
import de.sub.goobi.persistence.apache.MySQLHelper;
 
50
import de.sub.goobi.persistence.apache.ProcessObject;
47
51
 
48
52
/**
49
53
 * A CopierData object contains all the data the data copier has access to. It
68
72
        /**
69
73
         * The Goobi process corresponding to the workspace file
70
74
         */
71
 
        private final Prozess process;
 
75
        private final Object process;
72
76
 
73
77
        /**
74
78
         * Creates a new CopierData bean with an additional destination metadata
93
97
         * @param process
94
98
         *            the related goobi process
95
99
         */
96
 
        public CopierData(Fileformat fileformat, Prozess process) {
 
100
        public CopierData(Fileformat fileformat, Object process) {
97
101
                this.fileformat = fileformat;
98
102
                this.process = process;
99
103
                this.destination = null;
137
141
         * 
138
142
         * @return the required ruleset.
139
143
         */
140
 
        public Prefs getPreferences() {
141
 
                return process.getRegelsatz().getPreferences();
 
144
        public Prefs getPreferences() throws SQLException {
 
145
                if (process instanceof ProcessObject) {
 
146
                        return MySQLHelper.getRulesetForId(((ProcessObject) process).getRulesetId()).getPreferences();
 
147
                } else {
 
148
                        return ((Prozess) process).getRegelsatz().getPreferences();
 
149
                }
142
150
        }
143
151
 
144
152
        /**