Skip to content
Snippets Groups Projects
Commit 5dcd5112 authored by Andreas Romeyke's avatar Andreas Romeyke
Browse files

- added Readme

- added workaround to detect collisions regardless if file:// is used or not
- removed stacktrace in case of collsion detection
parent b9634001
Branches
No related tags found
No related merge requests found
Plugin to fix wrong fileOriginalPath entries in AIPs
====================================================
== compile
To compile it, you need an installed Rosetta API from ExlibrisGroup:
$> ant clean
$> ant jar
== install
Then copy the resulting jar-file "target/DnxMoveFileOriginalPath.jar" to the
custom-dir in the rosetta plugin directory (/operational_shared/plugins/custom/)
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
</fr:x_form> </fr:x_form>
</pl:initParameters> </pl:initParameters>
<pl:description>repairs broken file original paths</pl:description> <pl:description>repairs broken file original paths</pl:description>
<pl:version>1.11</pl:version> <pl:version>1.13</pl:version>
<pl:materialType>DIGITAL</pl:materialType> <pl:materialType>DIGITAL</pl:materialType>
<pl:module>Repository</pl:module> <pl:module>Repository</pl:module>
<pl:generalType>TASK</pl:generalType> <pl:generalType>TASK</pl:generalType>
......
...@@ -50,7 +50,13 @@ public class DnxMoveFileOriginalPath implements RepositoryTaskPlugin { ...@@ -50,7 +50,13 @@ public class DnxMoveFileOriginalPath implements RepositoryTaskPlugin {
DnxDocumentHelper ieDnxH = ieEditor.getDnxHelper(filePid); DnxDocumentHelper ieDnxH = ieEditor.getDnxHelper(filePid);
DnxDocumentHelper.GeneralFileCharacteristics ieGfs = ieDnxH.getGeneralFileCharacteristics(); DnxDocumentHelper.GeneralFileCharacteristics ieGfs = ieDnxH.getGeneralFileCharacteristics();
String currentFileOriginalPath = ieGfs.getFileOriginalPath(); String currentFileOriginalPath = ieGfs.getFileOriginalPath();
filePaths.add( currentFileOriginalPath ); // workaround to check if fileOriginalPath has no "file://" because the replacement
// always(!) starts with "file://"
if (currentFileOriginalPath.startsWith("file://") ) {
filePaths.add( currentFileOriginalPath );
} else {
filePaths.add( "file://" + currentFileOriginalPath);
}
} catch (DigitoolException e) { } catch (DigitoolException e) {
IEsuccess = false; IEsuccess = false;
String err = "unknown Digitool exception: " + e; String err = "unknown Digitool exception: " + e;
...@@ -77,7 +83,6 @@ public class DnxMoveFileOriginalPath implements RepositoryTaskPlugin { ...@@ -77,7 +83,6 @@ public class DnxMoveFileOriginalPath implements RepositoryTaskPlugin {
} catch (FileOriginalPathCollisionException e) { } catch (FileOriginalPathCollisionException e) {
IEsuccess = false; IEsuccess = false;
log.error(e.getMessage()); log.error(e.getMessage());
e.printStackTrace();
taskResults.addResult(ieEditor.getIEPid(), null, false, e.getMessage()); taskResults.addResult(ieEditor.getIEPid(), null, false, e.getMessage());
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment