CommentsPart — Aspose.Slides FOSS Java API Reference

CommentsPart — Manages a slide comments XML part (ppt/comments/slideN.

Package: org.aspose.slides.foss.internal.pptx

Note: This is an internal implementation class. Do not import or use it directly — the package org.aspose.slides.foss.internal.pptx is not part of the public API and may change without notice. This page is provided for reference only.


Properties

PropertyTypeAccessDescription
partNameStringRead/Write
commentsList<CommentData>Read/Write
emptybooleanRead/Write

Methods

MethodReturnsDescription
getPartName()StringReturns the part name (URI) of this comments part.
getComments()List<CommentData>Returns all comments in this part.
getCommentsByAuthor(int authorId)List<CommentData>Returns all comments by the given author.
findCommentByIdx(int authorId, int idx)Optional<CommentData>Finds a comment by author ID and index.
findCommentByIdxAll(int idx)Optional<CommentData>Finds a comment by index across all authors (for parentCmId lookup).
addComment(int authorId, int idx, String text, double posX, double posY, String dtStr, Integer parentIdx)CommentDataAppends a new comment element and returns its data wrapper.
insertComment(int index, int authorId, int idx, String text, double posX, double posY, String dtStr, Integer parentIdx)CommentDataInserts a comment at the given index among existing comments.
removeComment(int authorId, int idx)voidRemoves a comment by author ID and index.
removeCommentElem(Element elem)voidRemoves a specific comment element from the document.
removeCommentsAt(int index)voidRemoves the comment at the given positional index.
clear()voidRemoves all comments from this part.
count()intReturns the number of comments in this part.
isEmpty()booleanReturns whether this part contains no comments.
save()voidSaves the comments XML back to the package.
createForSlide(OpcPackage pkg, String slidePartName)CommentsPartCreates a new empty comments part for a slide and registers all relationships.
loadForSlide(OpcPackage pkg, String slidePartName)Optional<CommentsPart>Loads the comments part for a slide, if it exists.
delete(OpcPackage pkg, String slidePartName)voidDeletes the comments part for a slide, removing the part, content type, and relationship.
resolveTarget(String fromPart, String target)StringResolves a relative target path to an absolute part name.
computeRelativeTarget(String fromPart, String toPart)StringComputes a relative path from one part to another.
dtToStr(LocalDateTime dt)StringConverts a LocalDateTime or LocalDate to an OOXML datetime string.
dtToStr(LocalDate date)StringConverts a LocalDate to an OOXML datetime string.
strToDt(String s)Optional<LocalDateTime>Parses an OOXML datetime string to a LocalDateTime.

See Also