|
@@ -10,7 +10,7 @@ import arrow
|
|
from rdflib import Graph, URIRef, Literal
|
|
from rdflib import Graph, URIRef, Literal
|
|
from rdflib.namespace import RDF
|
|
from rdflib.namespace import RDF
|
|
|
|
|
|
-from lakesuperior.env import env
|
|
|
|
|
|
+from lakesuperior import env, thread_env
|
|
from lakesuperior.globals import (
|
|
from lakesuperior.globals import (
|
|
RES_CREATED, RES_DELETED, RES_UPDATED, ROOT_UID)
|
|
RES_CREATED, RES_DELETED, RES_UPDATED, ROOT_UID)
|
|
from lakesuperior.dictionaries.namespaces import ns_collection as nsc
|
|
from lakesuperior.dictionaries.namespaces import ns_collection as nsc
|
|
@@ -411,7 +411,7 @@ class Ldpr(metaclass=ABCMeta):
|
|
else:
|
|
else:
|
|
add_trp = {
|
|
add_trp = {
|
|
(self.uri, RDF.type, nsc['fcsystem'].Tombstone),
|
|
(self.uri, RDF.type, nsc['fcsystem'].Tombstone),
|
|
- (self.uri, nsc['fcrepo'].created, env.timestamp_term),
|
|
|
|
|
|
+ (self.uri, nsc['fcrepo'].created, thread_env.timestamp_term),
|
|
}
|
|
}
|
|
|
|
|
|
self.modify(RES_DELETED, remove_trp, add_trp)
|
|
self.modify(RES_DELETED, remove_trp, add_trp)
|
|
@@ -432,7 +432,7 @@ class Ldpr(metaclass=ABCMeta):
|
|
Remove all traces of a resource and versions.
|
|
Remove all traces of a resource and versions.
|
|
"""
|
|
"""
|
|
logger.info('Purging resource {}'.format(self.uid))
|
|
logger.info('Purging resource {}'.format(self.uid))
|
|
- refint = env.config['store']['ldp_rs']['referential_integrity']
|
|
|
|
|
|
+ refint = rdfly.config['referential_integrity']
|
|
inbound = True if refint else inbound
|
|
inbound = True if refint else inbound
|
|
rdfly.forget_rsrc(self.uid, inbound)
|
|
rdfly.forget_rsrc(self.uid, inbound)
|
|
|
|
|
|
@@ -692,7 +692,7 @@ class Ldpr(metaclass=ABCMeta):
|
|
|
|
|
|
if (
|
|
if (
|
|
ev_type is not None and
|
|
ev_type is not None and
|
|
- env.config['application'].get('messaging')):
|
|
|
|
|
|
+ env.app_globals.config['application'].get('messaging')):
|
|
logger.debug('Enqueuing message for {}'.format(self.uid))
|
|
logger.debug('Enqueuing message for {}'.format(self.uid))
|
|
self._enqueue_msg(ev_type, remove_trp, add_trp)
|
|
self._enqueue_msg(ev_type, remove_trp, add_trp)
|
|
|
|
|
|
@@ -720,7 +720,7 @@ class Ldpr(metaclass=ABCMeta):
|
|
|
|
|
|
env.app_globals.changelog.append((set(remove_trp), set(add_trp), {
|
|
env.app_globals.changelog.append((set(remove_trp), set(add_trp), {
|
|
'ev_type': ev_type,
|
|
'ev_type': ev_type,
|
|
- 'timestamp': env.timestamp.format(),
|
|
|
|
|
|
+ 'timestamp': thread_env.timestamp.format(),
|
|
'rsrc_type': rsrc_type,
|
|
'rsrc_type': rsrc_type,
|
|
'actor': actor,
|
|
'actor': actor,
|
|
}))
|
|
}))
|
|
@@ -769,7 +769,7 @@ class Ldpr(metaclass=ABCMeta):
|
|
# Create and modify timestamp.
|
|
# Create and modify timestamp.
|
|
if create:
|
|
if create:
|
|
self.provided_imr.set((
|
|
self.provided_imr.set((
|
|
- self.uri, nsc['fcrepo'].created, env.timestamp_term))
|
|
|
|
|
|
+ self.uri, nsc['fcrepo'].created, thread_env.timestamp_term))
|
|
self.provided_imr.set((
|
|
self.provided_imr.set((
|
|
self.uri, nsc['fcrepo'].createdBy, self.DEFAULT_USER))
|
|
self.uri, nsc['fcrepo'].createdBy, self.DEFAULT_USER))
|
|
else:
|
|
else:
|
|
@@ -781,7 +781,7 @@ class Ldpr(metaclass=ABCMeta):
|
|
self.uri, nsc['fcrepo'].createdBy)))
|
|
self.uri, nsc['fcrepo'].createdBy)))
|
|
|
|
|
|
self.provided_imr.set((
|
|
self.provided_imr.set((
|
|
- self.uri, nsc['fcrepo'].lastModified, env.timestamp_term))
|
|
|
|
|
|
+ self.uri, nsc['fcrepo'].lastModified, thread_env.timestamp_term))
|
|
self.provided_imr.set((
|
|
self.provided_imr.set((
|
|
self.uri, nsc['fcrepo'].lastModifiedBy, self.DEFAULT_USER))
|
|
self.uri, nsc['fcrepo'].lastModifiedBy, self.DEFAULT_USER))
|
|
|
|
|