jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marian Schedenig (qs)" <Marian.Schede...@qualysoft.com>
Subject Computed properties
Date Mon, 09 Mar 2009 16:42:32 GMT


I'm trying to implement dependencies between resources ("files") in my JCR,
more or less resembling a directed graph. Each file can have a number of
dependency subnodes which contain the path of a resource the property owner
depends on. This resource does not have to exist at the time the dependency
is set, but if it does, a reverseDependency subnode should automatically be
created on it pointing back to the resource containing the dependency node.
If the dependency target does not yet exist, the reverseDependency should be
created as soon as the target is created. For this, I have to keep a list of
"broken dependencies" somewhere, e.g. a system directory. A broken
dependency should be automatically created when a reverseDependency cannot
be set or when the owner of a reverseDependency is removed, and it should be
automatically deleted when the target comes into existence (and gets its
reverseDependency node). Likewise, deleting a node with dependencies should
remove all corresponding broken dependencies and reverseDependencies. The
respository is accessed through WebDAV.

My sample implementation so far creates/updates these nodes in a custom
PropertyHandler (I'm using fake properties called "setDependency" and
"removeDependency" to trigger these updates - the properties themselves are
never created; not a solution I'm happy with, but the only one I could think
of so far). Even though it's not forseeable that our JCR will ever be
accessed through other means than WebDAV, I don't like the fact that this
logic resides in the DAV layer, and anyway, I don't see how I could react on
newly created or deleted target nodes there.

So my idea was to use workspace observers to maintain correct reverse
dependencies. But after browsing the mailing list archives, I've come to
believe that asynchronous observers aren't guaranteed to be called
"immediately", making reverse dependency queries unreliable. And according
to [1], synchronous listeners aren't allowed to make workspace updates

So now I'm somewhat stumped. What would be the reasonable way to implement
this scenario?



View this message in context: http://www.nabble.com/Computed-properties-tp22413688p22413688.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

View raw message