001: package org.sakaiproject.citation.cover;
002:
003: import org.sakaiproject.component.cover.ComponentManager;
004:
005: public class SearchManager {
006: private static org.sakaiproject.citation.api.SearchManager m_instance;
007:
008: /**
009: * Access the component instance: special cover only method.
010: *
011: * @return the component instance.
012: */
013: public static org.sakaiproject.citation.api.SearchManager getInstance() {
014: if (ComponentManager.CACHE_COMPONENTS) {
015: if (m_instance == null)
016: m_instance = (org.sakaiproject.citation.api.SearchManager) ComponentManager
017: .get(org.sakaiproject.citation.api.SearchManager.class);
018: return m_instance;
019: } else {
020: return (org.sakaiproject.citation.api.SearchManager) ComponentManager
021: .get(org.sakaiproject.citation.api.SearchManager.class);
022: }
023: }
024:
025: public static org.sakaiproject.citation.api.ActiveSearch doNextPage(
026: org.sakaiproject.citation.api.ActiveSearch search)
027: throws org.sakaiproject.citation.util.api.SearchException {
028: org.sakaiproject.citation.api.SearchManager instance = getInstance();
029: if (instance == null) {
030: return null;
031: }
032:
033: return instance.doNextPage(search);
034: }
035:
036: public static org.sakaiproject.citation.api.ActiveSearch doPrevPage(
037: org.sakaiproject.citation.api.ActiveSearch search)
038: throws org.sakaiproject.citation.util.api.SearchException {
039: org.sakaiproject.citation.api.SearchManager instance = getInstance();
040: if (instance == null) {
041: return null;
042: }
043:
044: return instance.doPrevPage(search);
045: }
046:
047: public static org.sakaiproject.citation.api.ActiveSearch doSearch(
048: org.sakaiproject.citation.api.ActiveSearch search)
049: throws org.sakaiproject.citation.util.api.SearchException {
050: org.sakaiproject.citation.api.SearchManager instance = getInstance();
051: if (instance == null) {
052: return null;
053: }
054:
055: return instance.doSearch(search);
056: }
057:
058: public static org.sakaiproject.citation.api.SearchDatabaseHierarchy getSearchHierarchy()
059: throws org.sakaiproject.citation.util.api.SearchException {
060: org.sakaiproject.citation.api.SearchManager instance = getInstance();
061: if (instance == null) {
062: return null;
063: }
064:
065: return instance.getSearchHierarchy();
066: }
067:
068: public static org.sakaiproject.citation.api.ActiveSearch newSearch() {
069: org.sakaiproject.citation.api.SearchManager instance = getInstance();
070: if (instance == null) {
071: return null;
072: }
073:
074: return instance.newSearch();
075: }
076:
077: /**
078: * @param collection
079: * @return
080: */
081: public static org.sakaiproject.citation.api.ActiveSearch newSearch(
082: org.sakaiproject.citation.api.CitationCollection savedResults) {
083: org.sakaiproject.citation.api.SearchManager instance = getInstance();
084: if (instance == null) {
085: return null;
086: }
087:
088: return instance.newSearch(savedResults);
089: }
090:
091: public static void setDatabaseIds(String[] databaseIds) {
092: org.sakaiproject.citation.api.SearchManager instance = getInstance();
093: if (instance != null) {
094: instance.setDatabaseIds(databaseIds);
095: }
096: }
097:
098: public static String getGoogleScholarUrl(String resourceId) {
099: org.sakaiproject.citation.api.SearchManager instance = getInstance();
100: if (instance == null) {
101: return null;
102: }
103:
104: return instance.getGoogleScholarUrl(resourceId);
105: }
106: }
|