-
1. Re: FileSystemConnector and creating content in new nt:file nodes
rhauch Apr 3, 2013 5:23 PM (in response to mashtun)It looks like this is because id at this point ends with "bar.xml/content" while isContentNode(id) tests for id ending with "/jcr:content". The "jcr:" prefix has been removed at this point during writing (but is present when getNode("jcr:content") is called). If I extend FileSystemConnector and override isContentNode(String) and fileFor(String) so they handle a suffix of "/content" as well as "/jcr:content" then I get the behaviour I expect i.e. a non-empty XML file with the correct content.
This is indeed strange. The ID should not have just "bar.xml/content", so this looks like a bug.
Looking at the code, it looks like the ID is being written with only the local name (e.g., "content" without the prefix) on line 543. Please log a defect. IIRC, we're using only the local part because the IDs are translated into filenames, which generally shouldn't have a ":" character. At a minimum, we need to decide how we want to encode the node names into IDs, but we should probably handle "jcr:content" nodes in a special way in the "newDocumentId(..)" method. I think it's a bit too dangerous to change the "isContentNode(String)" method and "fileFor(String)" method to consider any ID ending in "content" as the file content node.
Do you want to try this? If so, do you want to create a pull-request with the change??
-
2. Re: FileSystemConnector and creating content in new nt:file nodes
mashtun Apr 4, 2013 5:05 AM (in response to rhauch)Thanks, Randall. Your suggestion does indeed work. I created MODE-1880 and linked it to a pull request. I'm an infrequent github user but hopefully got the process right.
-
3. Re: FileSystemConnector and creating content in new nt:file nodes
rhauch Apr 4, 2013 9:00 AM (in response to mashtun)You did everything perfectly. (UPDATE: Actually, see my comment on the pull-request: you should make your changes on a topic branch. It's okay this time.)
Thanks! I'll merge the pull-request shortly.
-
4. Re: FileSystemConnector and creating content in new nt:file nodes
mashtun Apr 4, 2013 11:29 AM (in response to rhauch)Thanks for the pointer to the workflow page - I'll certainly be sure to use a topic branch in future.