You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Katia Santos <ka...@gmail.com> on 2008/03/05 18:49:04 UTC

Access Control

Hello,

I would like to learn more how jackrabbit handles access control of
the data stored.
wich is the best way to allow/deny access to nodes? ACL in every Node?
How does it checks if the user is allowed to read/modify the node?
I really dont know anything about this issue...can someone give me a
starting ideia?


Katia

RE: Search not finding documents after Populate!

Posted by Ard Schrijvers <a....@hippo.nl>.
> 
> An interesting fact, the index subdirectory has the following 
> subdirectories in the repository folder: 
> _k,_l,_m,_n,_o,_p,_q,_r,_s there is no _a subdirectory as 
> mentioned in the log. Anyway, that is not the problem (just a 
> comment).

The _a subdirectory has already been merged again then with another
index, hence removed again (similar to lucene index segments)

> 
> When performing a search, no documents are found. I tried 
> several words that I saw in the Word and PDF documents when I 
> navigated using the Browsing link.

Are in the repository.xml (workspace.xml for existing repo) the correct
textFilterClasses configured, ie, asdd to the SearchIndex element of the
workspace something like:

<param name="textFilterClasses"
value="org.apache.jackrabbit.extractor.PlainTextExtractor,org.apache.jac
krabbit.extractor.MsWordTextExtractor,org.apache.jackrabbit.extractor.Ms
ExcelTextExtractor,org.apache.jackrabbit.extractor.MsPowerPointTextExtra
ctor,org.apache.jackrabbit.extractor.PdfTextExtractor,org.apache.jackrab
bit.extractor.OpenOfficeTextExtractor,org.apache.jackrabbit.extractor.RT
FTextExtractor,org.apache.jackrabbit.extractor.HTMLTextExtractor,org.apa
che.jackrabbit.extractor.XMLTextExtractor"/>

-Ard

Search not finding documents after Populate!

Posted by Julio Castillo <jc...@edgenuity.com>.
I just finished finally configuring the repository going against a MySQL
bundle for the persistence manager.

Using the demo jsp pages, I went ahead and used the "populate.jsp" link of
the default index.jsp page. I selected 50 documents of type MS Word and PDF.
It successfully finished and during that time the following INFO messages
appeared:
06.03.2008 12:35:38 *INFO * IndexMerger: merged 94 documents in 140 ms into
_a. (IndexMerger.java, line 304)
06.03.2008 12:40:47 *INFO * IndexMerger: merged 185 documents in 172 ms into
_k. (IndexMerger.java, line 304)

An interesting fact, the index subdirectory has the following subdirectories
in the repository folder: _k,_l,_m,_n,_o,_p,_q,_r,_s
there is no _a subdirectory as mentioned in the log. Anyway, that is not the
problem (just a comment).

When performing a search, no documents are found. I tried several words that
I saw in the Word and PDF documents when I navigated using the Browsing
link.

After restarting the log in DEBUG mode shows the following:

06.03.2008 13:21:25 *DEBUG* IndexMerger: index added: name=_0, numDocs=96
(IndexMerger.java, line 162)
06.03.2008 13:21:25 *DEBUG* AbstractIndex: closing IndexWriter.
(AbstractIndex.java, line 219)
06.03.2008 13:21:25 *DEBUG* Recovery: RedoLog is empty, no recovery needed.
(Recovery.java, line 80)
06.03.2008 13:21:25 *INFO * SearchIndex: Index initialized:
C:\Temp\jackrabbit\repository/repository/index Version: 2 (SearchIndex.java,
line 454)
06.03.2008 13:21:25 *DEBUG* MLRUItemStateCache:
org.apache.jackrabbit.core.state.MLRUItemStateCache@1c63e8c size=1,
1264/4194304 (MLRUItemStateCache.java, line 148)
06.03.2008 13:21:25 *DEBUG* JackrabbitTextExtractor:
JackrabbitTextExtractor(org.apache.jackrabbit.extractor.DefaultTextExtractor
) (JackrabbitTextExtractor.java, line 108)
06.03.2008 13:21:25 *INFO * LocalFileSystem: LocalFileSystem initialized at
path C:\Temp\jackrabbit\repository\workspaces\default\index
(LocalFileSystem.java, line 166)
06.03.2008 13:21:25 *DEBUG* IndexMerger: index added: name=_k, numDocs=185
(IndexMerger.java, line 162)
06.03.2008 13:21:25 *DEBUG* IndexMerger: index added: name=_l, numDocs=15
(IndexMerger.java, line 162)
06.03.2008 13:21:25 *DEBUG* IndexMerger: index added: name=_m, numDocs=11
(IndexMerger.java, line 162)
06.03.2008 13:21:25 *DEBUG* IndexMerger: index added: name=_n, numDocs=6
(IndexMerger.java, line 162)
06.03.2008 13:21:25 *DEBUG* IndexMerger: index added: name=_o, numDocs=45
(IndexMerger.java, line 162)
06.03.2008 13:21:25 *DEBUG* IndexMerger: index added: name=_p, numDocs=20
(IndexMerger.java, line 162)
06.03.2008 13:21:25 *DEBUG* IndexMerger: index added: name=_q, numDocs=14
(IndexMerger.java, line 162)
06.03.2008 13:21:25 *DEBUG* IndexMerger: index added: name=_r, numDocs=27
(IndexMerger.java, line 162)
06.03.2008 13:21:25 *DEBUG* IndexMerger: index added: name=_s, numDocs=6
(IndexMerger.java, line 162)
06.03.2008 13:21:25 *DEBUG* AbstractIndex: closing IndexWriter.
(AbstractIndex.java, line 219)
06.03.2008 13:21:25 *DEBUG* Recovery: RedoLog is empty, no recovery needed.
(Recovery.java, line 80)
06.03.2008 13:21:25 *INFO * SearchIndex: Index initialized:
C:\Temp\jackrabbit\repository\workspaces\default/index Version: 2
(SearchIndex.java, line 454)

I then went ahead and did a search on the following 2 words: election and
then on the word Texas. The election is part of the path to a PDF document
that has the word Texas within it. No document was found with either
keyword. Below is the log. Is there a way to inspect the search index? I can
get to the documents browsing them, but not via search:

06.03.2008 13:25:35 *DEBUG* QueryImpl: Executing query:
+ Root node
+ Select properties: {internal}excerpt()
  + PathQueryNode
    + LocationStepQueryNode:  NodeTest=* Descendants=true Index=NONE
      + NodeTypeQueryNode:  Prop={http://www.jcp.org/jcr/1.0}primaryType
Value={http://www.jcp.org/jcr/nt/1.0}file
      + TextsearchQueryNode:  Path={http://www.jcp.org/jcr/1.0}content
Query=elections (QueryImpl.java, line 106)
06.03.2008 13:25:35 *DEBUG* MLRUItemStateCache:
org.apache.jackrabbit.core.state.MLRUItemStateCache@14a97b size=1,
4564/4194304(MLRUItemStateCache.java, line 148)
06.03.2008 13:25:35 *DEBUG* ItemManager: created item
cafebabe-cafe-babe-cafe-babecafebabe (ItemManager.java, line 750)
06.03.2008 13:25:35 *DEBUG* ItemManager: caching item
cafebabe-cafe-babe-cafe-babecafebabe (ItemManager.java, line 689)
06.03.2008 13:25:35 *DEBUG* QueryResultImpl: getResults(2147483647)
(QueryResultImpl.java, line 272)
06.03.2008 13:25:35 *DEBUG* QueryImpl: executed in 0.24 s. (//element(*,
nt:file)[jcr:contains(jcr:content, 'elections')]/rep:excerpt(.))
(QueryImpl.java, line 183)
06.03.2008 13:25:35 *DEBUG* QueryImpl: Executing query:
+ Root node
+ Select properties: {internal}spellcheck()
  + PathQueryNode
    + LocationStepQueryNode:  NodeTest={} Descendants=false Index=NONE
      + RelationQueryNode: Op: spellcheck
Prop=@{http://www.jcp.org/jcr/1.0}primaryType Type=STRING Value=elections
(QueryImpl.java, line 106)
06.03.2008 13:25:35 *DEBUG* QueryResultImpl: getResults(2147483647)
(QueryResultImpl.java, line 272)
06.03.2008 13:25:35 *DEBUG* QueryImpl: executed in 0.03 s.
(/jcr:root[rep:spellcheck('elections')]/(rep:spellcheck())) (QueryImpl.java,
line 183)
06.03.2008 13:25:35 *DEBUG* DocOrderNodeIteratorImpl: 1 node(s) ordered in 0
ms (DocOrderNodeIteratorImpl.java, line 254)
06.03.2008 13:25:35 *DEBUG* ItemManager: invalidated item
cafebabe-cafe-babe-cafe-babecafebabe (ItemManager.java, line 761)
06.03.2008 13:25:35 *DEBUG* ItemManager: removing item
cafebabe-cafe-babe-cafe-babecafebabe from cache (ItemManager.java, line 702)
06.03.2008 13:26:42 *DEBUG* MLRUItemStateCache:
org.apache.jackrabbit.core.state.MLRUItemStateCache@1933acb size=1,
664/4194304(MLRUItemStateCache.java, line 148)
06.03.2008 13:26:42 *DEBUG* QueryImpl: Executing query:
+ Root node
+ Select properties: {internal}excerpt()
  + PathQueryNode
    + LocationStepQueryNode:  NodeTest=* Descendants=true Index=NONE
      + NodeTypeQueryNode:  Prop={http://www.jcp.org/jcr/1.0}primaryType
Value={http://www.jcp.org/jcr/nt/1.0}file
      + TextsearchQueryNode:  Path={http://www.jcp.org/jcr/1.0}content
Query=Texas (QueryImpl.java, line 106)
06.03.2008 13:26:42 *DEBUG* MLRUItemStateCache:
org.apache.jackrabbit.core.state.MLRUItemStateCache@8c858a size=1,
4564/4194304(MLRUItemStateCache.java, line 148)
06.03.2008 13:26:42 *DEBUG* ItemManager: created item
cafebabe-cafe-babe-cafe-babecafebabe (ItemManager.java, line 750)
06.03.2008 13:26:42 *DEBUG* ItemManager: caching item
cafebabe-cafe-babe-cafe-babecafebabe (ItemManager.java, line 689)
06.03.2008 13:26:42 *DEBUG* QueryResultImpl: getResults(2147483647)
(QueryResultImpl.java, line 272)
06.03.2008 13:26:42 *DEBUG* QueryImpl: executed in 0.02 s. (//element(*,
nt:file)[jcr:contains(jcr:content, 'Texas')]/rep:excerpt(.))
(QueryImpl.java, line 183)
06.03.2008 13:26:42 *DEBUG* QueryImpl: Executing query:
+ Root node
+ Select properties: {internal}spellcheck()
  + PathQueryNode
    + LocationStepQueryNode:  NodeTest={} Descendants=false Index=NONE
      + RelationQueryNode: Op: spellcheck
Prop=@{http://www.jcp.org/jcr/1.0}primaryType Type=STRING Value=Texas
(QueryImpl.java, line 106)
06.03.2008 13:26:42 *DEBUG* QueryResultImpl: getResults(2147483647)
(QueryResultImpl.java, line 272)
06.03.2008 13:26:42 *DEBUG* QueryImpl: executed in 0.00 s.
(/jcr:root[rep:spellcheck('Texas')]/(rep:spellcheck())) (QueryImpl.java,
line 183)
06.03.2008 13:26:42 *DEBUG* DocOrderNodeIteratorImpl: 1 node(s) ordered in 0
ms (DocOrderNodeIteratorImpl.java, line 254)
06.03.2008 13:26:42 *DEBUG* ItemManager: invalidated item
cafebabe-cafe-babe-cafe-babecafebabe (ItemManager.java, line 761)
06.03.2008 13:26:42 *DEBUG* ItemManager: removing item
cafebabe-cafe-babe-cafe-babecafebabe from cache (ItemManager.java, line 702)

The path to the document in my environment is as follows per browser link to
my repository in the index.jsp page:
/default/us/tx/state/sos/www/elections/forms/vr17.pdf

Any ideas? suggestions?

thanks


RE: DDLs and bootstrapping

Posted by Julio Castillo <jc...@edgenuity.com>.
Here is the answer to my question.
After several tries I did manage to have it create the schema and run it
with no problems.

The trick: The "schema" parameter, is not the database schema you want to
use, instead is the type of database you are using (e.g. mysql).

I was able to run Jackrabbit using bundle.MySqldbPersistenceManager. Seems
to be working ok.

Here is an excerpt of my repository.xml
    <Workspace name="Jackrabbit Core">
        <FileSystem
class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
            <param name="path" value="${wsp.home}"/>
        </FileSystem>
        <PersistenceManager
class="org.apache.jackrabbit.core.persistence.bundle.MySqlPersistenceManager
">
	    <param name="driver" value="com.mysql.jdbc.Driver"/>
	    <param name="url" value="jdbc:mysql://minbar:3306/jr_core"/>
	    <param name="user" value="jackrabbit"/>
	    <param name="password" value="jackrabbit"/>
	    <param name="schema" value="mysql"/>
          <param name="schemaObjectPrefix" value="Core_"/>
        </PersistenceManager>
        <SearchIndex
class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
            <param name="path" value="${wsp.home}/index"/>
        </SearchIndex>
    </Workspace>

    <Versioning rootPath="${rep.home}/version">
        <FileSystem
class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
            <param name="path" value="${rep.home}/version" />
        </FileSystem>
        <PersistenceManager
class="org.apache.jackrabbit.core.persistence.db.SimpleDbPersistenceManager"
>
	    <param name="driver" value="com.mysql.jdbc.Driver"/>
	    <param name="url"
value="jdbc:mysql://localhost:3306/jr_version"/>
	    <param name="user" value="jackrabbit"/>
	    <param name="password" value="jackrabbit"/>
	    <param name="schema" value="mysql"/>
	    <param name="schemaObjectPrefix" value="Version_"/>
	    <param name="externalBLOBs" value="false"/>
        </PersistenceManager>
    </Versioning>

-----Original Message-----
From: Julio Castillo [mailto:jcastillo@edgenuity.com] 
Sent: Thursday, March 06, 2008 10:22 AM
To: users@jackrabbit.apache.org
Subject: DDLs and bootstrapping

Still struggling on bootstrap with MySQL.

I have no problems now starting the model 3 jackrabbit using the demo/derby
setup.

I just have not been able to get it working with MySQL. Below is an excerpt
of my repository.xml.

I can't specify a "different" schema (from "mysql") as a parameter, because
then it looks for the "different.ddl" which of course does not exist
anywhere in the path.
I also can't seem to use the "create" substring used for derby. How do I
specify it for MySQL? "<param name="url"
value="jdbc:derby:${rep.home}/version/db;create=true"/>"

Help.
Last, for some reason, the "version" portion of the repository.xml is
executed first, or for some reason, I don't get any error messages from the
"core" portion of the xml file even though it is configured similarly (maybe
it hasn't reached that part of the file).

    <Workspace name="Jackrabbit Core">
        <FileSystem
class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
            <param name="path" value="${wsp.home}"/>
        </FileSystem>
        <PersistenceManager
class="org.apache.jackrabbit.core.persistence.bundle.MySqlPersistenceManager
">
	    <param name="driver" value="com.mysql.jdbc.Driver"/>
	    <param name="url" value="jdbc:mysql://localhost:3306/core"/>
	    <param name="user" value="jackrabbit"/>
	    <param name="password" value="jackrabbit"/>
	    <param name="schema" value="core"/>
          <param name="schemaObjectPrefix" value="Core_"/>
        </PersistenceManager>
       <SearchIndex
class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
            <param name="path" value="${wsp.home}/index"/>
        </SearchIndex>
    </Workspace>
....
    <Versioning rootPath="${rep.home}/version">
        <FileSystem
class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
            <param name="path" value="${rep.home}/version" />
        </FileSystem>
        <PersistenceManager
class="org.apache.jackrabbit.core.persistence.bundle.MySqlPersistenceManager
">
	    <param name="driver" value="com.mysql.jdbc.Driver"/>
	    <param name="url" value="jdbc:mysql://localhost:3306/version"/>
	    <param name="user" value="jackrabbit"/>
	    <param name="password" value="jackrabbit"/>
	    <param name="schema" value="version"/>
          <param name="schemaObjectPrefix" value="Version_"/>
        </PersistenceManager>
    </Versioning>



DDLs and bootstrapping

Posted by Julio Castillo <jc...@edgenuity.com>.
Still struggling on bootstrap with MySQL.

I have no problems now starting the model 3 jackrabbit using the demo/derby
setup.

I just have not been able to get it working with MySQL. Below is an excerpt
of my repository.xml.

I can't specify a "different" schema (from "mysql") as a parameter, because
then it looks for the "different.ddl" which of course does not exist
anywhere in the path.
I also can't seem to use the "create" substring used for derby. How do I
specify it for MySQL? "<param name="url"
value="jdbc:derby:${rep.home}/version/db;create=true"/>"

Help.
Last, for some reason, the "version" portion of the repository.xml is
executed first, or for some reason, I don't get any error messages from the
"core" portion of the xml file even though it is configured similarly (maybe
it hasn't reached that part of the file).

    <Workspace name="Jackrabbit Core">
        <FileSystem
class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
            <param name="path" value="${wsp.home}"/>
        </FileSystem>
        <PersistenceManager
class="org.apache.jackrabbit.core.persistence.bundle.MySqlPersistenceManager
">
	    <param name="driver" value="com.mysql.jdbc.Driver"/>
	    <param name="url" value="jdbc:mysql://localhost:3306/core"/>
	    <param name="user" value="jackrabbit"/>
	    <param name="password" value="jackrabbit"/>
	    <param name="schema" value="core"/>
          <param name="schemaObjectPrefix" value="Core_"/>
        </PersistenceManager>
       <SearchIndex
class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
            <param name="path" value="${wsp.home}/index"/>
        </SearchIndex>
    </Workspace>
....
    <Versioning rootPath="${rep.home}/version">
        <FileSystem
class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
            <param name="path" value="${rep.home}/version" />
        </FileSystem>
        <PersistenceManager
class="org.apache.jackrabbit.core.persistence.bundle.MySqlPersistenceManager
">
	    <param name="driver" value="com.mysql.jdbc.Driver"/>
	    <param name="url" value="jdbc:mysql://localhost:3306/version"/>
	    <param name="user" value="jackrabbit"/>
	    <param name="password" value="jackrabbit"/>
	    <param name="schema" value="version"/>
          <param name="schemaObjectPrefix" value="Version_"/>
        </PersistenceManager>
    </Versioning>



Re: Access Control

Posted by Fernando Meyer <fe...@fmeyer.org>.
I'm implementing ACL using jboss-security acl

http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-repository/src/main/java/org/drools/repository/security/

you can check my progress here

On Wed, Mar 5, 2008 at 2:49 PM, Katia Santos <ka...@gmail.com> wrote:

> Hello,
>
> I would like to learn more how jackrabbit handles access control of
> the data stored.
> wich is the best way to allow/deny access to nodes? ACL in every Node?
> How does it checks if the user is allowed to read/modify the node?
> I really dont know anything about this issue...can someone give me a
> starting ideia?
>
>
> Katia
>



-- 
Fernando Meyer http://fmeyer.org
JBoss Rules Core Developer
fernando@fmeyer.org