org.exoplatform.forum.common.jcr
Class KSDataLocation

java.lang.Object
  extended by org.exoplatform.forum.common.jcr.KSDataLocation

public class KSDataLocation
extends Object

This class is meant to be the starting for any data storage access in KS.
Provides all JCR pathes usable in KS JCR data storage.
A JCRSessionManager accessible by getSessionManager() is configured on the appropriate repository and workspace.
Relies on NodeHierarchyCreator to initialize the structure and provide pathes aliases.

Version:
$Revision$
Author:
Patrice Lamarque

Nested Class Summary
static interface KSDataLocation.Locations
          Location names for KS data storage
 
Field Summary
static String DEFAULT_REPOSITORY_NAME
          Default repository name used if none is specified
static String DEFAULT_WORKSPACE_NAME
          Default workspace name used if none is specified
static String WORKSPACE_PARAM
          Parameter name use to designate the name of the workspace in the repository where the data is stored.
 
Constructor Summary
KSDataLocation(org.exoplatform.container.xml.InitParams params, org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator creator, org.exoplatform.services.jcr.RepositoryService repositoryService)
          Creates a new KSDataLocation and initializes pathes.
KSDataLocation(String workspace)
           
KSDataLocation(String workspace, org.exoplatform.services.jcr.RepositoryService repositoryService)
          Mainly used for tests
 
Method Summary
 String getAdministrationLocation()
           
 String getAvatarsLocation()
           
 String getBanIPLocation()
           
 String getBBCodesLocation()
           
 String getFaqCategoriesLocation()
           
 String getFaqHomeLocation()
           
 String getFaqSettingsLocation()
           
 String getFaqTemplatesLocation()
           
 String getFaqUserSettingsLocation()
           
 String getForumBanIPLocation()
           
 String getForumCategoriesLocation()
           
 String getForumDataLocation()
           
 String getForumHomeLocation()
           
 String getForumStatisticsLocation()
           
 String getForumSystemLocation()
           
protected  String getPath(String locationName)
          Get a jcr path by location name.
 String getRepository()
           
 org.exoplatform.services.jcr.RepositoryService getRepositoryService()
           
 SessionManager getSessionManager()
           
 String getStatisticsLocation()
           
 String getTagsLocation()
           
 String getUserProfilesLocation()
           
 String getUserSubscriptionLocation(String userId)
          Return the location of forum subscriptions for a given user
 String getWorkspace()
           
 void setLocation(DataLocationPlugin plugin)
          Change the storage location.
 void setSessionManager(SessionManager manager)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

WORKSPACE_PARAM

public static final String WORKSPACE_PARAM
Parameter name use to designate the name of the workspace in the repository where the data is stored. Should be passed in constructor's InitParams

See Also:
Constant Field Values

DEFAULT_REPOSITORY_NAME

public static final String DEFAULT_REPOSITORY_NAME
Default repository name used if none is specified

See Also:
Constant Field Values

DEFAULT_WORKSPACE_NAME

public static final String DEFAULT_WORKSPACE_NAME
Default workspace name used if none is specified

See Also:
Constant Field Values
Constructor Detail

KSDataLocation

public KSDataLocation(org.exoplatform.container.xml.InitParams params,
                      org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator creator,
                      org.exoplatform.services.jcr.RepositoryService repositoryService)
Creates a new KSDataLocation and initializes pathes.

Parameters:
params - #REPOSITORY_PARAM and WORKSPACE_PARAM are expected as value-param
creator - used to resolve path names. It is also declared here to ensure that the data structure has been initalized before.

KSDataLocation

public KSDataLocation(String workspace,
                      org.exoplatform.services.jcr.RepositoryService repositoryService)
Mainly used for tests

Parameters:
workspace -

KSDataLocation

public KSDataLocation(String workspace)
Method Detail

setLocation

public void setLocation(DataLocationPlugin plugin)
Change the storage location. Note that pathes are not reset

Parameters:
plugin - plugin defining repository and workspace location for the data storage

getPath

protected String getPath(String locationName)
Get a jcr path by location name.

Parameters:
locationName - name of the location such a defined in KSDataLocation.Locations
Returns:
jcr path corresponding the alias name in NodeHierarchyCreator. If the creator was not set, returns the locationName. The path returned is relative to root (no leading '/')

getRepository

public String getRepository()

getRepositoryService

public org.exoplatform.services.jcr.RepositoryService getRepositoryService()

getWorkspace

public String getWorkspace()

getSessionManager

public SessionManager getSessionManager()

setSessionManager

public void setSessionManager(SessionManager manager)

getForumHomeLocation

public String getForumHomeLocation()
Returns:
root path for Forum data

getForumDataLocation

public String getForumDataLocation()
Returns:
root path for forum user data

getForumSystemLocation

public String getForumSystemLocation()
Returns:
root path for Forum internal data

getBanIPLocation

public String getBanIPLocation()
Returns:
root path for global bans

getStatisticsLocation

public String getStatisticsLocation()
Returns:
root path for all statistics

getAdministrationLocation

public String getAdministrationLocation()
Returns:
root path for forum settings

getUserProfilesLocation

public String getUserProfilesLocation()
Returns:
root path for forum user profiles

getForumCategoriesLocation

public String getForumCategoriesLocation()
Returns:
root path for forum categories

getTagsLocation

public String getTagsLocation()
Returns:
root path for all tags

getAvatarsLocation

public String getAvatarsLocation()
Returns:
root path for all user avatars

getForumBanIPLocation

public String getForumBanIPLocation()
Returns:
root path for forum bans

getBBCodesLocation

public String getBBCodesLocation()
Returns:
root path for all BBCodes

getFaqHomeLocation

public String getFaqHomeLocation()
Returns:
root path for FAQ

getFaqSettingsLocation

public String getFaqSettingsLocation()
Returns:
location for FAQ settings

getFaqUserSettingsLocation

public String getFaqUserSettingsLocation()
Returns:
root path for all user settings

getFaqCategoriesLocation

public String getFaqCategoriesLocation()
Returns:
root path for FAQ cateogries

getFaqTemplatesLocation

public String getFaqTemplatesLocation()
Returns:
path where FAQ templates are stored

getForumStatisticsLocation

public String getForumStatisticsLocation()
Returns:
path where forum statistics are stored

toString

public String toString()
Overrides:
toString in class Object

getUserSubscriptionLocation

public String getUserSubscriptionLocation(String userId)
Return the location of forum subscriptions for a given user

Parameters:
userId - user id
Returns:


Copyright © 2003–2014 eXo Platform SAS. All rights reserved.