Skip to content
This repository has been archived by the owner on Sep 25, 2022. It is now read-only.

Commit

Permalink
🐛 Fix issue #42
Browse files Browse the repository at this point in the history
  • Loading branch information
pmonks committed Aug 31, 2015
1 parent 4e13146 commit b8feed7
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 78 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@
<td width="25%">Status:</td>
<td width="75%" id="detailsStatus" style="color:[@stateToHtmlColour importStatus.processingState/]">${(importStatus.processingState!"")?html}</td>
</tr>
<tr>
<td>Initiating User:</td>
<td>${(importStatus.initiatingUserId!"n/a")?html}</td>
</tr>
<tr>
<td>Source Name:</td>
<td>${(importStatus.sourceName!"n/a")?html}</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"neverRun" : ${importStatus.neverRun()?c}
[#if !importStatus.neverRun()]
,
[#if importStatus.initiatingUserId??]
"initiatingUserId" : "${importStatus.initiatingUserId?js_string?replace("\\'", "'")?replace("\\>", ">")}",
[/#if]
[#if importStatus.sourceName??]
"sourceName" : "${importStatus.sourceName?js_string?replace("\\'", "'")?replace("\\>", ">")}",
[/#if]
Expand Down

This file was deleted.

5 changes: 4 additions & 1 deletion amp/src/main/amp/module.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ module.title=Alfresco Bulk Import v2.0-RC4-SNAPSHOT (for Alfresco v5.0+)
module.description=Alfresco Bulk Import tool. Provides high performance bulk loading of content into Alfresco.
module.repo.version.min=5.0.0
module.repo.version.max=5.99.99
module.editions=Community,Enterprise

# Note: this is commented out as Alfresco Community 5.0 appears to have a bug in it that breaks module edition compatibility checking.
# See: https://groups.google.com/forum/#!topic/alfresco-bulk-filesystem-import/ssNknci8c70
#module.editions=Community,Enterprise
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public class BulkImportStatusImpl
// General information
private AtomicBoolean inProgress = new AtomicBoolean(false);
private ProcessingState state = ProcessingState.NEVER_RUN;
private String initiatingUserId = null;
private BulkImportSource source = null;
private String targetSpace = null;
private boolean inPlaceImportPossible = false;
Expand All @@ -71,6 +72,7 @@ public class BulkImportStatusImpl
private ConcurrentMap<String, AtomicLong> targetCounters = new ConcurrentHashMap<String, AtomicLong>(16); // Start with a reasonable number of target counter slots

// Public methods
@Override public String getInitiatingUserId() { return(initiatingUserId); };
@Override public String getSourceName() { String result = null; if (source != null) result = source.getName(); return(result); }
@Override public Map<String, String> getSourceParameters() { Map<String, String> result = null; if (source != null) result = source.getParameters(); return(result); }
@Override public String getTargetPath() { return(targetSpace); }
Expand Down Expand Up @@ -205,7 +207,8 @@ public String getLastExceptionAsString()
@Override public Float getTargetCounterRate(final String counterName, final TimeUnit timeUnit) { return(calculateRate(getTargetCounter(counterName), getDurationInNs(), timeUnit)); }

@Override
public void importStarted(final BulkImportSource source,
public void importStarted(final String initiatingUserId,
final BulkImportSource source,
final String targetSpace,
final BulkImportThreadPoolExecutor threadPool,
final long batchWeight,
Expand All @@ -218,6 +221,7 @@ public void importStarted(final BulkImportSource source,
}

this.state = ProcessingState.SCANNING;
this.initiatingUserId = initiatingUserId;
this.source = source;
this.targetSpace = targetSpace;
this.threadPool = threadPool;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ public void run()

if (info(log)) info(log, "Import (" + (inPlacePossible ? "in-place" : "streaming") + ") started from " + source.getName() + ".");

importStatus.importStarted(source,
importStatus.importStarted(userId,
source,
targetAsPath,
importThreadPool,
batchWeight,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,13 @@
public interface WritableBulkImportStatus
extends BulkImportSourceStatus
{
void importStarted(BulkImportSource source, String targetSpace, BulkImportThreadPoolExecutor threadPool, long batchWeight, boolean inPlaceImportPossible, boolean isDryRun);
void importStarted(String initiatingUserId,
BulkImportSource source,
String targetSpace,
BulkImportThreadPoolExecutor threadPool,
long batchWeight,
boolean inPlaceImportPossible,
boolean isDryRun);
void scanningComplete();
void stopRequested();
void importComplete();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ public interface BulkImportStatus
TARGET_COUNTER_NODES_SKIPPED,
TARGET_COUNTER_OUT_OF_ORDER_RETRIES };

/**
* @return The userId of the person who initiatied the import <i>(will be null if an import has never been run)</i>.
*/
String getInitiatingUserId();

/**
* @return The name of the source used for the active (or previous) import <i>(will be null if an import has never been run)</i>.
Expand All @@ -74,12 +78,10 @@ public interface BulkImportStatus
*/
String getTargetPath();


/**
* @return A human-readable textual representation of the current processing state of the import <i>(will not be null)</i>.
*/
String getProcessingState();


/**
* State query methods, as per this state table:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public final class SampleSource

private final static String IMPORT_SOURCE_NAME = "Sample";

private final static String IMPORT_SOURCE_DESCRIPTION = "This import source is a sample that synthesises a small amount of hardcoded content. It primarily exists as a working example source code for a custom import source.";
private final static String IMPORT_SOURCE_DESCRIPTION = "This import source is a sample that synthesises a small amount of hardcoded content. It primarily exists as a working example of a custom import source, but is otherwise not very useful.";
private final static String IMPORT_SOURCE_CONFIG_UI_URI = "/bulk/import/samplesource/config";

final static String SOURCE_COUNTER_NAME_FOLDERS_SYNTHESISED = "Folders synthesised";
Expand Down

0 comments on commit b8feed7

Please sign in to comment.