当前位置: 首页>>代码示例>>Java>>正文


Java ServerConfigurationService.getString方法代码示例

本文整理汇总了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;
}
 
开发者ID:ITYug,项目名称:kaltura-ce-sakai-extension,代码行数:24,代码来源:CSSUtils.java

示例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");
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:39,代码来源:SkinnableCharonPortal.java

示例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();
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:25,代码来源:PASystemImpl.java

示例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;
}
 
开发者ID:ITYug,项目名称:kaltura-ce-sakai-extension,代码行数:12,代码来源:CSSUtils.java

示例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;
}
 
开发者ID:ITYug,项目名称:kaltura-ce-sakai-extension,代码行数:15,代码来源:CSSUtils.java

示例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;

}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:13,代码来源:ForumsEmailService.java

示例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");
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:18,代码来源:SamigoEmailService.java

示例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);
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:28,代码来源:HelpHandler.java

示例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;
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:13,代码来源:DeliveryBean.java

示例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);
               }
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:28,代码来源:ProviderServlet.java

示例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;
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:34,代码来源:PortletIFrame.java

示例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;
	}
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:14,代码来源:InetOrgPersonImpl.java

示例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
		}
       }
   }
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:43,代码来源:PreferencesBean.java

示例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"); 
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:15,代码来源:ContainerLogin.java

示例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)
		{
		}
	}
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:52,代码来源:SiteHandler.java


注:本文中的org.sakaiproject.component.cover.ServerConfigurationService.getString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。