Customize view and dialog boxes
The View settings of the registration pane and various dialog boxes in WorkZone for Office are stored in the database as an XAML configuration.
View and change settings for dialog boxes and views
To see the views available in the database and (or) change your selected settings, you need to execute the following query in SCANSQL or SQLPLUS:
SELECT*
FROM services_configuration
WHERE Module_name = 'Scanjour.Services.Office'
Below is the full list of customizable dialog boxes and views in WorkZone for Office:
- AddressSelectDialog
- CaseConfirmDialog
- CaseSearchDialog
- CreateCaseDialog
- DocumentRegistrationPane
- OutlookItemRegistrationDialog
- MultipleSavingCommonMetadataDialog
- FacetsSelectDialog
- FileClassSelectDialog
- FixedListDialog
- OutlookRecordSearchDialog
- PartiesSuggestionDialog
- RecipientSelectDialog
- RecordSearchDialog
- RecordSelectDialog
Notes:
- As views can contain language specific texts, separate versions of the views for each of the supported languages are stored in the database. See About SJStyles.
- ColumnSetDefinitions is an xml structure that defines which fields are available for the Office Clients. This configuration is merged into the WorkZone Content Server data dictionary.
Important: You need to load the standard ColumnSet configuration used by WorkZone for Office into the sd_datadict
table manually. See Installation Guide for WorkZone.
Make a field required or non-required during the registration of the item
You can add values to the dialog boxes and views and make them required or non-required during the item registration. This is relevant for the following dialog boxes and views:
- CreateCaseDialog
- DocumentRegistrationPane
- OutlookItemRegistrationDialog
- MultipleSavingCommonMetadataDialog.
- Open the relevant XAML file.
- Find the control with a field value that you want to make required or non-required.
- To make a field required, you must add the following property to the control:
prop:ControlBehaviour.IsRequired="True".
-or-
To make a field non-required, you must remove its control from the XAML file. - Save your changes.
Important: You can make a field required if it is defined as non-required on the server, but you cannot make a field non-required if it is set as required on the server.
The procedure of making the Role field on the Document registration pane required differs. You can find an example below:
If you want users to always select a role when they add a new party on a case, you need to complete the following changes in XAML:
- Remove the following code:
- Instead, insert the following code:
<GridViewColumn Width="80" DisplayMemberBinding="{Binding custom_label.Elab}"
prop:RangeColumnBehaviour.MinWidth="{x:Static
consts:LayoutConstants.GridViewColumnMinWidth}"/>
<GridViewColumn Width="80"
prop:RangeColumnBehaviour.MinWidth="{x:Static
consts:LayoutConstants.GridViewColumnMinWidth}">
<GridViewColumn.CellTemplate>
<DataTemplate>
<Grid>
<ComboBox DataContext="{Binding custom_label}"
Style="{DynamicResource ODataComboBox}"
IsEnabled="False" prop:ControlBehaviour.IsRequired="True"/>
</Grid>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
Configure the "ColumnSetDefinitions" file
To open and edit your ColumnSetDefinitions file, you must execute the following query in SCANSQL or SQLPLUS:
Customized versions of ColumnSetDefinitions and XAML are stored in a local project structure together with the scripts for loading the configuration to database.
Add a text field to the registration pane
You can add an extra field to the Registration pane.
- Add the data column for the new field to ColumnSetDefinitions (if it is not present already).
- Add the XAML control for the field using the appropriate SjStyle, and bind it to the relevant data column.
A text field example
In the example below, the Record Title field is defined as a simple text field.
The field name in data dictionary: record:title
In the ColumnSetDefinitions file, add the "title"
column under the register "record"
and ColumnSet "Single"
:
<Scanjour>
<Settings>
<Services>
<Clients>
<Client name="OfficeService">
<Registers>
<Register name="record">
<ColumnSets>
<ColumnSet name="Single">
<Column name="title"/>
</ColumnSet>
</ColumnSets>
</Register>
</Registers>
</Client>
</Clients>
</Services>
</Settings>
</Scanjour>
In Registration Pane.<language>.xaml, you can define a field using the SjTextBox styling and binding to the column Record.title:
<TextBox x:Name="Title_field" DataContext="{Binding Record.title}"
Style="{DynamicResource SjTextBox}"
Margin="0" Width="Auto" Height="20" TextWrapping="NoWrap"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch" TabIndex="0"
HorizontalAlignment="Stretch" TabIndex="0"/>
In the example above, extra layout attributes have been added to the XAML control to specify alignment, tab order, and text wrapping.
You can add all common ScanJour WorkZone Content Server field types using the predefined SjStyles.
The example below shows how to add a drop-down list for a domain controlled field. In the example, ‘Record Type’ is defined as a domain bound field.
ColunmSetDef.
In ColumnSetDefinitions, the field is added like this:
<ColumnSet name="Single">
<Column name="record_type"/>
</ColumnSet>
XAML
In XAML, the field can be defined as follows:
<ComboBox x:Name="Doctype_combo" DataContext="{Binding Record.record_type}"
Style="{DynamicResource SjComboBox}"
Margin="0" Height="20" TabIndex="1" />
Remove a field from the registration pane
You can remove any field from the standard Registration pane. You only need to remove the field from XAML; it is not necessary to remove the field from ColumnSetDefinitions.
Important: When you decide to remove a field from the Registration pane, you must make sure that this field is not defined as a required field in the data dictionary.
A required field must always be present for input, unless it has a default value defined in the data dictionary.
To write and use the customized add-ins, the following requirements must be met:
- The AddIn assembly must have a reference to the WorkZone for Office assembly
Scanjour.Office.CustomizationContracts
. - The AddIn class must be inherited from the
IAddIn
interface. - The AddIn class must have an
AddIn
attribute. - All AddIns have the
SetContext(HostContext hostContext)
method. This HostContext has WorkZone for Office methods that are accessible from the AddIn. - All AddIns have the
GetViewModel
method, which is used to get a view model (that is like a code behind the UI customization on XAML). The access to a view model from XAML uses theXamlViewModelKey
attribute from theAddInConfiguration.xml
file. - You can create an AddIn without a UI (a view model). To do this, you must return null from
'AddIn.GetViewModel()'
and not provide anXamlViewModelKey
attribute for the specific AddIn in theAddInConfiguration.xml
file.