Wicket implements resource loading with a fallback strategy using the Java class
hierarchy of the associated Web page.
For example, the Wicket markup to identify a static-text label is defined in the
html\com\sybase365\mobiliser\web\consumer\pages\portal\billpayment\PayBillPage.html
file.
<html xmlns:wicket = "http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd">
<body>
<wicket:extend>
<div id = "centerContent" class = "content">
<div class = "module clear">
<h1 class = "payments">
<wicket:message key = "payBill.title" />
</h1>
<div wicket:id = "billConfigListForPaymentPanel"></div>
</div>
</div>
</wicket:extend>
</body>
</html>
Based on the class hierarchy defined by the associated Java object:
- com.sybase365.mobiliser.web.consumer.pages.portal.billpayment.PayBillPage
extends
- com.sybase365.mobiliser.web.consumer.pages.portal.billpayment.BaseBillPaymentPage,
which extends
- com.sybase365.mobiliser.web.consumer.pages.portal.BaseConsumerPortalPage,
which extends
- com.sybase365.mobiliser.web.consumer.pages.portal.BaseConsumerPage,
which extends
- com.sybase365.mobiliser.web.consumer.pages.portal.BaseApplicationPage,
which extends
- com.sybase365.mobiliser.web.consumer.pages.portal.MobiliserBasePage,
which extends
- com.sybase365.mobiliser.util.tools.wicketutils.components.BasePage,
which extends
- org.apache.wicket.markup.html.WebPage
Text resources are searched in the following order. If a resource file is not found, the
next resource file in the hierarchy is checked. If a match to the associated
key—for example, "payBill.title"— is found in a resource file, the search
is terminated and the text label is returned.
- xml\com\sybase365\mobiliser\web\consumer\portal\billpayment\PayBillPage.xml
- xml\com\sybase365\mobiliser\web\consumer\pages\portal\billpayment\BaseBillPaymentPage.xml
- xml\com\sybase365\mobiliser\web\consumer\pages\portal\BaseConsumerPortalPage.xml
- xml\com\sybase365\mobiliser\web\consumer\pages\BaseConsumerPage.xml
- xml\com\sybase365\mobiliser\web\application\pages\BaseApplicationPage.xml
- xml\com\sybase365\mobiliser\web\application\pages\MobiliserBasePage.xml
- xml\com\sybase365\mobiliser\util\tools\wicketutils\components\BasePage.xml
Text labels should be unique and specific to the pages and panels in which they are used.
For efficient maintenance, you may want to aggregate them, and associate them with a
template. For example, all the Consumer Portal text labels are aggregated in the
xml\com\sybase365\mobiliser\web\consumer\pages\portal\BaseConsumerPortalPage.xml
file.
Put application-wide labels in the resource file for the top-level application class. Put
environment-wide labels—for example, shared form button labels—in the top-level
environment resource file.
Note: Panel templates are associated with a general package name, because they are shared
across multiple pages, and they can access text labels from a resource file, which is
specific to either the panel or the environment. In either case, the resource file in
which the text label exists may be outside of the package hierarchy where the panel is
used.