Skip to content

Need a strategy for writing to repository using seqs #1

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

Open
acfoltzer opened this issue Feb 22, 2010 · 2 comments
Open

Need a strategy for writing to repository using seqs #1

acfoltzer opened this issue Feb 22, 2010 · 2 comments

Comments

@acfoltzer
Copy link
Contributor

(iterator-seq coll) does a good job of bridging RangeIterators with Clojure seqs, but going the other direction to persist a sequence in the repository will be tricky. The naive approach is to walk the subtree(s) represented by a seq, comparing and/or setting properties, removing nodes, etc. What we'd like instead is a way to selectively persist changes only.

The VersionManager merge methods might be worth checking out, but it looks like they'd reduce generality by requiring nt:versionable. Is there a preferred approach to these sorts of operations in the Jackrabbit world?

@jukka
Copy link
Owner

jukka commented Feb 22, 2010

I think the JCR concepts that come closes to this idea are the XML import operations.

Perhaps it would be useful to define a mapping between JCR nodes and properties to Clojure maps. This might give us a chance to use higher-level operations like map to define content transformations. Though I'm not sure if you're looking for something like this in here.

@acfoltzer
Copy link
Contributor Author

Right; I'm not sure there really is a direct equivalent. I've just been trying to think of how to apply the persistent data structure model to JCR Items, which is what's really required for map, filter, and such to be useful for transformations that go back into the repository.

With a Clojure data structure to represent subgraphs as you suggest, the operation might consist of removing the original root, then recursively adding the new graph in its place. This seems like serious overkill, though.

I am certainly interested in the types of content transformations this level of integration would allow, but I'm beginning to think it might be worthwhile to rely for now on the side-effect + transactional model that the JCR API provides already.

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

No branches or pull requests

2 participants