use of org.xwiki.extension.repository.xwiki.model.jaxb.ExtensionAuthor in project xwiki-platform by xwiki.
the class AbstractExtensionRESTResource method resolveExtensionAuthor.
protected ExtensionAuthor resolveExtensionAuthor(String authorId) {
ExtensionAuthor author = new ExtensionAuthor();
XWikiContext xcontext = getXWikiContext();
XWikiDocument document;
try {
document = xcontext.getWiki().getDocument(authorId, xcontext);
} catch (XWikiException e) {
document = null;
}
if (document != null && !document.isNew()) {
author.setName(xcontext.getWiki().getPlainUserName(document.getDocumentReference(), xcontext));
author.setUrl(document.getExternalURL("view", xcontext));
} else {
author.setName(authorId);
}
return author;
}
Aggregations