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

Non-rdf resources emit /fcr:metadata events instead of /jcr:content #582

Closed
wants to merge 2 commits into from

Conversation

escowles
Copy link
Contributor

message.setStringProperty(IDENTIFIER_HEADER_NAME, jcrEvent.getPath());
String path = jcrEvent.getPath();
if ( path.endsWith("jcr:content") ) {
path = path.replaceAll("jcr:content","fcr:metadata");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty sure we have constants for these.

Do you really want to emit the event for the binary description, or can we just emit it for the binary and make the client figure it out (e.g. by doing a HEAD request on the target)?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 : use constants (FedoraJcrTypes.FCR_METADATA, plus maybe an addition for JCR_CONTENT in RdfLexicon).

My expectation would be that:

  • updates to binaries would send events with the binary path, and
  • updates to binary descriptions would send events with the path to /fcr:metadata.

Is that a shared expectation?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JCR_CONTENT is available as a constant from MODE.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll swap in the JCR_CONTENT and FCR_METADATA constants.

I'm not sure precisely what the current behavior is, other than to say that the message consumer expects the event to point to RDF instead of the binary, which is why I was updating the jcr:content events to point to fcr:metadata instead of to the binary itself.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For non-RDF resource /path/to/resource

  • updating the content => event on /path/to/resource/fcr:content
  • updating the description => event on /path/to/resource

IMHO, both of them should be mapped to /path/to/resource/fcr:metadata, since that is the description for both of them that the message consumer can work with. If it wants the content (e.g. for fulltext indexing, etc.), then the fcr:metadata will have a pointer to it.

message.setStringProperty(IDENTIFIER_HEADER_NAME, jcrEvent.getPath());
String path = jcrEvent.getPath();
if ( path.endsWith("/" + JCR_CONTENT) ) {
path = path.replaceAll("/" + JCR_CONTENT,"");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On binary update events, you appear to be sending a message with the binary path.
In the case where the event is on the description (i.e. /fcr:metadata) the message is with the description path.
This does not seem to be in line with your previous comments in this thread:
#582 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@awoods Not exactly. With an update on the binary, the event path is /path/to/resource/fcr:content -- I'm removing the /fcr:content to make the event path the resource path. When the event is on the description, the path is already the resource path, so I'm leaving it unchanged. So in both cases, the end result is that the event is emitted with the resource path.

@awoods
Copy link

awoods commented Oct 24, 2014

Resolved with: f388cd7

@awoods awoods closed this Oct 24, 2014
@awoods awoods deleted the content-events branch October 24, 2014 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants