mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Fixed MOB-1656: Audit Log: Log ordering is incorrect for "Last N" results
- Added option to have results in either ascending or descending order - RM uses descending listings where the query results are limited git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@16628 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -383,7 +383,10 @@ public abstract class AbstractAuditDAOImpl implements AuditDAO
|
||||
if (auditValuesPair == null)
|
||||
{
|
||||
// Ignore
|
||||
logger.warn("Audit entry not joined to audit properties: " + row);
|
||||
more = callback.handleAuditEntryError(
|
||||
row.getAuditEntryId(),
|
||||
"Audit entry not joined to audit properties: " + row,
|
||||
null);
|
||||
return;
|
||||
}
|
||||
auditValues = (Map<String, Serializable>) auditValuesPair.getSecond();
|
||||
@@ -397,17 +400,26 @@ public abstract class AbstractAuditDAOImpl implements AuditDAO
|
||||
}
|
||||
catch (ClassCastException e)
|
||||
{
|
||||
logger.warn("Audit entry not linked to a Map<String, Serializable> value: " + row);
|
||||
more = callback.handleAuditEntryError(
|
||||
row.getAuditEntryId(),
|
||||
"Audit entry not linked to a Map<String, Serializable> value: " + row,
|
||||
e);
|
||||
return;
|
||||
}
|
||||
catch (Throwable e)
|
||||
{
|
||||
logger.warn("Audit entry unable to extract audited values: " + row, e);
|
||||
more = callback.handleAuditEntryError(
|
||||
row.getAuditEntryId(),
|
||||
"Audit entry unable to extract audited values: " + row,
|
||||
e);
|
||||
return;
|
||||
}
|
||||
if (auditValues == null)
|
||||
{
|
||||
logger.warn("Audit entry incompletely joined to audit properties: " + row);
|
||||
more = callback.handleAuditEntryError(
|
||||
row.getAuditEntryId(),
|
||||
"Audit entry incompletely joined to audit properties: " + row,
|
||||
null);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -430,25 +442,28 @@ public abstract class AbstractAuditDAOImpl implements AuditDAO
|
||||
|
||||
public void findAuditEntries(
|
||||
AuditQueryCallback callback,
|
||||
boolean forward,
|
||||
String applicationName, String user, Long from, Long to,
|
||||
int maxResults)
|
||||
{
|
||||
AuditQueryRowHandler rowHandler = new AuditQueryRowHandler(callback);
|
||||
findAuditEntries(rowHandler, applicationName, user, from, to, maxResults, null, null);
|
||||
findAuditEntries(rowHandler, forward, applicationName, user, from, to, maxResults, null, null);
|
||||
}
|
||||
|
||||
public void findAuditEntries(
|
||||
AuditQueryCallback callback,
|
||||
boolean forward,
|
||||
String applicationName, String user, Long from, Long to,
|
||||
String searchKey, Serializable searchValue,
|
||||
int maxResults)
|
||||
{
|
||||
AuditQueryRowHandler rowHandler = new AuditQueryRowHandler(callback);
|
||||
findAuditEntries(rowHandler, applicationName, user, from, to, maxResults, searchKey, searchValue);
|
||||
findAuditEntries(rowHandler, forward, applicationName, user, from, to, maxResults, searchKey, searchValue);
|
||||
}
|
||||
|
||||
protected abstract void findAuditEntries(
|
||||
AuditQueryRowHandler rowHandler,
|
||||
boolean forward,
|
||||
String applicationName, String user, Long from, Long to, int maxResults,
|
||||
String searchKey, Serializable searchValue);
|
||||
}
|
||||
|
Reference in New Issue
Block a user