You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Angela Schreiber <an...@adobe.com> on 2013/04/16 16:30:58 UTC

simplify index definitions (was: svn commit: r1468426 - in /jackrabbit/oak/trunk/oak-core/src: main/java/org/apache/jackrabbit/oak/security/user/UserInitializer.java test/java/org/apache/jackrabbit/oak/security/user/UserInitializerTest.java)

hi marcel

can't we just drop the derived node types from the configuration?
previously the index mechanism didn't know about node type inheritance
but as far as i understood this has been fixed in the mean time.

the same would also apply for the access control related index
configuration.

alex, could you confirm if that would work?

thanks
angela

On 4/16/13 4:18 PM, mreutegg@apache.org wrote:
> Author: mreutegg
> Date: Tue Apr 16 14:18:44 2013
> New Revision: 1468426
>
> URL: http://svn.apache.org/r1468426
> Log:
> OAK-779: Add rep:Authorizable to declaringNodeTypeNames of rep:principalName index
>
> Modified:
>      jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserInitializer.java
>      jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserInitializerTest.java
>
> Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserInitializer.java
> URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserInitializer.java?rev=1468426&r1=1468425&r2=1468426&view=diff
> ==============================================================================
> --- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserInitializer.java (original)
> +++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserInitializer.java Tue Apr 16 14:18:44 2013
> @@ -113,7 +113,7 @@ public class UserInitializer implements
>               if (!index.hasChild("principalName")) {
>                   IndexUtils.createIndexDefinition(index, "principalName", true,
>                           new String[]{REP_PRINCIPAL_NAME},
> -                        new String[]{NT_REP_GROUP, NT_REP_USER});
> +                        new String[]{NT_REP_GROUP, NT_REP_USER, NT_REP_AUTHORIZABLE});
>               }
>               if (!index.hasChild("members")) {
>                   IndexUtils.createIndexDefinition(index, "members", false, new String[]{UserConstants.REP_MEMBERS}, null);
>
> Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserInitializerTest.java
> URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserInitializerTest.java?rev=1468426&r1=1468425&r2=1468426&view=diff
> ==============================================================================
> --- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserInitializerTest.java (original)
> +++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserInitializerTest.java Tue Apr 16 14:18:44 2013
> @@ -103,7 +103,7 @@ public class UserInitializerTest extends
>           Tree princName = oakIndex.getChild("principalName");
>           assertIndexDefinition(princName, UserConstants.REP_PRINCIPAL_NAME, true);
>           String[] declaringNtNames = TreeUtil.getStrings(princName, IndexConstants.DECLARING_NODE_TYPES);
> -        assertArrayEquals(new String[]{UserConstants.NT_REP_GROUP, UserConstants.NT_REP_USER}, declaringNtNames);
> +        assertArrayEquals(new String[]{UserConstants.NT_REP_GROUP, UserConstants.NT_REP_USER, UserConstants.NT_REP_AUTHORIZABLE}, declaringNtNames);
>
>           Tree members = oakIndex.getChild("members");
>           assertIndexDefinition(members, UserConstants.REP_MEMBERS, false);
>
>

Re: simplify index definitions

Posted by Angela Schreiber <an...@adobe.com>.
cool! thanks a lot

On 4/24/13 11:50 AM, Jukka Zitting wrote:
> Hi,
>
> On Tue, Apr 16, 2013 at 6:19 PM, Marcel Reutegger<mr...@adobe.com>  wrote:
>>> can't we just drop the derived node types from the configuration?
>>> previously the index mechanism didn't know about node type inheritance
>>> but as far as i understood this has been fixed in the mean time.
>>
>> I don't think so. The p2 index implementation does know about the node
>> type, but it doesn't respect the hierarchy.
>
> Now it does. :-) I changed the index definition accordingly in
> http://svn.apache.org/r1471328.
>
> BR,
>
> Jukka Zitting

Re: simplify index definitions (was: svn commit: r1468426 - in /jackrabbit/oak/trunk/oak-core/src: main/java/org/apache/jackrabbit/oak/security/user/UserInitializer.java test/java/org/apache/jackrabbit/oak/security/user/UserInitializerTest.java)

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On Tue, Apr 16, 2013 at 6:19 PM, Marcel Reutegger <mr...@adobe.com> wrote:
>> can't we just drop the derived node types from the configuration?
>> previously the index mechanism didn't know about node type inheritance
>> but as far as i understood this has been fixed in the mean time.
>
> I don't think so. The p2 index implementation does know about the node
> type, but it doesn't respect the hierarchy.

Now it does. :-) I changed the index definition accordingly in
http://svn.apache.org/r1471328.

BR,

Jukka Zitting

RE: simplify index definitions (was: svn commit: r1468426 - in /jackrabbit/oak/trunk/oak-core/src: main/java/org/apache/jackrabbit/oak/security/user/UserInitializer.java test/java/org/apache/jackrabbit/oak/security/user/UserInitializerTest.java)

Posted by Marcel Reutegger <mr...@adobe.com>.
> can't we just drop the derived node types from the configuration?
> previously the index mechanism didn't know about node type inheritance
> but as far as i understood this has been fixed in the mean time.

I don't think so. The p2 index implementation does know about the node
type, but it doesn't respect the hierarchy.

See also Jukka's comment in OAK-779.

regards
 marcel