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

aliasing any jcr-namespaced properties to fedora: #669

Closed
wants to merge 2 commits into
base: master
from

Conversation

Projects
None yet
4 participants
@acoburn
Contributor

acoburn commented Nov 25, 2014

https://www.pivotaltracker.com/n/projects/684825/stories/83411334

any jcr: properties are transformed to fedora: before sending to the JMS broker.

This potentially causes any jcr: property to populate the fedora: namespace, which may not be desired.

@cbeer

View changes

fcrepo-kernel-impl/src/main/java/org/fcrepo/kernel/impl/observer/GetNamespacedProperties.java Outdated
@@ -53,7 +53,7 @@ public FedoraEvent apply(final FedoraEvent evt) {
for (String property : evt.getProperties()) {
final String[] parts = property.split(":", 2);
if (parts.length == 2) {
final String prefix = parts[0];

This comment has been minimized.

@cbeer

cbeer Nov 25, 2014

Member

Don't we have existing machinery for this? Can we use it?

This comment has been minimized.

@awoods

awoods Nov 25, 2014

Member

What do you have in mind, @cbeer?

@awoods

View changes

fcrepo-kernel-impl/src/main/java/org/fcrepo/kernel/impl/observer/GetNamespacedProperties.java Outdated
@@ -53,7 +53,7 @@ public FedoraEvent apply(final FedoraEvent evt) {
for (String property : evt.getProperties()) {
final String[] parts = property.split(":", 2);
if (parts.length == 2) {
final String prefix = parts[0];
final String prefix = parts[0].equals("jcr") ? "fedora" : parts[0];

This comment has been minimized.

@awoods

awoods Nov 25, 2014

Member

These otherwise jcr properties are not actually included in the Fedora ontology:
http://fedora.info/definitions/v4/repository

It seems like we will want to take a more deliberate approach as it relates to the jcr properties, and quite likely eliminate them from the messages altogether... although, we may want to include some of them in the fedora namespace.
The point is, we will likely want to assess the properties individually.

This comment has been minimized.

@acoburn

acoburn Nov 25, 2014

Contributor

I agree that the jcr properties should be handled individually. Would you suggest filtering any incoming jcr property by first testing membership in the RdfLexicon.jcrProperties Set?

This comment has been minimized.

@awoods

awoods Nov 25, 2014

Member

Checking if the 'jcr'->'fedora' properties exist under the 'fedora' namespace in RdfLexicon seems safe. I would like to hear from others on the team as to whether any of those properties are needed/wanted in the JMS messages. I would doubt it.

@acoburn

This comment has been minimized.

Contributor

acoburn commented Nov 26, 2014

any jcr: property now is checked in the RdfLexicon.jcrProperties set before being added to the event properties.

@acoburn

This comment has been minimized.

Contributor

acoburn commented Mar 19, 2015

This is now tracked in JIRA: https://jira.duraspace.org/browse/FCREPO-1405

if ("jcr".equals(prefix)) {
if (jcrProperties.contains(createProperty(REPOSITORY_NAMESPACE + parts[1]))) {
event.addProperty(REPOSITORY_NAMESPACE + parts[1]);
} else if (LOGGER.isDebugEnabled()) {

This comment has been minimized.

@awoods

awoods Mar 20, 2015

Member

Please remove the LOGGER.isDebugEnabled() guard.

try {
event.addProperty(namespaceRegistry.getURI(prefix) + parts[1]);
} catch (RepositoryException ex) {
if (LOGGER.isDebugEnabled()) {

This comment has been minimized.

@awoods

awoods Mar 20, 2015

Member

Please remove the LOGGER.isDebugEnabled() guard.

This comment has been minimized.

@ajs6f

ajs6f Mar 20, 2015

Member

There's really just no reason to use these kinds of tests. They are built into the logging framework. Just LOGGER.debug() whatever it is and the logging framework will decide whether or not to execute the action.

@awoods

This comment has been minimized.

Member

awoods commented Mar 20, 2015

Resolved with: be0e046

@awoods awoods closed this Mar 20, 2015

@acoburn acoburn deleted the acoburn:jms-jcr-properties branch Jul 29, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment