Package org.mycore.frontend.cli
Class MCRBatchEditorCommands
java.lang.Object
org.mycore.frontend.cli.MCRAbstractCommands
org.mycore.frontend.cli.MCRBatchEditorCommands
- All Implemented Interfaces:
MCRExternalCommandInterface
@MCRCommandGroup(name="Batch Editor")
public class MCRBatchEditorCommands
extends MCRAbstractCommands
Commands to batch add/remove/replace values
like identifiers, categories, tags, flags etc. within XML.
Supported fields are completely configurable using XPath expressions.
- Author:
- Frank Lützenkirchen
-
Field Summary
Fields inherited from class org.mycore.frontend.cli.MCRAbstractCommands
command
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
static void
batchAddIf
(String oid, String level, String fieldIf, String valueIf, String field2Add, String value2Add) static void
batchRemove
(String oid, String level, String field, String value) static void
batchRemoveIf
(String oid, String level, String fieldIf, String valueIf, String field2Rem, String value2Rem) static void
batchReplace
(String oid, String level, String oldField, String oldValue, String newField, String newValue) static void
edit
(String oid, String level, org.mycore.frontend.cli.MCRBatchEditorCommands.Action a, String field1, String value1, String field2, String value2) Methods inherited from class org.mycore.frontend.cli.MCRAbstractCommands
addCommand, getDisplayName, getPossibleCommands, setDisplayName
-
Constructor Details
-
MCRBatchEditorCommands
public MCRBatchEditorCommands()
-
-
Method Details
-
batchAdd
@MCRCommand(syntax="edit {0} at {1} add {2} {3}", help="Edit XML elements in object {0} at level {1} in object {1}, add field {2} with value {3}", order=2) public static void batchAdd(String oid, String level, String field, String value) throws org.jaxen.JaxenException, MCRPersistenceException, MCRAccessException, IOException - Throws:
org.jaxen.JaxenException
MCRPersistenceException
MCRAccessException
IOException
-
batchAddIf
@MCRCommand(syntax="edit {0} at {1} if {2} {3} add {4} {5}", help="Edit XML elements in object {0} at level {1}, if there is a field {2} with value {3}, add field {4} with value {5}", order=1) public static void batchAddIf(String oid, String level, String fieldIf, String valueIf, String field2Add, String value2Add) throws org.jaxen.JaxenException, MCRPersistenceException, MCRAccessException, IOException - Throws:
org.jaxen.JaxenException
MCRPersistenceException
MCRAccessException
IOException
-
batchRemove
@MCRCommand(syntax="edit {0} at {1} remove {2} {3}", help="Edit XML elements at in object {0} at level {1}, remove field {2} where value is {3}", order=2) public static void batchRemove(String oid, String level, String field, String value) throws MCRPersistenceException, MCRAccessException, org.jaxen.JaxenException, IOException - Throws:
MCRPersistenceException
MCRAccessException
org.jaxen.JaxenException
IOException
-
batchRemoveIf
@MCRCommand(syntax="edit {0} at {1} if {2} {3} remove {4} {5}", help="Edit XML elements in object {0} at level {1}, if there is a field {2} with value {3}, remove field {4} where value is {5}", order=1) public static void batchRemoveIf(String oid, String level, String fieldIf, String valueIf, String field2Rem, String value2Rem) throws MCRPersistenceException, MCRAccessException, org.jaxen.JaxenException, IOException - Throws:
MCRPersistenceException
MCRAccessException
org.jaxen.JaxenException
IOException
-
batchReplace
@MCRCommand(syntax="edit {0} at {1} replace {2} {3} with {4} {5}", help="Edit XML elements in object {0} at level {1}, replace field {2} value {3} by field {4} with value {5}", order=1) public static void batchReplace(String oid, String level, String oldField, String oldValue, String newField, String newValue) throws org.jaxen.JaxenException, MCRPersistenceException, MCRAccessException, IOException - Throws:
org.jaxen.JaxenException
MCRPersistenceException
MCRAccessException
IOException
-
edit
public static void edit(String oid, String level, org.mycore.frontend.cli.MCRBatchEditorCommands.Action a, String field1, String value1, String field2, String value2) throws org.jaxen.JaxenException, MCRPersistenceException, MCRAccessException, IOException - Throws:
org.jaxen.JaxenException
MCRPersistenceException
MCRAccessException
IOException
-