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()
Fetch the identifiers for all XML database hierarchy documents known
to the ConfigurationService.
|
String |
getConfigFolder() |
String |
getConfigFolderId()
Fetch the collection-id for the folder in ContentHosting containing
the config files, or null if access from CHS is not enabled.
|
String |
getConfigFolderReference()
Fetch the reference string for the folder in ContentHosting containing
the config files, or null if access from CHS is not enabled.
|
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()
Get the current URL for the external search.
|
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()
Accesses the mapping for savecite clients.
|
List<Map<String,String>> |
getSaveciteClientsForLocale(Locale locale) |
String |
getSecondsBetweenSaveciteRefreshes()
Access the current setting for the number of seconds between AJAX requests to check for updates
of the main window during a session searching for citations in a savecite client window.
|
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()
Is the external search support enabled.
|
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)
Enable/disable the external search support.
|
void |
setExternalSearchUrl(String url)
Set the URL which the external search is deployed on.
|
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 ConfigurationService
OsidConfigurationException
public boolean isConfigurationXmlAvailable()
isConfigurationXmlAvailable
in interface ConfigurationService
public String getConfigFolderReference()
ConfigurationService
getConfigFolderReference
in interface ConfigurationService
public String getConfigFolderId()
ConfigurationService
getConfigFolderId
in interface ConfigurationService
public String getDatabaseHierarchyXml() throws OsidConfigurationException
getDatabaseHierarchyXml
in interface ConfigurationService
OsidConfigurationException
public boolean isDatabaseHierarchyXmlAvailable()
isDatabaseHierarchyXmlAvailable
in interface ConfigurationService
public List<String> getGroupIds() throws OsidConfigurationException
getGroupIds
in interface ConfigurationService
OsidConfigurationException
public String getSiteConfigOsidPackageName()
getSiteConfigOsidPackageName
in interface ConfigurationService
public String getSiteConfigExtendedRepositoryId()
getSiteConfigExtendedRepositoryId
in interface ConfigurationService
public String getSiteConfigMetasearchUsername()
getSiteConfigMetasearchUsername
in interface ConfigurationService
public String getSiteConfigMetasearchPassword()
getSiteConfigMetasearchPassword
in interface ConfigurationService
public String getSiteConfigMetasearchBaseUrl()
getSiteConfigMetasearchBaseUrl
in interface ConfigurationService
public String getSiteConfigOpenUrlLabel()
getSiteConfigOpenUrlLabel
in interface ConfigurationService
public String getSiteConfigOpenUrlResolverAddress()
getSiteConfigOpenUrlResolverAddress
in interface ConfigurationService
public String getSiteConfigGoogleBaseUrl()
getSiteConfigGoogleBaseUrl
in interface ConfigurationService
public String getSiteConfigSakaiServerKey()
getSiteConfigSakaiServerKey
in interface ConfigurationService
public int getSiteConfigMaximumSearchableDBs()
getSiteConfigMaximumSearchableDBs
in interface ConfigurationService
SEARCHABLE_DATABASES
if no other value is specified)public String getSiteConfigUsePreferredUrls()
getSiteConfigUsePreferredUrls
in interface ConfigurationService
public String getSiteConfigPreferredUrlPrefix()
getSiteConfigPreferredUrlPrefix
in interface ConfigurationService
public void setCitationsEnabledByDefault(boolean citationsEnabledByDefault)
setCitationsEnabledByDefault
in interface ConfigurationService
state
- true to set default 'On'public boolean isCitationsEnabledByDefault()
isCitationsEnabledByDefault
in interface ConfigurationService
public void setAllowSiteBySiteOverride(boolean allowSiteBySiteOverride)
setAllowSiteBySiteOverride
in interface ConfigurationService
state
- true to enable site by site Citations Helperpublic boolean isAllowSiteBySiteOverride()
isAllowSiteBySiteOverride
in interface ConfigurationService
public void setGoogleScholarEnabled(boolean state)
setGoogleScholarEnabled
in interface ConfigurationService
state
- true to enable Google supportpublic boolean isGoogleScholarEnabled()
isGoogleScholarEnabled
in interface ConfigurationService
public void setLibrarySearchEnabled(boolean state)
setLibrarySearchEnabled
in interface ConfigurationService
state
- true to enable supportpublic boolean isLibrarySearchEnabled()
isLibrarySearchEnabled
in interface ConfigurationService
protected String getConfigurationParameter(String parameter)
parameter
- Configuration parameter to lookupprotected SiteOsidConfiguration getSiteOsidConfiguration()
public SiteOsidConfiguration getConfigurationHandler(String osidConfigHandler) throws ClassNotFoundException, InstantiationException, IllegalAccessException
ClassNotFoundException
InstantiationException
IllegalAccessException
public 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()
DomException
protected 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()
ConfigurationService
org.sakaiproject.citation.api.SearchManager.getSaveciteUrl(String, String)
). The linkurl_id, if provided, is an identifer used by the search
source to identify this sakai instance.getSaveciteClients
in interface ConfigurationService
public void setSaveciteClients(Map<String,List<Map<String,String>>> saveciteClients)
saveciteClients
- the saveciteClients to setpublic List<Map<String,String>> getSaveciteClientsForLocale(Locale locale)
getSaveciteClientsForLocale
in interface ConfigurationService
protected 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()
ConfigurationService
getAllCategoryXml
in interface ConfigurationService
public 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 ConfigurationService
public void setExternalSearchEnabled(boolean state)
ConfigurationService
setExternalSearchEnabled
in interface ConfigurationService
state
- true to enable support.public boolean isExternalSerarchEnabled()
ConfigurationService
isExternalSerarchEnabled
in interface ConfigurationService
public void setExternalSearchUrl(String url)
ConfigurationService
setExternalSearchUrl
in interface ConfigurationService
public String getExternalSearchUrl()
ConfigurationService
getExternalSearchUrl
in interface ConfigurationService
public String getSecondsBetweenSaveciteRefreshes()
ConfigurationService
getSecondsBetweenSaveciteRefreshes
in interface ConfigurationService
Copyright © 2003–2019 The Sakai Foundation. All rights reserved.