users@javaserverfaces-spec-public.java.net

[jsr344-experts mirror] [jsr344-experts] [1142-ResourceLibraryContracts] How the property is calculated (was: [971-MultiTemplate])

From: Edward Burns <edward.burns_at_oracle.com>
Date: Tue, 13 Nov 2012 14:20:43 -0800

>>>>> On Fri, 9 Nov 2012 14:12:06 -0800, Edward Burns <edward.burns_at_oracle.com> said:

EB> Hello Volunteers,
EB> This email thread will resolve how the value of the
EB> resourceLibraryContracts property is calculated. There are two other
EB> threads, one that resolves the name of the property for storing the
EB> resource library contracts, and when and where the value of that
EB> property is set, and another regarding *how* the value of the property
EB> is used.

EB> CONDITIONALLY_RESOLVED: How are contracts made available to the
EB> application.

EB> This is where I bring in the syntax from Manfred I mentioned earlier.

EB> If we have a resource-library-contracts element in the application
EB> configuration resources, any mappings and contract declarations it has
EB> are added to the data structure of such things for the application.

EB> <faces-config>

EB> <resource-library-contracts>
EB> <mappings>
EB> <view pattern="" contracts="default1"/>
EB> <view pattern="/registration/*" contracts="default1, registration1"/>
EB> <view pattern="/welcome" contracts="welcome1"/>
EB> <view pattern="/print" contracts=""/>
EB> </mappings>

EB> <contracts>
EB> <contract id="default1" href="$CONTRACT_ROOT/default1"/>
EB> <contract id="registration1" href="$CONTRACT_ROOT/registration1"/>
EB> </contracts>

EB> </resource-library-contracts>

EB> </faces-config>

As Leonardo pointed out, the <contracts> section is really unnecessary,
because we scan for the existence of contracts at startup. I'll be
taking it out.

I'd also like to introduce a convention. If there are no
<resource-library-contracts> in the application configuration resources,
the templates of any resource library contracts are implicitly available to
be used template clients anywhere in the app.

Ed
-- 
| edward.burns_at_oracle.com | office: +1 407 458 0017
| homepage:               | http://ridingthecrest.com/