1212import org .apache .commons .cli .ParseException ;
1313import org .dspace .eperson .EPerson ;
1414import org .dspace .eperson .factory .EPersonServiceFactory ;
15- import org .dspace .utils .DSpace ;
1615
1716/**
1817 * Extension of {@link DSpaceObjectDeletionProcess} for CLI execution.
@@ -26,12 +25,12 @@ public class DSpaceObjectDeletionProcessCli extends DSpaceObjectDeletionProcess
2625
2726 /**
2827 * Assigns the current user to the context based on the email parameter for CLI execution.
29- *
28+ *
3029 * This method overrides the parent implementation to support command-line execution
3130 * with explicit user specification via the -e (email) parameter. This is required for
3231 * CLI scenarios where the script is invoked directly from the command line rather than
3332 * through the REST API or other programmatic interfaces.
34- *
33+ *
3534 * Process:
3635 * <ul>
3736 * <li>Creates a new DSpace Context instance</li>
@@ -40,14 +39,14 @@ public class DSpaceObjectDeletionProcessCli extends DSpaceObjectDeletionProcess
4039 * <li>Validates that the EPerson exists in the system</li>
4140 * <li>Sets the found EPerson as the current user in the context</li>
4241 * </ul>
43- *
42+ *
4443 * Usage Example:
4544 * <pre>
4645 * ./dspace object-deletion -e admin@example.com -i [object-uuid]
4746 * </pre>
4847 *
49- * @throws SQLException if a database error occurs during EPerson lookup
50- * @throws ParseException if the required -e parameter is missing from command line
48+ * @throws SQLException if a database error occurs during EPerson lookup
49+ * @throws ParseException if the required -e parameter is missing from command line
5150 * @throws IllegalArgumentException if the provided email address doesn't match any existing EPerson
5251 */
5352 @ Override
@@ -67,4 +66,10 @@ protected void assignCurrentUserInContext() throws SQLException, ParseException
6766 }
6867 }
6968
69+ @ Override
70+ public DSpaceObjectDeletionProcessScriptConfiguration <DSpaceObjectDeletionProcess > getScriptConfiguration () {
71+ org .dspace .kernel .ServiceManager sm = new org .dspace .utils .DSpace ().getServiceManager ();
72+ return sm .getServiceByName (OBJECT_DELETION_SCRIPT , DSpaceObjectDeletionProcessCliScriptConfiguration .class );
73+ }
74+
7075}
0 commit comments