myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeanne Waldman <jeanne.wald...@oracle.com>
Subject [TRINIDAD] public URLProvider API needed for TRINIDAD-1914
Date Tue, 14 Sep 2010 00:13:34 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi,<br>
<br>
Today I created a new jira issue,
<a class="moz-txt-link-freetext" href="https://issues.apache.org/jira/browse/TRINIDAD-1914">https://issues.apache.org/jira/browse/TRINIDAD-1914</a>&nbsp;
provide a hook for
external decorator to find trinidad-skins.xml from a location other
than META-INF or WEB-INF.<br>
<br>
I have some questions I need help answering. I've listed them in the
JIRA issue, but I'll reiterate here.<br>
<br>
Our design time team needs a way to have the Trinidad Skinning
Framework find trinidad-skins.xml from a location other than META-INF
or WEB-INF.
<br>
<br>
The implementation I have in mind is similar to <a
 href="https://issues.apache.org/jira/browse/TRINIDAD-1729">https://issues.apache.org/jira/browse/TRINIDAD-1729</a>
provide a hook for for an external decorator of Skin
InputStreamProvider.
<br>
<br>
I've mocked up a solution that works for our design time team. It is
outlined below with questions.<br>
<br>
1. Add a public API
<br>
<br>
public interface TrinidadSkinsURLProvider (name to be determined)
<br>
{
<br>
&nbsp;&nbsp;// returns an Iterator of all the URLs that have this resource
(trinidad-skins.xml)
<br>
&nbsp;&nbsp;// Design time team needs the ExternalContext to be able to find
their trinidad-skins.xml files.
<br>
&nbsp;&nbsp;// They put a parameter on the ServletContext to help them.
<br>
&nbsp;&nbsp;public Iterator&lt;URL&gt; findResources(ExternalContext context);
<br>
}
<br>
&nbsp;
<br>
<br>
2. Usage in SkinUtils.java
<br>
&nbsp;&nbsp;a. Call List&lt;TrinidadSkinsURLProvider&gt; urlProviders =
ClassLoaderUtils.getServices(
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"org.apache.myfaces.trinidad.share.io.TrinidadSkinsURLProvider");
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;to get the List of TrinidadSkinsURLProviders.
<br>
&nbsp;&nbsp;b. Call findResources for each TrinidadSkinsURLProvider
<br>
&nbsp;&nbsp;c. Call the existing trinidad-skins.xml parse code.
<br>
<br>
<b>Questions
</b><br>
<br>
a. Is this idea acceptable?
<br>
b. Are there existing Trinidad APIs that I'm not aware of that I
could use instead, like an existing ResourceLoader?
org.apache.myfaces.trinidad.resource.ResourceLoader does not have a
findResources method of any kind.
<br>
c. Should we have a more generic class name, like URLProvider? Or
URLResourceProvider? If so, then we can pass in the filename to
findResources().
<br>
d. What package should this go in? My mockup is in
org.apache.myfaces.trinidad.share.io.
<br>
e. ClassLoader#getResources returns an Enumeration&lt;URL&gt;.
Should this new API be Iterator&lt;URL&gt; or should it match
ClassLoader#getResources?
<br>
<br>
Thanks,<br>
Jeanne<br>
</body>
</html>

Mime
View raw message