Class DocForumService

java.lang.Object
sk.iway.iwcm.components.forum.rest.DocForumService

public class DocForumService extends Object
  • Method Details

    • getStatusIconOptions

      public static List<LabelValue> getStatusIconOptions(Prop prop)
      Return icon options for status icon select.
      Parameters:
      prop -
      Returns:
    • saveDocForum

      public static String saveDocForum(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, DocForumEntity forumForm)
      Save given ForumFormBean entity, update and send confirmation notification email
      Parameters:
      request -
      response -
      forumForm - - entity to be saved (forum)
      Returns:
      Throws:
      IOException
    • docForumRecursiveAction

      public static boolean docForumRecursiveAction(DocForumService.ActionType actionType, int forumId, int docId, Identity user)
      Perform recursive supported action uppon forum. More details in this fn code coments.
      Parameters:
      actionType - - Supported recursive actions
      forumId -
      docId -
      user - - logged user
      Returns:
    • isVulgar

      public static boolean isVulgar(String message)
      testuje, ci nie je prispevok vulgarny, alebo obsahuje nepovoleny HTML kod
      Parameters:
      message -
      Returns:
    • clearMsOfficeTags

      public static String clearMsOfficeTags(String text)
      Odstrani Microsot Office tagy z textu. Tieto tagy mozu sposobovat zle odsadzovanie textu.
      Returns:
      String - povodny text ostripovany o tagy
    • getForumBean

      public static DocForumEntity getForumBean(int forumId, boolean sortAscending)
      Get DocForumEntity based on forumId (id), is entity is present, convert it to dDocForumEntity or return null.
      Parameters:
      forumId - - entity id
      sortAscending - - true = ASC, false = DESC
      Returns:
    • recursiveSort

      public static void recursiveSort(List<DocForumEntity> unsorted, List<DocForumEntity> sorted, int level, int parent)
      Recursively sort List (unsorted) and sorted values add into List (sorted).
      Parameters:
      unsorted -
      sorted -
      level -
      parent -
    • getForumFieldsForDoc

      public static List<DocForumEntity> getForumFieldsForDoc(javax.servlet.http.HttpServletRequest request, int docId, boolean onlyConfirmed, int parentId, boolean sortAscending, boolean showDeleted, boolean isForumSearch)
    • getChildForumIdsRecursive

      public static String getChildForumIdsRecursive(List<DocForumEntity> msgList, int forumId)
      BAsed on give forumId, return string where are joined all children id's.
      Parameters:
      msgList - - list of entities to loop
      forumId - - forumId of root parent
      Returns:
    • updateForumStatInfo

      public static void updateForumStatInfo(int docId, int forumId)
    • findParentRecursive

      public static int findParentRecursive(List<DocForumEntity> msgList, int parentId)
      Rekurzivne vyhlada forumId pod-temy
      Parameters:
      msgList -
      parentId -
      Returns:
    • uploadForumFile

      public static String uploadForumFile(org.springframework.web.multipart.commons.CommonsMultipartFile uploadFile, javax.servlet.http.HttpServletRequest request)
      Upload file for specific forum. Using MediaDB.
      Parameters:
      uploadFile - - file to upload
      request -
      Returns:
      - path to file (forward)
    • getForumStat

      public static DocForumEntity getForumStat(int docId)
    • getForumTopics

      public static List<DocForumEntity> getForumTopics(int docId, boolean onlyConfirmed, boolean showDeleted, String flagSearch, ForumSortBy sortBy)
    • getLastMessage

      public static DocForumEntity getLastMessage(int docId)