Gratz all,
Tapestry-OSGi now support extension-point in templates, by this way we
can build a powerfull page dynamically.
Case:
BundleA:
There is a component for a menu in some page, named MainMenu, we can
export a extension-point in component.xml:
<extension-points>
<extension-point>
<point>MainMenus</point>
</extension-point>
</extension-points>
apply this extension-point in component's template:
<t:content xmlns:t="
http://tapestry.apache.org/schema/
tapestry_5_1_0.xsd">
<div class="mainMenus">
<t:extension-point id="MainMenus" attr="$
{literal:attrForExtensions} attr2="propAttrForExtensions" />
</div>
</t:content>
BundleB:
For extension bundles, export a extension in component.xml:
<extensions>
<extension>
<id>LoginMenuService</id>
<point>MainMenus</point>
<name>org.extwind.osgi.console.login.extension.LoginMenuItem</
name>
</extension>
</extensions>
LoginMenuItem.tml:
<t:content xmlns:t="
http://tapestry.apache.org/schema/
tapestry_5_1_0.xsd">
<li><t:PageLink page="${page}">${label}</t:PageLink></li>
</t:content>
Now, menu item [Login] is tired to bundle's lifecycle
start BundleB: menu item [Login] will be rendered and linked to page
"Login"
stop BundleB: page link [Login] disappear physically.
It's greatly like what the eclipse plugins done, fill extension-points
in our system, for plugins, expansibility or something else.
In future, we will provide a extension-point management page for
disable/enable extensions and extension-points without stop/start
bundles.