Skip to content

Commit

Permalink
get author name
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelwechner committed Apr 20, 2016
1 parent 66b1d18 commit 33c87ed
Showing 1 changed file with 12 additions and 3 deletions.
Expand Up @@ -3,7 +3,9 @@
*/
package org.wyona.yanel.servlet.menu.impl;

import org.apache.log4j.Logger;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;

import org.wyona.yanel.core.Resource;
import org.wyona.yanel.core.api.attributes.WorkflowableV1;
import org.wyona.yanel.core.attributes.versionable.RevisionInformation;
Expand All @@ -25,7 +27,7 @@
*/
public class RevisionInformationMenuItem implements RevisionInformationMenuContent {

private static Logger log = Logger.getLogger(RevisionInformationMenuItem.class);
private static Logger log = LogManager.getLogger(RevisionInformationMenuItem.class);
private static String NBSP = "   ";

private Resource resource;
Expand Down Expand Up @@ -88,7 +90,14 @@ private String getContent(boolean mostRecent, boolean oldestRevision) {
value += "<li class=\"haschild\">Show more details" + NBSP + "<ul>";
value += "<li>Revision name: " + this.revisionInfo.getName() + "</li>";
value += "<li>Creation date of revision: " + formatDate(this.revisionInfo.getDate()) + "</li>";
value += "<li>Author: " + this.revisionInfo.getUser() + "</li>";

org.wyona.security.core.api.UserManager um = resource.getRealm().getIdentityManager().getUserManager();
try {
value += "<li>Author: " + um.getUser(this.revisionInfo.getUser()).getName() + " (" + this.revisionInfo.getUser() + ")</li>";
} catch(Exception e) {
value += "<li>Author: " + this.revisionInfo.getUser() + "</li>";
log.error(e, e);
}

String comment = this.revisionInfo.getComment();
if (comment != null && comment.length() > 0) {
Expand Down

0 comments on commit 33c87ed

Please sign in to comment.