I have requirement to create the termGroup in TermStore.
private void ProvisionTermGroups(SPFarm farm)
{
DebugWriter.Write("Started processing of term groups", this);
foreach (TermGroup termGroup in this.Farm.ManagedMetadata)
{
if (termGroup.Action == Action.Add)
{
//TODO: Code processing of term groups
foreach (TermSet termSet in termGroup.TermSets)
{
//TODO: Code processing of term sets
foreach (Term term in termSet.Terms)
{
//TODO: Code processing of term
}
}
}
}
}
My code structure as above.
How can i get the Site collection context of central administration from the FARM object to provision Term Group in Term Store ?
I have tried getting the default server from the local.farm but i am not able to get the Sharepoint Central Administration of the "SpServer" ?
Can i get term-store Object from the Service Instances in farm?