Hi,

On Fri, Nov 7, 2008 at 9:08 PM, Dan Tenenbaum <[EMAIL PROTECTED]> wrote:
> I have a java program that opens a TransientRepository using
> SLING_HOME/jackrabbit/repository.xml as the config file and
> SLING_HOME/jackrabbit/repository as the repository directory...

Using the TransientRepository(String config, String home) constructor I assume.

> So my questions are:
> 1) Where is the repository that my program is writing to? ...

If config and home actually point to the repository that Sling uses,
that should be the same one. The best way to find out is to check the
file timestamps after making changes with one app or the other.

> ...Or, if it is
> writing to the same repository, why can't I see the nodes that were created.
> Could it be using a different workspace? Is there a way to determine what
> workspace you are in (and what user you are logged in as) from a sling
> script?...

By default, Sling uses the repository's default workspace.

The JCR Session object can tell you what this is, so
currentNode.getSession().getWorkspace().getName() should do.

> ...2) Can a java program directly modify the repository that launchpad uses,
> while the launchpad app is running?...

Not directly, but your program could connect to the same repository via RMI.

But can't you do those modifications using the Sling API? We aim to
provide full access to the repository via the HTTP/JSON interface of
the default Sling servlets, and if there's something missing we might
want to add it.

> Next question:
> ...This suggests that sling is starting up RMI but not using it. Can I disable
> that?...

Yes, use the Sling console
(http://localhost:8888/system/console/configMgr), select the
org.apache.sling.jcr.jackrabbit.server.RmiRegistrationSupport config
and change the port number. I don't think there's a simple way to
completely disable that ATM.

-Bertrand

Reply via email to