Skip to content

Commit f7fb1c4

Browse files
committed
set $nosnapshot=true (Issue #229)
1 parent d72b499 commit f7fb1c4

2 files changed

Lines changed: 14 additions & 12 deletions

File tree

imixs-archive-importer/src/main/java/org/imixs/archive/importer/DocumentImportController.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ public void saveConfiguration() {
117117
config.replaceItemValue(DocumentImportService.ITEM_SOURCES, mapItemList);
118118
}
119119

120+
// disable snapshot
121+
config.setItemValue("$nosnapshot", true);
120122
super.saveConfiguration();
121123
}
122124

@@ -167,8 +169,8 @@ public void addSource() {
167169
*/
168170
public void selectSource(int index) {
169171
if (sources != null) {
170-
if (index>sources.size()) {
171-
index=sources.size()-1;
172+
if (index > sources.size()) {
173+
index = sources.size() - 1;
172174
}
173175
source = sources.get(index);
174176
}
@@ -181,8 +183,8 @@ public void selectSource(int index) {
181183
*/
182184
public void removeSource(int index) {
183185
if (sources != null) {
184-
if (index>sources.size()) {
185-
index=sources.size()-1;
186+
if (index > sources.size()) {
187+
index = sources.size() - 1;
186188
}
187189
sources.remove(index);
188190
}

imixs-archive-importer/src/main/java/org/imixs/archive/importer/DocumentImportScheduler.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@
4949
public class DocumentImportScheduler implements Scheduler {
5050

5151
public static final String DOCUMENT_IMPORTER_NAME = "DOCUMENT_IMPORTER";
52-
52+
5353
@EJB
5454
DocumentImportService documentImportService;
55-
55+
5656
@Inject
5757
protected Event<DocumentImportEvent> importEvents;
5858

@@ -64,7 +64,6 @@ public class DocumentImportScheduler implements Scheduler {
6464
* process the source. If a event returns PROCESSING_RESULT_COMPLETED = 1 than
6565
* no more events will be fired for this source.
6666
*
67-
*
6867
* @param timer
6968
* @throws SchedulerException
7069
* @throws QueryException
@@ -73,10 +72,13 @@ public class DocumentImportScheduler implements Scheduler {
7372
public ItemCollection run(ItemCollection configuration) throws SchedulerException {
7473

7574
if (importEvents != null) {
75+
// disable snapshot
76+
configuration.setItemValue("$nosnapshot", true);
7677
// load all sources
7778
List<ItemCollection> sources = documentImportService.loadSourcesFromConfiguration(configuration);
7879
if (sources.size() > 0) {
79-
documentImportService.logMessage("Document import starting - " + sources.size() + " sources found...", configuration);
80+
documentImportService.logMessage("Document import starting - " + sources.size() + " sources found...",
81+
configuration);
8082
for (ItemCollection source : sources) {
8183
// Finally fire the DocumentImportEvent. This allows CDI Observers to process
8284
// the import
@@ -88,7 +90,7 @@ public ItemCollection run(ItemCollection configuration) throws SchedulerExceptio
8890
logger.severe("...Document Import Error");
8991
}
9092
}
91-
93+
9294
// update sources (a CDI bean may have added new data....)
9395
// convert the option ItemCollection elements into a List of Map
9496
List<Map> mapItemList = new ArrayList<Map>();
@@ -97,8 +99,7 @@ public ItemCollection run(ItemCollection configuration) throws SchedulerExceptio
9799
mapItemList.add(orderItem.getAllItems());
98100
}
99101
configuration.replaceItemValue(DocumentImportService.ITEM_SOURCES, mapItemList);
100-
101-
102+
102103
documentImportService.logMessage("Document import completed.", configuration);
103104
} else {
104105
documentImportService.logMessage("No sources defined.", configuration);
@@ -108,5 +109,4 @@ public ItemCollection run(ItemCollection configuration) throws SchedulerExceptio
108109
return configuration;
109110
}
110111

111-
112112
}

0 commit comments

Comments
 (0)