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
MODE-1706 Support for extra properties #599
Conversation
The Connector framework now has a way for connector implementations to handle "extra" properties that are not normally supported by the external system that the connector is using. These extra properties can be stored in the same Infinispan cache used to persist the regular "internal" repository content, although connector implementations are responsible for explicitly using this new facility. The file system connector has been changed to take advantage of this mechanism. By default, all properties that cannot be represented by native file system attributes (e.g., lastModified, file content, etc.) are stored using the extra properties facility. However, the connector can also be configured to store these extra properties on the file system in "sidecar" files, in the same way that the file system connector in ModeShape 2.x worked. These sidecar files can be of several formats, including JSON, BSON, or the ModeShape 2.x format (a text-based but proprietary format). Several new tests were added to verify the functionality works as expected.
|
||
// Add the extra properties (if there are any) ... | ||
writer.addProperties(extraPropertiesStore().getProperties(id)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note the way that a connector can obtain the properties from the ExtraPropertiesStore instance and simply add them to the document currently being written. By doing this late in the method, some of the extra properties might overwrite the non-extra properties (which is likely a good thing).
@hchiorean, what do you think about these changes? If they're okay, then this can be merged onto the 'federation branch. |
@rhauch: with the exception of the minor comments above, I think the design looks really good. |
Made the corrections that @hchiorean suggested, and also improved the way the file system connector handles Binary values:
|
…ages The FileSystemConnector is now in the same 'org.modeshape.connector.filesystem' package as in 2.x, and it follows the convention used by the sequencers. Note that the file system connector is still located in the 'modeshape-jcr' module rather than a separate module (as in 2.x) - this is for simplicity. The MockConnector was moved into the test source, since it is now only used by the test cases and can be configured like any other connector.
I merged this into the 'federation' branch. If there are any changes, they can be done in other pull-requests. |
The Connector framework now has a way for connector implementations to handle "extra" properties that are not normally supported by the external system that the connector is using. These extra properties can be stored in the same Infinispan cache used to persist the regular "internal" repository content, although connector implementations are responsible for explicitly using this new facility.
The file system connector has been changed to take advantage of this mechanism. By default, all properties that cannot be represented by native file system attributes (e.g., lastModified, file content,
etc.) are stored using the extra properties facility. However, the connector can also be configured to store these extra properties on the file system in "sidecar" files, in the same way that the file system connector in ModeShape 2.x worked. These sidecar files can be of several formats, including JSON, BSON, or the ModeShape 2.x format (a text-based but proprietary format).
Several new tests were added to verify the functionality works as expected.