Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VIVO-1545] Tracking of user changes to the content store #81

Closed
wants to merge 1 commit into from

Conversation

grahamtriggs
Copy link
Member

VIVO-1545: (please link to issue)

What does this pull request do?

The pull request adds a module that enables tracking of changes being made in the triple store by users through the Vitro user interface.

Changes are recorded in a triple store, with the users ID (URI), the time, and the changes that have been made.

A user interface (/audit) is also provided that, when logged in, displays the changes that have been made by that user.

What's new?

Adds a new AuditModule application module
TDBAuditModule can be configured / enabled via the applicationSetup.n3
A servlet request listener and RDFService change listener work in tandem to capture any changes made to the content store, and record those changes in a dedicated TDB store.

How should this be tested?

An unmodified applicationSetup.n3 should result in no changes to the application behaviour / home directory.
Adding the TDBAuditModule configuration to applicationSetup.n3 will:

  • create a TDB store in the file system (the recommendation is to be "tdbAuditModels" within the Vitro home directory)
  • Any modifications to the data (e.g. editing a Person's overview) will result in the changes being logged in audit TDB store, but otherwise there will be no difference to the perceived behaviour of the application.
  • Whilst logged in, accessing /audit will show the changes that the logged in user has previously made

Everything else about the application should operate normally - every request will be going through the servlet request listener, but it will not be doing any work when there is no logged in user / changes made to the content store.

Additional Notes:

As it is adding a listener to the RDFService, this change will only work without side effects when the (already merged) change to do a stream reset inside the loop is present:
#79

Interested parties

@VIVO-project/vivo-committers

@awoods
Copy link
Member

awoods commented Sep 26, 2018

Instead of adding more code to the codebase, does this new feature represent an opportunity to have a pluggable, external library, optionally wired into Vitro?

@j2blake
Copy link
Member

j2blake commented Sep 27, 2018

@awoods I like your idea, but how do we generalize it? Would it be feasible for this to become:

  • a separate repo/codebase within the vivo-project?
    • or within vivo-community?
  • a Maven artifact that could be optionally included in pom.xml by the VIVO administrator/installer?

What other portions of the VIVO codebase would be eligible for this sort of partitioning?

  • The Data Distribution API?
  • The Elasticsearch driver?
    • or perhaps the Solr 7 driver, if Elasticsearch becomes the default

Graham has already pointed out the perils of circular dependency, in relation to the Data Distribution API. We would need to make changes to the build script, so modules like these would be dependent on the vitro-api artifact, and then VIVO would be dependent on the result.

Food for thought...

@awoods
Copy link
Member

awoods commented Sep 27, 2018

@grahamtriggs : thoughts?

@awoods awoods closed this Jan 28, 2020
@gneissone
Copy link
Member

Reopening this pull request. In an effort to follow current best practices, the VIVO project will now be developed against the master branch. As a result of removing the develop branch, this pull request was automatically closed by GitHub, apologies for any confusion this may have caused.

@gneissone gneissone reopened this Feb 5, 2020
@gneissone gneissone changed the base branch from develop to master February 5, 2020 16:08
Base automatically changed from master to main January 20, 2021 17:29
@litvinovg litvinovg self-requested a review December 18, 2021 12:28
@litvinovg
Copy link
Contributor

I think this PR should be closed because the approach of synchronizing the servlet request listener events and the RDFService change listener events by time will not work reliably.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants