Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
issue imixs#350
  • Loading branch information
rsoika committed Feb 27, 2018
1 parent 31b3a30 commit b9e9130
Showing 1 changed file with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public boolean run(ItemCollection adminp) throws AdminPException {
}
Date datFilterFrom = adminp.getItemValueDate("datfrom");
Date datFilterTo = adminp.getItemValueDate("datto");

int iUpdates = adminp.getItemValueInteger("numUpdates");
int iProcessed = adminp.getItemValueInteger("numProcessed");
String fromUserID = adminp.getItemValueString("namFrom").trim();
Expand Down Expand Up @@ -134,14 +134,14 @@ public boolean run(ItemCollection adminp) throws AdminPException {
sQuery += " AND ($writeaccess:\"" + fromUserID + "\" OR $readaccess:\"" + fromUserID + "\" OR namowner:\""
+ fromUserID + "\" OR $creator:\"" + fromUserID + "\" OR namcreator:\"" + fromUserID + "\" )";


if (datFilterFrom!=null && datFilterTo!=null ) {
if (datFilterFrom != null && datFilterTo != null) {
SimpleDateFormat luceneFormat = new SimpleDateFormat("yyyyMMdd");
sQuery += " AND ($created:["+luceneFormat.format(datFilterFrom)+ " TO " + luceneFormat.format(datFilterTo) + "])";
sQuery += " AND ($created:[" + luceneFormat.format(datFilterFrom) + " TO "
+ luceneFormat.format(datFilterTo) + "])";
}

adminp.replaceItemValue("txtQuery", sQuery);

Collection<ItemCollection> col;
try {
// ASC sorting is important here!
Expand Down Expand Up @@ -172,15 +172,14 @@ public boolean run(ItemCollection adminp) throws AdminPException {
adminp.replaceItemValue("numIndex", iIndex);

long time = (System.currentTimeMillis() - lProfiler) / 1000;
if (time==0) {
time=1;
if (time == 0) {
time = 1;
}

logger.info("Job " + AdminPService.JOB_RENAME_USER + " (" + adminp.getUniqueID() + ") - " + colSize
+ " documents processed, " + iUpdates + " updates in " + time + " sec. (in total: " + iProcessed
+ " processed, " + iUpdates + " updates)");


// if colSize<numBlockSize we can stop the timer
if (colSize < iBlockSize) {
// prepare for rerun
Expand Down Expand Up @@ -217,7 +216,7 @@ public boolean updateWorkitemUserIds(ItemCollection entity, String from, String
if (entity.getItemValueBoolean("$immutable")) {
return false;
}

// Verify Fields
if (updateList(entity.getItemValue("$ReadAccess"), from, to, replace))
bUpdate = true;
Expand All @@ -228,12 +227,13 @@ public boolean updateWorkitemUserIds(ItemCollection entity, String from, String
if (updateList(entity.getItemValue("namOwner"), from, to, replace))
bUpdate = true;

// !! We do not replace the creator!! - we only allow additions here!
if (updateList(entity.getItemValue("$Creator"), from, to, false))
bUpdate = true;
if (updateList(entity.getItemValue("namCreator"), from, to, false))
bUpdate = true;

// !! We do not replace the creator!! - see issue #350
/*
* if (updateList(entity.getItemValue("$Creator"), from, to, false)) bUpdate =
* true;
*/


if (bUpdate) {
// create log entry....
String summary = "Rename: " + from + " -> " + to + " (replace=" + replace + ")";
Expand Down

0 comments on commit b9e9130

Please sign in to comment.