You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@chemistry.apache.org by "Dominique Pfister (JIRA)" <ji...@apache.org> on 2010/03/18 11:28:27 UTC

[jira] Created: (CMIS-166) Allow CMISServlet to get repository after instance creation

Allow CMISServlet to get repository after instance creation
-----------------------------------------------------------

                 Key: CMIS-166
                 URL: https://issues.apache.org/jira/browse/CMIS-166
             Project: Chemistry
          Issue Type: Bug
          Components: chemistry-atompub
            Reporter: Dominique Pfister
            Assignee: Dominique Pfister


The RepositoryFactory class, introduced in CMIS-12, is no longer available. Therefore, it is not possible to use CMISServlet with the default constructor, because the private createRepository() method will always throw an UnsupportedOperationException.

I'd like to replace this mechanism by a protected getRepository() method that will simply return the repository instance member, allowing derived classes to actually create the repository at that point if needed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (CMIS-166) Allow CMISServlet to get repository after instance creation

Posted by "Dominique Pfister (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CMIS-166?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dominique Pfister resolved CMIS-166.
------------------------------------

    Resolution: Fixed

I added the new overridable getRepository() as suggested.

Fixed in revision 925167.

> Allow CMISServlet to get repository after instance creation
> -----------------------------------------------------------
>
>                 Key: CMIS-166
>                 URL: https://issues.apache.org/jira/browse/CMIS-166
>             Project: Chemistry
>          Issue Type: Bug
>          Components: chemistry-atompub
>            Reporter: Dominique Pfister
>            Assignee: Dominique Pfister
>
> The RepositoryFactory class, introduced in CMIS-12, is no longer available. Therefore, it is not possible to use CMISServlet with the default constructor, because the private createRepository() method will always throw an UnsupportedOperationException.
> I'd like to replace this mechanism by a protected getRepository() method that will simply return the repository instance member, allowing derived classes to actually create the repository at that point if needed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CMIS-166) Allow CMISServlet to get repository after instance creation

Posted by "Florent Guillaume (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CMIS-166?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12846851#action_12846851 ] 

Florent Guillaume commented on CMIS-166:
----------------------------------------

Yes I'm sorry I had to change this code a bit when refactoring the RepositoryManager stuff, and as there was no unit test for standalone servlet creation it was not clear to me what should be done and how this was used [I use JAX-RS bindings in Nuxeo].

Go ahead and fix it the way you think best, but I'm not sure how having a getRepository() would help. Don't you mean a setRepository() ?


> Allow CMISServlet to get repository after instance creation
> -----------------------------------------------------------
>
>                 Key: CMIS-166
>                 URL: https://issues.apache.org/jira/browse/CMIS-166
>             Project: Chemistry
>          Issue Type: Bug
>          Components: chemistry-atompub
>            Reporter: Dominique Pfister
>            Assignee: Dominique Pfister
>
> The RepositoryFactory class, introduced in CMIS-12, is no longer available. Therefore, it is not possible to use CMISServlet with the default constructor, because the private createRepository() method will always throw an UnsupportedOperationException.
> I'd like to replace this mechanism by a protected getRepository() method that will simply return the repository instance member, allowing derived classes to actually create the repository at that point if needed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CMIS-166) Allow CMISServlet to get repository after instance creation

Posted by "Dominique Pfister (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CMIS-166?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12846854#action_12846854 ] 

Dominique Pfister commented on CMIS-166:
----------------------------------------

Never mind. I'd like to add a method:

    /**
     * Return the repository. Allows subclasses to create the repository if necessary.
     *
     * @return repository
     */
    protected Repository getRepository() {
        return repository;
    }

and in a derived class I could, e.g.

    @Override
    protected Repository getRepository() {
        if (repository == null) {
            repository = new JcrRepository2(RepositoryAccessServlet.getRepository(getServletContext()));
        }
        return repository;
    }

Sounds good?


> Allow CMISServlet to get repository after instance creation
> -----------------------------------------------------------
>
>                 Key: CMIS-166
>                 URL: https://issues.apache.org/jira/browse/CMIS-166
>             Project: Chemistry
>          Issue Type: Bug
>          Components: chemistry-atompub
>            Reporter: Dominique Pfister
>            Assignee: Dominique Pfister
>
> The RepositoryFactory class, introduced in CMIS-12, is no longer available. Therefore, it is not possible to use CMISServlet with the default constructor, because the private createRepository() method will always throw an UnsupportedOperationException.
> I'd like to replace this mechanism by a protected getRepository() method that will simply return the repository instance member, allowing derived classes to actually create the repository at that point if needed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.