org.olat.modules.wiki
Class WikiManager

java.lang.Object
  extended by org.olat.modules.wiki.WikiManager

public class WikiManager
extends java.lang.Object

Description:
This class handles several wiki's by storing them in a cache and also creates a new wikis. It handles also the file operation to persist the data in the wiki pages which are stored on the file system.

Initial Date: May 5, 2006

Author:
guido

Field Summary
static java.lang.String C_TIME
           
static java.lang.String FORUM_KEY
           
static java.lang.String INITIAL_AUTHOR
           
static java.lang.String M_TIME
           
static java.lang.String MODIFY_AUTHOR
           
static java.lang.String PAGENAME
           
static java.lang.String UPDATE_COMMENT
           
static java.lang.String VERSION
           
static java.lang.String VERSION_FOLDER_NAME
           
static java.lang.String VIEW_COUNT
           
static java.lang.String WIKI_FILE_SUFFIX
           
static java.lang.String WIKI_PROPERTIES_SUFFIX
           
static java.lang.String WIKI_RESOURCE_FOLDER_NAME
           
 
Constructor Summary
WikiManager()
           
 
Method Summary
static SubscriptionContext createTechnicalSubscriptionContextForCourse(CourseEnvironment cenv, WikiCourseNode wikiCourseNode)
          wiki subscription context for wikis in the course.
 FileResource createWiki()
           
 WikiMainController createWikiMainController(UserRequest ureq, WindowControl wControl, OLATResourceable ores, WikiSecurityCallback securityCallback, java.lang.String initialPageName)
           
 Controller createWikiMainControllerDisposeOnOres(UserRequest ureq, WindowControl wControl, OLATResourceable ores, WikiSecurityCallback securityCallback, java.lang.String initialPageName)
          brasato:::: to discuss, are two methods needed at all? probably not, unless there are cases to launch this controller without an ores known.
static java.lang.String generatePageId(java.lang.String pageName)
           
 DifferenceService getDiffService()
           
static WikiManager getInstance()
          return singleton
 OlatRootFolderImpl getMediaFolder(OLATResourceable ores)
          Return Media folder for uploading files.
 Wiki getOrLoadWiki(OLATResourceable ores)
           
 VFSContainer getWikiContainer(OLATResourceable ores, java.lang.String folderName)
           
 VFSContainer getWikiRootContainer(OLATResourceable ores)
          Returns the root-container for certain OLAT-resourceable.
 void updateWikiPageProperties(OLATResourceable ores, WikiPage page)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VIEW_COUNT

public static final java.lang.String VIEW_COUNT
See Also:
Constant Field Values

MODIFY_AUTHOR

public static final java.lang.String MODIFY_AUTHOR
See Also:
Constant Field Values

M_TIME

public static final java.lang.String M_TIME
See Also:
Constant Field Values

INITIAL_AUTHOR

public static final java.lang.String INITIAL_AUTHOR
See Also:
Constant Field Values

FORUM_KEY

public static final java.lang.String FORUM_KEY
See Also:
Constant Field Values

VERSION

public static final java.lang.String VERSION
See Also:
Constant Field Values

C_TIME

public static final java.lang.String C_TIME
See Also:
Constant Field Values

PAGENAME

public static final java.lang.String PAGENAME
See Also:
Constant Field Values

WIKI_RESOURCE_FOLDER_NAME

public static final java.lang.String WIKI_RESOURCE_FOLDER_NAME
See Also:
Constant Field Values

VERSION_FOLDER_NAME

public static final java.lang.String VERSION_FOLDER_NAME
See Also:
Constant Field Values

WIKI_FILE_SUFFIX

public static final java.lang.String WIKI_FILE_SUFFIX
See Also:
Constant Field Values

WIKI_PROPERTIES_SUFFIX

public static final java.lang.String WIKI_PROPERTIES_SUFFIX
See Also:
Constant Field Values

UPDATE_COMMENT

public static final java.lang.String UPDATE_COMMENT
See Also:
Constant Field Values
Constructor Detail

WikiManager

public WikiManager()
Method Detail

getInstance

public static WikiManager getInstance()
return singleton


createWikiMainController

public WikiMainController createWikiMainController(UserRequest ureq,
                                                   WindowControl wControl,
                                                   OLATResourceable ores,
                                                   WikiSecurityCallback securityCallback,
                                                   java.lang.String initialPageName)
Parameters:
ureq -
wControl -
ores - either an OlatResourcable of an repository entry or of an BusinessGroup
securityCallback - a callback to evaluate the permissions
initialPageName - opens the wiki with an certain page, default is the index page if null is passed
courseContext - - a course context or null if used outside a course
courseNodeContext - - a courseNode context or null if used outside a course
groupContext - - a BusinessGroup or null if not used in group context

createWikiMainControllerDisposeOnOres

public Controller createWikiMainControllerDisposeOnOres(UserRequest ureq,
                                                        WindowControl wControl,
                                                        OLATResourceable ores,
                                                        WikiSecurityCallback securityCallback,
                                                        java.lang.String initialPageName)
brasato:::: to discuss, are two methods needed at all? probably not, unless there are cases to launch this controller without an ores known. such as contentPackacking which requires only a fileroot (but this file directory depends on a ores in the end) create a wikiMaincontroller which disposes itself when the associated olatresourceable is disposed.


createWiki

public FileResource createWiki()
Returns:
the new created resource

getOrLoadWiki

public Wiki getOrLoadWiki(OLATResourceable ores)
Parameters:
ores -
Returns:
a wiki loaded from cache or the fileSystem

getDiffService

public DifferenceService getDiffService()

updateWikiPageProperties

public void updateWikiPageProperties(OLATResourceable ores,
                                     WikiPage page)
Parameters:
ores -
page -

generatePageId

public static java.lang.String generatePageId(java.lang.String pageName)
Parameters:
pageName -
Returns:

getWikiContainer

public VFSContainer getWikiContainer(OLATResourceable ores,
                                     java.lang.String folderName)
Parameters:
ores -
folderName -
Returns:
the Vfs container or null if not found

getWikiRootContainer

public VFSContainer getWikiRootContainer(OLATResourceable ores)
Returns the root-container for certain OLAT-resourceable.

Parameters:
ores -
Returns:

getMediaFolder

public OlatRootFolderImpl getMediaFolder(OLATResourceable ores)
Return Media folder for uploading files.

Parameters:
ores -
Returns:

createTechnicalSubscriptionContextForCourse

public static SubscriptionContext createTechnicalSubscriptionContextForCourse(CourseEnvironment cenv,
                                                                              WikiCourseNode wikiCourseNode)
wiki subscription context for wikis in the course.

Parameters:
cenv -
wikiCourseNode -
Returns: