Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-stastny committed Oct 16, 2024
1 parent f78b2b5 commit 2736d1f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ public static void main(String[] args) throws InterruptedException, JAXBExceptio
int argsIndex = 0;
boolean policyPublic = Boolean.parseBoolean(args[argsIndex++]);
String importRoot = args.length > argsIndex ? args[argsIndex++] : KConfiguration.getInstance().getConfiguration().getString("convert.directory");

log.info(String.format("Import directory %s", importRoot));

String exportRoot = args.length > argsIndex ? args[argsIndex++] : KConfiguration.getInstance().getConfiguration().getString("convert.target.directory");
new MetsConvertor().run(importRoot, exportRoot, policyPublic, false, null, null, null);
} else { // as a process
Expand All @@ -106,6 +109,8 @@ public static void main(String[] args) throws InterruptedException, JAXBExceptio
String policy = args[argsIndex++];
boolean policyPublic = "PUBLIC".equals(policy);
String importRoot = args.length > argsIndex ? args[argsIndex++] : KConfiguration.getInstance().getConfiguration().getString("convert.directory");
log.info(String.format("Import directory %s", importRoot));

String exportRoot = args.length > argsIndex ? args[argsIndex++] : KConfiguration.getInstance().getConfiguration().getString("convert.target.directory");
boolean startIndexer = Boolean.valueOf(args.length > argsIndex ? args[argsIndex++] : KConfiguration.getInstance().getConfiguration().getString("ingest.startIndexer", "true"));

Expand Down
7 changes: 5 additions & 2 deletions processes/import/src/main/java/org/kramerius/Import.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ public static void main(String[] args) throws IOException, RepositoryException,
String authToken = args[argsIndex++]; //auth token always second, but still suboptimal solution, best would be if it was outside the scope of this as if ProcessHelper.scheduleProcess() similarly to changing name (ProcessStarter)
//process params
String importDirFromArgs = args.length > argsIndex ? args[argsIndex++] : null;
log.info(String.format("Import directory %s", importDirFromArgs));


Boolean startIndexerFromArgs = args.length > argsIndex ? Boolean.valueOf(args[argsIndex++]) : null;

String license = null;
Expand Down Expand Up @@ -184,8 +187,8 @@ public static void main(String[] args) throws IOException, RepositoryException,
log.info("start indexer: " + startIndexer);
log.info("license : " + license);

Import.run(fa, feeder, sortingServiceLocal, KConfiguration.getInstance().getProperty("ingest.url"), KConfiguration.getInstance().getProperty("ingest.user"), KConfiguration.getInstance().getProperty("ingest.password"), importDirectory, startIndexer, authToken,addCollection);
Import.run(fa, feeder, sortingServiceLocal, KConfiguration.getInstance().getProperty("ingest.url"), KConfiguration.getInstance().getProperty("ingest.user"), KConfiguration.getInstance().getProperty("ingest.password"), licensesImportFile.getAbsolutePath(), startIndexer, authToken,addCollection);

log.info( String.format("Deleting import folder %s", licensesImportFile));
FileUtils.deleteDirectory(licensesImportFile);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ public Response role(@PathParam("id") String roleId) {
try {
User user = this.userProvider.get();
if (permitRead(user) || permit(user)) {
//if (permit(this.userProvider.get())) {
Role role = this.userManager.findRole(Integer.parseInt(roleId));
if (role != null) {
return Response.ok().entity(roleToJSON(role).toString()).build();
Expand Down

0 comments on commit 2736d1f

Please sign in to comment.