Portal Engine Questions on portal engine and web parts.
Version 4.x > Portal Engine > get NodeOwner View modes: 
User avatar
Member
Member
eagleag - 4/6/2011 3:03:36 AM
   
get NodeOwner
Hi,
I created a FormControl that when user logged into site it automatically get theyre FullName and UserID.

It stored the userId and then in transformation I use custom function to get thetre FullName.

I would really like to use NodeOwner adn one form submit save NodeOwnerID insted of UserId.
two issues:
1. how can I save nodeOwnerId throw code in formControl.
2. when in cmsdesk (admin approving document) I cant seem to get nodeOwner throw api, alwys come back null. code im using:
CMS.TreeEngine.TreeProvider tp = new CMS.TreeEngine.TreeProvider(CMS.CMSHelper.CMSContext.CurrentUser);
CMS.TreeEngine.TreeNode node = tp.SelectSingleNode(CMS.CMSHelper.CMSContext.CurrentDocument.NodeID);
curUsrFullName.Text = CMS.SiteProvider.UserInfoProvider.GetUserInfo(node.NodeOwner).FullName;


summary: Functionality I want is-> formControl should store value of DocumentOwner.

btw, what is differnce between documentOwner and NodeOwner?

THANKS :)



User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 4/11/2011 9:24:25 AM
   
RE:get NodeOwner
Hi,

you do not need to create a custom function (form control) for displaying (storing) NodeOwnerId. This information is stored automatically by the system (in the CMS_Tree table). Therefore you could use following function inside your transformation and the owner's full name will be displayed:

<%# Eval("NodeOwnerFullName") %>

Document owner is created from the NodeOwner, there is not some big difference.

If you need to work with node owner's ID, you can find this information using standard API working with documents:
Select single node by nodeID

Best regards,
Ivana Tomanickova

User avatar
Member
Member
tfoulk - 4/9/2013 9:08:00 AM
   
RE:get NodeOwner
Is there a way to grab the first and last name separately of a nodeowner in a transformation?

User avatar
Kentico Support
Kentico Support
kentico_janh - 4/11/2013 2:39:59 PM
   
RE:get NodeOwner
Hello,

Yes of course:

<%# CMS.SiteProvider.UserInfoProvider.GetUserInfo(Eval("NodeOwnerUserName").ToString()).FirstName %>
<%# CMS.SiteProvider.UserInfoProvider.GetUserInfo(Eval("NodeOwnerUserName").ToString()).LastName %>


Best regards,
Jan Hermann

User avatar
Member
Member
tfoulk - 4/11/2013 2:45:52 PM
   
RE:get NodeOwner
Thank you Jan!