org.exoplatform.wiki.mow.core.api.wiki
Class PageImpl

java.lang.Object
  extended by org.chromattic.ext.ntdef.NTHierarchyNode
      extended by org.chromattic.ext.ntdef.NTFolder
          extended by org.exoplatform.wiki.mow.core.api.wiki.PageImpl
All Implemented Interfaces:
Iterable<org.chromattic.ext.ntdef.NTHierarchyNode>, Page
Direct Known Subclasses:
DraftPageImpl, HelpPage, Template, WikiHome

public abstract class PageImpl
extends org.chromattic.ext.ntdef.NTFolder
implements Page

Created by The eXo Platform SAS Author : viet.nguyen viet.nguyen@exoplatform.com Mar 26, 2010


Constructor Summary
PageImpl()
           
 
Method Summary
 void addAttachment(AttachmentImpl attachment)
           
protected  void addPage(String pageName, Page page)
           
 void addPublicPage(Page page)
          Add a public wiki page
 String addRelatedPage(PageImpl page)
          add a related page
 void addWikiPage(Page page)
          Add a wiki page as child page
 NTVersion checkin()
           
 void checkout()
           
abstract  AttachmentImpl createAttachment()
           
 AttachmentImpl createAttachment(String fileName, org.chromattic.ext.ntdef.Resource contentResource)
           
protected abstract  AttachmentImpl createContent()
           
protected abstract  VersionableMixin createVersionableMixin()
           
protected abstract  WatchedMixin createWatchedMixin()
           
 AttachmentImpl getAttachment(String attachmentId)
           
 Collection<AttachmentImpl> getAttachments()
          Get the attachments of this page
abstract  Collection<AttachmentImpl> getAttachmentsByChromattic()
           
 Collection<AttachmentImpl> getAttachmentsExcludeContent()
           
abstract  String getAuthor()
          The Author is changed when any part of the document changes (content, attachments).
 Map<String,PageImpl> getChildPages()
           
 Map<String,PageImpl> getChildrenByRootPermission()
           
protected abstract  Map<String,PageImpl> getChildrenContainer()
           
 org.chromattic.api.ChromatticSession getChromatticSession()
           
abstract  String getComment()
           
 AttachmentImpl getContent()
          Get the actual content of the page
protected abstract  AttachmentImpl getContentByChromattic()
           
abstract  Date getCreatedDate()
          The date when creating page.
 javax.jcr.Node getJCRPageNode()
          Get JCR node of wiki page
 javax.jcr.Session getJCRSession()
           
abstract  MovedMixin getMovedMixin()
           
 MOWService getMOWService()
           
abstract  String getName()
          Get jcr node name
abstract  boolean getOverridePermission()
           
abstract  String getOwner()
          Get the owner of the page
abstract  PageImpl getParentPage()
          get the parent page
abstract  String getPath()
           
 HashMap<String,String[]> getPermission()
          Get map of permission of page
 Map<String,javax.jcr.Value> getReferredUUIDs()
          get reference uuids of current page
 List<PageImpl> getRelatedPages()
           
abstract  RemovedMixin getRemovedMixin()
           
abstract  RenamedMixin getRenamedMixin()
           
abstract  String getSyntax()
          Get the syntax used in that page
 String getTitle()
           
abstract  String getTitleByChromattic()
           
abstract  Trash getTrash()
           
abstract  Date getUpdatedDate()
          The date when any part of the document changes (content, attachments).
abstract  String getURL()
          get URL of page.
 VersionableMixin getVersionableMixin()
          get Versionable Mixin
abstract  VersionableMixin getVersionableMixinByChromattic()
           
abstract  WatchedMixin getWatchedMixin()
           
 Wiki getWiki()
          get Wiki of page
 WikiHome getWikiHome()
           
 PageImpl getWikiPage(String pageId)
           
 WikiService getWikiService()
           
abstract  String getWorkspace()
           
 boolean hasPermission(PermissionType permissionType)
           
 boolean hasPermission(PermissionType permissionType, org.exoplatform.services.security.Identity user)
          Check if user has permisison on page or not
 boolean isMinorEdit()
           
 void makeVersionable()
           
 void makeWatched()
           
abstract  void remove()
          Detroy wiki page
 void removeAllRelatedPages()
           
 void removeAttachment(String attachmentId)
           
 String removeRelatedPage(PageImpl page)
          remove a specified related page.
 void restore(String versionName, boolean removeExisting)
           
abstract  void setComment(String comment)
           
 void setComponentManager(org.xwiki.component.manager.ComponentManager componentManager)
           
protected abstract  void setContentByChromattic(AttachmentImpl content)
           
abstract  void setCreatedDate(Date date)
           
 void setMinorEdit(boolean isMinorEdit)
          set alow page minor edit or not
abstract  void setMovedMixin(MovedMixin move)
           
 void setMOWService(MOWService mowService)
           
abstract  void setName(String name)
          set jcr node name
 void setNonePermission()
          Reset page permisison
abstract  void setOverridePermission(boolean isOverridePermission)
           
abstract  void setOwner(String owner)
           
abstract  void setParentPage(PageImpl page)
           
 void setPermission(HashMap<String,String[]> permissions)
          Set permission to page
abstract  void setRemovedMixin(RemovedMixin remove)
           
abstract  void setRenamedMixin(RenamedMixin mix)
           
abstract  void setSyntax(String syntax)
           
 void setTitle(String title)
           
abstract  void setTitleByChromattic(String title)
           
abstract  void setTrash(Trash trash)
           
abstract  void setURL(String url)
          set url
protected abstract  void setVersionableMixinByChromattic(VersionableMixin mix)
           
abstract  void setWatchedMixin(WatchedMixin mix)
           
 void setWikiService(WikiService wService)
           
 
Methods inherited from class org.chromattic.ext.ntdef.NTFolder
addChild, addChild, createFile, createFile, createFolder, createFolder, getChild, getChildren, getFile, getFolder, iterator
 
Methods inherited from class org.chromattic.ext.ntdef.NTHierarchyNode
getCreated, getParent, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PageImpl

public PageImpl()
Method Detail

setMOWService

public void setMOWService(MOWService mowService)

getMOWService

public MOWService getMOWService()

setWikiService

public void setWikiService(WikiService wService)

getChromatticSession

public org.chromattic.api.ChromatticSession getChromatticSession()

getJCRSession

public javax.jcr.Session getJCRSession()

getWikiService

public WikiService getWikiService()

setComponentManager

public void setComponentManager(org.xwiki.component.manager.ComponentManager componentManager)

getJCRPageNode

public javax.jcr.Node getJCRPageNode()
                              throws Exception
Description copied from interface: Page
Get JCR node of wiki page

Specified by:
getJCRPageNode in interface Page
Returns:
JCR node of wiki page
Throws:
Exception

getName

public abstract String getName()
Description copied from interface: Page
Get jcr node name

Specified by:
getName in interface Page
Specified by:
getName in class org.chromattic.ext.ntdef.NTHierarchyNode
Returns:
jcr node name

setName

public abstract void setName(String name)
Description copied from interface: Page
set jcr node name

Specified by:
setName in interface Page
Parameters:
name - Nodename

getPath

public abstract String getPath()

getWorkspace

public abstract String getWorkspace()

getContentByChromattic

protected abstract AttachmentImpl getContentByChromattic()

setContentByChromattic

protected abstract void setContentByChromattic(AttachmentImpl content)

createContent

protected abstract AttachmentImpl createContent()

getContent

public AttachmentImpl getContent()
Description copied from interface: Page
Get the actual content of the page

Specified by:
getContent in interface Page
Returns:

getTitleByChromattic

public abstract String getTitleByChromattic()

setTitleByChromattic

public abstract void setTitleByChromattic(String title)

getTitle

public String getTitle()
Specified by:
getTitle in interface Page

setTitle

public void setTitle(String title)
Specified by:
setTitle in interface Page

getSyntax

public abstract String getSyntax()
Description copied from interface: Page
Get the syntax used in that page

Specified by:
getSyntax in interface Page
Returns:

setSyntax

public abstract void setSyntax(String syntax)
Specified by:
setSyntax in interface Page

getComment

public abstract String getComment()
Specified by:
getComment in interface Page

setComment

public abstract void setComment(String comment)
Specified by:
setComment in interface Page

getOwner

public abstract String getOwner()
Description copied from interface: Page
Get the owner of the page

Specified by:
getOwner in interface Page
Returns:

setOwner

public abstract void setOwner(String owner)

getAuthor

public abstract String getAuthor()
Description copied from interface: Page
The Author is changed when any part of the document changes (content, attachments).

Specified by:
getAuthor in interface Page

getCreatedDate

public abstract Date getCreatedDate()
Description copied from interface: Page
The date when creating page.

Specified by:
getCreatedDate in interface Page

setCreatedDate

public abstract void setCreatedDate(Date date)

getUpdatedDate

public abstract Date getUpdatedDate()
Description copied from interface: Page
The date when any part of the document changes (content, attachments).

Specified by:
getUpdatedDate in interface Page

getURL

public abstract String getURL()
Description copied from interface: Page
get URL of page. The domain part of link can be fixed.

Specified by:
getURL in interface Page

setURL

public abstract void setURL(String url)
Description copied from interface: Page
set url

Specified by:
setURL in interface Page

getMovedMixin

public abstract MovedMixin getMovedMixin()

setMovedMixin

public abstract void setMovedMixin(MovedMixin move)

getRemovedMixin

public abstract RemovedMixin getRemovedMixin()

setRemovedMixin

public abstract void setRemovedMixin(RemovedMixin remove)

getRenamedMixin

public abstract RenamedMixin getRenamedMixin()

setRenamedMixin

public abstract void setRenamedMixin(RenamedMixin mix)

getWatchedMixin

public abstract WatchedMixin getWatchedMixin()

setWatchedMixin

public abstract void setWatchedMixin(WatchedMixin mix)

createWatchedMixin

protected abstract WatchedMixin createWatchedMixin()

makeWatched

public void makeWatched()

getVersionableMixinByChromattic

public abstract VersionableMixin getVersionableMixinByChromattic()

setVersionableMixinByChromattic

protected abstract void setVersionableMixinByChromattic(VersionableMixin mix)

createVersionableMixin

protected abstract VersionableMixin createVersionableMixin()

getVersionableMixin

public VersionableMixin getVersionableMixin()
Description copied from interface: Page
get Versionable Mixin

Specified by:
getVersionableMixin in interface Page
Returns:
Versionable Mixin

makeVersionable

public void makeVersionable()

checkin

public NTVersion checkin()
                  throws Exception
Throws:
Exception

checkout

public void checkout()
              throws Exception
Throws:
Exception

restore

public void restore(String versionName,
                    boolean removeExisting)
             throws Exception
Throws:
Exception

createAttachment

public abstract AttachmentImpl createAttachment()

createAttachment

public AttachmentImpl createAttachment(String fileName,
                                       org.chromattic.ext.ntdef.Resource contentResource)
                                throws Exception
Throws:
Exception

getAttachmentsByChromattic

public abstract Collection<AttachmentImpl> getAttachmentsByChromattic()

getAttachments

public Collection<AttachmentImpl> getAttachments()
Description copied from interface: Page
Get the attachments of this page

Specified by:
getAttachments in interface Page
Returns:

getAttachmentsExcludeContent

public Collection<AttachmentImpl> getAttachmentsExcludeContent()
                                                        throws Exception
Throws:
Exception

getAttachment

public AttachmentImpl getAttachment(String attachmentId)
                             throws Exception
Throws:
Exception

addAttachment

public void addAttachment(AttachmentImpl attachment)
                   throws org.chromattic.api.DuplicateNameException
Throws:
org.chromattic.api.DuplicateNameException

removeAttachment

public void removeAttachment(String attachmentId)
                      throws Exception
Throws:
Exception

getParentPage

public abstract PageImpl getParentPage()
Description copied from interface: Page
get the parent page

Specified by:
getParentPage in interface Page
Returns:
the parent page

setParentPage

public abstract void setParentPage(PageImpl page)

getTrash

public abstract Trash getTrash()

setTrash

public abstract void setTrash(Trash trash)

getChildrenContainer

protected abstract Map<String,PageImpl> getChildrenContainer()

getChildPages

public Map<String,PageImpl> getChildPages()
                                   throws Exception
Throws:
Exception

getChildrenByRootPermission

public Map<String,PageImpl> getChildrenByRootPermission()
                                                 throws Exception
Throws:
Exception

getOverridePermission

public abstract boolean getOverridePermission()

setOverridePermission

public abstract void setOverridePermission(boolean isOverridePermission)

hasPermission

public boolean hasPermission(PermissionType permissionType)
                      throws Exception
Specified by:
hasPermission in interface Page
Throws:
Exception

hasPermission

public boolean hasPermission(PermissionType permissionType,
                             org.exoplatform.services.security.Identity user)
                      throws Exception
Description copied from interface: Page
Check if user has permisison on page or not

Specified by:
hasPermission in interface Page
Parameters:
permissionType - The type of permisison to check PermissionType}
user - The user to check
Returns:
User has permisison on page or not
Throws:
Exception

getPermission

public HashMap<String,String[]> getPermission()
                                       throws Exception
Description copied from interface: Page
Get map of permission of page

Specified by:
getPermission in interface Page
Returns:
Throws:
Exception

setPermission

public void setPermission(HashMap<String,String[]> permissions)
                   throws Exception
Description copied from interface: Page
Set permission to page

Specified by:
setPermission in interface Page
Throws:
Exception

setNonePermission

public void setNonePermission()
                       throws Exception
Description copied from interface: Page
Reset page permisison

Specified by:
setNonePermission in interface Page
Throws:
Exception

addPage

protected void addPage(String pageName,
                       Page page)

addWikiPage

public void addWikiPage(Page page)
Description copied from interface: Page
Add a wiki page as child page

Specified by:
addWikiPage in interface Page

addPublicPage

public void addPublicPage(Page page)
                   throws Exception
Description copied from interface: Page
Add a public wiki page

Specified by:
addPublicPage in interface Page
Throws:
Exception

getWikiPage

public PageImpl getWikiPage(String pageId)
                     throws Exception
Throws:
Exception

getWiki

public Wiki getWiki()
Description copied from interface: Page
get Wiki of page

Specified by:
getWiki in interface Page
Returns:
Wiki of page

getWikiHome

public WikiHome getWikiHome()

isMinorEdit

public boolean isMinorEdit()

setMinorEdit

public void setMinorEdit(boolean isMinorEdit)
Description copied from interface: Page
set alow page minor edit or not

Specified by:
setMinorEdit in interface Page

remove

public abstract void remove()
Description copied from interface: Page
Detroy wiki page

Specified by:
remove in interface Page

addRelatedPage

public String addRelatedPage(PageImpl page)
                      throws Exception
add a related page

Parameters:
page -
Returns:
uuid of node of related page if add successfully.
null if add failed.
Throws:
NullPointerException - if the param is null
Exception - when any error occurs.

getRelatedPages

public List<PageImpl> getRelatedPages()
                               throws Exception
Throws:
Exception

removeRelatedPage

public String removeRelatedPage(PageImpl page)
                         throws Exception
remove a specified related page.

Parameters:
page -
Returns:
uuid of node if related page is removed successfully
null if removing failed.
Throws:
Exception - when an error is thrown.

getReferredUUIDs

public Map<String,javax.jcr.Value> getReferredUUIDs()
                                             throws Exception
get reference uuids of current page

Returns:
Map map of referred uuids of current page
Throws:
Exception - when an error is thrown.

removeAllRelatedPages

public void removeAllRelatedPages()
                           throws Exception
Throws:
Exception


Copyright © 2013 eXo Platform SAS. All Rights Reserved.