@Override public String getAuthorInitials() { final CTCommentAuthor aut = authors.getAuthorById(comment.getAuthorId()); return aut == null ? null : aut.getInitials(); }
/** * Construct a SpreadsheetML slide authors from a package part * * @param part the package part holding the comment authors data, * the content type must be <code>application/vnd.openxmlformats-officedocument.commentAuthors+xml</code> * * @since POI 3.14-Beta1 */ XSLFCommentAuthors(PackagePart part) throws IOException, XmlException { super(part); CmAuthorLstDocument doc = CmAuthorLstDocument.Factory.parse(getPackagePart().getInputStream(), DEFAULT_XML_OPTIONS); _authors = doc.getCmAuthorLst(); }
@Override public void setAuthor(final String author) { if (author == null) { throw new IllegalArgumentException("author must not be null"); } final CTCommentAuthorList list = authors.getCTCommentAuthorsList(); long maxId = -1; for (final CTCommentAuthor aut : list.getCmAuthorArray()) { maxId = Math.max(aut.getId(), maxId); if (author.equals(aut.getName())) { comment.setAuthorId(aut.getId()); return; } } // author not found -> add new author final CTCommentAuthor newAuthor = list.addNewCmAuthor(); newAuthor.setName(author); newAuthor.setId(maxId+1); newAuthor.setInitials(author.replaceAll( "\\s*(\\w)\\S*", "$1").toUpperCase(LocaleUtil.getUserLocale())); comment.setAuthorId(maxId+1); }
@Override public void setAuthorInitials(final String initials) { final CTCommentAuthor aut = authors.getAuthorById(comment.getAuthorId()); if (aut != null) { aut.setInitials(initials); } }
/** * Construct a SpreadsheetML slide authors from a package part * * @param part the package part holding the comment authors data, * the content type must be <code>application/vnd.openxmlformats-officedocument.commentAuthors+xml</code> * * @since POI 3.14-Beta1 */ XSLFCommentAuthors(PackagePart part) throws IOException, XmlException { super(part); CmAuthorLstDocument doc = CmAuthorLstDocument.Factory.parse(getPackagePart().getInputStream(), DEFAULT_XML_OPTIONS); _authors = doc.getCmAuthorLst(); }
@Override public void setAuthor(final String author) { if (author == null) { throw new IllegalArgumentException("author must not be null"); } final CTCommentAuthorList list = authors.getCTCommentAuthorsList(); long maxId = -1; for (final CTCommentAuthor aut : list.getCmAuthorArray()) { maxId = Math.max(aut.getId(), maxId); if (author.equals(aut.getName())) { comment.setAuthorId(aut.getId()); return; } } // author not found -> add new author final CTCommentAuthor newAuthor = list.addNewCmAuthor(); newAuthor.setName(author); newAuthor.setId(maxId+1); newAuthor.setInitials(author.replaceAll( "\\s*(\\w)\\S*", "$1").toUpperCase(LocaleUtil.getUserLocale())); comment.setAuthorId(maxId+1); }
@Override public String getAuthor() { return authors.getAuthorById(comment.getAuthorId()).getName(); }
/** * Construct a SpreadsheetML slide authors from a package part * * @param part the package part holding the comment authors data, * the content type must be <code>application/vnd.openxmlformats-officedocument.commentAuthors+xml</code> * @param rel the package relationship holding this comment authors, * the relationship type must be http://schemas.openxmlformats.org/officeDocument/2006/relationships/commentAuthors */ XSLFCommentAuthors(PackagePart part, PackageRelationship rel) throws IOException, XmlException { super(part, rel); CmAuthorLstDocument doc = CmAuthorLstDocument.Factory.parse(getPackagePart().getInputStream()); _authors = doc.getCmAuthorLst(); }
@Override public void setAuthorInitials(final String initials) { final CTCommentAuthor aut = authors.getAuthorById(comment.getAuthorId()); if (aut != null) { aut.setInitials(initials); } }
@Override public String getAuthorInitials() { final CTCommentAuthor aut = authors.getAuthorById(comment.getAuthorId()); return aut == null ? null : aut.getInitials(); }
@Override public String getAuthor() { return authors.getAuthorById(comment.getAuthorId()).getName(); }
CTCommentAuthor author = commentAuthors.getAuthorById(comment.getAuthorId()); if(author != null) { text.append(author.getName() + ": ");
CTCommentAuthor author = commentAuthors.getAuthorById(comment.getAuthorId()); if (author != null) { sbComment.append(author.getName());
CTComment comment = comments.getCommentAt(i); xhtml.startElement("p", "class", "slide-comment"); CTCommentAuthor cta = commentAuthors.getAuthorById(comment.getAuthorId()); if (cta != null) { if (cta.getName() != null) {