userLayoutStore.setUserLayout(owner, profile, view.layout, true, false);
}
private IPerson bindToOwner( FragmentDefinition fragment )
{
IPerson owner = new PersonImpl();
owner.setAttribute( "username", fragment.getOwnerId() );
int userID = -1;
try
{
userID = identityStore.getPortalUID( owner, false );
}
catch( AuthorizationException ae )
{
// current implementation of RDMBUserIdentityStore throws an
// auth exception if the user doesn't exist even if
// create data is false as we have it here. So this exception
// can be discarded since we check for the userID being -1
// meaning that the user wasn't found to trigger creating
// that user.
}
if (userID == -1)
{
userID = createOwner( owner, fragment );
owner.setAttribute(NEWLY_CREATED_ATTR, "" + (userID != -1));
}
owner.setID(userID);
return owner;
}