Package org.silverpeas.components.blog.control

## Class BlogSessionController

- java.lang.Object
- - org.silverpeas.core.web.mvc.controller.AbstractComponentSessionController
  - - org.silverpeas.components.blog.control.BlogSessionController

- All Implemented Interfaces:
    `Serializable`, `org.silverpeas.core.web.mvc.controller.ComponentSessionController`, `org.silverpeas.core.web.session.SessionCloseable`

      public final class BlogSessionController
      extends org.silverpeas.core.web.mvc.controller.AbstractComponentSessionController

  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from class org.silverpeas.core.web.mvc.controller.AbstractComponentSessionController

      `context`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `BlogSessionController​(org.silverpeas.core.web.mvc.controller.MainSessionController mainSessionCtrl, org.silverpeas.core.web.mvc.controller.ComponentContext componentContext)` | Standard Session Controller Constructeur

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `checkWriteAccessOnBlogPost()` |
    `void` | `createCategory​(Category category)` |
    `String` | `createPost​(String title, String categoryId, Date dateEvent, String pdcJsonPositions)` |
    `void` | `deleteCategory​(String categoryId)` |
    `void` | `deletePost​(String postId)` |
    `void` | `draftOutPost​(String postId)` |
    `Collection<Archive>` | `getAllArchives()` |
    `Collection<org.silverpeas.core.node.model.NodeDetail>` | `getAllCategories()` |
    `Collection<org.silverpeas.core.comment.model.Comment>` | `getAllComments​(String postId)` |
    `Collection<org.silverpeas.core.mylinks.model.LinkDetail>` | `getAllLinks()` |
    `Category` | `getCategory​(String categoryId)` |
    `protected org.silverpeas.core.comment.service.CommentService` | `getCommentService()` | Gets a DefaultCommentService instance.
    `String` | `getCurrentBeginDateAsString()` |
    `String` | `getCurrentEndDateAsString()` |
    `String` | `getFlag()` |
    `String` | `getListNodeJSON​(Collection<org.silverpeas.core.node.model.NodeDetail> listNode)` | Converts the list of Delegated News into its JSON representation.
    `PostDetail` | `getPost​(String postId)` |
    `Collection<PostDetail>` | `getResultSearch​(String word, int limit)` |
    `String` | `getRSSUrl()` |
    `String` | `getServerURL()` |
    `StyleSheet` | `getStyleSheet()` | Get the style sheet object.
    `WallPaper` | `getWallPaper()` | Get the wallpaper object.
    `Boolean` | `isDraftVisibleForCurrentUser()` | Drafts are visible for blogger is the linked instance parameter is enabled.
    `Boolean` | `isPdcUsed()` |
    `boolean` | `isUserSubscribed()` |
    `Collection<PostDetail>` | `lastPosts​(int limit)` |
    `Collection<PostDetail>` | `lastValidPosts()` |
    `String` | `manageSubscriptions()` |
    `void` | `nextMonth()` |
    `Collection<PostDetail>` | `postsByArchive​(String theBeginDate, String theEndDate, int limit)` |
    `Collection<PostDetail>` | `postsByCategory​(String categoryId, int limit)` |
    `Collection<PostDetail>` | `postsByDate​(String date, int limit)` |
    `void` | `previousMonth()` |
    `void` | `removeStyleSheetFile()` | Remove the actual style sheet file.
    `void` | `removeWallPaperFile()` | Remove the actual wallpaper file.
    `void` | `saveStyleSheetFile​(org.apache.commons.fileupload.FileItem fileItemStyleSheet)` | Save the stylesheet file.
    `void` | `saveWallPaperFile​(org.apache.commons.fileupload.FileItem fileItemWallPaper)` | Save the banner file.
    `void` | `setCurrentBeginDate​(String beginDate)` |
    `void` | `setCurrentEndDate​(String endDate)` |
    `void` | `setStyleSheet()` | Set the name, URL, size and content of the style sheet file.
    `void` | `setWallPaper()` | Set the name, URL and size of the wallpaper file.
    `void` | `updateCategory​(Category category)` |
    `void` | `updatePost​(String postId, String title, String content, String categoryId, Date dateEvent, String pdcJsonPositions)` |
    `void` | `updatePostAndDraftOut​(String postId, String title, String content, String categoryId, Date dateEvent, String pdcJsonPositions)` |

    - ### Methods inherited from class org.silverpeas.core.web.mvc.controller.AbstractComponentSessionController

      `addClipboardSelection, clipboardPasteDone, close, getClipboardErrorMessage, getClipboardExceptionError, getClipboardObjects, getClipboardSelectedObjects, getClipboardSize, getComponentAccessController, getComponentId, getComponentLabel, getComponentName, getComponentParameterValue, getComponentParameterValue, getComponentRootName, getComponentUrl, getHighestSilverpeasUserRole, getIcon, getLanguage, getLook, getMultilang, getOrganisationController, getPersonalization, getSelection, getSettings, getSilverpeasUserRoles, getSpaceId, getSpaceLabel, getString, getSubscriptionContext, getUrlEncodedParameter, getUserAccessLevel, getUserAvailComponentIds, getUserDetail, getUserDetail, getUserId, getUserManageableGroupIds, getUserManageableSpaceIds, getUserRoles, getZoneId, isAppInMaintenance, isGroupManager, isPasswordChangeAllowed, isSpaceInMaintenance, removeClipboardElement, setAppModeMaintenance, setClipboardSelectedElement, setComponentRootName, setSpaceModeMaintenance`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### BlogSessionController

          public BlogSessionController​(org.silverpeas.core.web.mvc.controller.MainSessionController mainSessionCtrl,
                                       org.silverpeas.core.web.mvc.controller.ComponentContext componentContext)

      Standard Session Controller Constructeur
      Parameters:
        `mainSessionCtrl` - The user's profile
        `componentContext` - The component's profile

  - ### Method Detail

    - #### checkWriteAccessOnBlogPost

          public void checkWriteAccessOnBlogPost()

    - #### getFlag

          public String getFlag()

    - #### lastPosts

          public Collection<PostDetail> lastPosts​(int limit)

    - #### lastValidPosts

          public Collection<PostDetail> lastValidPosts()

    - #### postsByCategory

          public Collection<PostDetail> postsByCategory​(String categoryId,
                                                        int limit)

    - #### postsByArchive

          public Collection<PostDetail> postsByArchive​(String theBeginDate,
                                                       String theEndDate,
                                                       int limit)

    - #### postsByDate

          public Collection<PostDetail> postsByDate​(String date,
                                                    int limit)

    - #### getPost

          public PostDetail getPost​(String postId)

    - #### createPost

          public String createPost​(String title,
                                   String categoryId,
                                   Date dateEvent,
                                   String pdcJsonPositions)

    - #### updatePost

          public void updatePost​(String postId,
                                 String title,
                                 String content,
                                 String categoryId,
                                 Date dateEvent,
                                 String pdcJsonPositions)

    - #### draftOutPost

          public void draftOutPost​(String postId)

    - #### updatePostAndDraftOut

          public void updatePostAndDraftOut​(String postId,
                                            String title,
                                            String content,
                                            String categoryId,
                                            Date dateEvent,
                                            String pdcJsonPositions)

    - #### deletePost

          public void deletePost​(String postId)

    - #### getAllComments

          public Collection<org.silverpeas.core.comment.model.Comment> getAllComments​(String postId)

    - #### getAllCategories

          public Collection<org.silverpeas.core.node.model.NodeDetail> getAllCategories()

    - #### getCategory

          public Category getCategory​(String categoryId)

    - #### createCategory

          public void createCategory​(Category category)

    - #### deleteCategory

          public void deleteCategory​(String categoryId)

    - #### updateCategory

          public void updateCategory​(Category category)

    - #### getAllArchives

          public Collection<Archive> getAllArchives()

    - #### getAllLinks

          public Collection<org.silverpeas.core.mylinks.model.LinkDetail> getAllLinks()

    - #### getResultSearch

          public Collection<PostDetail> getResultSearch​(String word,
                                                        int limit)

    - #### isUserSubscribed

          public boolean isUserSubscribed()

    - #### manageSubscriptions

          public String manageSubscriptions()

    - #### getRSSUrl

          public String getRSSUrl()

      Overrides:
        `getRSSUrl` in class `org.silverpeas.core.web.mvc.controller.AbstractComponentSessionController`

    - #### isPdcUsed

          public Boolean isPdcUsed()

    - #### isDraftVisibleForCurrentUser

          public Boolean isDraftVisibleForCurrentUser()

      Drafts are visible for blogger is the linked instance parameter is enabled.
      Returns:
        true if drafts are visible for current user, false otherwise.

    - #### getCommentService

          protected org.silverpeas.core.comment.service.CommentService getCommentService()

      Gets a DefaultCommentService instance.
      Returns:
        a DefaultCommentService instance.

    - #### setCurrentBeginDate

          public void setCurrentBeginDate​(String beginDate)

    - #### setCurrentEndDate

          public void setCurrentEndDate​(String endDate)

    - #### getCurrentBeginDateAsString

          public String getCurrentBeginDateAsString()

    - #### getCurrentEndDateAsString

          public String getCurrentEndDateAsString()

    - #### nextMonth

          public void nextMonth()

    - #### previousMonth

          public void previousMonth()

    - #### getServerURL

          public String getServerURL()

    - #### getListNodeJSON

          public String getListNodeJSON​(Collection<org.silverpeas.core.node.model.NodeDetail> listNode)

      Converts the list of Delegated News into its JSON representation.
      Returns:
        a JSON representation of the list of Delegated News (as string)

    - #### setWallPaper

          public void setWallPaper()

      Set the name, URL and size of the wallpaper file.

    - #### getWallPaper

          public WallPaper getWallPaper()

      Get the wallpaper object.
      Returns:
        the wallpaper object

    - #### saveWallPaperFile

          public void saveWallPaperFile​(org.apache.commons.fileupload.FileItem fileItemWallPaper)

      Save the banner file.
      Throws:
        `BlogRuntimeException`

    - #### removeWallPaperFile

          public void removeWallPaperFile()

      Remove the actual wallpaper file.

    - #### setStyleSheet

          public void setStyleSheet()

      Set the name, URL, size and content of the style sheet file.

    - #### getStyleSheet

          public StyleSheet getStyleSheet()

      Get the style sheet object.
      Returns:
        style sheet object

    - #### saveStyleSheetFile

          public void saveStyleSheetFile​(org.apache.commons.fileupload.FileItem fileItemStyleSheet)

      Save the stylesheet file.
      Throws:
        `BlogRuntimeException`

    - #### removeStyleSheetFile

          public void removeStyleSheetFile()

      Remove the actual style sheet file.