>From: "Ryan Wynn" <[EMAIL PROTECTED]>
>
> What I am trying to accomplish with clay is to encapsulate a fragment
> of an application as a jar file. In the jar file I have clay and
> faces configuration as well as java classes. The idea is that the
> client application will include the fragment jar that provides the
> templates, navigation, and application logic. I want to be able to
> pass control from the client application to the fragment by
> referencing a view id with the classpath*:com/bar/foo.html syntax.
> From this point the fragment jar will reference it's own pages using
> the same classpath*:com/bar/foo.html syntax for view ids. Then when
> the fragment is done doing what it needs to do it can forward back to
> the client using a view id like /done.html. The client would need to
> implement /done.html so that the transition works. I guess you could
> think of this as another form of dialog.
>
> Is something like classpath*:/com/bar/foo.html supported as a valid
> view id? I am pretty sure all of this is possible using full xml
> views, but mixing full xml and html seems to be going against the
> grain.
I'm not sure if I completly understand your scenario but I think that
full XML views would be the best strategy. In hindsight, that's kind
of a silly name full XML views.
What I mean by that is that you can change the suffix to pretty much
anything as long as it doesn't use the same suffix that the full HTML
views use or ".jsp" :--)
However, if you really liked an entry point of .html, you might try something
like
( Disclaimer: never actually tried) this:
<!-- Override the default suffix for extension-mapped -->
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.html</param-value>
</context-param>
<!-- Clay XML View Suffix -->
<context-param>
<param-name>org.apache.shale.clay.XML_TEMPLATE_SUFFIX</param-name>
<param-value>.html</param-value>
</context-param>
<!-- Clay HTML View Suffix -->
<context-param>
<param-name>org.apache.shale.clay.XML_TEMPLATE_SUFFIX</param-name>
<param-value>.chtm</param-value>
</context-param>
Your base page definition might look something like ( Disclaimer: never
actually tried) this:
The Base layout defintion found in the commons config file.
<component jsfid="basePage" extends="clay">
<attributes>
<set name="clayJsfid" value="classpath*:@templatePackage/@page" />
</attributes>
<symbols>
<set name="@templatePackage" value="org/apache/shale/usecases/templates" />
<set name="@page" value="index.chtm" />
</symbols>
</component>
The full XML view common config file.
<view>
<component jsfid="org/blue/page1.html" extends="basePage">
<symbols>
<set name="@templatePackage" value="org/blue/usecases/templates"/>
<set name="@page" value="home.chtm" />
</symbols>
</component>
<component jsfid="/org/blue/page2.html" extends="basePage">
<symbols>
<set name="@templatePackage" value="org/blue/usecases/templates"/>
<set name="@page" value="history.chtm" />
</symbols>
</component>
<component jsfid="org/green/page1.html" extends="/org/blue/page1.html">
<symbols>
<set name="@templatePackage" value="org/green/templates"/>
</symbols>
</component>
<component jsfid="/org/green/page2.html" extends="/org/blue/page2.html">
<symbols>
<set name="@templatePackage" value="org/green/templates"/>
</symbols>
</component>
I'm not sure if this is an exact fit but hopefully gives you some more ideas.
Gary