Skip to content
This repository has been archived by the owner on Jan 3, 2019. It is now read-only.

Persist jcr/xml in hierarchy structure. #49

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lsitu
Copy link
Contributor

@lsitu lsitu commented Aug 8, 2014

@@ -217,7 +218,8 @@ public void onMessage(final Message message) {
LOGGER.debug("Discovered baseURL: {} in message.", baseURL);
LOGGER.debug("Discovered properties: {} in message.", message.getStringProperty(PROPERTIES_HEADER_NAME));

index( baseURL + id, eventType );
// jcr/xml persist need the base url to storage file in hierarchy structure
index( baseURL, baseURL + id, eventType );
Copy link

Choose a reason for hiding this comment

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

These parameters are too complicated and redundant: baseURL and baseURL + id

@awoods
Copy link

awoods commented Aug 11, 2014

This implementation creates the following directories:
fcrepo4-jcrxml/
└── http:
└── localhost:8080
└── rest
└── collection
└── book
└── page
└── page-jcr.xml

The directory should start at "collection"

@awoods awoods closed this Aug 11, 2014
@awoods awoods reopened this Aug 11, 2014
@lsitu
Copy link
Contributor Author

lsitu commented Aug 12, 2014

Okay, I've rebase and squash it into one commit lsitu@4274f9f. The compiling error/conflicts should be fixed now.

@@ -286,7 +289,7 @@ private void index( final String uri, final String eventType ) {
if (rdf.contains(createResource(uri), type, DATASTREAM_TYPE) && uri.indexOf("/fedora:system/") == -1 ) {
final String parent = uri.substring(0, uri.lastIndexOf("/"));
Copy link

Choose a reason for hiding this comment

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

"parent" should actually be "parentID", no?
When the index() call concatenates "baseURL" and "parent" it should have a valid URI.

Should this instead be:
final String parentID = uri.substring(uri.lastIndexOf("/"));

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 It sounds good to me. The term "parent" was used that way in the source codes. Would you like me to make the change now?

Copy link

Choose a reason for hiding this comment

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

@lsitu, it is not just the name of the variable, but the logic in creating the substring that likely needs to change.
I believe the current logic is incorrect.

@lsitu
Copy link
Contributor Author

lsitu commented Aug 13, 2014

I've updated it to use the parentID and made the change to use reindexURI( child, "", true ) instead of splitting the child url into two parts like baseURL+id.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants