You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Peter Swulius (JIRA)" <ji...@apache.org> on 2010/02/02 04:12:23 UTC

[jira] Created: (WICKET-2713) Locate .properties files using the same convention as markup files

Locate .properties files using the same convention as markup files
------------------------------------------------------------------

                 Key: WICKET-2713
                 URL: https://issues.apache.org/jira/browse/WICKET-2713
             Project: Wicket
          Issue Type: Improvement
          Components: wicket
            Reporter: Peter Swulius
            Priority: Minor


original inquiry on mailing list
http://www.mail-archive.com/users@wicket.apache.org/msg47803.html

--
I am curious.  Why are .properties files not located in the same way as .html?  I've overridden:

[ResourceStreamLocator]
public IResourceStream locate( Class<?> clazz, String aPath, String aStyle, Locale aLocale, String anExtension )

I notice that property file locating doesn't invoke this method, but only invokes the lesser arg version with the style/variation/locale already embedded in the path.  This is an inconvenience for me because I'm trying to inspect the style during location.  Perhaps I shouldn't be doing what I'm trying to do, but after reading the docs, I expected locating to work the way it does for .html, but .properties threw me.


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


[jira] Updated: (WICKET-2713) Locate .properties files using the same convention as markup files

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

Jeremy Thomerson updated WICKET-2713:
-------------------------------------

    Fix Version/s:     (was: 1.5-M3)
                   1.5-M4

> Locate .properties files using the same convention as markup files
> ------------------------------------------------------------------
>
>                 Key: WICKET-2713
>                 URL: https://issues.apache.org/jira/browse/WICKET-2713
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>            Reporter: Peter Swulius
>            Assignee: Juergen Donnerstag
>            Priority: Minor
>             Fix For: 1.5-M4
>
>
> original inquiry on mailing list
> http://www.mail-archive.com/users@wicket.apache.org/msg47803.html
> --
> I am curious.  Why are .properties files not located in the same way as .html?  I've overridden:
> [ResourceStreamLocator]
> public IResourceStream locate( Class<?> clazz, String aPath, String aStyle, Locale aLocale, String anExtension )
> I notice that property file locating doesn't invoke this method, but only invokes the lesser arg version with the style/variation/locale already embedded in the path.  This is an inconvenience for me because I'm trying to inspect the style during location.  Perhaps I shouldn't be doing what I'm trying to do, but after reading the docs, I expected locating to work the way it does for .html, but .properties threw me.

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


[jira] Commented: (WICKET-2713) Locate .properties files using the same convention as markup files

Posted by "Juergen Donnerstag (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2713?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12830006#action_12830006 ] 

Juergen Donnerstag commented on WICKET-2713:
--------------------------------------------

a little bit of digging (no judgement whether it is right or wrong)

markup resources are loaded via
MarkupContainer.getAssociatedMarkupStream()
   MarkupCache.getMarkupStream(container, enforceReload, throwException);
	MarkupCache.getMarkup(container, clazz, enforceReload)
            get IMarkupResourceStreamProvider  (lets assume DefaultMarkupResourceStreamProvider)
                get ResourceStreamLocator from application setting
                     iterate over class hierarchie
                         locator.locate(container.getClass(), path (based on real class), style, locale, ext);
                            iterate over all possible combinations of style and  locale to find the file


Properties:
Component.getString(xx)
   Localizer.getString(key, component, model, defaultValue)
       iterate over all StringResourceLoaders registered with application settings
           loader.loadStringResource(component, key)
              lets assume ComponentStringResourceLoader
                   loadStringResource(Class<?> clazz, final String key, final Locale locale, final String style)
                        iterate over possible combinations of locale and style
                           PropertiesFactory (application setting
                                iterate over properties loader (support different formats such .properties, .xml, etc.)
                                   ResourceStreamLocator() (application setting)
				        locator.locate(clazz, fullPath);

as you can see the main functional difference is that with properties we also need to check different file extensions. And we decided that the extension should take preference over the locale,style and class.

This still doesn't mean that the ResourceLocator couldn't be refactored and enhanced to provide the additional functionality though. And your explanation / expection seem reasonable / logical to me. Feel free to provide a patch (with all tests working, so no changes in functional behavior) and I'm happy to consider it.

Juergen

> Locate .properties files using the same convention as markup files
> ------------------------------------------------------------------
>
>                 Key: WICKET-2713
>                 URL: https://issues.apache.org/jira/browse/WICKET-2713
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>            Reporter: Peter Swulius
>            Priority: Minor
>             Fix For: 1.5-M1
>
>
> original inquiry on mailing list
> http://www.mail-archive.com/users@wicket.apache.org/msg47803.html
> --
> I am curious.  Why are .properties files not located in the same way as .html?  I've overridden:
> [ResourceStreamLocator]
> public IResourceStream locate( Class<?> clazz, String aPath, String aStyle, Locale aLocale, String anExtension )
> I notice that property file locating doesn't invoke this method, but only invokes the lesser arg version with the style/variation/locale already embedded in the path.  This is an inconvenience for me because I'm trying to inspect the style during location.  Perhaps I shouldn't be doing what I'm trying to do, but after reading the docs, I expected locating to work the way it does for .html, but .properties threw me.

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


[jira] Updated: (WICKET-2713) Locate .properties files using the same convention as markup files

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

Igor Vaynberg updated WICKET-2713:
----------------------------------

    Fix Version/s: 1.5-M2
                       (was: 1.5-M1)

> Locate .properties files using the same convention as markup files
> ------------------------------------------------------------------
>
>                 Key: WICKET-2713
>                 URL: https://issues.apache.org/jira/browse/WICKET-2713
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>            Reporter: Peter Swulius
>            Priority: Minor
>             Fix For: 1.5-M2
>
>
> original inquiry on mailing list
> http://www.mail-archive.com/users@wicket.apache.org/msg47803.html
> --
> I am curious.  Why are .properties files not located in the same way as .html?  I've overridden:
> [ResourceStreamLocator]
> public IResourceStream locate( Class<?> clazz, String aPath, String aStyle, Locale aLocale, String anExtension )
> I notice that property file locating doesn't invoke this method, but only invokes the lesser arg version with the style/variation/locale already embedded in the path.  This is an inconvenience for me because I'm trying to inspect the style during location.  Perhaps I shouldn't be doing what I'm trying to do, but after reading the docs, I expected locating to work the way it does for .html, but .properties threw me.

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


[jira] Updated: (WICKET-2713) Locate .properties files using the same convention as markup files

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

Igor Vaynberg updated WICKET-2713:
----------------------------------

    Fix Version/s: 1.5-M3
                       (was: 1.5-M2)

> Locate .properties files using the same convention as markup files
> ------------------------------------------------------------------
>
>                 Key: WICKET-2713
>                 URL: https://issues.apache.org/jira/browse/WICKET-2713
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>            Reporter: Peter Swulius
>            Priority: Minor
>             Fix For: 1.5-M3
>
>
> original inquiry on mailing list
> http://www.mail-archive.com/users@wicket.apache.org/msg47803.html
> --
> I am curious.  Why are .properties files not located in the same way as .html?  I've overridden:
> [ResourceStreamLocator]
> public IResourceStream locate( Class<?> clazz, String aPath, String aStyle, Locale aLocale, String anExtension )
> I notice that property file locating doesn't invoke this method, but only invokes the lesser arg version with the style/variation/locale already embedded in the path.  This is an inconvenience for me because I'm trying to inspect the style during location.  Perhaps I shouldn't be doing what I'm trying to do, but after reading the docs, I expected locating to work the way it does for .html, but .properties threw me.

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


[jira] Updated: (WICKET-2713) Locate .properties files using the same convention as markup files

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

Igor Vaynberg updated WICKET-2713:
----------------------------------

    Fix Version/s: 1.5-M1

> Locate .properties files using the same convention as markup files
> ------------------------------------------------------------------
>
>                 Key: WICKET-2713
>                 URL: https://issues.apache.org/jira/browse/WICKET-2713
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>            Reporter: Peter Swulius
>            Priority: Minor
>             Fix For: 1.5-M1
>
>
> original inquiry on mailing list
> http://www.mail-archive.com/users@wicket.apache.org/msg47803.html
> --
> I am curious.  Why are .properties files not located in the same way as .html?  I've overridden:
> [ResourceStreamLocator]
> public IResourceStream locate( Class<?> clazz, String aPath, String aStyle, Locale aLocale, String anExtension )
> I notice that property file locating doesn't invoke this method, but only invokes the lesser arg version with the style/variation/locale already embedded in the path.  This is an inconvenience for me because I'm trying to inspect the style during location.  Perhaps I shouldn't be doing what I'm trying to do, but after reading the docs, I expected locating to work the way it does for .html, but .properties threw me.

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


[jira] Assigned: (WICKET-2713) Locate .properties files using the same convention as markup files

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

Juergen Donnerstag reassigned WICKET-2713:
------------------------------------------

    Assignee: Juergen Donnerstag

> Locate .properties files using the same convention as markup files
> ------------------------------------------------------------------
>
>                 Key: WICKET-2713
>                 URL: https://issues.apache.org/jira/browse/WICKET-2713
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>            Reporter: Peter Swulius
>            Assignee: Juergen Donnerstag
>            Priority: Minor
>             Fix For: 1.5-M3
>
>
> original inquiry on mailing list
> http://www.mail-archive.com/users@wicket.apache.org/msg47803.html
> --
> I am curious.  Why are .properties files not located in the same way as .html?  I've overridden:
> [ResourceStreamLocator]
> public IResourceStream locate( Class<?> clazz, String aPath, String aStyle, Locale aLocale, String anExtension )
> I notice that property file locating doesn't invoke this method, but only invokes the lesser arg version with the style/variation/locale already embedded in the path.  This is an inconvenience for me because I'm trying to inspect the style during location.  Perhaps I shouldn't be doing what I'm trying to do, but after reading the docs, I expected locating to work the way it does for .html, but .properties threw me.

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