DocStruct dsFirst = null;
if (dsTop.getAllChildren() != null && dsTop.getAllChildren().size() > 0) {
dsFirst = dsTop.getAllChildren().get(0);
}
MetadataType mdtPpnDigital = ughhelp.getMetadataType(myPrefs, "CatalogIDDigital");
MetadataType mdtPpnAnalog = ughhelp.getMetadataType(myPrefs, "CatalogIDSource");
List<? extends Metadata> alleMetadaten;
/* digitale PPN korrigieren */
if (dsFirst != null) {
alleMetadaten = dsFirst.getAllMetadataByType(mdtPpnDigital);
if (alleMetadaten != null && alleMetadaten.size() > 0) {
Metadata md = alleMetadaten.get(0);
myLogger.debug(md.getValue());
if (!md.getValue().endsWith(myBandnr)) {
md.setValue(md.getValue() + myBandnr);
Helper.setMeldung(null, "PPN digital adjusted: ", p.getTitel());
}
}
/* analoge PPN korrigieren */
alleMetadaten = dsFirst.getAllMetadataByType(mdtPpnAnalog);
if (alleMetadaten != null && alleMetadaten.size() > 0) {
Metadata md1 = alleMetadaten.get(0);
myLogger.debug(md1.getValue());
if (!md1.getValue().endsWith(myBandnr)) {
md1.setValue(md1.getValue() + myBandnr);
Helper.setMeldung(null, "PPN analog adjusted: ", p.getTitel());
}
}
}
/* Collections korrigieren */
List<String> myKollektionenTitel = new ArrayList<String>();
MetadataType coltype = ughhelp.getMetadataType(myPrefs, "singleDigCollection");
ArrayList<Metadata> myCollections;
if (dsTop.getAllMetadataByType(coltype) != null && dsTop.getAllMetadataByType(coltype).size() != 0) {
myCollections = new ArrayList<Metadata>(dsTop.getAllMetadataByType(coltype));
if (myCollections != null && myCollections.size() > 0) {
for (Metadata md : myCollections) {