/********************************************************************************** * $URL: https://source.sakaiproject.org/svn/search/trunk/search-impl/impl/src/test/org/sakaiproject/search/mock/MockServerConfigurationService.java $ * $Id: MockServerConfigurationService.java 122143 2013-04-03 19:10:10Z azeckoski@unicon.net $ *********************************************************************************** * * Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008 The Sakai Foundation * * Licensed under the Educational Community License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.opensource.org/licenses/ECL-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * **********************************************************************************/ package org.sakaiproject.search.mock; import java.util.List; import java.util.Map; import java.util.Locale; import org.sakaiproject.component.api.ServerConfigurationService; /** * @author ieb * */ public class MockServerConfigurationService implements ServerConfigurationService { private String instanceName = "testserverid"; /* (non-Javadoc) * @see org.sakaiproject.component.api.ServerConfigurationService#getAccessPath() */ public String getAccessPath() { return null; } /* (non-Javadoc) * @see org.sakaiproject.component.api.ServerConfigurationService#getAccessUrl() */ public String getAccessUrl() { return null; } /* (non-Javadoc) * @see org.sakaiproject.component.api.ServerConfigurationService#getBoolean(java.lang.String, boolean) */ public boolean getBoolean(String name, boolean dflt) { return false; } /* (non-Javadoc) * @see org.sakaiproject.component.api.ServerConfigurationService#getDefaultTools(java.lang.String) */ public List getDefaultTools(String category) { return null; } /* (non-Javadoc) * @see org.sakaiproject.component.api.ServerConfigurationService#getGatewaySiteId() */ public String getGatewaySiteId() { return null; } /* (non-Javadoc) * @see org.sakaiproject.component.api.ServerConfigurationService#getHelpUrl(java.lang.String) */ public String getHelpUrl(String helpContext) { return null; } /* (non-Javadoc) * @see org.sakaiproject.component.api.ServerConfigurationService#getInt(java.lang.String, int) */ public int getInt(String name, int dflt) { return 0; } /* (non-Javadoc) * @see org.sakaiproject.component.api.ServerConfigurationService#getLoggedOutUrl() */ public String getLoggedOutUrl() { return null; } /* (non-Javadoc) * @see org.sakaiproject.component.api.ServerConfigurationService#getPortalUrl() */ public String getPortalUrl() { return null; } /* (non-Javadoc) * @see org.sakaiproject.component.api.ServerConfigurationService#getSakaiHomePath() */ public String getSakaiHomePath() { return null; } /* (non-Javadoc) * @see org.sakaiproject.component.api.ServerConfigurationService#getServerId() */ public String getServerId() { return instanceName; } /* (non-Javadoc) * @see org.sakaiproject.component.api.ServerConfigurationService#getServerIdInstance() */ public String getServerIdInstance() { return null; } /* (non-Javadoc) * @see org.sakaiproject.component.api.ServerConfigurationService#getServerInstance() */ public String getServerInstance() { return null; } /* (non-Javadoc) * @see org.sakaiproject.component.api.ServerConfigurationService#getServerName() */ public String getServerName() { return null; } /* (non-Javadoc) * @see org.sakaiproject.component.api.ServerConfigurationService#getServerUrl() */ public String getServerUrl() { return "http://something:8080/"; } /* (non-Javadoc) * @see org.sakaiproject.component.api.ServerConfigurationService#getRawProperties(java.lang.String) */ public String getRawProperty(String name) { return getString(name); } /* (non-Javadoc) * @see org.sakaiproject.component.api.ServerConfigurationService#getString(java.lang.String) */ public String getString(String name) { if ( "search.enable".equals(name) ) { return "true"; } if ( "search.indexbuild".equals(name) ) { return "true"; } return null; } /* (non-Javadoc) * @see org.sakaiproject.component.api.ServerConfigurationService#getString(java.lang.String, java.lang.String) */ public String getString(String name, String dflt) { if ( "search.enable".equals(name) ) { return "true"; } if ( "search.indexbuild".equals(name) ) { return "true"; } return dflt; } /* (non-Javadoc) * @see org.sakaiproject.component.api.ServerConfigurationService#getStrings(java.lang.String) */ public String[] getStrings(String name) { return null; } /* (non-Javadoc) * @see org.sakaiproject.component.api.ServerConfigurationService#getToolCategories(java.lang.String) */ public List<String> getToolCategories(String category) { return null; } /* (non-Javadoc) * @see org.sakaiproject.component.api.ServerConfigurationService#getToolCategoriesAsMap(java.lang.String) */ public Map<String, List<String>> getToolCategoriesAsMap(String category) { return null; } /* (non-Javadoc) * @see org.sakaiproject.component.api.ServerConfigurationService#getToolOrder(java.lang.String) */ public List getToolOrder(String category) { return null; } /* (non-Javadoc) * @see org.sakaiproject.component.api.ServerConfigurationService#getToolToCategoryMap(java.lang.String) */ public Map<String, String> getToolToCategoryMap(String category) { return null; } /* (non-Javadoc) * @see org.sakaiproject.component.api.ServerConfigurationService#getToolUrl() */ public String getToolUrl() { return null; } /* * Returns true if selected tool is contained in pre-initialized list of selected items * @parms toolId id of the selected tool */ public boolean toolGroupIsSelected(String groupName, String toolId) { return false; } /* * Returns true if selected tool is contained in pre-initialized list of required items * @parms toolId id of the selected tool */ public boolean toolGroupIsRequired(String groupName, String toolId) { return false; } /** * Access the list of groups by category (site type) * * @param category * The tool category * @return An ordered list of tool ids (String) indicating the desired tool display order, or an empty list if there are none for this category. */ public List getCategoryGroups(String category){ return null; } /** * Access the list of tools by group * * @param category * The tool category * @return An unordered list of tool ids (String) in selected group, or an empty list if there are none for this category. */ public List getToolGroup(String category) { return null; } /* (non-Javadoc) * @see org.sakaiproject.component.api.ServerConfigurationService#getToolsRequired(java.lang.String) */ public List getToolsRequired(String category) { return null; } /* (non-Javadoc) * @see org.sakaiproject.component.api.ServerConfigurationService#getUserHomeUrl() */ public String getUserHomeUrl() { return null; } /** * @param instanceName */ public void setInstanceName(String instanceName) { this.instanceName = instanceName; } public <T> T getConfig(String name, T defaultValue) { return null; } public ConfigItem getConfigItem(String name) { return null; } public ConfigData getConfigData() { return null; } public ConfigItem registerConfigItem(ConfigItem configItem) { return null; } public void registerListener(ConfigurationListener configurationListener) { } public Locale[] getSakaiLocales() { return new Locale[] {Locale.getDefault()}; } public Locale getLocaleFromString(String localeString) { return Locale.getDefault(); } }