For one of the requirement, on each keyword save, we need to retrieve the category and the hierarchy of the keywords with corresponding metadata under that category.
The category Id will be used for publishing and hierarchy with metadata will be used for maintaining the details of what data were published as categories and keyword do not have history.
Using webdav url of the keyword, I was able to retrieve category:
Category category = (Category)keyword.Session.GetObject(
keyword.WebDavUrl.Substring(0,
keyword.WebDavUrl.LastIndexOf("/"))
);
Is there any other approach available to retrieve the category?
What method can I use to retrieve the hierarchy details?
OrganizationalItem
property?