Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

Code Block
xml
xml
titleDetails panel generating default templates
linenumberstrue
	<view id="com.cohga.client.panel.details">
		<location>west</location>
		<label>Details</label>
		<detail>
			<data>ar_road_details</data>
		</detail>
		<detail>
			<entity>property</entity>
			<datadefinition>dd<data>ar_property_details</datadefinition>data>
			<label>Property Details</label>
		</detail>
	</view>

The above example will add the details view and setup the display of details for roads and properties.

...

The details panel understands a data tag, which already includes the entity, label and data definition, or datadefinition (a template is defined automatically, unless it's also provided), alternatively these values can be specified directly if there isn't a separate data item defined.

The previous example did not include a template, so the Weave client will generate a simple default template that will list each attribute from the underlying data definition, using the label to annotate each entry. If you want more control over the output then you can set a template that contains HTML marker with place holders that mark where the associated attribute should be placed.

Code Block
xml
xml
titleDetails panel with a template
linenumberstrue
	<view id="com.cohga.client.panel.details">
		<location>west</location>
		<label>Details</label>
		<loadingText>Loading...</loadingText>
		<detail>
			<entity>property</entity>
			<datadefinition>dd<data>ar_owner_details</datadefinition>data>
			<template><![CDATA[
The property located at<br/>
<b>{address}</b><br/>
is currently owned by<br/>
{owner}<br/>
of<br/>
{owner_address}
<hr>
<i>Links</i>
{owner_link}<br/>
{occupier_link}<br/>
{property_link}<br/>
			]]></template>
		</detail>
	</view>

...

Code Block
xml
xml
titleDetails panel with modified text
linenumberstrue
	<view id="com.cohga.client.panel.details">
		<location>west</location>
		<label>Details</label>
		<emptyText>No results</emptyText>
		<loadingText>Please wait</loadingText>
		<errorText>Sorry, the server was unable to load data</errorText>
		<tooltip>
			<title>More Details</title>
			<text>Display details about the selected object</text>
		</tooltip>
		<detail>
			<data>ar_road_details</data>
		</detail>
		<detail>
			<entity>property</entity>
			<datadefinition>dd<data>ar_property_details</datadefinition>
			<label>Property Details</label>data>
		</detail>
	</view>

If you use complex templates then it may be worth using snippets to move the templates out of the configuration of the details panel itself (and possibly even store them in a separate configuration file)

...