Common Application Framework
- Last UpdatedMar 16, 2023
- 2 minute read
The Common Application Framework (CAF) provides the .NET programmer with access to various services which support both application development and customization. The available services are:
-
ServiceManager
-
AddinManager
-
SettingsManager
-
CommandBarManager/RibbonBar
-
CommandManager
-
ResourceManager
-
WindowManager

CAF uses a declarative XML definition of menus, toolbars and ribbon tabs and can be used as a menu/toolbar design tool.

Each CAF based application consists of an XML customization file which lists UIC files that define the tools attached to commands.
XML Customization File
The example displays an XML customization file named in the format <module>Customization.xml.
<?xml version="1.0" encoding="utf-8"?>
<UICustomizationSet xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<UICustomizationFiles>
<CustomizationFile Name="Module" Path="module.uic" />
</UICustomizationFiles>
</UICustomizationSet>
UIC File
The example displays a UIC file named in the format module.uic:
<?xml version="1.0" encoding="utf-8"?>
<UserInterfaceCustomization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="www.aveva.com">
<VersionNumber>1.0</Version>
<Tools>
<PopupControlContainerTool Name="Aveva.Pdms.HistoryBackContainer">
<Command>
CAF .NET Commands
NET commands can be used in a CAF. For example:
public class MyCommand : Aveva.ApplicationFramework.Presentation.Command
{
public override void Execute()
{
Console.WriteLine("Do something");
}
public override System.Collections.ArrayList List
{
get
{
return new System.Collections.ArrayList();
}
}
}
CAF PML Commands
PML commands can be used in a CAF. For example:
setup command !!MyCommand
exit
define method .commanda()
!this.key = 'Aveva.Pdms.Pml.commanda'
!this.Execute = 'Execute‘
!this.list = 'List'
endmethod
define method .Execute(!args is ARRAY)
$P Execute commanda
Endmethod
define method .List(!args is ARRAY)
!a = object array()
!a[0] = 'a'
!args[0] = !a
endmethod
Execute the CAF Command
Attach the command object to the AVEVA module using the Command window.

Execute the command. For example:
define method Execute(!args is ARRAY)
q var !this.checked()
endmethod
The button is displayed on the ribbon.

Detailed information about CAF is available, refer to Common Application Framework Interfaces and Menu and Command Bar Customization for further information.