本文整理汇总了Java中org.sakaiproject.component.cover.ServerConfigurationService.getString方法的典型用法代码示例。如果您正苦于以下问题:Java ServerConfigurationService.getString方法的具体用法?Java ServerConfigurationService.getString怎么用?Java ServerConfigurationService.getString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.sakaiproject.component.cover.ServerConfigurationService
的用法示例。
在下文中一共展示了ServerConfigurationService.getString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: adjustCssSkinFolder
import org.sakaiproject.component.cover.ServerConfigurationService; //导入方法依赖的package包/类
/**
* Captures the (yes) overly complex rules for the skin folder naming convention
*
* @param <code>skinFolder</code>
* The folder where the skins are to be found.
* @return <code>skinFolder</code> The adjusted folder where the skins can be found.
*/
public static String adjustCssSkinFolder(String skinFolder)
{
if (skinFolder == null)
{
skinFolder = ServerConfigurationService.getString("skin.default");
if ( skinFolder == null ) skinFolder = ""; // Not likely - not good if it happens
}
String prefix = ServerConfigurationService.getString(PORTAL_SKIN_NEOPREFIX_PROPERTY, PORTAL_SKIN_NEOPREFIX_DEFAULT);
if (prefix == null) prefix = "";
String templates = ServerConfigurationService.getString("portal.templates", "neoskin");
if ( "neoskin".equals(templates) && !skinFolder.startsWith(prefix) ) skinFolder = prefix + skinFolder;
return skinFolder;
}
示例2: doLogout
import org.sakaiproject.component.cover.ServerConfigurationService; //导入方法依赖的package包/类
/**
* Process a logout
*
* @param req
* Request object
* @param res
* Response object
* @param session
* Current session
* @param returnPath
* if not null, the path to use for the end-user browser redirect
* after the logout is complete. Leave null to use the configured
* logged out URL.
* @throws IOException
*/
public void doLogout(HttpServletRequest req, HttpServletResponse res,
Session session, String returnPath) throws ToolException
{
// SAK-16370 to allow multiple logout urls
String loggedOutUrl = null;
String userType = UserDirectoryService.getCurrentUser().getType();
if(userType == null) {
loggedOutUrl = ServerConfigurationService.getLoggedOutUrl();
} else {
loggedOutUrl = ServerConfigurationService.getString("loggedOutUrl." + userType, ServerConfigurationService.getLoggedOutUrl());
}
if ( returnPath != null )
{
loggedOutUrl = loggedOutUrl + returnPath;
}
session.setAttribute(Tool.HELPER_DONE_URL, loggedOutUrl);
ActiveTool tool = ActiveToolManager.getActiveTool("sakai.login");
String context = req.getContextPath() + req.getServletPath() + "/logout";
tool.help(req, res, context, "/logout");
}
示例3: getActiveBannersJSON
import org.sakaiproject.component.cover.ServerConfigurationService; //导入方法依赖的package包/类
private String getActiveBannersJSON() {
JSONArray banners = new JSONArray();
String serverId = ServerConfigurationService.getString("serverId", "localhost");
User currentUser = UserDirectoryService.getCurrentUser();
if (currentUser != null && currentUser.getId() != null && !"".equals(currentUser.getId())) {
for (Banner banner : getBanners().getRelevantBanners(serverId, currentUser.getId())) {
try {
JSONObject bannerData = new JSONObject();
bannerData.put("id", banner.getUuid());
bannerData.put("message", banner.getMessage());
bannerData.put("dismissible", banner.isDismissible());
bannerData.put("dismissed", banner.isDismissed());
bannerData.put("type", banner.getType());
banners.add(bannerData);
} catch (Exception e) {
log.warn("Error processing banner: " + banner, e);
}
}
}
return banners.toJSONString();
}
示例4: getCssToolBase
import org.sakaiproject.component.cover.ServerConfigurationService; //导入方法依赖的package包/类
/**
* Returns a URL for the tool_base.css suitable for putting in an href= field.
*
* @return <code>cssToolBase</code> URL for the tool_base.css
*/
public static String getCssToolBase()
{
String skinRepo = ServerConfigurationService.getString("skin.repo");
String cssToolBase = skinRepo + "/tool_base.css";
return cssToolBase;
}
示例5: getCssToolSkin
import org.sakaiproject.component.cover.ServerConfigurationService; //导入方法依赖的package包/类
/**
* Returns a URL for the tool.css suitable for putting in an href= field.
*
* @param <code>skinFolder</code>
* where the tool.css skin lives for this site.
* @return <code>cssToolSkin</code> URL for the tool.css
*/
public static String getCssToolSkin(String skinFolder)
{
skinFolder = adjustCssSkinFolder(skinFolder);
String skinRepo = ServerConfigurationService.getString("skin.repo");
String cssToolSkin = skinRepo + "/" + skinFolder + "/tool.css";
return cssToolSkin;
}
示例6: ForumsEmailService
import org.sakaiproject.component.cover.ServerConfigurationService; //导入方法依赖的package包/类
/**
* Creates a new SamigoEmailService object.
*/
public ForumsEmailService(List<String> toEmailAddress, Message reply,
DiscussionMessageBean currthread) {
this.toEmailAddress = filterMailAddresses(toEmailAddress);
this.reply = reply;
this.prefixedPath = ServerConfigurationService.getString(
"forum.email.prefixedPath", System.getProperty("java.io.tmpdir"));
this.threadhead = currthread;
}
示例7: SamigoEmailService
import org.sakaiproject.component.cover.ServerConfigurationService; //导入方法依赖的package包/类
/**
* Creates a new SamigoEmailService object.
*/
public SamigoEmailService(String fromName, String fromEmailAddress, String toName, String toEmailAddress,
ArrayList toEmailAddressList, String ccMe, String subject, String message) {
this.fromName = fromName;
this.fromEmailAddress = fromEmailAddress;
this.toName = toName;
this.toEmailAddress = toEmailAddress;
this.toEmailAddressList = toEmailAddressList;
this.ccMe = ccMe;
this.subject = subject;
this.message = message;
this.smtpServer = ServerConfigurationService.getString("samigo.smtp.server");
this.smtpPort = ServerConfigurationService.getString("samigo.smtp.port");
this.prefixedPath = ServerConfigurationService.getString("samigo.email.prefixedPath");
}
示例8: doHelp
import org.sakaiproject.component.cover.ServerConfigurationService; //导入方法依赖的package包/类
public void doHelp(HttpServletRequest req, HttpServletResponse res, Session session,
String toolContextPath, String toolPathInfo) throws ToolException,
IOException
{
// permission check - none
// get the detault skin
String skin = ServerConfigurationService.getString("skin.default");
// find the tool registered for this
ActiveTool tool = ActiveToolManager.getActiveTool("sakai.help");
if (tool == null)
{
portal.doError(req, res, session, Portal.ERROR_WORKSITE);
return;
}
// form a placement based on ... help TODO: is this enough?
// Note: the placement is transient, but will always have the same id
// and (null) context
org.sakaiproject.util.Placement placement = new org.sakaiproject.util.Placement(
"help", tool.getId(), tool, null, null, null);
portal
.forwardTool(tool, req, res, placement, skin, toolContextPath,
toolPathInfo);
}
示例9: getAutoSaveRepeatMilliseconds
import org.sakaiproject.component.cover.ServerConfigurationService; //导入方法依赖的package包/类
public String getAutoSaveRepeatMilliseconds()
{
String s = ServerConfigurationService.getString("samigo.autoSave.repeat.milliseconds");
try {
Integer.parseInt(s);
}
catch (NumberFormatException ex) {
s = "-1";
}
log.debug("auto save every {} milliseconds", s);
return s;
}
示例10: handleCASAList
import org.sakaiproject.component.cover.ServerConfigurationService; //导入方法依赖的package包/类
private void handleCASAList(HttpServletRequest request, HttpServletResponse response)
{
ArrayList<Application> apps = new ArrayList<Application>();
String allowedToolsConfig = ServerConfigurationService.getString("basiclti.provider.allowedtools", "");
String[] allowedTools = allowedToolsConfig.split(":");
List<String> allowedToolsList = Arrays.asList(allowedTools);
for (String toolId : allowedToolsList) {
Application app = SakaiCASAUtil.getCASAEntry(toolId);
if ( app == null ) {
log.warn("Could not produce CASA entry for {}", toolId);
continue;
}
apps.add(app);
}
try {
response.setCharacterEncoding("UTF-8");
response.setContentType("application/json");
PrintWriter out = response.getWriter();
out.write(JacksonUtil.prettyPrint(apps));
}
catch (Exception e) {
log.error(e.getMessage(), e);
}
}
示例11: getLocalizedURL
import org.sakaiproject.component.cover.ServerConfigurationService; //导入方法依赖的package包/类
/** Construct and return localized filepath, if it exists
**/
private String getLocalizedURL(String property) {
String filename = ServerConfigurationService.getString(property);
if ( filename == null || filename.trim().length()==0 )
return filename;
else
filename = filename.trim();
int extIndex = filename.lastIndexOf(".") >= 0 ? filename.lastIndexOf(".") : filename.length()-1;
String ext = filename.substring(extIndex);
String doc = filename.substring(0,extIndex);
Locale locale = new ResourceLoader().getLocale();
// You can only access inside the current context in Tomcat 8.
// Tomcat 8 advises against unpacking the WARs so this isn't a good long term solution.
String rootPath = getPortletConfig().getPortletContext().getRealPath("/");
if (locale != null){
// check if localized file exists for current language/locale/variant
String localizedFile = doc + "_" + locale.toString() + ext;
String filePath = rootPath+ ".."+localizedFile;
if ( (new File(filePath)).exists() )
return localizedFile;
// otherwise, check if localized file exists for current language
localizedFile = doc + "_" + locale.getLanguage() + ext;
filePath = rootPath+ ".."+localizedFile;
if ( (new File(filePath)).exists() )
return localizedFile;
}
return filename;
}
示例12: getBlobImage
import org.sakaiproject.component.cover.ServerConfigurationService; //导入方法依赖的package包/类
public Blob getBlobImage()
{
if (this.jpegPhoto == null || jpegPhoto.length < 1 || ServerConfigurationService.getString("profile.photoRepositoryPath", null) != null)
{
return null;
}
try {
return new SerialBlob(this.jpegPhoto);
} catch (SQLException e) {
log.warn(e.getMessage(), e);
return null;
}
}
示例13: loadPreferences
import org.sakaiproject.component.cover.ServerConfigurationService; //导入方法依赖的package包/类
/**
* This could eventually be loaded from persistence or from the framework
*/
protected void loadPreferences() {
assignmentSortAscending = true;
assignmentSortColumn = GradebookAssignment.DEFAULT_SORT;
categorySortAscending = true;
categorySortColumn = Category.SORT_BY_NAME;
rosterTableSortAscending = true;
rosterTableSortColumn = SORT_BY_NAME;
assignmentDetailsTableSortAscending = true;
assignmentDetailsTableSortColumn = SORT_BY_NAME;
courseGradeDetailsTableSortAscending = true;
courseGradeDetailsTableSortColumn = SORT_BY_NAME;
assignmentDetailsTableSelectedSectionFilter = new Integer(EnrollmentTableBean.ALL_SECTIONS_SELECT_VALUE);
rosterTableSelectedSectionFilter = new Integer(EnrollmentTableBean.ALL_SECTIONS_SELECT_VALUE);
defaultMaxDisplayedScoreRows = 50;
String defaultMaxDisplayedScoreRowsSakaiProp = ServerConfigurationService.getString("gradebook.defaultMaxDisplayedScoreRows");
if(defaultMaxDisplayedScoreRowsSakaiProp != null){
try{
int defaultMaxDisplayedScoreRowsSakaiPropInt = Integer.parseInt(defaultMaxDisplayedScoreRowsSakaiProp);
if(defaultMaxDisplayedScoreRowsSakaiPropInt == 5 ||
defaultMaxDisplayedScoreRowsSakaiPropInt == 10 ||
defaultMaxDisplayedScoreRowsSakaiPropInt == 15 ||
defaultMaxDisplayedScoreRowsSakaiPropInt == 20 ||
defaultMaxDisplayedScoreRowsSakaiPropInt == 50 ||
defaultMaxDisplayedScoreRowsSakaiPropInt == 100 ||
defaultMaxDisplayedScoreRowsSakaiPropInt == 0){
defaultMaxDisplayedScoreRows = defaultMaxDisplayedScoreRowsSakaiPropInt;
}
}catch (Exception e) {
//integer parse issue, bad property
}
}
}
示例14: init
import org.sakaiproject.component.cover.ServerConfigurationService; //导入方法依赖的package包/类
/**
* Initialize the servlet.
*
* @param config
* The servlet config.
* @throws ServletException
*/
public void init(ServletConfig config) throws ServletException
{
super.init(config);
log.info("init()");
defaultReturnUrl = ServerConfigurationService.getString("portalPath", "/portal");
}
示例15: includeSiteNav
import org.sakaiproject.component.cover.ServerConfigurationService; //导入方法依赖的package包/类
protected void includeSiteNav(PortalRenderContext rcontext, HttpServletRequest req,
Session session, String siteId)
{
if (session.getUserId() != null) {
refreshAutoFavorites(session);
}
if (rcontext.uses(INCLUDE_SITE_NAV))
{
boolean loggedIn = session.getUserId() != null;
boolean topLogin = ServerConfigurationService.getBoolean("top.login", true);
String accessibilityURL = ServerConfigurationService
.getString("accessibility.url");
rcontext.put("siteNavHasAccessibilityURL", Boolean
.valueOf((accessibilityURL != null && !accessibilityURL.equals(""))));
rcontext.put("siteNavAccessibilityURL", accessibilityURL);
// rcontext.put("siteNavSitAccessability",
// Web.escapeHtml(rb.getString("sit_accessibility")));
// rcontext.put("siteNavSitJumpContent",
// Web.escapeHtml(rb.getString("sit_jumpcontent")));
// rcontext.put("siteNavSitJumpTools",
// Web.escapeHtml(rb.getString("sit_jumptools")));
// rcontext.put("siteNavSitJumpWorksite",
// Web.escapeHtml(rb.getString("sit_jumpworksite")));
rcontext.put("siteNavTopLogin", Boolean.valueOf(topLogin));
rcontext.put("siteNavLoggedIn", Boolean.valueOf(loggedIn));
try
{
if (loggedIn)
{
includeLogo(rcontext, req, session, siteId);
includeTabs(rcontext, req, session, siteId, getUrlFragment(), false);
}
else
{
includeLogo(rcontext, req, session, siteId);
if (portal.getSiteHelper().doGatewaySiteList())
includeTabs(rcontext, req, session, siteId, getUrlFragment(),
false);
}
}
catch (Exception any)
{
}
}
}