dspaceContext.setIgnoreAuthorization(true);
DSpace dspace = new DSpace();
ApplicationService applicationService = dspace.getServiceManager()
.getServiceByName("applicationService",
ApplicationService.class);
CommandLineParser parser = new PosixParser();
String xmlFilePath = null;
Options options = new Options();
options.addOption("rpmode", "rpmode", false, "if this check exist then import from internal database");
options.addOption("f", "file", true, "File xml to import");
options.addOption("h", "help", false, "help");
options.addOption("status", "status", false, "Get active RPs only");
options.addOption("active", "active", false,
"Set active true newly created grants public");
options.addOption("newly", "newly", false,
"Get only newly grants find on rps");
// RPs status flag. Default is get public RPs
boolean status = false;
// RGs active flag. Default is inactive.
boolean active = false;
// Import only newly grants (with new grantCode)
boolean newly = false;
CommandLine line = parser.parse(options, args);
if (line.hasOption('h')) {
HelpFormatter myhelp = new HelpFormatter();
myhelp.printHelp("ScriptHRURP \n", options);
System.out