Temporarily switching jackrabbit version

2011-04-13 Thread Markus Joschko
I have asked that question before on the sling mailing list but I
guess it is more appropraite here:
The current stable sling release uses jackrabbit 2.1.1 which has a bug
as it does not respect sv:multiple
on properties during import operation.

This bug is fixed in the latest jackrabbit release (which is available
in sling trunk). However I would like to stick to the stable release
of sling.

So I tried some kind of workaround and connected with the latest
jackrabbit cli to the existing repository (2.1.1) and imported
successfully.
Afterwards I continued with sling and jackrabbit 2.1.1 and so far
haven't had any problems.

Before doing so in production I would like to ask whether this
temporary switching of jackrabbit versions on the repository can have
consequences
I can not easily recognize.

Thanks,
 Markus


Re: Multiple workspaces and access control question

2011-04-13 Thread Angela Schreiber



My app will have 1-n workspaces.
Requirement 1: Each workspace will have its own set of users. User's from
one workspace cannot access other workspaces.
Requirement 2: In some exceptional cases, users may access other workspace


userperworkspace usermanager would be the right option. if you combine 
it with the corresponding security manager then users will only be
allowed to access the workspace if the user exists therein (in contrast 
to e.g. the simple-workspace-ac-mgr which allows everyone to access

every workspace, see below).


To highlight this with an example: say the workspaces are Legal, Marketing
and Sales. They will have their own users and they cannot see each others
stuff. Now a new workspace Cafeteria is added, that users from all other
workspaces should be able to see [and perhaps write comments on the menu
etc] that workspace.


you can either create users with the same userID in the cafeteria
workspace (the user nodes will be 'corresponding' to those in the other
workspaces based on the nodeID which stores the hashed identifier) or
simply clone the nodes.


Since, Jackrabbit gives everyone read access to all workspaces, using the
DefaultSecurityManager was not an option. I ended up using


this configurable (omit-default-permissions parameter with the access
control provider which can be configured for each workspace) and not 
related to the user manager at all.



UserPerWorkspaceSecurityManager, which now allows me to fulfill requirement


see above. that's fine but not related to the default permission
setup which depends on the per workspace ac provider.


1.
However I am puzzling over how to get to requirement 2.


see above.


I tried giving a user from workspace 1 access to workspace 2, but obviously
it does not work, since users are per workspace. I tried using


as stated above you have to make sure that the users are present
in the workspace. that's the default if you use the u-p-w-security
manager.
if you can't deal with this, you optionally could change the the
security configuration to use a different workspace-access-mgr
that applies a different logic to determine if a given user can
access the workspace... but that you potentially have to fiddle
around with a custom loginmodule and/or principal provider if the
users were not present in the cafeteria workspace but still
need to have access and access control entries assigned.


DefaultSecurityManager, but that then gives everyone access to all
workspaces.


see above.


So, is there a mechanism to fulfill the requirements or is it asking too
much of jackrabbit ??


not at all.


PS: Please don't ask me to use a single workspace. Due to requirements of
total isolation, strong file system level security requirements and possible
future migration of workspaces independently to other machines, our
architects have decided on separate workspaces per community of users. I
cannot change that requirement.


that shouldn't be a problem from my point of view.

regards
angela


Re: Temporarily switching jackrabbit version

2011-04-13 Thread Jukka Zitting

Hi,

On 04/13/2011 08:53 AM, Markus Joschko wrote:

Before doing so in production I would like to ask whether this
temporary switching of jackrabbit versions on the repository can
have consequences I can not easily recognize.


As a general rule we try to keep our patch releases both forwards- and 
backwards-compatible with other releases in the same maintenance branch.


Thus you can safely switch from 2.2.1 to 2.2.5 and back again without 
API or data compatibility issues.


--
Jukka Zitting


Re: Temporarily switching jackrabbit version

2011-04-13 Thread Markus Joschko
Thanks Jukka. However that means I might run into problems switching
from 2.1.1 to 2.2.5 and back?
I'll check if 2.1.3 has fixed the import bug.

Regards,
 Markus

On Wed, Apr 13, 2011 at 10:17 AM, Jukka Zitting jzitt...@adobe.com wrote:
 Hi,

 On 04/13/2011 08:53 AM, Markus Joschko wrote:

 Before doing so in production I would like to ask whether this
 temporary switching of jackrabbit versions on the repository can
 have consequences I can not easily recognize.

 As a general rule we try to keep our patch releases both forwards- and
 backwards-compatible with other releases in the same maintenance branch.

 Thus you can safely switch from 2.2.1 to 2.2.5 and back again without API or
 data compatibility issues.

 --
 Jukka Zitting



Re: problem with removeMixin

2011-04-13 Thread Gazi Mushfiqur Rahman
I am not sure how that is possible. This is what I have done:
   1. Added 'mix:shareable' mixin to a node.
   2. Created a shared node for that node
   3. Removed the shared node (by calling: 'node.removeShare();' on the
shared node)
   4. Remove the 'mix:shareable' mixin from the original node (which is
failing).

The stack trace of the error is given below:

13.04.2011 14:51:59.019 *ERROR* [10.0.0.87 [1302684719009] POST
/sling/content/hello.move.html HTTP/1.1]
org.apache.sling.engine.impl.SlingRequestProcessorImpl service: Uncaught
SlingException org.mozilla.javascript.WrappedException: Wrapped
javax.jcr.UnsupportedRepositoryOperationException: Removing mix:shareable is
not supported. (/apps/versionable/document/move/POST.esp#13)
at
org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1757)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:170)
at
org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:243)
at
org.mozilla.javascript.optimizer.OptRuntime.callProp0(OptRuntime.java:119)
at
org.mozilla.javascript.gen.c25._c0(/apps/versionable/document/move/POST.esp:13)
at
org.mozilla.javascript.gen.c25.call(/apps/versionable/document/move/POST.esp)
at
org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:393)
at
org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2834)
at
org.mozilla.javascript.gen.c25.call(/apps/versionable/document/move/POST.esp)
at
org.mozilla.javascript.gen.c25.exec(/apps/versionable/document/move/POST.esp)
at org.mozilla.javascript.Context.evaluateReader(Context.java:1227)
at
org.apache.sling.scripting.javascript.internal.RhinoJavaScriptEngine.eval(RhinoJavaScriptEngine.java:114)
at
org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:351)
at
org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:163)
at
org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:449)
at
org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:529)
at
org.apache.sling.engine.impl.SlingRequestProcessorImpl.processComponent(SlingRequestProcessorImpl.java:274)
at
org.apache.sling.engine.impl.filter.RequestSlingFilterChain.render(RequestSlingFilterChain.java:49)
at
org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:64)
at
org.apache.sling.engine.impl.debug.RequestProgressTrackerLogFilter.doFilter(RequestProgressTrackerLogFilter.java:59)
at
org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:60)
at
org.apache.sling.engine.impl.SlingRequestProcessorImpl.processRequest(SlingRequestProcessorImpl.java:161)
at
org.apache.sling.engine.impl.SlingMainServlet.service(SlingMainServlet.java:183)
at
org.apache.felix.http.base.internal.handler.ServletHandler.doHandle(ServletHandler.java:96)
at
org.apache.felix.http.base.internal.handler.ServletHandler.handle(ServletHandler.java:79)
at
org.apache.felix.http.base.internal.dispatch.ServletPipeline.handle(ServletPipeline.java:42)
at
org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFilterChain.java:49)
at
org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.java:33)
at
org.apache.felix.http.base.internal.dispatch.FilterPipeline.dispatch(FilterPipeline.java:48)
at
org.apache.felix.http.base.internal.dispatch.Dispatcher.dispatch(Dispatcher.java:39)
at
org.apache.felix.http.base.internal.DispatcherServlet.service(DispatcherServlet.java:67)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at
org.apache.felix.http.proxy.ProxyServlet.service(ProxyServlet.java:60)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at
org.apache.sling.launchpad.base.webapp.SlingServletDelegate.service(SlingServletDelegate.java:277)
at
org.apache.sling.launchpad.webapp.SlingServlet.service(SlingServlet.java:148)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:163)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:108)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:556)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)

Re: problem with removeMixin

2011-04-13 Thread Stefan Guggisberg
On Wed, Apr 13, 2011 at 11:01 AM, Gazi Mushfiqur Rahman
gazimushfiqurrah...@gmail.com wrote:
 I am not sure how that is possible. This is what I have done:
   1. Added 'mix:shareable' mixin to a node.
   2. Created a shared node for that node
   3. Removed the shared node (by calling: 'node.removeShare();' on the
 shared node)
   4. Remove the 'mix:shareable' mixin from the original node (which is
 failing).

the exception thrown answers your question:

 Caused by: javax.jcr.UnsupportedRepositoryOperationException: Removing
 mix:shareable is not supported.

cheers
stefan


 The stack trace of the error is given below:

 13.04.2011 14:51:59.019 *ERROR* [10.0.0.87 [1302684719009] POST
 /sling/content/hello.move.html HTTP/1.1]
 org.apache.sling.engine.impl.SlingRequestProcessorImpl service: Uncaught
 SlingException org.mozilla.javascript.WrappedException: Wrapped
 javax.jcr.UnsupportedRepositoryOperationException: Removing mix:shareable is
 not supported. (/apps/versionable/document/move/POST.esp#13)
        at
 org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1757)
        at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:170)
        at
 org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:243)
        at
 org.mozilla.javascript.optimizer.OptRuntime.callProp0(OptRuntime.java:119)
        at
 org.mozilla.javascript.gen.c25._c0(/apps/versionable/document/move/POST.esp:13)
        at
 org.mozilla.javascript.gen.c25.call(/apps/versionable/document/move/POST.esp)
        at
 org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:393)
        at
 org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2834)
        at
 org.mozilla.javascript.gen.c25.call(/apps/versionable/document/move/POST.esp)
        at
 org.mozilla.javascript.gen.c25.exec(/apps/versionable/document/move/POST.esp)
        at org.mozilla.javascript.Context.evaluateReader(Context.java:1227)
        at
 org.apache.sling.scripting.javascript.internal.RhinoJavaScriptEngine.eval(RhinoJavaScriptEngine.java:114)
        at
 org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:351)
        at
 org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:163)
        at
 org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:449)
        at
 org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:529)
        at
 org.apache.sling.engine.impl.SlingRequestProcessorImpl.processComponent(SlingRequestProcessorImpl.java:274)
        at
 org.apache.sling.engine.impl.filter.RequestSlingFilterChain.render(RequestSlingFilterChain.java:49)
        at
 org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:64)
        at
 org.apache.sling.engine.impl.debug.RequestProgressTrackerLogFilter.doFilter(RequestProgressTrackerLogFilter.java:59)
        at
 org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:60)
        at
 org.apache.sling.engine.impl.SlingRequestProcessorImpl.processRequest(SlingRequestProcessorImpl.java:161)
        at
 org.apache.sling.engine.impl.SlingMainServlet.service(SlingMainServlet.java:183)
        at
 org.apache.felix.http.base.internal.handler.ServletHandler.doHandle(ServletHandler.java:96)
        at
 org.apache.felix.http.base.internal.handler.ServletHandler.handle(ServletHandler.java:79)
        at
 org.apache.felix.http.base.internal.dispatch.ServletPipeline.handle(ServletPipeline.java:42)
        at
 org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFilterChain.java:49)
        at
 org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.java:33)
        at
 org.apache.felix.http.base.internal.dispatch.FilterPipeline.dispatch(FilterPipeline.java:48)
        at
 org.apache.felix.http.base.internal.dispatch.Dispatcher.dispatch(Dispatcher.java:39)
        at
 org.apache.felix.http.base.internal.DispatcherServlet.service(DispatcherServlet.java:67)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
        at
 org.apache.felix.http.proxy.ProxyServlet.service(ProxyServlet.java:60)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
        at
 org.apache.sling.launchpad.base.webapp.SlingServletDelegate.service(SlingServletDelegate.java:277)
        at
 org.apache.sling.launchpad.webapp.SlingServlet.service(SlingServlet.java:148)
        at
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
        at
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at
 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
        at
 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201)
        at
 

Re: Query for nodes based on presence of descendant nodes

2011-04-13 Thread Alex Parvulescu
Hi Craig,

I don't think sql2 has something like that.

could you be a bit more specific with your usecase? I can't figure out what
you are trying to do :)
are you looking for a certain parent of a node? or parents of node types?

wouldn't it be easier to have a property on the parent node to indicate the
presence of certain child node(s) / (types)?

alex

On Tue, Apr 12, 2011 at 9:02 PM, Craig S. Dickson 
cr...@thejuggernautgroup.com wrote:

 Hi,

 I would like to query for nodes based on the presence of a descendant node.
 In psuedo code, something like:

 select * from nt:base where
 hasDescendant('./relative/path/to/descendant/node')

 I am trying to create the query with SQL2 and I can see the ischild() and
 isdescendant() constraints, but I am not clear how to use them to query for
 and return the parent/ancestor nodes, instead of the child/descendant nodes.

 Is this possible? I would prefer and SQL2 answer, but can use QOM or XPath
 if necessary.

 Thanks in advance.

 Craig




RE: Query for nodes based on presence of descendant nodes

2011-04-13 Thread Tomás Temprano
I'm not sure I fully understand your requrirement but you could query the 
descendant node and use node.getParent() to get its parent...


-Mensaje original-
De: Craig S. Dickson [mailto:cr...@thejuggernautgroup.com] 
Enviado el: Martes, 12 de Abril de 2011 02:32 p.m.
Para: users@jackrabbit.apache.org
Asunto: Query for nodes based on presence of descendant nodes

Hi,

I would like to query for nodes based on the presence of a descendant node. In 
psuedo code, something like:

select * from nt:base where hasDescendant('./relative/path/to/descendant/node')

I am trying to create the query with SQL2 and I can see the ischild() and 
isdescendant() constraints, but I am not clear how to use them to query for and 
return the parent/ancestor nodes, instead of the child/descendant nodes.

Is this possible? I would prefer and SQL2 answer, but can use QOM or XPath if 
necessary.

Thanks in advance.

Craig


**
La informacion contenida en este mail es de caracter confidencial o para uso 
exclusivo
del Grupo TOYOTA DE VENEZUELA en sus procesos y actividades de negocio. Los 
puntos de 
vista u  opiniones  presentes  en  el mismo  son  responsabilidad  del  
remitente y no 
representan una posicion formal del grupo TOYOTA DE VENEZUELA (TOYOTA DE 
VENEZUELA, C.A.
o TOYOTA INDUSTRIAL DE VENEZUELA, C.A.). Si  UD. no  es  el destinatario o  
recibio  esta 
informacion por error, agradecemos destruirla de inmediato y notificar al 
remitente por
esta misma via, debido a que su copia, distribucion o uso esta reservado solo 
para
personas autorizadas.
***
The information contained in this mail is strictly confidential or for the 
exclusive use
by TOYOTA DE VENEZUELA Group in its process and business activities. The points 
of view
or  present  opinions  contained  in the mail, are the senders responsibility 
and  dont
represent a formal opinion of TOYOTA DE VENEZUELA Group (TOYOTA  DE  VENEZUELA, 
C.A. or
TOYOTA INDUSTRIAL DE VENEZUELA, C.A.) If you are not the destined user or 
received this
information by mistake, we appreciate if you destroy  it  inmediately  and  
notify  the
sender  by this same way, because its copying, distributing and use is allowed 
only for 
authorized people.



XPATH question

2011-04-13 Thread JCR

All,

I wonder if multiple ORed path constraints can be set in one single 
XPATH statement in some way.


E.g.
/a/b/c//*[text='...'] OR /a/d/e//*[text='...']

Interesting, the above statement does not produce an error... but also 
won't return any results.


Thanks,
Juerg




Re: XPATH question

2011-04-13 Thread Alexander Klimetschek
On 13.04.11 14:05, JCR j...@proxymit.net wrote:
I wonder if multiple ORed path constraints can be set in one single
XPATH statement in some way.

E.g.
/a/b/c//*[text='...'] OR /a/d/e//*[text='...']

No, this is not supported in JCR's xpath. SQL2 (since JCR 2.0) supports
joins of different node sets (from different paths).

Regards,
Alex

-- 
Alexander Klimetschek
Developer // Adobe (Day) // Berlin - Basel