Class NotePageViewService

java.lang.Object
io.meeds.notes.service.NotePageViewService

public class NotePageViewService extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    NotePageViewService(NoteService noteService, WikiService noteBookService, io.meeds.social.cms.service.CMSService cmsService, org.exoplatform.social.attachment.AttachmentService attachmentService, org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.portal.config.UserACL userACL, org.exoplatform.services.resources.LocaleConfigService localeConfigService)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    copyNotePage(String sourceName, String newName, org.exoplatform.services.security.Identity currentUserAclIdentity)
    Copies the content of a page note, in its default language and in every published translation, onto the note of another setting, attributed to the user: a file the source content names among the source note's attachments is attached to the target note and the content copied names it there.
    createNoteTranslation(String name, String content, String lang, org.exoplatform.services.security.Identity currentUserAclIdentity)
    Writes the content of the page note in a language as a new published version of that language, attributed to the user, creating the translation when the note holds none in that language.
    getNotePage(String name, String lang)
     
    getNotePage(String name, String lang, org.exoplatform.services.security.Identity currentUserAclIdentity)
     
     
     
    importNotePageData(String name, NotePageData pageData, org.exoplatform.services.security.Identity currentUserAclIdentity)
    Writes the contents of a NotePageData, the window's data.init preference, onto the note of a setting, attributed to the user: the default content, then each translation.
    saveNotePage(String name, String content, String lang, org.exoplatform.services.security.Identity currentUserAclIdentity)
     
    savePageData(String name, NotePageData pageData)
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • NotePageViewService

      public NotePageViewService(NoteService noteService, WikiService noteBookService, io.meeds.social.cms.service.CMSService cmsService, org.exoplatform.social.attachment.AttachmentService attachmentService, org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.portal.config.UserACL userACL, org.exoplatform.services.resources.LocaleConfigService localeConfigService)
  • Method Details

    • getNotePage

      public Page getNotePage(String name, String lang, org.exoplatform.services.security.Identity currentUserAclIdentity) throws IllegalAccessException
      Throws:
      IllegalAccessException
    • getNotePageData

      public NotePageData getNotePageData(String name)
    • savePageData

      public Page savePageData(String name, NotePageData pageData)
    • getNotePages

      public Map<String,Page> getNotePages(String name)
    • getNotePage

      public Page getNotePage(String name, String lang)
    • saveNotePage

      public Page saveNotePage(String name, String content, String lang, org.exoplatform.services.security.Identity currentUserAclIdentity) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
      Throws:
      IllegalAccessException
      org.exoplatform.commons.exception.ObjectNotFoundException
    • createNoteTranslation

      public Page createNoteTranslation(String name, String content, String lang, org.exoplatform.services.security.Identity currentUserAclIdentity) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
      Writes the content of the page note in a language as a new published version of that language, attributed to the user, creating the translation when the note holds none in that language. The language is the stored form (Locale.toString(), as es_ES), whatever the platform's default language. The default content and the metadata of every language stay as stored; the note's update date moves and every draft of the note is removed, as the drawer's save does.
      Parameters:
      name - the setting name of the window
      content - the content to publish in the language
      lang - the language, in its stored form
      currentUserAclIdentity - the writing user
      Returns:
      the note as read in that language
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException - when no setting carries the name
      IllegalAccessException - when the user may not edit the setting's page
      IllegalArgumentException - when the language is blank, or when the note has no default content yet
    • copyNotePage

      public Page copyNotePage(String sourceName, String newName, org.exoplatform.services.security.Identity currentUserAclIdentity) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
      Copies the content of a page note, in its default language and in every published translation, onto the note of another setting, attributed to the user: a file the source content names among the source note's attachments is attached to the target note and the content copied names it there. The target's content is replaced language by language; its metadata and the source note stay as stored.
      Parameters:
      sourceName - the setting name of the note to copy
      newName - the setting name of the note to write
      currentUserAclIdentity - the copying user
      Returns:
      the target note's default content, null when the source holds no note yet
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException - when either setting does not exist
      IllegalAccessException - when the user may not read the source or edit the target's page
    • importNotePageData

      public Page importNotePageData(String name, NotePageData pageData, org.exoplatform.services.security.Identity currentUserAclIdentity) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
      Writes the contents of a NotePageData, the window's data.init preference, onto the note of a setting, attributed to the user: the default content, then each translation. A file the contents name among the attachments of a note the user can read is attached to the target note by the user and the content written names it there; any other named file is left as named. The preference is one any editor of the page can write, so nothing is written as the super user.
      Parameters:
      name - the setting name of the note to write
      pageData - the contents per language, the default content under the empty key
      currentUserAclIdentity - the importing user
      Returns:
      the target note's default content, null when the data holds no default content
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException - when the setting does not exist
      IllegalAccessException - when the user may not edit the setting's page