Class HtmlResponse

java.lang.Object
org.apache.sling.servlets.post.AbstractPostResponse
com.adobe.granite.ui.components.HtmlResponse
All Implemented Interfaces:
PostResponse

public class HtmlResponse extends AbstractPostResponse
The post response which produces HTML containing metadata, such as status code, title, so that the client can parse it.
  • Constructor Details

    • HtmlResponse

      public HtmlResponse(@Nonnull XSSAPI xss, @Nonnull I18n i18n, @Nonnull Locale locale)
  • Method Details

    • onModified

      public void onModified(String path)
      Description copied from class: AbstractPostResponse
      Records a 'modified' change
      Specified by:
      onModified in interface PostResponse
      Overrides:
      onModified in class AbstractPostResponse
      Parameters:
      path - path of the item that was modified
    • onCreated

      public void onCreated(String path)
      Description copied from class: AbstractPostResponse
      Records a 'created' change
      Specified by:
      onCreated in interface PostResponse
      Overrides:
      onCreated in class AbstractPostResponse
      Parameters:
      path - path of the item that was created
    • onDeleted

      public void onDeleted(String path)
      Description copied from class: AbstractPostResponse
      Records a 'deleted' change
      Specified by:
      onDeleted in interface PostResponse
      Overrides:
      onDeleted in class AbstractPostResponse
      Parameters:
      path - path of the item that was deleted
    • onMoved

      public void onMoved(String srcPath, String dstPath)
      Description copied from class: AbstractPostResponse
      Records a 'moved' change.

      Note: the moved change only records the basic move command. the implied changes on the moved properties and sub nodes are not recorded.

      Specified by:
      onMoved in interface PostResponse
      Overrides:
      onMoved in class AbstractPostResponse
      Parameters:
      srcPath - source path of the node that was moved
      dstPath - destination path of the node that was moved.
    • onCopied

      public void onCopied(String srcPath, String dstPath)
      Description copied from class: AbstractPostResponse
      Records a 'copied' change.

      Note: the copy change only records the basic copy command. the implied changes on the copied properties and sub nodes are not recorded.

      Specified by:
      onCopied in interface PostResponse
      Overrides:
      onCopied in class AbstractPostResponse
      Parameters:
      srcPath - source path of the node that was copied
      dstPath - destination path of the node that was copied.
    • onChange

      public void onChange(String type, String... arguments)
      Description copied from interface: PostResponse
      Records a generic change of the given type with arguments.
      Parameters:
      type - The type of the modification
      arguments - The arguments to the modifications
    • setDescription

      public void setDescription(@CheckForNull String description)
    • setGeneralError

      public void setGeneralError(int code)
      Sets the general purpose error message using the given status code. The title and description will be set automatically.
      Parameters:
      code - the status code
    • addRedirectLink

      public void addRedirectLink(@Nonnull String href, @Nonnull String text)
      Adds a redirect link to indicate where the client should go after the post. Note that you SHOULD call this method once, otherwise would be a duplicate.
      Parameters:
      href - the link
      text - the link text
    • addLink

      public void addLink(@Nonnull String rel, @Nonnull String href, @Nonnull String text)
      Adds a link to the response. It is for the server to give affordance to the client.
      Parameters:
      rel - relationship attribute
      href - the link
      text - the link text