SoApplicationConfiguration.config file
The application configuration file lists all the pages used in the system. It stores data like the preference section for a given page in the UserPreference
table and what the key of the preference is. It holds the current information of a given page in the current section of the file.
SoApplicationConfiguration
The SoApplicationConfiguration.config file can contain declarations for:
- pages
- dialogs
- currents
- consts
- jsincludes
- cssincludes
<?xml version="1.0" encoding="utf-8" ?>
<applicationsettings defaultprefsection="SuperMode">
<pages prefsection="SuperMode" prefkey="MainPanel">
<page id="contact" type="mainpage" function-right="hide-company" />
<page id="project" type="mainpage" function-right="hide-project" />
<page id="selection" type="mainpage" function-right="hide-selection" />
<page id="diary" type="mainpage" />
<page id="mail" type="mainpage" function-right="hide-mail" />
<page id="maillogin" type="mainpage" function-right="hide-mail" />
<page id="browser" type="mainpage" />
<page id="sale" type="dialog" height="500px" width="650px" />
</pages>
<currents>
<current id="appointment" type="history" providername="SoProtocolProvider" />
<current id="day" type="preference" providername="SoProtocolProvider" />
<current id="week" type="preference" providername="SoProtocolProvider" />
<current id="month" type="preference" providername="SoProtocolProvider" />
<current id="associate" type="history" providername="SoProtocolProvider" />
<current id="contact" type="history" providername="SoProtocolProvider" />
<current id="person" type="history" providername="SoProtocolProvider" />
<current id="previewcontact" type="none" providername="SoProtocolProvider" />
<current id="previewperson" type="none" providername="SoProtocolProvider" />
<current id="project" type="history" providername="SoProtocolProvider" />
<current id="sale" type="history" providername="SoProtocolProvider" />
</currents>
</applicationsettings>
In the above file, we can see that the pages are listed inside the pages
element. The user preference data for all the pages will be stored under the SuperMode section and the key will be MainPanel.
When we go into the individual pages, it gives the page ID, the type of the page, and if it is a main page, the functional rights it has. If the page is not a main page, we can see that the size information of the page has been detailed out since it is not appearing as a page but as a dialog.
In the currents
section, it gives details about where the application has stored the current data for a given page. For example, the below line says that the current appointment is stored in the history
table and the provider that will retrieve the data for us is the SoProtocolProvider. Likewise, it will list all the current values of the application.
<current id="appointment" type="history" providername="SoProtocolProvider" />
Example merge file
The following example demonstrates how to add a page, current, JavaScript, and CSS file.
To override SoApplicationConfiguration, create a new file named MyApplicationConfiguration.merge and place it in your custom path directory.
<applicationsettings>
<pages>
<!-- new feature !!! -->
<page id="customfeature" type="mainpage" />
</pages>
<currents>
<!-- new current !!! -->
<current id="customfeature" type="none" providername="SoProtocolProvider" />
</currents>
<jsincludes>
<!-- new feature script dependency !!! -->
<jsinclude path="~/scripts/customfeature.js" />
</jsincludes>
<cssincludes>
<!-- new feature styles dependency !!! -->
<cssinclude path="~/styles/customfeature.css" />
</cssincludes>
</applicationsettings>
When the application starts, these elements are read into the memory representation of ApplicationConfiguration.config and ready to be used by the application when called upon.
Assuming a file called SoCustomFeature.config exists that contains the page definition for customfeature, it can be called and shown using SoProtocol:
PageUpdate('soprotocol:CustomFeature','');
A global SuperOffice method PageUpdate issues an SoProtocol string to the server. In addition to navigation and changing the viewed configuration, SoProtocol can also update currents.
Set current with JavaScript:
var id = 10;
PageUpdate('soprotocol:?customfeature_id=' + id,'');
Set current with SuperOffice.PageBuilder:
SuperOffice.PageBuilder.setCurrent("customfeature", id);
To get a current value, use the SuperOffice.Util.getCurrentId JavaScript method:
id = SuperOffice.Util.getCurrentId("customfeature");