You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Akil Ali <Ak...@cognizant.com> on 2009/02/25 11:57:27 UTC

From where transientRepository class get the repository.xml file?

Please see my code snippet that i am using to create a repository

public class InitializeRepository {

	/**
	 * @param args
	 */
    public static Session session;
    public static Session getSession() {
        return session;
    }

    public void destroy() {
        session.logout();
    }
	public static void main(String[] args) {
		 try {
	            System.setProperty("org.apache.jackrabbit.repository.home",
	                "D:/PQR");
	            Repository repository = new TransientRepository();
	            session = repository.login(new SimpleCredentials("username",
	                    "password".toCharArray()));
	            Node rootNode = session.getRootNode();
	            Node parentNode = rootNode.addNode("A");
	            for(int i=600; i < 611; i++){
	            	parentNode.addNode(""+i);
	            }
	            session.save();
	            session.logout();
 
	        } catch (LoginException e) {
	             e.printStackTrace();
	        } catch (IOException e) {
	        	e.printStackTrace();
	        } catch (RepositoryException e) {
	        	e.printStackTrace();
	        }
	}

}

I have set the org.apache.jackrabbit.repository.home property. also i know
that repository.xml is part of org.apache.jackrabbit.core package. but thing
is that i dont want to use indexing functionality given by jackrabbit. so i
have commented the indexing part and built the jar file. finally when i run
the program i can see that the indexes were created. can you please tell me
how can i disable the indexing feature by using transientrepository class.
-- 
View this message in context: http://www.nabble.com/From-where-transientRepository-class-get-the-repository.xml-file--tp22200624p22200624.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: From where transientRepository class get the repository.xml file?

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

On Wed, Feb 25, 2009 at 11:57 AM, Akil Ali <Ak...@cognizant.com> wrote:
> I have set the org.apache.jackrabbit.repository.home property. also i know
> that repository.xml is part of org.apache.jackrabbit.core package. but thing
> is that i dont want to use indexing functionality given by jackrabbit. so i
> have commented the indexing part and built the jar file.

A perhaps easier alternative is to point the
org.apache.jackrabbit.repository.conf system property to your custom
configuration file. Or you could use the TransientRepository
constructor that takes both the configuration file and the repository
directory paths as explicit arguments.

> finally when i run the program i can see that the indexes were created.

Did you note that there are two <SearchIndex/> configuration entries
in the repository.xml? One is for the version store and one is for the
workspace configuration template that's used as the default for all
created workspaces.

BR,

Jukka Zitting