Installing an Add-on
After an AddOn or UpgradeAddOn object
is registered in a domain Global Configuration Database (GCD), it can
be installed to a new or existing object store.
About this task
As shown in the following Java™ and C# examples, you call the ObjectStore.installAddOn method
to install an AddOn or UpgradeAddOn object
to an object store. When you save the ObjectStore object,
an AddOnInstallationRecord object is created, from
which you can get the status of the installation.
In these examples, the Publishing Extensions add-on is installed. Note that determinePrerequisiteAddOnIds method
is called on ObjectStore so that any prerequisite
add-ons are also installed along with the Publishing Extensions add-on.
Java Example
public void verifyPublishingExtensions()
{
System.out.println("Checking for required Add-Ons ...");
IdList requiredAddOnIds = objectStore.determinePrerequisiteAddOnIds(SystemAddOnId.PUBLISHING);
for (int i = 0; i < requiredAddOnIds.size(); i++ )
{
Id addOnIds = (Id)requiredAddOnIds.get(i);
AddOn addOn = Factory.AddOn.getInstance(domain, addOnId);
System.out.println("Installing AddOn: " + addOn.get_DisplayName() + " ... ");
objectStore.installAddOn(addOn);
objectStore.save(RefreshMode.REFRESH);
System.out.println("Installed AddOn: " + addOn.get_DisplayName() + ".");
}
System.out.println("Required Add-Ons installed.");
}
C# Example
public void verifyPublishingExtensions()
{
System.Console.WriteLine("Checking for required Add-Ons ...");
IIdList requiredAddOnIds = objectStore.DeterminePrerequisiteAddOnIds(SystemAddOnId.PUBLISHING);
for (int i = 0; i < requiredAddOnIds.Count; i++ )
{
Id addOnId = (Id)requiredAddOnIds[i];
IAddOn addOn = Factory.AddOn.GetInstance(domain,addOnId);
System.Console.WriteLine("Installing AddOn: " + addOn.DisplayName + " ... ");
objectStore.InstallAddOn(addOn);
objectStore.Save(RefreshMode.REFRESH);
System.Console.WriteLine("Installed AddOn: " + addOn.DisplayName + ".");
}
System.Console.WriteLine("Required Add-Ons installed.");
}