You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Costin Leau (JIRA)" <ji...@apache.org> on 2005/10/09 14:37:51 UTC

[jira] Created: (JCR-248) create configuration on InputStream

create configuration on InputStream
-----------------------------------

         Key: JCR-248
         URL: http://issues.apache.org/jira/browse/JCR-248
     Project: Jackrabbit
        Type: Improvement
  Components: config  
    Versions: 1.0    
    Reporter: Costin Leau
    Priority: Minor


RepositoryConfig should be possible to create based on InputStreams (in case of URLs) ; right now it's possible only using String and InputSource. Please update also the JCA connector. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (JCR-248) create configuration on InputStream

Posted by "Costin Leau (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/JCR-248?page=comments#action_12331781 ] 

Costin Leau commented on JCR-248:
---------------------------------

It's quite easy - the JCA connector creates the repository and it's configuration from Strings - the update should add the rest of the methods from repository config ( create(URI, String) and create(InputStream, String)). That's it.

> create configuration on InputStream
> -----------------------------------
>
>          Key: JCR-248
>          URL: http://issues.apache.org/jira/browse/JCR-248
>      Project: Jackrabbit
>         Type: Improvement
>   Components: config
>     Reporter: Costin Leau
>     Assignee: Dominique Pfister
>     Priority: Minor
>      Fix For: 1.0

>
> RepositoryConfig should be possible to create based on InputStreams (in case of URLs) ; right now it's possible only using String and InputSource. Please update also the JCA connector. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (JCR-248) create configuration on InputStream

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/JCR-248?page=comments#action_12331693 ] 

Jukka Zitting commented on JCR-248:
-----------------------------------

org.xml.sax.InputSource is a part of Java 1.4 so no extra dependencies are required. An InputSource is created internally when RepositoryConfig is given a configuration file path, and it would certainly be possible to add a utility method that does the same for an InputStream. I'm just hesitant on extending this semi-public API without a good use case for it.

Extending the RepositoryConfig.create(String,String) method to allow URLs in addition to file paths is a "cleaner" extension, so I'd like to do that instead if it is good enough for you. This extension would also require no changes in JCA.


> create configuration on InputStream
> -----------------------------------
>
>          Key: JCR-248
>          URL: http://issues.apache.org/jira/browse/JCR-248
>      Project: Jackrabbit
>         Type: Improvement
>   Components: config
>     Reporter: Costin Leau
>     Assignee: Jukka Zitting
>     Priority: Minor
>      Fix For: 1.0

>
> RepositoryConfig should be possible to create based on InputStreams (in case of URLs) ; right now it's possible only using String and InputSource. Please update also the JCA connector. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (JCR-248) create configuration on InputStream

Posted by "Dominique Pfister (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/JCR-248?page=comments#action_12356421 ] 

Dominique Pfister commented on JCR-248:
---------------------------------------

According to the J2EE Connector Architecture Specification 1.0, custom properties for the managed connection factory class must be of one of the following types:

- java.lang.Boolean
- java.lang.String
- java.lang.Integer,
- java.lang.Double
- java.lang.Byte
- java.lang.Short,
- java.lang.Long
- java.lang.Float
- java.lang.Character

Adding URI and/or InputStream would then obviously be in violation to this. It would, of course, make sense to add a property of type String named URI, that would internally be converted to a URI before creating the RepositoryConfig object, but what about InputStream?

> create configuration on InputStream
> -----------------------------------
>
>          Key: JCR-248
>          URL: http://issues.apache.org/jira/browse/JCR-248
>      Project: Jackrabbit
>         Type: Improvement
>   Components: config
>     Reporter: Costin Leau
>     Assignee: Dominique Pfister
>     Priority: Minor
>      Fix For: 1.0

>
> RepositoryConfig should be possible to create based on InputStreams (in case of URLs) ; right now it's possible only using String and InputSource. Please update also the JCA connector. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (JCR-248) create configuration on InputStream

Posted by "Costin Leau (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/JCR-248?page=comments#action_12331707 ] 

Costin Leau commented on JCR-248:
---------------------------------

But you can create an InputSource based on an InputStream (i.e. InputSource xmlSource = new InputSource(myInputStream); ). Am I missing something here?

> create configuration on InputStream
> -----------------------------------
>
>          Key: JCR-248
>          URL: http://issues.apache.org/jira/browse/JCR-248
>      Project: Jackrabbit
>         Type: Improvement
>   Components: config
>     Reporter: Costin Leau
>     Assignee: Jukka Zitting
>     Priority: Minor
>      Fix For: 1.0

>
> RepositoryConfig should be possible to create based on InputStreams (in case of URLs) ; right now it's possible only using String and InputSource. Please update also the JCA connector. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (JCR-248) create configuration on InputStream

Posted by "Tobias Strasser (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/JCR-248?page=comments#action_12331709 ] 

Tobias Strasser commented on JCR-248:
-------------------------------------

sure you can. but then you loose the ability to resolve relative entities. currently, the config does not make use of those, so this is no problem.

my point is the following:
- adding a new signature that takes an inputstream would just be convenience. the overhead in typing 'new InputSource(in)' is very low
- only having the InputStream signature is not acceptable, since the XML parsing could need the information stored in the InputSource.


> create configuration on InputStream
> -----------------------------------
>
>          Key: JCR-248
>          URL: http://issues.apache.org/jira/browse/JCR-248
>      Project: Jackrabbit
>         Type: Improvement
>   Components: config
>     Reporter: Costin Leau
>     Assignee: Jukka Zitting
>     Priority: Minor
>      Fix For: 1.0

>
> RepositoryConfig should be possible to create based on InputStreams (in case of URLs) ; right now it's possible only using String and InputSource. Please update also the JCA connector. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Resolved: (JCR-248) create configuration on InputStream

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-248?page=all ]
     
Jukka Zitting resolved JCR-248:
-------------------------------

    Resolution: Fixed

Tobias is right, InputSource is the correct format to use.

I added (r312816)  the convenience methods create(URI, String) and create(InputStream, String). This should cover all use cases.

> create configuration on InputStream
> -----------------------------------
>
>          Key: JCR-248
>          URL: http://issues.apache.org/jira/browse/JCR-248
>      Project: Jackrabbit
>         Type: Improvement
>   Components: config
>     Reporter: Costin Leau
>     Assignee: Jukka Zitting
>     Priority: Minor
>      Fix For: 1.0

>
> RepositoryConfig should be possible to create based on InputStreams (in case of URLs) ; right now it's possible only using String and InputSource. Please update also the JCA connector. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Reopened: (JCR-248) create configuration on InputStream

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-248?page=all ]
     
Jukka Zitting reopened JCR-248:
-------------------------------

     Assign To: Dominique Pfister  (was: Jukka Zitting)

Costin Leau wrote:
> Can you please, also update the JCA connector configuration methods?

Ah, sorry. Reopened the issue and assigned to Dominique.

Dominique, could you take a look at this? The current JCA configuration is based on the repository configuration file name and I'm not sure about all the implications of changing that.

> create configuration on InputStream
> -----------------------------------
>
>          Key: JCR-248
>          URL: http://issues.apache.org/jira/browse/JCR-248
>      Project: Jackrabbit
>         Type: Improvement
>   Components: config
>     Reporter: Costin Leau
>     Assignee: Dominique Pfister
>     Priority: Minor
>      Fix For: 1.0

>
> RepositoryConfig should be possible to create based on InputStreams (in case of URLs) ; right now it's possible only using String and InputSource. Please update also the JCA connector. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (JCR-248) create configuration on InputStream

Posted by "Costin Leau (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/JCR-248?page=comments#action_12331777 ] 

Costin Leau commented on JCR-248:
---------------------------------

Can you please, also update the JCA connector configuration methods?

> create configuration on InputStream
> -----------------------------------
>
>          Key: JCR-248
>          URL: http://issues.apache.org/jira/browse/JCR-248
>      Project: Jackrabbit
>         Type: Improvement
>   Components: config
>     Reporter: Costin Leau
>     Assignee: Jukka Zitting
>     Priority: Minor
>      Fix For: 1.0

>
> RepositoryConfig should be possible to create based on InputStreams (in case of URLs) ; right now it's possible only using String and InputSource. Please update also the JCA connector. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (JCR-248) create configuration on InputStream

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/JCR-248?page=comments#action_12331673 ] 

Jukka Zitting commented on JCR-248:
-----------------------------------

You can use InputStreams just by wrapping them into InputSources:

    String repositoryHome = ...;
    InputStream repositoryXml = ...;
    RepositoryConfig config = RepositoryConfig.create(new InputSource(repositoryXml), repositoryHome);

(The API uses InputSources as they make for better XML error messages)

The JCA case is a bit more difficult. It might make sense to allow URLs instead of just file paths as configuration file paths in RepositoryConfig.create(String,String)? Would this cover your use case?

> create configuration on InputStream
> -----------------------------------
>
>          Key: JCR-248
>          URL: http://issues.apache.org/jira/browse/JCR-248
>      Project: Jackrabbit
>         Type: Improvement
>   Components: config
>     Reporter: Costin Leau
>     Assignee: Jukka Zitting
>     Priority: Minor
>      Fix For: 1.0

>
> RepositoryConfig should be possible to create based on InputStreams (in case of URLs) ; right now it's possible only using String and InputSource. Please update also the JCA connector. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (JCR-248) create configuration on InputStream

Posted by "Costin Leau (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/JCR-248?page=comments#action_12331687 ] 

Costin Leau commented on JCR-248:
---------------------------------

Yes it would. The JCA relies on the RepositoryConfigu so it just needs some methods which accept InputSources instead of just Strings.
As for the InputSource why doesn't JackRabbit creates it internally ? - the client is force to have the InputSource library in the classpath just as a dependency.

> create configuration on InputStream
> -----------------------------------
>
>          Key: JCR-248
>          URL: http://issues.apache.org/jira/browse/JCR-248
>      Project: Jackrabbit
>         Type: Improvement
>   Components: config
>     Reporter: Costin Leau
>     Assignee: Jukka Zitting
>     Priority: Minor
>      Fix For: 1.0

>
> RepositoryConfig should be possible to create based on InputStreams (in case of URLs) ; right now it's possible only using String and InputSource. Please update also the JCA connector. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (JCR-248) create configuration on InputStream

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-248?page=all ]

Jukka Zitting updated JCR-248:
------------------------------

    Fix Version: 1.1
                     (was: 1.0)

> create configuration on InputStream
> -----------------------------------
>
>          Key: JCR-248
>          URL: http://issues.apache.org/jira/browse/JCR-248
>      Project: Jackrabbit
>         Type: Improvement
>   Components: config
>     Reporter: Costin Leau
>     Assignee: Dominique Pfister
>     Priority: Minor
>      Fix For: 1.1

>
> RepositoryConfig should be possible to create based on InputStreams (in case of URLs) ; right now it's possible only using String and InputSource. Please update also the JCA connector. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Assigned: (JCR-248) create configuration on InputStream

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-248?page=all ]

Jukka Zitting reassigned JCR-248:
---------------------------------

    Assign To: Jukka Zitting

> create configuration on InputStream
> -----------------------------------
>
>          Key: JCR-248
>          URL: http://issues.apache.org/jira/browse/JCR-248
>      Project: Jackrabbit
>         Type: Improvement
>   Components: config
>     Reporter: Costin Leau
>     Assignee: Jukka Zitting
>     Priority: Minor
>      Fix For: 1.0

>
> RepositoryConfig should be possible to create based on InputStreams (in case of URLs) ; right now it's possible only using String and InputSource. Please update also the JCA connector. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (JCR-248) create configuration on InputStream

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/JCR-248?page=comments#action_12332170 ] 

Jukka Zitting commented on JCR-248:
-----------------------------------

I'm just curious about how to handle the property declarations in ra.xml, and more generally whether it even makes sense to allow InputStreams as declarative connector properties.

> create configuration on InputStream
> -----------------------------------
>
>          Key: JCR-248
>          URL: http://issues.apache.org/jira/browse/JCR-248
>      Project: Jackrabbit
>         Type: Improvement
>   Components: config
>     Reporter: Costin Leau
>     Assignee: Dominique Pfister
>     Priority: Minor
>      Fix For: 1.0

>
> RepositoryConfig should be possible to create based on InputStreams (in case of URLs) ; right now it's possible only using String and InputSource. Please update also the JCA connector. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (JCR-248) create configuration on InputStream

Posted by "Costin Leau (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/JCR-248?page=comments#action_12331696 ] 

Costin Leau commented on JCR-248:
---------------------------------

You are right about the extra dependecy however considering that an InputSource is created internally by JackRabbit if a String is used I think using an InputStream is the best alternative. The configuration implementation doesn't have to treat the case of file, url or InputSource or anything like that - maybe the client is using a PipedStream. Indeed I have a hook (create the InputSource) but I think it would be easier if the would be a generic method which accepts the inputStream and the rest of the method internally delegate to it InputStream is the lowest common dominator and there is always a situation where the client doesn't use URLs or File.
My main motivation behind the issue is the update of the JCA contribution so if I can hook an input stream to it (no matter if I have to create an InputSource or not).


> create configuration on InputStream
> -----------------------------------
>
>          Key: JCR-248
>          URL: http://issues.apache.org/jira/browse/JCR-248
>      Project: Jackrabbit
>         Type: Improvement
>   Components: config
>     Reporter: Costin Leau
>     Assignee: Jukka Zitting
>     Priority: Minor
>      Fix For: 1.0

>
> RepositoryConfig should be possible to create based on InputStreams (in case of URLs) ; right now it's possible only using String and InputSource. Please update also the JCA connector. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (JCR-248) create configuration on InputStream

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-248?page=all ]

Jukka Zitting updated JCR-248:
------------------------------

    Fix Version: 1.0
        Version:     (was: 1.0)

> create configuration on InputStream
> -----------------------------------
>
>          Key: JCR-248
>          URL: http://issues.apache.org/jira/browse/JCR-248
>      Project: Jackrabbit
>         Type: Improvement
>   Components: config
>     Reporter: Costin Leau
>     Priority: Minor
>      Fix For: 1.0

>
> RepositoryConfig should be possible to create based on InputStreams (in case of URLs) ; right now it's possible only using String and InputSource. Please update also the JCA connector. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (JCR-248) create configuration on InputStream

Posted by "Tobias Strasser (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/JCR-248?page=comments#action_12331701 ] 

Tobias Strasser commented on JCR-248:
-------------------------------------

when dealing with xml configuration, an InputSource signature should be provided. the InputSource also hold information about the SystemId or PublishId. this information is used to resolve external entities, or DTDs.

> create configuration on InputStream
> -----------------------------------
>
>          Key: JCR-248
>          URL: http://issues.apache.org/jira/browse/JCR-248
>      Project: Jackrabbit
>         Type: Improvement
>   Components: config
>     Reporter: Costin Leau
>     Assignee: Jukka Zitting
>     Priority: Minor
>      Fix For: 1.0

>
> RepositoryConfig should be possible to create based on InputStreams (in case of URLs) ; right now it's possible only using String and InputSource. Please update also the JCA connector. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira