PageRenderTime 39ms CodeModel.GetById 13ms RepoModel.GetById 1ms app.codeStats 0ms

/citations/trunk/citations-api/api/src/java/org/sakaiproject/citation/api/ConfigurationService.java

https://bitbucket.org/botimer/sakaitrunk
Java | 285 lines | 45 code | 40 blank | 200 comment | 0 complexity | 230fe8a173db9f2dbb7d556218569aea MD5 | raw file
Possible License(s): Apache-2.0
  1. /**********************************************************************************
  2. * $URL:
  3. * $Id:
  4. ***********************************************************************************
  5. *
  6. * Copyright (c) 2006, 2007, 2008 The Sakai Foundation
  7. *
  8. * Licensed under the Educational Community License, Version 2.0 (the "License");
  9. * you may not use this file except in compliance with the License.
  10. * You may obtain a copy of the License at
  11. *
  12. * http://www.osedu.org/licenses/ECL-2.0
  13. *
  14. * Unless required by applicable law or agreed to in writing, software
  15. * distributed under the License is distributed on an "AS IS" BASIS,
  16. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  17. * See the License for the specific language governing permissions and
  18. * limitations under the License.
  19. *
  20. **********************************************************************************/
  21. package org.sakaiproject.citation.api;
  22. import java.util.Collection;
  23. import java.util.List;
  24. import java.util.Locale;
  25. import java.util.Map;
  26. import org.sakaiproject.citation.util.api.OsidConfigurationException;
  27. /**
  28. * Repository OSID configuration
  29. */
  30. public interface ConfigurationService
  31. {
  32. /**
  33. * Maximum number of databases to be searched at one time.
  34. *
  35. * Eight is the value used in the original implementation - it's compatible
  36. * with both the Ex Libris Xserver and the Sirsi Web2 Bridge.
  37. */
  38. public static final int SEARCHABLE_DATABASES = 8;
  39. /**
  40. * Fetch the appropriate XML configuration document for this user
  41. * @return Configuration XML (eg file:///tomcat-home/sakai/config.xml)
  42. */
  43. public String getConfigurationXml() throws OsidConfigurationException;
  44. /**
  45. * Is the configuration XML file provided and readable
  46. * @return true If the XML file is provided and readable, false otherwise
  47. */
  48. public boolean isConfigurationXmlAvailable();
  49. /**
  50. * Fetch the appropriate XML database hierarchy document for this user
  51. * @return Hierarchy XML (eg file:///tomcat-home/sakai/database.xml)
  52. */
  53. public String getDatabaseHierarchyXml() throws OsidConfigurationException;
  54. /**
  55. * Fetch the identifiers for all XML database hierarchy documents known
  56. * to the ConfigurationService.
  57. * @return Hierarchy XML (eg file:///tomcat-home/sakai/database.xml)
  58. */
  59. public Collection<String> getAllCategoryXml();
  60. /**
  61. * Is the database hierarchy XML file provided and readable
  62. * @return true If the XML file is provided and readable, false otherwise
  63. */
  64. public boolean isDatabaseHierarchyXmlAvailable();
  65. /**
  66. * Fetch the reference string for the folder in ContentHosting containing
  67. * the config files, or null if access from CHS is not enabled.
  68. * @return the reference string (eg /content/group/citationsAdmin/config/)
  69. */
  70. public String getConfigFolderReference();
  71. /**
  72. * Fetch the collection-id for the folder in ContentHosting containing
  73. * the config files, or null if access from CHS is not enabled.
  74. * @return the resource-id string (eg /group/citationsAdmin/config/)
  75. */
  76. public String getConfigFolderId();
  77. /**
  78. * Fetch this user's group affiliations
  79. * @return A list of group IDs (empty if no IDs exist)
  80. */
  81. public List<String> getGroupIds() throws OsidConfigurationException;
  82. /**
  83. * Fetch the site specific Repository OSID package name
  84. * @return Repository Package (eg org.sakaibrary.osid.repository.xserver)
  85. */
  86. public String getSiteConfigOsidPackageName();
  87. /**
  88. * Fetch the site specific extended Repository ID
  89. * @return The Repository ID
  90. */
  91. public String getSiteConfigExtendedRepositoryId();
  92. /**
  93. * Fetch the meta-search username
  94. * @return the username
  95. */
  96. public String getSiteConfigMetasearchUsername();
  97. /**
  98. * Fetch the meta-search password
  99. * @return the username
  100. */
  101. public String getSiteConfigMetasearchPassword();
  102. /**
  103. * Fetch the meta-search base-URL
  104. * @return the base URL
  105. */
  106. public String getSiteConfigMetasearchBaseUrl();
  107. /**
  108. * Fetch the OpenURL label
  109. * @return the label text
  110. */
  111. public String getSiteConfigOpenUrlLabel();
  112. /**
  113. * Fetch the OpenURL resolver address
  114. * @return the address (domain name or IP)
  115. */
  116. public String getSiteConfigOpenUrlResolverAddress();
  117. /**
  118. * Fetch the Google base-URL
  119. * @return the URL
  120. */
  121. public String getSiteConfigGoogleBaseUrl();
  122. /**
  123. * Fetch the Sakai server key
  124. * @return the key text
  125. */
  126. public String getSiteConfigSakaiServerKey();
  127. /**
  128. * How should we use "preferred" URLs found by Library Search?
  129. * @return "false", "related-link", or "title-link"
  130. */
  131. public String getSiteConfigUsePreferredUrls();
  132. /**
  133. * Prefix string for "preferred" URLs (when used as title or related links).
  134. *
  135. * This is likely to be the proxy information for the direct URL.
  136. *
  137. * @return The prefix String (null if none)
  138. */
  139. public String getSiteConfigPreferredUrlPrefix();
  140. /**
  141. * Get the maximum number of databases we can search at one time
  142. */
  143. public int getSiteConfigMaximumSearchableDBs();
  144. /**
  145. * Enable/disable Citations Helper by default
  146. * @param state true to set default 'On'
  147. */
  148. public void setCitationsEnabledByDefault(boolean state);
  149. /**
  150. * Is Citations Helper by default enabled?
  151. * @return true if so
  152. */
  153. public boolean isCitationsEnabledByDefault();
  154. /**
  155. * Enable/disable site by site Citations Helper override
  156. * @param state true to enable site by site Citations Helper
  157. */
  158. public void setAllowSiteBySiteOverride(boolean state);
  159. /**
  160. * Is site by site Citations Helper enabled?
  161. * @return true if so
  162. */
  163. public boolean isAllowSiteBySiteOverride();
  164. /**
  165. * Enable/disable Google support
  166. * @param state true to enable Google support
  167. */
  168. public void setGoogleScholarEnabled(boolean state);
  169. /**
  170. * Is Google search enabled?
  171. * @return true if so
  172. */
  173. public boolean isGoogleScholarEnabled();
  174. /**
  175. * Enable/disable library search support
  176. * @param state true to enable support
  177. */
  178. public void setLibrarySearchEnabled(boolean state);
  179. /**
  180. * Is library search enabled for any users?
  181. * @return true if so
  182. */
  183. public boolean isLibrarySearchEnabled();
  184. /**
  185. * Is library search enabled for the current user?
  186. * @return true if so
  187. */
  188. public boolean librarySearchEnabled();
  189. /**
  190. * Enable/disable the external search support.
  191. * @param state true to enable support.
  192. */
  193. public void setExternalSearchEnabled(boolean state);
  194. /**
  195. * Is the external search support enabled.
  196. * @return true if so
  197. */
  198. public boolean isExternalSerarchEnabled();
  199. /**
  200. * Set the URL which the external search is deployed on.
  201. * @param url
  202. */
  203. public void setExternalSearchUrl(String url);
  204. /**
  205. * Get the current URL for the external search.
  206. * @return
  207. */
  208. public String getExternalSearchUrl();
  209. /**
  210. * Accesses the mapping for savecite clients. Keys in the mapping will be locale identifiers, and
  211. * values will be a list of clients, where each client is a Map<String,String> object with key-value
  212. * pairs for significant settings for a search source. The keys should include the following to fully
  213. * configure a search source:
  214. * <ul>
  215. * <li>id, where the value is an identifer that is unique within this list of clients (i.e. within
  216. * the list of clients defined for the current locale.</li>
  217. * <li>searchurl_base - The base URL used to access the search source. This should NOT include a
  218. * separator ('?') or any request parameters. One or two query parameters will be added to the base
  219. * URL - linkurl_base and linkurl_id. The value of the linkurl_base will be the URL for the savecite
  220. * servlet in this sakai instance (See {@link org.sakaiproject.citation.api.SearchManager.getSaveciteUrl(String, String)}). The linkurl_id, if provided, is an identifer used by the search
  221. * source to identify this sakai instance.</li>
  222. * <li>linkurl_id - A short string that, if present, is included as the value for the "linkurl_id" query
  223. * parameter as described above.</li>
  224. * <li>searchurl_label - A short string that will be used as the label on the button that launches
  225. * a search in the search source.</li>
  226. * <li>searchurl_description - A description of the search to help users choose which search to use.</li>
  227. * <li>return_label - The label that will appear on a button in the confirmation dialog that users will
  228. * see after saving a citation from search results. This button takes the user back to the search results
  229. * in the same window.</li>
  230. * <li>close_label - The label that will appear on a button in the confirmation dialog seen by users
  231. * after saving a citation from the search results. This button closes the window in which the search
  232. * results were shown, effectively returning the user to the "add citation" dialog in the main window.</li>
  233. * <li>window_width - the width in pixels of the dialog in which the search source will be shown.</li>
  234. * <li>window_height - the height in pixels of the dialog in which the search source will be shown.</li>
  235. * </ul>
  236. * @return
  237. */
  238. public Map<String, List<Map<String,String>>> getSaveciteClients();
  239. /**
  240. *
  241. * @param locale
  242. * @return
  243. */
  244. public List<Map<String, String>> getSaveciteClientsForLocale(Locale locale);
  245. }