Interface DiscussionBodyService


@Deprecated public interface DiscussionBodyService
Deprecated.
The Discussion Forums functionality will be removed in a future release. Use the News feed and related smart services to build applications with similar functionality.
Defines body-related methods for the discussion forums server. The methods that return bodies only throw exceptions if there is a failure in the storage mechanism. If a body is requested from a location that doesn't exist, then a null is returned for that body. If a body is requested from a valid location but the body is empty, an empty string is returned. The case of scalars is clear. For arrays, if some bodies are found and others are not, then the bodies that are found will be returned at the proper indexes and the indexed spots for bodies that are not found will contain nulls. If there is a storage mechanism failure in retrieving any of the bodies, an exception will be thrown.

Methods of service classes can all throw the unchecked exception ServiceException if any system-level error (for example, server failure) occurs, and will in general throw a checked exception (InvalidXXXException) when an entity to be retrieved is inaccessible, instead of returning null. Exceptions to this paradigm (including the use of ResultList as described below) are noted. All checked exceptions extend AppianException.

It may be necessary to retrieve a subset of results as opposed to an entire collection, and also to sort the subset by some property of the returned object. "Paging" methods which return a ResultPage are provided in certain instances for this purpose. The ResultPage will contain the sorted subset of results (via Result.getResults()), and the total number of items in the available result set (via ResultPage.getAvailableItems()).

It may also be necessary to retrieve some results, even if all results cannot be retrieved (for instance, some of the entities corresponding to a list of entity IDs may no longer exist). Methods which return a ResultList are provided for this purpose. The Result.getResults() method in this case will return all results which can be retrieved. In addition, there will be a list of result codes (ResultList.getResultCodes()) that represent the successful retrieval of an entity, or, if the entity could not be retrieved, the reason for the failure. See the CODE_XXX constants in ResultList for details.

See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    static final boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    static final boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    static final boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    static final boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    static final boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Deprecated.
    Stores the body for a new message
    void
    Deprecated.
    Stores the body for multiple messages
    Deprecated.
    Read multiple message bodies.
    Deprecated.
    Read multiple message bodies.
    readBodies(String[] locations_)
    Deprecated.
    Read multiple message bodies from given locations.
    readBody(String location_)
    Deprecated.
    Read the message body at the given location.
    void
    Deprecated.
    Updates a message body
    void
    Deprecated.
    Updates multiple message bodies
  • Field Details

    • readBody$UPDATES

      @Deprecated(forRemoval=true) static final boolean readBody$UPDATES
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • readBodies$UPDATES

      @Deprecated(forRemoval=true) static final boolean readBodies$UPDATES
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • createMessage$UPDATES

      @Deprecated(forRemoval=true) static final boolean createMessage$UPDATES
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • createMessages$UPDATES

      @Deprecated(forRemoval=true) static final boolean createMessages$UPDATES
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • updateMessage$UPDATES

      @Deprecated(forRemoval=true) static final boolean updateMessage$UPDATES
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • updateMessages$UPDATES

      @Deprecated(forRemoval=true) static final boolean updateMessages$UPDATES
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
  • Method Details

    • readBody

      @Read(OBJECT_STORE) String readBody(String location_)
      Deprecated.
      Read the message body at the given location.
      Parameters:
      location_ - The location of the body, i.e. filename
      Returns:
      The body, if found; null, if not found.
      Throws:
      ServiceException - if any system-level error occurs.
      NullPointerException - if the given String is null.
    • readBodies

      @Read(OBJECT_STORE) String[] readBodies(String[] locations_)
      Deprecated.
      Read multiple message bodies from given locations.
      Parameters:
      locations_ - The locations of the bodies.
      Returns:
      An array containing: the body, if found; a null, if not found (this applies for null locations). If the array is empty then it also returns an empty array.
      Throws:
      ServiceException - if any system-level error occurs
      NullPointerException - if the given array is null.
    • readBodies

      @Read(OBJECT_STORE) String[] readBodies(Message[] ms_)
      Deprecated.
      Read multiple message bodies.
      Parameters:
      ms_ - The Message objects for which to obtain bodies; the bodyLocation field should be populated.
      Returns:
      An array containing: the body, if found; a null, if not found (this applies for null locations). If the array is empty then it also returns an empty array.
      Throws:
      ServiceException - if any system-level error occurs
      NullPointerException - if the given array is null.
    • readBodies

      @Read(OBJECT_STORE) String[] readBodies(ThreadedMessage[] tms_)
      Deprecated.
      Read multiple message bodies.
      Parameters:
      tms_ - The threaded Message objects for which to obtain bodies; the bodyLocation field should be populated.
      Returns:
      An array containing: the body, if found; a null, if not found (this applies for null locations). If the array is empty then it also returns an empty array.
      Throws:
      ServiceException - if any system-level error occurs
      NullPointerException - if the given array is null.
    • createMessage

      @Write({K_FORUMS,OBJECT_STORE}) void createMessage(Message m_)
      Deprecated.
      Stores the body for a new message
      Parameters:
      m_ - The Message to be stored; the bodyLocation field should be populated.
      Throws:
      ServiceException - if any system-level error occurs
    • createMessages

      @Write({K_FORUMS,OBJECT_STORE}) void createMessages(Message[] ms_)
      Deprecated.
      Stores the body for multiple messages
      Parameters:
      ms_ - The Message to be stored; the bodyLocation field should be populated.
      Throws:
      ServiceException - if any system-level error occurs
      NullPointerException - if the given message array is null.
    • updateMessage

      @Write({K_FORUMS,OBJECT_STORE}) void updateMessage(Message m_)
      Deprecated.
      Updates a message body
      Parameters:
      m_ - The Message to be updated; the bodyLocation field should be populated.
      Throws:
      ServiceException - if any system-level error occurs
    • updateMessages

      @Write({K_FORUMS,OBJECT_STORE}) void updateMessages(Message[] ms_)
      Deprecated.
      Updates multiple message bodies
      Parameters:
      ms_ - The messages to be updated; the bodyLocation field should be populated.
      Throws:
      ServiceException - if any system-level error occurs
      NullPointerException - if the given message array is null.