Administering the client at a basic level is all done through the configuration xml file. The configuration allow allows multiple clients with different components depending on the user base of the client.
...
Weave supports the ability to configure multiple clients from the one instance. Each Client needs to have a unique ID which that is used in the url when opening the client.
...
You should consult the section on Access Control Lists for more information.
Alternatively, you can add an ACL to individual items within the client configuration to have those items only available to users that have the appropriate level of access.
...
The ACL can be attached to anything within the client configuration, not just buttons/actions. When a user does not pass the ACL then the entire content of the tag containing the ACL tag is removed.
Additionally, you can have the same item added twice, each with a mutually exclusive ACL attached , so that all users see one version and others see another.
This can be used for example to alter the map area that a user is allowed to view, if you have multiple groups of users, where each one should only be able to view part of the overall map then you could setup multiple extent tags for the map view and attach different ACLs to each one so that in the end each user only receives one of the available extents and that's the area they're limited to.
...
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.
...
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.
This beings brings us on to layouts, which are covered in more details detail at Layouts, but we'll cover them here to show where they fit within the client configuration.
...
Once we have the new layout in place the first view will appear on the left and 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.
...
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).
We can also include a set of default values at the same level as perspectives to provide defaults values for various components that are included on the client, for example indicating the initial map extent to use if a map view doesn't specify it explicitly, or determining of if a report should be opened in a new browser window.
...
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.
...
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.
...
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 windows window embedded within the weave client itself, openExternal
, and it'll use 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
.
...
In the above example the user attribute named entities
should contains contain one or more entity id's and the user will have access to only those entities. In this situation you can still specify individual entity settings, for example the default search, within the entities
tag (they just haven't been shown in this example), but you can also specify that information directly within the entity configuration rather than here in the default section.
...
Note |
---|
It's assumed that if there are two icons with the same name name, and one a .png and the other .gif, then the .gif will be used for Internet Explorer and the .png for other browsers, this is because of the poor support for .png images in earlier IE versions. Note that this is no longer strictly true and Internet Explorer has improved the level of support for .png images, so you should always use .png images rather than .gif |
...
Additionally, for the text/labelling, it can be a bit inconsistent, but a general run of thumb is to set a 'text', or 'label', property to add/alter the default text for a button/panel/component/control.
License Agreement and Responses
It is possible to display a license agreement dialog to a user and redirect them to a specified URL based on their response. Alternatively, this function could be used to display a different message to the user.
...
Aliases
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="externalclient"> <title>External Client</title> <description>Client for access by external users</description> <license> <usetop>true</usetop><alias id="alias"/> <!-- SinceOther Weave 2.5.26: When Weave is embedded inside an IFrame, indicate that the top-level window has to be changed to the given URL. --> <title>License</title> <text>By clicking OK you agree to the terms and conditions of Weave end user license agreement.</text> <url>https://www.cohga.com</url> </license> <acl id="external"/> <!-- Other config items here --> <client:config> |
Aliases
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
Which by itself isn't much, but by allowing you to publish the same client config under different url's you can provide different security contexts for them.
That is the security.xml
file can now specify different security filters to be applied to the same client config (this is because the security chain is based on the initial URL).
This means it's possible to have a single client config, and point one group of users to one url to access it, where they'll need to login with a username and password, and have another group of people access the same client config, via a different url, where NTLM authentication is used.
Note |
---|
The security implications described above rely on changes also being made to the security.xml, and will probably require advanced configuration of the security.xml file. |
Additionally you can override some of the configuration in the client config, for example,
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
This by itself isn't much, but by allowing you to publish the same client config under different url's you can provide different security contexts for them.
That is the security.xml
file can now specify different security filters to be applied to the same client config (this is because the security chain is based on the initial URL).
This means it's possible to have a single client config, and point one group of users to one url to access it, where they'll need to login with a username and password, and have another group of people access the same client config, via a different url, where NTLM authentication is used.
Note |
---|
The security implications described above rely on changes also being made to the security.xml, and will probably require advanced configuration of the security.xml file. |
Additionally you can override some of the configurations in the client config, 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.
You can also specify an ACL in the alias, but it doesn't affect the alias itself, as is the case if an ACL is attached to any other item in a client config, rather it'll replace the ACL for the client as a whole.
This means the following:
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> |
would be the is equivalent ofto
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> |
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.
You can also specify an ACL in the alias, but it doesn't effect the alias itself, as is the case if an ACL is attached to any other item in a client config, rather it'll replace the ACL for the client as a whole.
Which means thow following:
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="externalmain"> <alias id="internalpathway"> <title>Internal<title>Pathway Client</title> <description>Client for access by internal users<to be used when called from Pathway</description> <license xsi:nil="true"/> <acl id="internal"/><publish>false</publish> </alias> <title>External<title>Default Client</title> <description>General <description>Clientclient for accessuse 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 the 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
The buttons used to expand and collapse the panel can be too small for some users, but since these buttons are just images they can be updated to use a different images.
...
Here is a bundle that contains a set of replacement buttons, com.cohga.client.weave.themes.collapse_1.0.0.jar, that you can use to alter the appearance.
...
Installing the new expand/collapse button theme
To use the updated buttons you need to download the com.cohga.client.weave.themes.collapse_1.0.0.jar file and copy it to the ...\weave\platform\plugins\
directory.
Once you've done that you have to edit the ...\weave\platform\configuration\config.ini
file to add the file you just downloaded to the list of bundles
that Weave will start automatically each time Weave is restarted.
The image below shows the config.ini
file after it's been edited, the line that needs to be added has been highlighted in the image. In this case the line has been added after the lines that list the grey and olive themes that ship with Weave, the line that's added to config.ini
is the line containing com.cohga.client.weave.themes.collapse@:start,\
...
After downloading and installing the file, and editing config.ini
you should restart the Weave instance to ensure the new bundle is started and available for use.
Using the new expand/collapse theme in your client
After you have the new theme bundle installed and started you have to add the theme to the client config, along with any existing theme you're currently using.
The image below shows an existing client config that been changed to add the line highlighted below. Note that your client config will not match the example below, the one below is just an example to show you where in your client config(s) you'd need to add the highlighted line to enable the larger expand/collapse buttons.
In the following example the client config is already setup to use the grey
theme, you may not be using a theme at all, in which case you won't have an existing theme
entry and you should just add a new theme
tag for the expand/collapse buttons.
...
Info |
---|
As of Weave 2.5.18 this bundle is already included and setup so all you need to do is the last step to add the |
Licence agreement and startup tips
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 config
Displaying a licence agreement
Code Block | ||
---|---|---|
| ||
<client:config id="main">
<licence>
<title>Licence Agreement</title> <!-- "Licence Agreement" is the default so this is not strictly required -->
<text>This is where you would insert the agreement text you wish the user to confirm.</text> <!-- this must be set -->
<url>http://example.com</url> <!-- optional link if the user does not agree -->
</licence>
<!-- rest of client config goes here -->
</client:config> |
...
Displaying a startup tip
Code Block | ||
---|---|---|
| ||
<client:config id="main">
<tip>
<delay>1000</delay> <!-- how long before the tip should popup, default is 1000ms so this is not strictly required -->
<title>Tip o' the day</title> <!-- title for the tip window -->
<text>Don't run with scissors</text> <!-- required text for the tip -->
<time>3000</time> <!-- optional duration for how long the tip should show, if not set then the user will have to click to hide it -->
</tip>
<!-- rest of client config goes here -->
</client:config> |
...
Adjusting the panel collapse buttons
The buttons used to expand and collapse the panel can be too small for some users, but since these buttons are just images they can be updated to use a different image.
...
Here is a bundle that contains a set of replacement buttons, com.cohga.client.weave.themes.collapse_1.0.0.jar, that you can use to alter the appearance.
...
Installing the new expand/collapse button theme
To use the updated buttons you need to download the com.cohga.client.weave.themes.collapse_1.0.0.jar file and copy it to the ...\weave\platform\plugins\
directory.
Once you've done that you have to edit the ...\weave\platform\configuration\config.ini
file to add the file you just downloaded to the list of bundles
that Weave will start automatically each time Weave is restarted.
The image below shows the config.ini
file after it's been edited, the line that needs to be added has been highlighted in the image. In this case, the line has been added after the lines that list the grey and olive themes that ship with Weave, the line that's added to config.ini
is the line containing com.cohga.client.weave.themes.collapse@:start,\
...
After downloading and installing the file, and editing config.ini
you should restart the Weave instance to ensure the new bundle is started and available for use.
Using the new expand/collapse theme in your client
After you have the new theme bundle installed and started you have to add the theme to the client config, along with any existing theme you're currently using.
The image below shows an existing client config that has been changed to add the line highlighted below. Note that your client config will not match the example below, the one below is just an example to show you where in your client config(s) you'd need to add the highlighted line to enable the larger expand/collapse buttons.
In the following example, the client config is already setup to use the grey
theme, you may not be using a theme at all, in which case you won't have an existing theme
entry and you should just add a new theme
tag for the expand/collapse buttons.
...
Info |
---|
As of Weave 2.5.18 this bundle is already included and setup so all you need to do is the last step to add the |
Licence agreement, startup tips and splash screens
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 config
Displaying a licence agreement
Code Block | ||
---|---|---|
| ||
<client:config id="main">
<licence>
<title>Licence Agreement</title> <!-- "Licence Agreement" is the default so this is not strictly required -->
<text>This is where you would insert the agreement text you wish the user to confirm.</text> <!-- this must be set -->
<url>http://example.com</url> <!-- optional link if the user does not agree -->
<usetop>true</usetop> <!-- Since Weave 2.5.26: When Weave is embedded inside an IFrame, indicate that the top-level window has to be changed to the given URL. -->
</licence>
<!-- rest of client config goes here -->
</client:config> |
...
Displaying a startup tip
Code Block | ||
---|---|---|
| ||
<client:config id="main">
<tip>
<delay>1000</delay> <!-- how long before the tip should popup, default is 1000ms so this is not strictly required -->
<title>Tip o' the day</title> <!-- title for the tip window -->
<text>Don't run with scissors</text> <!-- required text for the tip -->
<time>3000</time> <!-- how long the tip should show -->
</tip>
<!-- rest of client config goes here -->
</client:config> |
...
Splash screens
New in 2.6.7 is the splash screen, a bit of a combination of the licence and tips. A splash screen gives you 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 licence panel, and tips, is that you have to supply HTML content to be displayed, the content can either be embedded directly in the configuration or provided as a URL pointing to a web page to display, 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 will then be available at the URL http://example.com/weave/static/
. This allows you to be much more expressive with the content of the window, and because it directly supports multiple tabs you can provide separate sections with different content, 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
...
If the user clicks Yes the panel will close 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 can add to a toolbar/statusbar to allow the user to open the panel again if they want.
...
Finally, you have the option to configure the panel to always display only once 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.
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 | ||
---|---|---|
| ||
<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 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 been hidden. Note that the splashId defaults to “startup”, so if you 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”)
Code Block | ||
---|---|---|
| ||
<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 | ||
---|---|---|
| ||
<plugin id="weave.splash" height="400" width="600" url="https://cohga.com/weave/licence.html" redirectUrl="https://cohga.com/weave/"/> |
Show a basic splash page with embedded HTML that allows the user to stop it displaying at the start of each session.
Code Block | ||
---|---|---|
| ||
<plugin id="weave.splash">
<height>100</height>
<html><![CDATA[
<div style="padding: 15px; font-size: 15pt; background: #dee9f7; height: 100%; text-align: center">
Welcome to the wonderful world of Weave
</div>
]]></html>
<allowHide>true</allowHide>
</plugin> |
Show a splash page with multiple tabs
Code Block |
---|
<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 |
---|
<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 | ||
---|---|---|
| ||
<item action="weave.showsplash" splashId="splash20211119" tab="1"/> |