tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Jakarta-tapestry Wiki] Update of "ApplicationBorderComponent" by SvenHomburg
Date Fri, 10 Feb 2006 20:59:25 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Jakarta-tapestry Wiki" for change
notification.

The following page has been changed by SvenHomburg:
http://wiki.apache.org/jakarta-tapestry/ApplicationBorderComponent

New page:
== 1. insert into your application hivemodule.xml ==

{{{
    <implementation service-id="tapestry.page.ComponentSpecificationResolver">

        <invoke-factory model="threaded">
            <construct class="de.hsofttec.core4.resolver.Core4ComponentSpecificationResolverImpl">
                <set-object property="specificationSource" value="infrastructure:specificationSource"/>
                <set-service property="delegate" service-id="tapestry.page.SpecificationResolverDelegate"/>
                <set-object property="applicationId" value="infrastructure:applicationId"/>
                <set-object property="contextRoot" value="infrastructure:contextRoot"/>
                <set-object property="classFinder" value="infrastructure:classFinder"/>
            </construct>
        </invoke-factory>

    </implementation>
}}}

== 2. overwrite tapestry's ComponentSpecificationResolverImpl ==

{{{
public class Core4ComponentSpecificationResolverImpl extends ComponentSpecificationResolverImpl
{
    public void resolve(IRequestCycle cycle, INamespace containerNamespace, String libraryId,
String type, Location location)
    {
        // we detect the Border component and are sure, we dont call from the application
namesspace
        if (type.equals("Border") && !containerNamespace.isApplicationNamespace())
        {
            INamespace namespace = containerNamespace;
            while (!namespace.isApplicationNamespace() && namespace != null)
                namespace = namespace.getParentNamespace();

            if (namespace != null)
                containerNamespace = namespace;
        }

        super.resolve(cycle, containerNamespace, libraryId, type, location);
    }
}
}}}

== 3. make more flexible ==
insert into your application config a meta key like "appl.border" in fill the value with the
name of your border component.
then retrieve the value of this meta key in the Core4ComponentSpecificationResolverImpl.

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


Mime
View raw message