You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Jukka Zitting (JIRA)" <ji...@apache.org> on 2009/10/22 16:13:59 UTC
[jira] Created: (JCR-2360) JcrUtils.getRepository(...) for simple
repository access
JcrUtils.getRepository(...) for simple repository access
--------------------------------------------------------
Key: JCR-2360
URL: https://issues.apache.org/jira/browse/JCR-2360
Project: Jackrabbit Content Repository
Issue Type: New Feature
Components: jackrabbit-jcr-commons
Reporter: Jukka Zitting
Priority: Minor
As discussed on the mailing list, it would be nice to have a trivially simple way (one line of code) to connect to a repository. The RepositoryFactory interface in JCR 2.0 defines a way for clients to get a repository reference without a direct implementation dependency, but a client still needs extra code to handle the Service Provider lookup and the iteration through all the available repository factories.
To simplify client code I'd like to introduce a JcrUtils.getRepository(Map<String, String>) method that takes care of the tasks mentioned above:
Map<String, String> parameters = ...; // repository settings
Repository repository = JcrUtils.getRepository(parameters);
As a further simplification, I'd also like to introduce a JcrUtils.getRepository(String) method that builds the parameter map based on a given "repository URI".
Repository repository = JcrUtils.getRepository("file:///path/to/repository");
Repository repository = JcrUtils.getRepository("http://localhost:8080/server");
The set of supported URI types is still to be defined.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (JCR-2360) JcrUtils.getRepository(...) for simple
repository access
Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-2360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12798641#action_12798641 ]
Jukka Zitting commented on JCR-2360:
------------------------------------
> let each factory interpret org.apache.jackrabbit.repository.uri
This is now implemented with the new jcr2dav component and the jackrabbit-core changes in revision 897836.
Any new RepositoryFactory implementations that want to work with JcrUtils.getRepository(String uri) should implement similar processing for the org.apache.jackrabbit.repository.uri configuration parameter.
> JcrUtils.getRepository(...) for simple repository access
> --------------------------------------------------------
>
> Key: JCR-2360
> URL: https://issues.apache.org/jira/browse/JCR-2360
> Project: Jackrabbit Content Repository
> Issue Type: New Feature
> Components: jackrabbit-jcr-commons
> Reporter: Jukka Zitting
> Assignee: Jukka Zitting
> Priority: Minor
> Fix For: 2.0-beta1
>
> Attachments: JCR-2360.patch
>
>
> As discussed on the mailing list, it would be nice to have a trivially simple way (one line of code) to connect to a repository. The RepositoryFactory interface in JCR 2.0 defines a way for clients to get a repository reference without a direct implementation dependency, but a client still needs extra code to handle the Service Provider lookup and the iteration through all the available repository factories.
> To simplify client code I'd like to introduce a JcrUtils.getRepository(Map<String, String>) method that takes care of the tasks mentioned above:
> Map<String, String> parameters = ...; // repository settings
> Repository repository = JcrUtils.getRepository(parameters);
> As a further simplification, I'd also like to introduce a JcrUtils.getRepository(String) method that builds the parameter map based on a given "repository URI".
> Repository repository = JcrUtils.getRepository("file:///path/to/repository");
> Repository repository = JcrUtils.getRepository("http://localhost:8080/server");
> The set of supported URI types is still to be defined.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (JCR-2360) JcrUtils.getRepository(...) for simple
repository access
Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-2360?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jukka Zitting updated JCR-2360:
-------------------------------
Resolution: Fixed
Fix Version/s: 2.0.0
Status: Resolved (was: Patch Available)
I committed the patch and a followup change that introduced an o.a.j.commons.GenericRepositoryFactory class that implements the repository URI functionality (and JNDI lookups) as a standard RepositoryFactory.
> JcrUtils.getRepository(...) for simple repository access
> --------------------------------------------------------
>
> Key: JCR-2360
> URL: https://issues.apache.org/jira/browse/JCR-2360
> Project: Jackrabbit Content Repository
> Issue Type: New Feature
> Components: jackrabbit-jcr-commons
> Reporter: Jukka Zitting
> Assignee: Jukka Zitting
> Priority: Minor
> Fix For: 2.0.0
>
> Attachments: JCR-2360.patch
>
>
> As discussed on the mailing list, it would be nice to have a trivially simple way (one line of code) to connect to a repository. The RepositoryFactory interface in JCR 2.0 defines a way for clients to get a repository reference without a direct implementation dependency, but a client still needs extra code to handle the Service Provider lookup and the iteration through all the available repository factories.
> To simplify client code I'd like to introduce a JcrUtils.getRepository(Map<String, String>) method that takes care of the tasks mentioned above:
> Map<String, String> parameters = ...; // repository settings
> Repository repository = JcrUtils.getRepository(parameters);
> As a further simplification, I'd also like to introduce a JcrUtils.getRepository(String) method that builds the parameter map based on a given "repository URI".
> Repository repository = JcrUtils.getRepository("file:///path/to/repository");
> Repository repository = JcrUtils.getRepository("http://localhost:8080/server");
> The set of supported URI types is still to be defined.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (JCR-2360) JcrUtils.getRepository(...) for simple
repository access
Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-2360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12769958#action_12769958 ]
Felix Meschberger commented on JCR-2360:
----------------------------------------
How come I think of the OSGi ServiceRegistry would be faboulous helper for this kind of extensibility ... ;-)
> JcrUtils.getRepository(...) for simple repository access
> --------------------------------------------------------
>
> Key: JCR-2360
> URL: https://issues.apache.org/jira/browse/JCR-2360
> Project: Jackrabbit Content Repository
> Issue Type: New Feature
> Components: jackrabbit-jcr-commons
> Reporter: Jukka Zitting
> Assignee: Jukka Zitting
> Priority: Minor
> Fix For: 2.0-beta1
>
> Attachments: JCR-2360.patch
>
>
> As discussed on the mailing list, it would be nice to have a trivially simple way (one line of code) to connect to a repository. The RepositoryFactory interface in JCR 2.0 defines a way for clients to get a repository reference without a direct implementation dependency, but a client still needs extra code to handle the Service Provider lookup and the iteration through all the available repository factories.
> To simplify client code I'd like to introduce a JcrUtils.getRepository(Map<String, String>) method that takes care of the tasks mentioned above:
> Map<String, String> parameters = ...; // repository settings
> Repository repository = JcrUtils.getRepository(parameters);
> As a further simplification, I'd also like to introduce a JcrUtils.getRepository(String) method that builds the parameter map based on a given "repository URI".
> Repository repository = JcrUtils.getRepository("file:///path/to/repository");
> Repository repository = JcrUtils.getRepository("http://localhost:8080/server");
> The set of supported URI types is still to be defined.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (JCR-2360) JcrUtils.getRepository(...) for simple
repository access
Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-2360?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jukka Zitting updated JCR-2360:
-------------------------------
Assignee: Jukka Zitting
Status: Patch Available (was: Open)
> JcrUtils.getRepository(...) for simple repository access
> --------------------------------------------------------
>
> Key: JCR-2360
> URL: https://issues.apache.org/jira/browse/JCR-2360
> Project: Jackrabbit Content Repository
> Issue Type: New Feature
> Components: jackrabbit-jcr-commons
> Reporter: Jukka Zitting
> Assignee: Jukka Zitting
> Priority: Minor
> Attachments: JCR-2360.patch
>
>
> As discussed on the mailing list, it would be nice to have a trivially simple way (one line of code) to connect to a repository. The RepositoryFactory interface in JCR 2.0 defines a way for clients to get a repository reference without a direct implementation dependency, but a client still needs extra code to handle the Service Provider lookup and the iteration through all the available repository factories.
> To simplify client code I'd like to introduce a JcrUtils.getRepository(Map<String, String>) method that takes care of the tasks mentioned above:
> Map<String, String> parameters = ...; // repository settings
> Repository repository = JcrUtils.getRepository(parameters);
> As a further simplification, I'd also like to introduce a JcrUtils.getRepository(String) method that builds the parameter map based on a given "repository URI".
> Repository repository = JcrUtils.getRepository("file:///path/to/repository");
> Repository repository = JcrUtils.getRepository("http://localhost:8080/server");
> The set of supported URI types is still to be defined.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (JCR-2360) JcrUtils.getRepository(...) for simple
repository access
Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-2360?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jukka Zitting updated JCR-2360:
-------------------------------
Attachment: JCR-2360.patch
Proposed patch with the following supported URI types:
jndi:... for o.a.j.core.jndi.RepositoryFactoryImpl
file://... for o.a.j.core.RepositoryFactoryImpl
http(s)://... for o.a.j.jcr2spi.Jcr2spiRepositoryFactory with o.a.j.spi2davex.Spi2davexRepositoryServiceFactory
More elaborate support (URI parameter support, autodetection of file:// or http:// repository types, etc.) can be added as needed.
> JcrUtils.getRepository(...) for simple repository access
> --------------------------------------------------------
>
> Key: JCR-2360
> URL: https://issues.apache.org/jira/browse/JCR-2360
> Project: Jackrabbit Content Repository
> Issue Type: New Feature
> Components: jackrabbit-jcr-commons
> Reporter: Jukka Zitting
> Priority: Minor
> Attachments: JCR-2360.patch
>
>
> As discussed on the mailing list, it would be nice to have a trivially simple way (one line of code) to connect to a repository. The RepositoryFactory interface in JCR 2.0 defines a way for clients to get a repository reference without a direct implementation dependency, but a client still needs extra code to handle the Service Provider lookup and the iteration through all the available repository factories.
> To simplify client code I'd like to introduce a JcrUtils.getRepository(Map<String, String>) method that takes care of the tasks mentioned above:
> Map<String, String> parameters = ...; // repository settings
> Repository repository = JcrUtils.getRepository(parameters);
> As a further simplification, I'd also like to introduce a JcrUtils.getRepository(String) method that builds the parameter map based on a given "repository URI".
> Repository repository = JcrUtils.getRepository("file:///path/to/repository");
> Repository repository = JcrUtils.getRepository("http://localhost:8080/server");
> The set of supported URI types is still to be defined.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (JCR-2360) JcrUtils.getRepository(...) for simple
repository access
Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-2360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12769952#action_12769952 ]
Thomas Mueller commented on JCR-2360:
-------------------------------------
Instead of hard-coding the prefix-to-factory mapping, we could add a way for factories to 'register' one more multiple URL prefixes. Similar to JDBC, http://java.sun.com/javase/6/docs/api/java/sql/DriverManager.html#registerDriver(java.sql.Driver) - instead of an explicit "register" method, the factory could return the list of prefixes it supports.
> JcrUtils.getRepository(...) for simple repository access
> --------------------------------------------------------
>
> Key: JCR-2360
> URL: https://issues.apache.org/jira/browse/JCR-2360
> Project: Jackrabbit Content Repository
> Issue Type: New Feature
> Components: jackrabbit-jcr-commons
> Reporter: Jukka Zitting
> Assignee: Jukka Zitting
> Priority: Minor
> Fix For: 2.0-beta1
>
> Attachments: JCR-2360.patch
>
>
> As discussed on the mailing list, it would be nice to have a trivially simple way (one line of code) to connect to a repository. The RepositoryFactory interface in JCR 2.0 defines a way for clients to get a repository reference without a direct implementation dependency, but a client still needs extra code to handle the Service Provider lookup and the iteration through all the available repository factories.
> To simplify client code I'd like to introduce a JcrUtils.getRepository(Map<String, String>) method that takes care of the tasks mentioned above:
> Map<String, String> parameters = ...; // repository settings
> Repository repository = JcrUtils.getRepository(parameters);
> As a further simplification, I'd also like to introduce a JcrUtils.getRepository(String) method that builds the parameter map based on a given "repository URI".
> Repository repository = JcrUtils.getRepository("file:///path/to/repository");
> Repository repository = JcrUtils.getRepository("http://localhost:8080/server");
> The set of supported URI types is still to be defined.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (JCR-2360) JcrUtils.getRepository(...) for simple
repository access
Posted by "Dario Louzado (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-2360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12857900#action_12857900 ]
Dario Louzado commented on JCR-2360:
------------------------------------
Currently, using version 2.0.0, how can I connect to a remote Jackrabbit WebDav repository?
> JcrUtils.getRepository(...) for simple repository access
> --------------------------------------------------------
>
> Key: JCR-2360
> URL: https://issues.apache.org/jira/browse/JCR-2360
> Project: Jackrabbit Content Repository
> Issue Type: New Feature
> Components: jackrabbit-jcr-commons
> Reporter: Jukka Zitting
> Assignee: Jukka Zitting
> Priority: Minor
> Fix For: 2.0-beta1
>
> Attachments: JCR-2360.patch
>
>
> As discussed on the mailing list, it would be nice to have a trivially simple way (one line of code) to connect to a repository. The RepositoryFactory interface in JCR 2.0 defines a way for clients to get a repository reference without a direct implementation dependency, but a client still needs extra code to handle the Service Provider lookup and the iteration through all the available repository factories.
> To simplify client code I'd like to introduce a JcrUtils.getRepository(Map<String, String>) method that takes care of the tasks mentioned above:
> Map<String, String> parameters = ...; // repository settings
> Repository repository = JcrUtils.getRepository(parameters);
> As a further simplification, I'd also like to introduce a JcrUtils.getRepository(String) method that builds the parameter map based on a given "repository URI".
> Repository repository = JcrUtils.getRepository("file:///path/to/repository");
> Repository repository = JcrUtils.getRepository("http://localhost:8080/server");
> The set of supported URI types is still to be defined.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (JCR-2360) JcrUtils.getRepository(...) for simple
repository access
Posted by "Marcel Reutegger (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-2360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12769987#action_12769987 ]
Marcel Reutegger commented on JCR-2360:
---------------------------------------
> Instead of a new registry, we could actually just let each specific repository factory to interpret the org.apache.jackrabbit.repository.uri [...]
+1
> JcrUtils.getRepository(...) for simple repository access
> --------------------------------------------------------
>
> Key: JCR-2360
> URL: https://issues.apache.org/jira/browse/JCR-2360
> Project: Jackrabbit Content Repository
> Issue Type: New Feature
> Components: jackrabbit-jcr-commons
> Reporter: Jukka Zitting
> Assignee: Jukka Zitting
> Priority: Minor
> Fix For: 2.0-beta1
>
> Attachments: JCR-2360.patch
>
>
> As discussed on the mailing list, it would be nice to have a trivially simple way (one line of code) to connect to a repository. The RepositoryFactory interface in JCR 2.0 defines a way for clients to get a repository reference without a direct implementation dependency, but a client still needs extra code to handle the Service Provider lookup and the iteration through all the available repository factories.
> To simplify client code I'd like to introduce a JcrUtils.getRepository(Map<String, String>) method that takes care of the tasks mentioned above:
> Map<String, String> parameters = ...; // repository settings
> Repository repository = JcrUtils.getRepository(parameters);
> As a further simplification, I'd also like to introduce a JcrUtils.getRepository(String) method that builds the parameter map based on a given "repository URI".
> Repository repository = JcrUtils.getRepository("file:///path/to/repository");
> Repository repository = JcrUtils.getRepository("http://localhost:8080/server");
> The set of supported URI types is still to be defined.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (JCR-2360) JcrUtils.getRepository(...) for simple
repository access
Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-2360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12769959#action_12769959 ]
Thomas Mueller commented on JCR-2360:
-------------------------------------
> OSGi ServiceRegistry
See the title "simple repository access". If I want a simple solution, I _definitely_ don't want to use OSGi.
> JcrUtils.getRepository(...) for simple repository access
> --------------------------------------------------------
>
> Key: JCR-2360
> URL: https://issues.apache.org/jira/browse/JCR-2360
> Project: Jackrabbit Content Repository
> Issue Type: New Feature
> Components: jackrabbit-jcr-commons
> Reporter: Jukka Zitting
> Assignee: Jukka Zitting
> Priority: Minor
> Fix For: 2.0-beta1
>
> Attachments: JCR-2360.patch
>
>
> As discussed on the mailing list, it would be nice to have a trivially simple way (one line of code) to connect to a repository. The RepositoryFactory interface in JCR 2.0 defines a way for clients to get a repository reference without a direct implementation dependency, but a client still needs extra code to handle the Service Provider lookup and the iteration through all the available repository factories.
> To simplify client code I'd like to introduce a JcrUtils.getRepository(Map<String, String>) method that takes care of the tasks mentioned above:
> Map<String, String> parameters = ...; // repository settings
> Repository repository = JcrUtils.getRepository(parameters);
> As a further simplification, I'd also like to introduce a JcrUtils.getRepository(String) method that builds the parameter map based on a given "repository URI".
> Repository repository = JcrUtils.getRepository("file:///path/to/repository");
> Repository repository = JcrUtils.getRepository("http://localhost:8080/server");
> The set of supported URI types is still to be defined.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (JCR-2360) JcrUtils.getRepository(...) for simple
repository access
Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-2360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12769988#action_12769988 ]
Thomas Mueller commented on JCR-2360:
-------------------------------------
> let each factory interpret org.apache.jackrabbit.repository.uri
+1
> JcrUtils.getRepository(...) for simple repository access
> --------------------------------------------------------
>
> Key: JCR-2360
> URL: https://issues.apache.org/jira/browse/JCR-2360
> Project: Jackrabbit Content Repository
> Issue Type: New Feature
> Components: jackrabbit-jcr-commons
> Reporter: Jukka Zitting
> Assignee: Jukka Zitting
> Priority: Minor
> Fix For: 2.0-beta1
>
> Attachments: JCR-2360.patch
>
>
> As discussed on the mailing list, it would be nice to have a trivially simple way (one line of code) to connect to a repository. The RepositoryFactory interface in JCR 2.0 defines a way for clients to get a repository reference without a direct implementation dependency, but a client still needs extra code to handle the Service Provider lookup and the iteration through all the available repository factories.
> To simplify client code I'd like to introduce a JcrUtils.getRepository(Map<String, String>) method that takes care of the tasks mentioned above:
> Map<String, String> parameters = ...; // repository settings
> Repository repository = JcrUtils.getRepository(parameters);
> As a further simplification, I'd also like to introduce a JcrUtils.getRepository(String) method that builds the parameter map based on a given "repository URI".
> Repository repository = JcrUtils.getRepository("file:///path/to/repository");
> Repository repository = JcrUtils.getRepository("http://localhost:8080/server");
> The set of supported URI types is still to be defined.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (JCR-2360) JcrUtils.getRepository(...) for simple
repository access
Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-2360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12769962#action_12769962 ]
Jukka Zitting commented on JCR-2360:
------------------------------------
Instead of a new registry, we could actually just let each specific repository factory to interpret the org.apache.jackrabbit.repository.uri parameter in addition to any custom parameters they may support.
For example, the jackrabbit-core repository factory could look up a file:// URI and only return an instantiated repository if the given path points to a Jackrabbit repository directory. Another repository factory could then also support file:// URIs that point to other types of files or directories.
The nice thing about this approach is that we wouldn't need another registry mechanism, as the normal service provider system already used by repository factories would be good enough.
> JcrUtils.getRepository(...) for simple repository access
> --------------------------------------------------------
>
> Key: JCR-2360
> URL: https://issues.apache.org/jira/browse/JCR-2360
> Project: Jackrabbit Content Repository
> Issue Type: New Feature
> Components: jackrabbit-jcr-commons
> Reporter: Jukka Zitting
> Assignee: Jukka Zitting
> Priority: Minor
> Fix For: 2.0-beta1
>
> Attachments: JCR-2360.patch
>
>
> As discussed on the mailing list, it would be nice to have a trivially simple way (one line of code) to connect to a repository. The RepositoryFactory interface in JCR 2.0 defines a way for clients to get a repository reference without a direct implementation dependency, but a client still needs extra code to handle the Service Provider lookup and the iteration through all the available repository factories.
> To simplify client code I'd like to introduce a JcrUtils.getRepository(Map<String, String>) method that takes care of the tasks mentioned above:
> Map<String, String> parameters = ...; // repository settings
> Repository repository = JcrUtils.getRepository(parameters);
> As a further simplification, I'd also like to introduce a JcrUtils.getRepository(String) method that builds the parameter map based on a given "repository URI".
> Repository repository = JcrUtils.getRepository("file:///path/to/repository");
> Repository repository = JcrUtils.getRepository("http://localhost:8080/server");
> The set of supported URI types is still to be defined.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.