As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
// get the current user FacesContext context = FacesContext.getCurrentInstance(); String currentUserName = Repository.getServiceRegistry(context).getAuthenticationService().getCurrentUserName();
FacesContext context = FacesContext.getCurrentInstance(); String currentUserName = Repository.getServiceRegistry(context).getAuthenticationService().getCurrentUserName(); NodeRef person = personService.getPerson(currentUserName); String userName = (String) nodeService.getProperty(person, ContentModel.PROP_LASTNAME);