I think it sould work. If you create the required nodes in store s1 (i.e. /a, /a/deeper and /a/deeper/path). It is simply a (lesser usefull) version of the very usefull version like: <scope match="/" store="s1"> <scope match="/docs" store="s2"> <scope match="/users" store="s3">
Such a configuration would not cause any problems with the easy solutionn, right?
May be the following method at the Namespace class could answer whether we could use the MacroStore interface: (I have not tried it out )
public boolean canUseMacroStore(Uri source, Uri destination) { if (source.getStore() == destination.getStore()) { // source and destination MAY BE in the same store
// the potentially same store Store store = source.getStore(); Scope sameScope = source.getScope();
// look for a registered scope that is below the scope to that
// the store is mapped
for(Enumeration e = scopes.elements(); e.hasMoreElements();) {
Scope scope = (Scope)e.nextElement();
if (scope.toString().startsWith(sameScope.toString())) { // (:-(
if (scopes.get(scope) != store) {
// we found an other store that is responsible to
// resources below the scope
return false;
}
}
// source and destination ARE in the same store return true; } return false; }
Looks like a good starting point :)
Oliver
Oliver Zeigermann wrote:
Right. Is this legal in the first place? Does such a configuration work? Is it sensible?
If it is maybe it would be easiest to simply disallow the use of MacroStores in such scenarios?!
Oliver
Stefan L�tzkendorf schrieb:
Did you mean something like this?
<scope match="/" store="s1"> <scope match="/a/deeper/path" store="s2">
copy /a to /some/collection
both /a and /some/collection are mapped to the same store s1 but some descendants of the source are from are in store s2.
Thats strange by may happen.
Stefan
Oliver Zeigermann wrote:
Stefan L�tzkendorf schrieb:
Oliver Zeigermann wrote:
Oliver Zeigermann schrieb:
Stefan L�tzkendorf schrieb:
Oliver Zeigermann wrote:
How do I find out which stores are involved? Analysing what has been configured in Domain.xml?
what about that? Uri source, destination; if (source.getStore() == destination.getStore()) { // source and destination are in the same store }
Glad I asked someone ;) My solution would have been crazy...
But wait: this will not work when successors of the Uris are in different stores :(
??? can you give me an example?
No, seems this was just nonsense ...
Oliver
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
