You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by "Henning Schmiedehausen (JIRA)" <ji...@apache.org> on 2008/05/22 16:59:55 UTC

[jira] Created: (SHINDIG-299) Allow whitespaces in features.txt and commenting out of elements

Allow whitespaces in features.txt and commenting out of elements
----------------------------------------------------------------

                 Key: SHINDIG-299
                 URL: https://issues.apache.org/jira/browse/SHINDIG-299
             Project: Shindig
          Issue Type: Improvement
          Components: Common Components (Java)
            Reporter: Henning Schmiedehausen
         Attachments: shindig-299-1.patch

ATM, it is not possible to just "comment out" a feature in the features.txt file and as soon as you drop a whitespace somewhere, the JsFeatureLoader will complain immediately. 

The attached patch allows to comment out features using "#" in the first column and it also trims whitespaces. Please apply.



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


[jira] Issue Comment Edited: (SHINDIG-299) Allow whitespaces in features.txt and commenting out of elements

Posted by "Henning Schmiedehausen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHINDIG-299?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12599199#action_12599199 ] 

henning edited comment on SHINDIG-299 at 5/22/08 2:37 PM:
-------------------------------------------------------------------------

Even without a central text file to select features and some magic that automatically loads all features present on the classpath (what you want is not jar-magic BTW; but classpath-magic. ;-) ), you still want to be able to enable/disable features found on the classpath. Else you would have to rebind the features jar every time you want to add/remove a feature.

Most of the stuff that you are probably looking for is available under Apache License in the org.springframework.core.io.support.PathMatchingResourcePatternResolver. Spring loads its classpath*:/META-INF/context.xml files this way; you probably want to load e.g. all classpath*:/**/features.xml files ...



      was (Author: henning):
    Even without a central text file to select features and some magic that automatically loads all features present on the classpath (what you want is nor jar-magic BTW; but classpath-magic. ;-) ), you still want to be able to enable/disable features found on the classpath. Else you would have to rebind the features jar every time you want to add/remove a feature.

Most of the stuff that you are probably looking for is available under Apache License in the org.springframework.core.io.support.PathMatchingResourcePatternResolver. Spring loads its classpath*:/META-INF/context.xml files this way; you probably want to load e.g. all classpath*:/**/features.xml files ...


  
> Allow whitespaces in features.txt and commenting out of elements
> ----------------------------------------------------------------
>
>                 Key: SHINDIG-299
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-299
>             Project: Shindig
>          Issue Type: Improvement
>          Components: Common Components (Java)
>            Reporter: Henning Schmiedehausen
>         Attachments: shindig-299-1.patch
>
>
> ATM, it is not possible to just "comment out" a feature in the features.txt file and as soon as you drop a whitespace somewhere, the JsFeatureLoader will complain immediately. 
> The attached patch allows to comment out features using "#" in the first column and it also trims whitespaces. Please apply.

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


[jira] Commented: (SHINDIG-299) Allow whitespaces in features.txt and commenting out of elements

Posted by "Henning Schmiedehausen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHINDIG-299?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12599199#action_12599199 ] 

Henning Schmiedehausen commented on SHINDIG-299:
------------------------------------------------

Even without a central text file to select features and some magic that automatically loads all features present on the classpath (what you want is nor jar-magic BTW; but classpath-magic. ;-) ), you still want to be able to enable/disable features found on the classpath. Else you would have to rebind the features jar every time you want to add/remove a feature.

Most of the stuff that you are probably looking for is available under Apache License in the org.springframework.core.io.support.PathMatchingResourcePatternResolver. Spring loads its classpath*:/META-INF/context.xml files this way; you probably want to load e.g. all classpath*:/**/features.xml files ...



> Allow whitespaces in features.txt and commenting out of elements
> ----------------------------------------------------------------
>
>                 Key: SHINDIG-299
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-299
>             Project: Shindig
>          Issue Type: Improvement
>          Components: Common Components (Java)
>            Reporter: Henning Schmiedehausen
>         Attachments: shindig-299-1.patch
>
>
> ATM, it is not possible to just "comment out" a feature in the features.txt file and as soon as you drop a whitespace somewhere, the JsFeatureLoader will complain immediately. 
> The attached patch allows to comment out features using "#" in the first column and it also trims whitespaces. Please apply.

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


[jira] Commented: (SHINDIG-299) Allow whitespaces in features.txt and commenting out of elements

Posted by "Kevin Brown (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHINDIG-299?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12599254#action_12599254 ] 

Kevin Brown commented on SHINDIG-299:
-------------------------------------

Indeed -- the simpler solution is actually to load files from the file system rather than from a jar. At least that's what our production stuff is doing. I'd rather not pull in a dependency on spring.

> Allow whitespaces in features.txt and commenting out of elements
> ----------------------------------------------------------------
>
>                 Key: SHINDIG-299
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-299
>             Project: Shindig
>          Issue Type: Improvement
>          Components: Common Components (Java)
>            Reporter: Henning Schmiedehausen
>         Attachments: shindig-299-1.patch
>
>
> ATM, it is not possible to just "comment out" a feature in the features.txt file and as soon as you drop a whitespace somewhere, the JsFeatureLoader will complain immediately. 
> The attached patch allows to comment out features using "#" in the first column and it also trims whitespaces. Please apply.

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


[jira] Updated: (SHINDIG-299) Allow whitespaces in features.txt and commenting out of elements

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

Henning Schmiedehausen updated SHINDIG-299:
-------------------------------------------

    Attachment: shindig-299-1.patch

patch should apply with "-p1".

> Allow whitespaces in features.txt and commenting out of elements
> ----------------------------------------------------------------
>
>                 Key: SHINDIG-299
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-299
>             Project: Shindig
>          Issue Type: Improvement
>          Components: Common Components (Java)
>            Reporter: Henning Schmiedehausen
>         Attachments: shindig-299-1.patch
>
>
> ATM, it is not possible to just "comment out" a feature in the features.txt file and as soon as you drop a whitespace somewhere, the JsFeatureLoader will complain immediately. 
> The attached patch allows to comment out features using "#" in the first column and it also trims whitespaces. Please apply.

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


[jira] Commented: (SHINDIG-299) Allow whitespaces in features.txt and commenting out of elements

Posted by "Henning Schmiedehausen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHINDIG-299?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12599308#action_12599308 ] 

Henning Schmiedehausen commented on SHINDIG-299:
------------------------------------------------

Of course you should not add a dependency to Spring to Shindig. That would be silly, wouldn't it? Looking at the code in the class above (it is open source) and then model a loader based on the code that the Spring guys did in a number of iterations would be my way of action.

Add a line to the NOTICES file saying "this product contains code based on Spring framework" and you are done. It is Apache licensed, so it is compatible.

The whole idea of open source is to be able to pick existing code and use it in new and exciting ways. It makes no sense that everyone tries to re-invent the wheel over and over again just to find out after a number of iterations that "round" is the best possible shape.

After all, what you are trying to do is  .list() on a URL that is based on a resource and not a file. It is not trivial, especially with the various schemes of jar-based URLs, but I used that kind of code in a number of projects and it worked well under various containers (jetty, tomcat, WebLogic).

An alternative, if digging through Spring code is too painful would be 
https://facelets.dev.java.net/source/browse/facelets/src/java/com/sun/facelets/util/Classpath.java?rev=1.8&view=markup but this is CDDL.

> Allow whitespaces in features.txt and commenting out of elements
> ----------------------------------------------------------------
>
>                 Key: SHINDIG-299
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-299
>             Project: Shindig
>          Issue Type: Improvement
>          Components: Common Components (Java)
>            Reporter: Henning Schmiedehausen
>         Attachments: shindig-299-1.patch
>
>
> ATM, it is not possible to just "comment out" a feature in the features.txt file and as soon as you drop a whitespace somewhere, the JsFeatureLoader will complain immediately. 
> The attached patch allows to comment out features using "#" in the first column and it also trims whitespaces. Please apply.

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


[jira] Commented: (SHINDIG-299) Allow whitespaces in features.txt and commenting out of elements

Posted by "Kevin Brown (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHINDIG-299?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12599124#action_12599124 ] 

Kevin Brown commented on SHINDIG-299:
-------------------------------------

I've been working with Bob Evans (who knows a lot more about jar files than I do) to come up with a mechanism to eliminate the need for the features.txt entirely, so this may not be necessary. If we can't get it working in the next week or so, I'll go ahead and apply this patch anyway.

> Allow whitespaces in features.txt and commenting out of elements
> ----------------------------------------------------------------
>
>                 Key: SHINDIG-299
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-299
>             Project: Shindig
>          Issue Type: Improvement
>          Components: Common Components (Java)
>            Reporter: Henning Schmiedehausen
>         Attachments: shindig-299-1.patch
>
>
> ATM, it is not possible to just "comment out" a feature in the features.txt file and as soon as you drop a whitespace somewhere, the JsFeatureLoader will complain immediately. 
> The attached patch allows to comment out features using "#" in the first column and it also trims whitespaces. Please apply.

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