Class NotePageViewService
java.lang.Object
io.meeds.notes.service.NotePageViewService
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionNotePageViewService(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 TypeMethodDescriptioncopyNotePage(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) getNotePageData(String name) getNotePages(String name) importNotePageData(String name, NotePageData pageData, org.exoplatform.services.security.Identity currentUserAclIdentity) Writes the contents of aNotePageData, the window'sdata.initpreference, 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)
-
Field Details
-
CMS_CONTENT_TYPE
- See Also:
-
-
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
-
savePageData
-
getNotePages
-
getNotePage
-
saveNotePage
public Page saveNotePage(String name, String content, String lang, org.exoplatform.services.security.Identity currentUserAclIdentity) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException - Throws:
IllegalAccessExceptionorg.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(), ases_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 windowcontent- the content to publish in the languagelang- the language, in its stored formcurrentUserAclIdentity- the writing user- Returns:
- the note as read in that language
- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when no setting carries the nameIllegalAccessException- when the user may not edit the setting's pageIllegalArgumentException- 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 copynewName- the setting name of the note to writecurrentUserAclIdentity- 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 existIllegalAccessException- 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 aNotePageData, the window'sdata.initpreference, 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 writepageData- the contents per language, the default content under the empty keycurrentUserAclIdentity- 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 existIllegalAccessException- when the user may not edit the setting's page
-