public class BaseConfigurationService extends Object implements ConfigurationService, Observer
SEARCHABLE_DATABASES| Constructor and Description |
|---|
BaseConfigurationService() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addListToStringBuilder(StringBuilder buf,
List list,
int indent,
int indentIncrement) |
protected void |
addMapToStringBuilder(StringBuilder buf,
Map map,
int indent,
int indentIncrement) |
void |
destroy() |
protected SecurityAdvisor |
enableSecurityAdvisor()
Establish a security advisor to allow the "embedded" azg work to occur
with no need for additional security permissions.
|
String |
getAdminSiteName() |
Collection<String> |
getAllCategoryXml() |
String |
getConfigFolder() |
String |
getConfigFolderId() |
String |
getConfigFolderReference() |
SiteOsidConfiguration |
getConfigurationHandler(String osidConfigHandler)
Return a SiteOsidConfiguration instance
|
protected String |
getConfigurationParameter(String parameter)
Get a named value from the site-specific XML configuration file
|
String |
getConfigurationXml()
Fetch the appropriate XML configuration document for this user
|
String |
getConfigXmlCache() |
String |
getDatabaseHierarchyXml()
Fetch the appropriate XML database hierarchy document for this user
|
String |
getDatabaseXml() |
String |
getDatabaseXmlCache() |
String |
getExtendedRepositoryId() |
String |
getExternalSearchUrl() |
String |
getGoogleBaseUrl() |
String |
getGoogleSearchEnabled() |
List<String> |
getGroupIds()
Fetch this user's group affiliations
|
String |
getLibrarySearchEnabled() |
String |
getMetasearchBaseUrl() |
String |
getMetasearchPassword() |
String |
getMetasearchUsername() |
String |
getOpenUrlLabel() |
String |
getOpenUrlResolverAddress() |
String |
getOsidConfig() |
String |
getOsidImpl() |
String |
getSakaiServerKey() |
Map<String,List<Map<String,String>>> |
getSaveciteClients() |
List<Map<String,String>> |
getSaveciteClientsForLocale(Locale locale) |
String |
getSecondsBetweenSaveciteRefreshes() |
ServerConfigurationService |
getServerConfigurationService() |
SessionManager |
getSessionManager() |
String |
getSiteConfigExtendedRepositoryId()
Fetch the site specific extended Repository ID
|
String |
getSiteConfigGoogleBaseUrl()
Fetch the Google base-URL
|
int |
getSiteConfigMaximumSearchableDBs()
Get the maximum number of databases we can search at one time
|
String |
getSiteConfigMetasearchBaseUrl()
Fetch the meta-search base-URL
|
String |
getSiteConfigMetasearchPassword()
Fetch the meta-search password
|
String |
getSiteConfigMetasearchUsername()
Fetch the meta-search username
|
String |
getSiteConfigOpenUrlLabel()
Fetch the OpenURL label
|
String |
getSiteConfigOpenUrlResolverAddress()
Fetch the OpenURL resolver address
|
String |
getSiteConfigOsidPackageName()
Fetch the site specific Repository OSID package name
|
String |
getSiteConfigPreferredUrlPrefix()
Prefix string for "preferred" URLs (when used as title or related links).
|
String |
getSiteConfigSakaiServerKey()
Fetch the Sakai server key
|
String |
getSiteConfigUsePreferredUrls()
How should we use URLs marked as "preferred" by the OSID implementation?
|
String |
getSiteConfigXml() |
protected SiteOsidConfiguration |
getSiteOsidConfiguration()
Load and initialize the site-specific OSID configuration code
|
protected String |
getText(Document root,
String elementName)
Get the text associated with this element
|
protected String |
getText(Element root,
String elementName)
Get the text associated with this element
|
protected DocumentBuilder |
getXmlDocumentBuilder()
Get a DOM Document builder.
|
void |
init() |
boolean |
isAllowSiteBySiteOverride()
Is the Citations Helper enabled site-by-site?
|
boolean |
isCitationsEnabledByDefault()
Is the Citations Helper [potentially] available for all sites?
|
boolean |
isConfigurationXmlAvailable()
Is the configuration XML file provided and readable
|
boolean |
isDatabaseHierarchyXmlAvailable()
Is the database hierarchy XML file provided and readable
|
boolean |
isExternalSerarchEnabled() |
boolean |
isGoogleScholarEnabled()
Is Google search enabled?
|
boolean |
isLibrarySearchEnabled()
Is library search enabled for any users?
|
boolean |
librarySearchEnabled()
Is library search enabled for the current user?
|
protected String |
normalizeText(String original,
String update)
"Normalize" XML text node content to create a simple string
|
protected Document |
parseXmlFromStream(InputStream stream)
Parse an XML resource
|
void |
populateConfig(String configurationXml,
InputStream stream)
Populate cached values from a configuration XML resource.
|
protected void |
saveParameter(Document document,
Map parameterMap,
String name)
Lookup and save one dynamic configuration parameter
|
protected void |
saveServletClientMappings(Document document) |
void |
setAdminSiteName(String adminSiteName) |
void |
setAllowSiteBySiteOverride(boolean allowSiteBySiteOverride)
Enable/disable site by site Citations Helper override
|
void |
setCitationsEnabledByDefault(boolean citationsEnabledByDefault)
Enable/disable Citations Helper by default
|
void |
setConfigFolder(String configFolder) |
void |
setConfigXmlCache(String configXml) |
void |
setDatabaseXml(String databaseXml) |
void |
setDatabaseXmlCache(String categoriesXml) |
void |
setExtendedRepositoryId(String extendedRepositoryId) |
void |
setExternalSearchEnabled(boolean state) |
void |
setExternalSearchUrl(String url) |
void |
setGoogleBaseUrl(String googleBaseUrl) |
void |
setGoogleScholarEnabled(boolean state)
Enable/disable Google support (no support for site specific XML configuration)
|
void |
setGoogleSearchEnabled(String googleSearchEnabled) |
void |
setLibrarySearchEnabled(boolean state)
Enable/disable library search support (no support for site specific XML configuration)
|
void |
setLibrarySearchEnabled(String librarySearchEnabled) |
void |
setMetasearchBaseUrl(String baseUrl) |
void |
setMetasearchPassword(String password) |
void |
setMetasearchUsername(String username) |
void |
setOpenUrlLabel(String openUrlLabel) |
void |
setOpenUrlResolverAddress(String openUrlResolverAddress) |
void |
setOsidConfig(String osidConfig) |
void |
setOsidImpl(String osidImpl) |
void |
setSakaiServerKey(String sakaiId) |
void |
setSaveciteClients(Map<String,List<Map<String,String>>> saveciteClients) |
void |
setServerConfigurationService(ServerConfigurationService serverConfigurationService) |
void |
setSessionManager(SessionManager sessionManager) |
void |
setSiteConfigXml(String siteConfigXml) |
void |
update(Observable arg0,
Object arg1)
Called when an observed object chnages (@see java.util.Observer#update)
|
protected void |
updateConfig(String configFileRef)
Update configuration data from an XML resource
|
public static final String DEFAULT_SECONDS_BETWEEN_SAVECITE_REFRESHES
public static final int MAXIMUM_SECONDS_BETWEEN_SAVECITE_REFRESHES
public static final String PARAM_SECONDS_BETWEEN_SAVECITE_REFRESHES
protected boolean m_citationsEnabledByDefault
protected boolean m_allowSiteBySiteOverride
protected String m_googleSearchEnabled
protected String m_librarySearchEnabled
protected boolean m_externalSearchEnabled
protected String m_adminSiteName
protected String m_configFolder
protected String m_configXml
protected String m_categoriesXml
protected String m_databaseXml
protected String m_siteConfigXml
protected String m_metasearchUsername
protected String m_metasearchPassword
protected String m_metasearchBaseUrl
protected String m_osidImpl
protected String m_extendedRepositoryId
protected String m_openUrlLabel
protected String m_openUrlResolverAddress
protected String m_googleBaseUrl
protected String m_sakaiServerKey
protected String m_externalSearchUrl
protected String m_osidConfig
protected SessionManager m_sessionManager
protected ServerConfigurationService m_serverConfigurationService
protected static String m_configListRef
public String getConfigurationXml() throws OsidConfigurationException
getConfigurationXml in interface ConfigurationServiceOsidConfigurationExceptionpublic boolean isConfigurationXmlAvailable()
isConfigurationXmlAvailable in interface ConfigurationServicepublic String getConfigFolderReference()
getConfigFolderReference in interface ConfigurationServicepublic String getConfigFolderId()
getConfigFolderId in interface ConfigurationServicepublic String getDatabaseHierarchyXml() throws OsidConfigurationException
getDatabaseHierarchyXml in interface ConfigurationServiceOsidConfigurationExceptionpublic boolean isDatabaseHierarchyXmlAvailable()
isDatabaseHierarchyXmlAvailable in interface ConfigurationServicepublic List<String> getGroupIds() throws OsidConfigurationException
getGroupIds in interface ConfigurationServiceOsidConfigurationExceptionpublic String getSiteConfigOsidPackageName()
getSiteConfigOsidPackageName in interface ConfigurationServicepublic String getSiteConfigExtendedRepositoryId()
getSiteConfigExtendedRepositoryId in interface ConfigurationServicepublic String getSiteConfigMetasearchUsername()
getSiteConfigMetasearchUsername in interface ConfigurationServicepublic String getSiteConfigMetasearchPassword()
getSiteConfigMetasearchPassword in interface ConfigurationServicepublic String getSiteConfigMetasearchBaseUrl()
getSiteConfigMetasearchBaseUrl in interface ConfigurationServicepublic String getSiteConfigOpenUrlLabel()
getSiteConfigOpenUrlLabel in interface ConfigurationServicepublic String getSiteConfigOpenUrlResolverAddress()
getSiteConfigOpenUrlResolverAddress in interface ConfigurationServicepublic String getSiteConfigGoogleBaseUrl()
getSiteConfigGoogleBaseUrl in interface ConfigurationServicepublic String getSiteConfigSakaiServerKey()
getSiteConfigSakaiServerKey in interface ConfigurationServicepublic int getSiteConfigMaximumSearchableDBs()
getSiteConfigMaximumSearchableDBs in interface ConfigurationServiceSEARCHABLE_DATABASES
if no other value is specified)public String getSiteConfigUsePreferredUrls()
getSiteConfigUsePreferredUrls in interface ConfigurationServicepublic String getSiteConfigPreferredUrlPrefix()
getSiteConfigPreferredUrlPrefix in interface ConfigurationServicepublic void setCitationsEnabledByDefault(boolean citationsEnabledByDefault)
setCitationsEnabledByDefault in interface ConfigurationServicestate - true to set default 'On'public boolean isCitationsEnabledByDefault()
isCitationsEnabledByDefault in interface ConfigurationServicepublic void setAllowSiteBySiteOverride(boolean allowSiteBySiteOverride)
setAllowSiteBySiteOverride in interface ConfigurationServicestate - true to enable site by site Citations Helperpublic boolean isAllowSiteBySiteOverride()
isAllowSiteBySiteOverride in interface ConfigurationServicepublic void setGoogleScholarEnabled(boolean state)
setGoogleScholarEnabled in interface ConfigurationServicestate - true to enable Google supportpublic boolean isGoogleScholarEnabled()
isGoogleScholarEnabled in interface ConfigurationServicepublic void setLibrarySearchEnabled(boolean state)
setLibrarySearchEnabled in interface ConfigurationServicestate - true to enable supportpublic boolean isLibrarySearchEnabled()
isLibrarySearchEnabled in interface ConfigurationServiceprotected String getConfigurationParameter(String parameter)
parameter - Configuration parameter to lookupprotected SiteOsidConfiguration getSiteOsidConfiguration()
public SiteOsidConfiguration getConfigurationHandler(String osidConfigHandler) throws ClassNotFoundException, InstantiationException, IllegalAccessException
ClassNotFoundExceptionInstantiationExceptionIllegalAccessExceptionpublic void populateConfig(String configurationXml, InputStream stream)
configurationXml - Configuration resource name (this doubles as a
unique key into the configuration cache)protected void saveServletClientMappings(Document document)
protected void saveParameter(Document document, Map parameterMap, String name)
Configuration - XMLparameterMap - Parameter name=value pairsname - Parameter nameprotected Document parseXmlFromStream(InputStream stream)
filename - The filename (or URI) to parseprotected DocumentBuilder getXmlDocumentBuilder()
DomExceptionprotected String normalizeText(String original, String update)
original - Original textupdate - Text to add to the original string (a space separates the two)protected String getText(Document root, String elementName)
root - The document containing the text elementprotected String getText(Element root, String elementName)
root - The root node of the text elementpublic void init()
public void destroy()
public String getOsidImpl()
public void setOsidImpl(String osidImpl)
osidImpl - the OSID package namepublic String getExtendedRepositoryId()
public void setExtendedRepositoryId(String extendedRepositoryId)
extendedRepositoryId - the extended Repository IDpublic String getMetasearchUsername()
public void setMetasearchUsername(String username)
username - the m_metasearchUsername to setpublic String getMetasearchBaseUrl()
public void setMetasearchBaseUrl(String baseUrl)
baseUrl - the m_metasearchBaseUrl to setpublic String getMetasearchPassword()
public void setMetasearchPassword(String password)
password - the m_metasearchPassword to setpublic String getGoogleBaseUrl()
public void setGoogleBaseUrl(String googleBaseUrl)
googleBaseUrl - the base URL to setpublic String getSakaiServerKey()
public void setSakaiServerKey(String sakaiId)
sakaiServerKey - the sakaiServerKey to setpublic String getOpenUrlLabel()
public void setOpenUrlLabel(String openUrlLabel)
set - the OpenURL labelpublic String getOpenUrlResolverAddress()
public void setOpenUrlResolverAddress(String openUrlResolverAddress)
set - the OpenURL resolver addresspublic String getDatabaseXml()
public void setDatabaseXml(String databaseXml)
set - the database hierarchy XML filename/URIpublic String getSiteConfigXml()
public void setSiteConfigXml(String siteConfigXml)
set - the configuration XML filename/URIpublic ServerConfigurationService getServerConfigurationService()
public void setServerConfigurationService(ServerConfigurationService serverConfigurationService)
serverConfigurationService - the serverConfigurationService to setpublic void setSessionManager(SessionManager sessionManager)
sessionManager - the SessionManager to savepublic SessionManager getSessionManager()
public String getOsidConfig()
public void setOsidConfig(String osidConfig)
osidConfig - the site specific "OSID configuration" package namepublic String getGoogleSearchEnabled()
public void setGoogleSearchEnabled(String googleSearchEnabled)
googleSearchEnabled - ("true" or "false")public String getLibrarySearchEnabled()
public void setLibrarySearchEnabled(String librarySearchEnabled)
librarySearchEnabled - ("true" or "false")public String getAdminSiteName()
public void setAdminSiteName(String adminSiteName)
adminSiteName - the adminSiteName to setpublic String getConfigFolder()
public void setConfigFolder(String configFolder)
configFolder - the configFolder to setpublic String getConfigXmlCache()
public void setConfigXmlCache(String configXml)
configFile - the configFile to setpublic String getDatabaseXmlCache()
public void setDatabaseXmlCache(String categoriesXml)
categoriesXml - the categoriesXml to setpublic Map<String,List<Map<String,String>>> getSaveciteClients()
getSaveciteClients in interface ConfigurationServicepublic void setSaveciteClients(Map<String,List<Map<String,String>>> saveciteClients)
saveciteClients - the saveciteClients to setpublic List<Map<String,String>> getSaveciteClientsForLocale(Locale locale)
getSaveciteClientsForLocale in interface ConfigurationServiceprotected void addMapToStringBuilder(StringBuilder buf, Map map, int indent, int indentIncrement)
protected void addListToStringBuilder(StringBuilder buf, List list, int indent, int indentIncrement)
public Collection<String> getAllCategoryXml()
getAllCategoryXml in interface ConfigurationServicepublic void update(Observable arg0, Object arg1)
protected void updateConfig(String configFileRef)
configFileRef - XML configuration reference (/content/...)protected SecurityAdvisor enableSecurityAdvisor()
public boolean librarySearchEnabled()
librarySearchEnabled in interface ConfigurationServicepublic void setExternalSearchEnabled(boolean state)
setExternalSearchEnabled in interface ConfigurationServicepublic boolean isExternalSerarchEnabled()
isExternalSerarchEnabled in interface ConfigurationServicepublic void setExternalSearchUrl(String url)
setExternalSearchUrl in interface ConfigurationServicepublic String getExternalSearchUrl()
getExternalSearchUrl in interface ConfigurationServicepublic String getSecondsBetweenSaveciteRefreshes()
getSecondsBetweenSaveciteRefreshes in interface ConfigurationServiceCopyright © 2003–2017 The Sakai Foundation. All rights reserved.