marmotta-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wik...@apache.org
Subject git commit: MARMOTTA-145: provide feedback at the ui about the target context where data is being imported
Date Mon, 02 Sep 2013 14:43:59 GMT
Updated Branches:
  refs/heads/develop bbd900e2a -> ed115fcff


MARMOTTA-145: provide feedback at the ui about the target context where data is being imported


Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/ed115fcf
Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/ed115fcf
Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/ed115fcf

Branch: refs/heads/develop
Commit: ed115fcff04d03265336d876c1c533efeaf7fa06
Parents: bbd900e
Author: Sergio Fernández <wikier@apache.org>
Authored: Mon Sep 2 16:14:33 2013 +0200
Committer: Sergio Fernández <wikier@apache.org>
Committed: Mon Sep 2 16:14:33 2013 +0200

----------------------------------------------------------------------
 .../services/importer/ImportWatchServiceImpl.java   | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/ed115fcf/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/importer/ImportWatchServiceImpl.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/importer/ImportWatchServiceImpl.java
b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/importer/ImportWatchServiceImpl.java
index 76a9590..06e9106 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/importer/ImportWatchServiceImpl.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/importer/ImportWatchServiceImpl.java
@@ -66,8 +66,12 @@ import com.ibm.icu.text.CharsetMatch;
 @ApplicationScoped
 public class ImportWatchServiceImpl implements ImportWatchService {
 
-	private static final String TASK_GROUP = "ImportWatch";
+	private static final String TASK_GROUP = "Import Watch";
 
+	private static final String TASK_DETAIL_PATH = "path";
+	
+	private static final String TASK_DETAIL_CONTEXT = "context";
+	
 	@Inject
 	private Logger log;
 
@@ -107,7 +111,7 @@ public class ImportWatchServiceImpl implements ImportWatchService {
 			public void run() {
 				final Task task = taskManagerService.createTask("Directory import watch", TASK_GROUP);
 				task.updateMessage("watching...");
-				task.updateDetailMessage("path", path);
+				task.updateDetailMessage(TASK_DETAIL_PATH, path);
 
 				try {
 					Path root = Paths.get(path);
@@ -128,10 +132,11 @@ public class ImportWatchServiceImpl implements ImportWatchService {
 									register(Paths.get(dir.toString(), item.toString()), watcher, StandardWatchEventKinds.ENTRY_CREATE,
StandardWatchEventKinds.ENTRY_DELETE);
 									task.updateProgress(++count);
 								} else {
+									URI context = getTargetContext(file);
 									log.debug("Importing '{}'...", file.getAbsolutePath());
 									task.updateMessage("importing...");
-									task.updateDetailMessage("path", file.getAbsolutePath());
-									URI context = getTargetContext(file);
+									task.updateDetailMessage(TASK_DETAIL_PATH, file.getAbsolutePath());
+									task.updateDetailMessage(TASK_DETAIL_CONTEXT, context.stringValue());
 									if (execImport(file, context)) {
 										log.info("Sucessfully imported file '{}' into {}", file.getAbsolutePath(), context.stringValue());
 										try {
@@ -144,7 +149,8 @@ public class ImportWatchServiceImpl implements ImportWatchService {
 									}
 									task.updateProgress(++count);
 									task.updateMessage("watching...");
-									task.updateDetailMessage("path", path);
+									task.updateDetailMessage(TASK_DETAIL_PATH, path);
+									task.removeDetailMessage(TASK_DETAIL_CONTEXT);
 								}
 							} else if (StandardWatchEventKinds.ENTRY_DELETE.equals(event.kind()) && Files.isDirectory(item))
{
 								//TODO: unregister deleted directories?


Mime
View raw message