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 Details

    • readBody$UPDATES

      static final boolean readBody$UPDATES
      Deprecated.
      See Also:
    • readBodies$UPDATES

      static final boolean readBodies$UPDATES
      Deprecated.
      See Also:
    • createMessage$UPDATES

      static final boolean createMessage$UPDATES
      Deprecated.
      See Also:
    • createMessages$UPDATES

      static final boolean createMessages$UPDATES
      Deprecated.
      See Also:
    • updateMessage$UPDATES

      static final boolean updateMessage$UPDATES
      Deprecated.
      See Also:
    • updateMessages$UPDATES

      static final boolean updateMessages$UPDATES
      Deprecated.
      See Also:
  • Method Details

    • readBody

      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 the given String is null.
    • readBodies

      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 the given array is null.
    • readBodies

      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 the given array is null.
    • readBodies

      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 the given array is null.
    • createMessage

      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

      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 the given message array is null.
    • updateMessage

      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

      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 the given message array is null.