[ 
https://issues.apache.org/jira/browse/TRINIDAD-1496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13015647#comment-13015647
 ] 

Blake Sullivan commented on TRINIDAD-1496:
------------------------------------------

I forgot to say that I agree that the relative URL case for icons isn't 
especially useful--it would only really work if all of the pages were in the 
same directory

> Need org.apache.myfaces.trinidad.skin.Icon to expose the raw content value 
> instead of just getImageURI
> ------------------------------------------------------------------------------------------------------
>
>                 Key: TRINIDAD-1496
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1496
>             Project: MyFaces Trinidad
>          Issue Type: New Feature
>          Components: Components
>    Affects Versions:  1.2.11-core
>            Reporter: Matt Cooper
>            Priority: Minor
>
> In skinning, you can define image icons in 4 different ways:
> 1.) Absolute URLs specify the complete URL to the resource, including the 
> protocol (e.g. http://). Example:
> content: url(http://incubator.apache.org/images/asf_logo_wide.gif);
> 2.) Relative URLs are used if the specified URL does not start with a slash 
> ("/") and if there's no protocol present. A relative URL is based on the 
> skin's CSS file location. For instance, if the CSS is located in 
> MyWebApp/skins/mySkin/ and the specified url is skinImages/myImage.gif, then 
> the final URL will be /MyWebApp/skins/mySkin/skinImages/myImage.gif. Example:
> content: url(skin_images/ObjectIconError.gif);
> 3.) Context relative URLs are resolved relatively to the context root of the 
> web application. To use them, you simply have to make it start with a single 
> slash ("/"). For instance, if the context root is /MyWebApp and the specified 
> URL is /images/myImage.jpeg, the resulting URL will be 
> /MyWebApp/images/myImage.jpeg. Example:
> content: url(/skins/mySkin/skin_images/ObjectIconError.gif);
> 4.) Server relative URLs are resolved relatively to the web server as opposed 
> to the context root. This allow to easily refer to resources located on 
> another application on the same server. To use this type of URL, the 
> specified URL must starts with two slashes ("//"). Example:
> content: url(//MyOtherWebApp/images/myCalendar.gif);
> The org.apache.myfaces.trinidad.skin.Icon class currently provides a 
> getImageURI() method.  This method returns a value that has the context path 
> built-in.  If a component exposes an icon attribute (there are a handful in 
> Apache MyFaces Trinidad and also in another framework that has components 
> built upon Trinidad), that icon String supports these same alternative 
> mechanisms for referring to the icon image.  Let's say you have a component 
> that you want to keep abstract but might want it to reuse existing components 
> (e.g. a rich text editor with a toolbar containing buttons that you want to 
> reuse an existing toolbar button component so you can have consistency in 
> button styling).  For that publicly-exposed component, you will want to allow 
> people to customize in skinning what the icons are for its toolbar.  These 
> icons must be defined in that publicly-exposed component but then converted 
> into a String that can be passed into the toolbar button component.  With the 
> current Icon.getImageURI(), if a user skinned the icon image using some of 
> the 4 above paths, either the icon would have 2 context paths added to it 
> (one from the skin framework and one from the toolbar button resource 
> encoding) or it would have a context path when it should not be including the 
> local context path (image definition option #4).  For the public component's 
> renderer to support all 4 of these image definition options, the 
> org.apache.myfaces.trinidad.skin.Icon needs to expose some mechanism to 
> either let it have access to the raw content value so that raw value can be 
> passed along to the button or at least some kind of mechanism to let the 
> public component's renderer know that it is not safe to let the button add 
> its own copy of the context path (e.g. add another leading "/" to the result).

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to