Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
<client:config id="CONFIGID">
  <title>TITLE</title>
  <perspective>
    <label>LABEL</label>
  </perspective>
</client:config>

Obviously, this creates a pretty useless client experience as it creates single center region with nothing in it.

...

Code Block
<client:config id="CONFIGID">
  <title>TITLE</title>
  <perspective>
    <label>LABEL</label>
    <view id="VIEWID">
      VIEWCONTENT
    </view>
  </perspective>
</client:config>

Once we've added the view we would expect to see the content of the view displayed in the center region.

...

Code Block
<client:config id="CONFIGID">
  <title>TITLE</title>
  <perspective>
    <label>LABEL</label>
    <view id="VIEWID1">
      VIEW1CONTENT
    </view>
    <view id="VIEWID2">
      VIEW2CONTENT
    </view>
  </perspective>
</client:config>

The user will then be able to switch between displaying the two views because by default views are added to the center region and that region is configured to display multiple views using tabs.

...

Code Block
<client:config id="CONFIGID">
  <title>TITLE</title>
  <perspective>
    <label>LABEL</label>
    <layout>
      <west width="WIDTH">
      <center>
    </layout>
    <view id="VIEWID1" location="west">
      VIEW1CONTENT
    </view>
    <view id="VIEWID2">
      VIEW2CONTENT
    </view>
  </perspective>
</client:config>

Once we have the new layout in place the first view will appear on the left and the second on the right, with the left view taking up an amount of room determined by the value of WIDTH and the second filling in the rest. The second view will still go into the center region since that's the default if none is explicitly set, and there must always be a center view defined within a layout.

...

Code Block
<client:config id="CONFIGID">
  <title>TITLE</title>
  <toolbar>
    TOOLBARCONTENT
  </toolbar>
  <statusbar>
    STATUSBARCONTENT
  </statusbar>
  <perspective>
    <label>LABEL</label>
    <layout>
      <west width="WIDTH">
      <center>
    </layout>
    <view id="VIEWID1" location="west">
      VIEW1CONTENT
    </view>
    <view id="VIEWID2">
      VIEW2CONTENT
    </view>
  </perspective>
</client:config>

These will always be shown at the top and bottom of the page irrespective of the layout. If you have more than one perspective then a perspective switcher component would be an obvious choice to include in the top-level toolbar or statusbar.
Note that perspectives can also have their own toolbar and/or statusbar, as can views (but it's up to the implementation of the view to provide support for it).

...

Code Block
<client:config id="CONFIGID">
  <title>TITLE</title>
  <toolbar>
    TOOLBARCONTENT
  </toolbar>
  <statusbar>
    STATUSBARCONTENT
  </statusbar>
  <perspective>
    <label>LABEL</label>
    <layout>
      <west width="WIDTH">
      <center>
    </layout>
    <view id="VIEWID1" location="west">
      VIEW1CONTENT
    </view>
    <view id="VIEWID2">
      VIEW2CONTENT
    </view>
  </perspective>
  <defaults>
    DEFAULTCONTENT
  </defaults>
</client:config>

Again the contents of the default section are determined by what's being set, but generally, there could be a report section, a map section and a section for entities.

Aside from that, there are a couple of other minor items that could be added, one is a description, that's shown to the user if they get the option to choose between multiple client configurations. Another is a debug flag that indicates that the client should be loaded in debug mode which helps when modifying the client configuration. And finally, it's possible to specify a theme to be used for the configuration.

Code Block
languagexml
<client:config id="CONFIGID">
  <title>TITLE</title>
  <description>DESCRIPTION</description>
  <debug>true</debug>
  <theme>THEMENAME</theme>
  <toolbar>
    TOOLBARCONTENT
  </toolbar>
  <statusbar>
    STATUSBARCONTENT
  </statusbar>
  <perspective>
    <label>LABEL</label>
    <layout>
      <west width="WIDTH">
      <center>
    </layout>
    <view id="VIEWID1" location="west">
      VIEW1CONTENT
    </view>
    <view id="VIEWID2">
      VIEW2CONTENT
    </view>
  </perspective>
  <defaults>
    DEFAULTCONTENT
  </defaults>
</client:config>

Defaults

You can set various default options in the defaults section in the client configuration. For example, the default report format to generate, which entity to have active initially or which data to display when the user open a data grid.

Code Block
<client:config id="CONFIGID">
  ...
  <perspective>
    ..
  </perspective>
  <defaults>
    <entities>
      <entity id="property" isDefault="true">
        <data>data.property.detail</data> <!-- set the default data definition for properties -->
        <search>search.property.byaddress</search> <!-- set the default search for properties -->
      </entity>
      <entity id="roads">
        <data>data.road.detail</data> <!-- set the default data definition for roads -->
        <search>search.road.byname</search> <!-- set the default search for roads -->
      </entity>
      <entity id="parks" remove="true"/> <!-- remove parks as being an available entity -->
      <entity id="lights" remove="true"/> <!-- remove lights as being an available entity -->
    <entities>
    <report>
      <format>html</format>
      <openExternal>true</openExternal>
      <openWithScript>true</openWithScript>
      <timeout>240</timeout>
    </report>
  </defaults>
</client:config>

In the above example we've set the property entity as the default, and set the initial search for properties to be search.property.byaddress and the initial data to be data.property.detail. For roads we've set the search to search.road.byname and the data to data.road.detail. We've also removed the parks and lights entities from being available to the user. The user will have access to all the other available entities, but they will have the default settings (for default search, data definition, etc).

We've also specified that the default report format will be html, format, report will open in a new window (or tab) rather than a window embedded within the weave client itself, openExternal, and it'll use javascript JavaScript to open the window, bypassing the intermediate 'click to open' popup window, openWithScript,  and finally increased the report timeout to 240 seconds (from the default of 120 seconds), timeout.

...

Code Block
<item action="weave.toggleToolbar" text="Edit" iconCls="icon-edit">
  ...
</item>

If you want to remove the icon for a component set the iconCls property to be blank, e.g. to remove the icon from the Legend panel in your layout:

...

As of version 2.22.9 of the com.cohga.client.weave bundle it's possible to specify an alias for a client configuration.

Code Block
<client:config id="client">
  <alias id="alias"/>

  <!-- Other config items here -->
<client:config>

At the minimum this provides exactly the same client configuration under an additional url, so the above configuration would be available at
/weave/client.html
and
/weave/alias.html

...

Additionally you can override some of the configurations in the client config, for . For example,:

Code Block
<client:config id="external">
  <alias id="internal">
    <title>Internal Client</title>
    <description>Client for access by internal users</description>
    <license xsi:nil="true"/>
  </alias>

  <title>External Client</title>
  <description>Client for access by external users</description>
  <license>
    <title>License</title>
    <text>By clicking OK you agree ....</text>
  </license>

  <!-- Other config items here -->
<client:config>

would be the equivalent of:

Code Block
<client:config id="external">
  <title>External Client</title>
  <description>Client for access by external users</description>
  <license>
    <title>License</title>
    <text>By clicking OK you agree ....</text>
  </license>

  <!-- Other config items here -->
<client:config>

<client:config id="internal">
  <title>Internal Client</title>
  <description>Client for access by internal users</description>

  <!-- Other config items here -->
<client:config>

This example will alter the title and description for the internal version of the client config, plus it'll remove the license screen that the external user normally would have to click on.

...

Code Block
<client:config id="external">
  <alias id="internal">
    <title>Internal Client</title>
    <description>Client for access by internal users</description>
    <license xsi:nil="true"/>
    <acl id="internal"/>
  </alias>

  <title>External Client</title>
  <description>Client for access by external users</description>
  <license>
    <title>License</title>
    <text>By clicking OK you agree ....</text>
  </license>
  <acl id="external"/>

  <!-- Other config items here -->
<client:config>

is equivalent to:

Code Block
<client:config id="external">
  <title>External Client</title>
  <description>Client for access by external users</description>
  <license>
    <title>License</title>
    <text>By clicking OK you agree ....</text>
  </license>
  <acl id="external"/>

  <!-- Other config items here -->
<client:config>

<client:config id="internal">
  <title>Internal Client</title>
  <description>Client for access by internal users</description>
  <acl id="internal"/>

  <!-- Other config items here -->
<client:config>

Some other things you could do would be to set the publish flag to false in the alias configuration so that the aliased client configuration won't show up in the users list of available configs (but they can still access it using a direct url), which is handy for client configurations that are used for third party integration.

Code Block
<client:config id="main">
  <alias id="pathway">
    <title>Pathway Client</title>
    <description>Client to be used when called from Pathway</description>
    <license xsi:nil="true"/>
    <publish>false</publish>
  </alias>

  <title>Default Client</title>
  <description>General client for use by users</description>
  <license>
    <title>License</title>
    <text>By clicking OK you agree ....</text>
  </license>

  <!-- Other config items here -->
<client:config>

Adjusting the panel collapse buttons

...

It's possible to have the client display a licence that the user must agree to before continuing or to display some general text, by adding one of the following configs to the client configfile.

Displaying a licence agreement

...

New in 2.6.7 is the splash screen, a bit of a combination of which has the combined function of the licence and tipsstartup tip. A splash screen gives you provides a way to display information to the user at startup similar in appearance to the licence agreement above but provides additional options to customise the experience.

...

One major difference between the splash screens and the licence panel, and /tips, is that you have to supply HTML content to be displayed, the . The content can either be embedded directly in the configuration or provided as a URL pointing to a web page to display, note . Note that this isn’t such an issue now because 2.6.7 also provides a convenient method of publishing your own custom HTML directly from Weave , by storing the HTML in the ...\weave\platform\workspace\static\ directory, it . That HTML will then be available at the URL http://example.com/weave/static/. This allows you to be much more expressive control and flexibility with the content of the window, and because it directly supports multiple tabs, you can provide separate sections with different content, for . For example, the first tab can be a welcome text, the second a help guide and the third a contact page.

...

By providing a redirect URL as part of the configuration you can change the simple Close button into a choice between Yes and No and make this a replacement for the licence panel (as shown below).

...

If the user clicks Yes the panel will close if . If they click No they will be redirected to where ever you set the redirect URL.

In addition, you can also provide the option to not display the splash screen again, with an optional button you that can add be added to a toolbar/statusbar to allow the user to open the panel again if they want (as shown below).

...

Finally, you have the option to configure the panel to always display only once so . So once it’s closed the first time it won’t display on startup again unless you provide access to the button to re-show the splash panel or update the config to give the panel a different id.

Configuration for the splash panel is provided by a plugin, and the various configuration options for the panel are configured within the plugin, e.g. Some configuration examples are shown below.

Show a basic splash page with the content from a static web page (served by Weave from the content at ...\weave\platform\workspace\static\welcome.html)

Code Block
languagexml
<plugin id="weave.splash">
	<url>static/welcome.html</url>
</plugin>

Show a basic splash page with the content from a static web page (served by Weave from the content at ...\weave\platform\workspace\static\information.html) that the user only has to see sees once.
Additionally, it has a splashId set which can be changed if the content of the information.html file changes and you want to force the panel to display again if it’s it's been hidden. Note that the splashId defaults to “startup”"startup", so if you didn’t didn't set a splashId at the start but now want to force the page to display again you can just add a new splashId (that isn’t “startup”)isn't "startup").

Code Block
languagexml
<plugin id="weave.splash">
	<url>static/information.html</url>
	<splashId>splash20211119</splashId>
	<title>Important News</title>
	<iconCls>icon-information</iconCls>
	<showOnce>true</showOnce>
</plugin>

Show a basic licence page with the content from a static web page (served by something else) and a custom window size.

Code Block
languagexml
<plugin id="weave.splash" height="400" width="600" url="https://cohga.com/weave/licence.html" redirectUrl="https://cohga.com/weave/"/>

...

Show a splash page with multiple tabs.

Code Block
languagexml
<plugin id="weave.splash">
	<tabs>
		<tab url="static/welcome.html" title="Welcome"/>
		<tab url="static/help.html" title="Help"/>
		<tab url="static/contact.html" title="Contact"/>
	</tabs>
</plugin>

Finally, the show splash button can be added to a toolbar and would allow the user to display the page at any time.

Code Block
languagexml
<item action="weave.showsplash"/>

If you have a different splashId you have to also provide that, and if you want to specify a different tab on a multi-tab splash panel you can also do that.

Code Block
languagexml
<item action="weave.showsplash" splashId="splash20211119" tab="1"/>

...