Actions
Task #182
closedAudit for all entities
Added by Ondřej Kopr about 8 years ago. Updated about 8 years ago.
Start date:
11/15/2016
Due date:
% Done:
100%
Estimated time:
(Total: 0.00 h)
Owner:
Description
- New item in menu Audit - Audit?
- Agenda audit with table. All entities in one table (Identity, Role, Notification, tree structure, tree nodes, ...)
- Filter with from, to, who edited, which entity.
- BE new endpoint - audit, with quick search implementation for filter.
- Envers collect all entities and back it in pageable object for table.
- Detail for one recrod? Discussion.
Updated by Ondřej Kopr about 8 years ago
- % Done changed from 20 to 0
In AuditListener was not able to access to application context. Solutions was found: https://guylabs.ch/2014/02/22/autowiring-pring-beans-in-hibernate-jpa-entity-listeners/ and http://stackoverflow.com/questions/8519862/hibernate-envers-revisionlistener-spring-integration-as-spring-bean
Updated by Ondřej Kopr about 8 years ago
- % Done changed from 70 to 80
- Connect envers listener to our entity - IdmAudit
- New table idm_audit - Repository with find method and controller with quick search.
- Audit service use find quick and envers queries for getting revision and audit entity - Method findRevision return object from _aud tables, findRevisions return revisions from idm_audit table.
- Method getNameChangedColumns use property descriptor, please check correct use.
- Method getAllAuditedEntitiesNames return list of audited entities, use meta model.
- Method getLastVersionNumber using envers queries and return last revisionNumber (id) for entity.
- Tests will be implemented in another task.
Please do code review. Thank you.
Updated by Ondřej Kopr about 8 years ago
Possible extensions
- Modifier - in select box missing [SYSTEM]
- Detail - diff two version? Detail of entity?
- Add original modifier
- Version
Updated by Ondřej Kopr about 8 years ago
- Status changed from In Progress to Needs feedback
- Assignee changed from Ondřej Kopr to Radek Tomiška
Updated by Radek Tomiška about 8 years ago
- Assignee changed from Radek Tomiška to Vít Švanda
Updated by Vít Švanda about 8 years ago
- Status changed from Needs feedback to In Progress
- Assignee changed from Vít Švanda to Ondřej Kopr
- Sort in audit table is not working
-- When i try sort over revisionId (and others), then is workin only asc
-- When i try sort over revisonDate, then i get error
org.hibernate.QueryException: could not resolve property: revisionDate of: eu.bcvsolutions.idm.core.model.entity.IdmAudit [SELECT e FROM eu.bcvsolutions.idm.core.model.entity.IdmAudit e WHERE (?1 IS null OR lower(e.modification) like ?2 ) AND (?3 IS null OR lower(e.changedAttributes) like ?4 ) AND (?5 IS null OR (lower(e.modifier) like ?6 AND lower(e.originalModifier) like ?6 )) AND (?8 IS null OR e.entityId = ?8 ) AND (?10 = 'null' or e.timestamp >= ?11 ) AND (?12 = 'null' or e.timestamp <= ?13 ) AND (?14 IS null OR lower(e.type) like ?15 ) order by e.revisionDate asc]; nested exception is java.lang.IllegalArgumentException: org.hibernate.QueryException: could not resolve property: revisionDate of: eu.bcvsolutions.idm.core.model.entity.IdmAudit [SELECT e FROM eu.bcvsolutions.idm.core.model.entity.IdmAudit e WHERE (?1 IS null OR lower(e.modification) like ?2 ) AND (?3 IS null OR lower(e.changedAttributes) like ?4 ) AND (?5 IS null OR (lower(e.modifier) like ?6 AND lower(e.originalModifier) like ?6 )) AND (?8 IS null OR e.entityId = ?8 ) AND (?10 = 'null' or e.timestamp >= ?11 ) AND (?12 = 'null' or e.timestamp <= ?13 ) AND (?14 IS null OR lower(e.type) like ?15 ) order by e.revisionDate asc]
- When I removed some IdentityContract from Identity, then I don't see item in auditlog for IdentityContract delete.
- When I add subrole to some role, then I see in auditlog delete operation (create missing) for multiplied fields (subRoles, superiorRoles,guarantees, subRoles,superiorRoles, authorities,superiorRoles).
- In this branch is not woking search for workflow instances/tasks (http://localhost:3000/#/identity/admin/roles). Why is missing "quick/search" in url (http://localhost:8080/idm-backend/api/v1/workflow/processes?size=10&page=0&sort=processDefinitionName,asc&identity=admin&category=eu.bcvsolutions.identity.roles.change)
..to be continued...
Updated by Ondřej Kopr about 8 years ago
Thank you for report.
- Sort over revisonDate was fixed. Problem was in name of column,
- problem with ASC sorting was fix. In audit table was user forceSearchParameters changed to defaultSearchParameters
- Search for workflow instance/task was fixed. Problem: To abstract service was added override setName for search parameters. Fix if statement.
- Remove all audited annotations from list and add save to child revision
Updated by Ondřej Kopr about 8 years ago
- Status changed from In Progress to Needs feedback
- Assignee changed from Ondřej Kopr to Vít Švanda
Updated by Vít Švanda about 8 years ago
- Status changed from Needs feedback to In Progress
I did review and everything looking good.
Updated by Vít Švanda about 8 years ago
- Assignee changed from Vít Švanda to Ondřej Kopr
Updated by Ondřej Kopr about 8 years ago
- AuditFilter - fix style,
- remove unnecessary rawtypes check from AuditListener, method changeRevisionEntity.
- remove selectBox with identity and add simple textfield,
- replace exception e.printStackTrace with IllegalArgumentException. Found on DefaultAuditService,
- fix alert margin in table.
Updated by Ondřej Kopr about 8 years ago
- Status changed from In Progress to Closed
Actions