Portal Engine Questions on portal engine and web parts.
Version 4.x > Portal Engine > API - Owned by group View modes: 
User avatar
Member
Member
eagleag - 1/9/2011 2:35:15 PM
   
API - Owned by group
Hi,
Is there anyway to use api to update the field Owned by group that appear under page/document -> Properties -> general?

I searched the api and couldn't find anything :(

Thanks :)

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 1/14/2011 9:29:23 AM
   
RE:API - Owned by group
Hi,

There is no special method for this action, since the Group that owns some document(node) is determined by NodeGroupID property (column) of the TreeNode.

You can therefore just select appropriate Group either from CommunityContext or using GroupInfoProvider methods, e.g.:

public static GroupInfo GetGroupInfo(
string groupCodeName,
string siteName
)

Then you can assign it like TreeNode.NodeGroupID = GroupInfo.GroupID;


Regards,
Zdenek

User avatar
Member
Member
eagleag - 2/9/2011 1:45:19 PM
   
RE:API - Owned by group
thanks for you help.

this is what I used.

node.TreeProvider.ChangeCommunityGroup("/MyCommunity/Group-pages/"+node.NodeAlias, gi.GroupID, CMS.CMSHelper.CMSContext.CurrentSite.SiteID, true);


THANKS :)