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


Java ToolConfiguration.getToolId方法代码示例

本文整理汇总了Java中org.sakaiproject.site.api.ToolConfiguration.getToolId方法的典型用法代码示例。如果您正苦于以下问题:Java ToolConfiguration.getToolId方法的具体用法?Java ToolConfiguration.getToolId怎么用?Java ToolConfiguration.getToolId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.sakaiproject.site.api.ToolConfiguration的用法示例。


在下文中一共展示了ToolConfiguration.getToolId方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addSynopticTool

import org.sakaiproject.site.api.ToolConfiguration; //导入方法依赖的package包/类
private void addSynopticTool(SitePage page, String toolId,
		String toolTitle, String layoutHint, int position) {
	page.setLayout(SitePage.LAYOUT_DOUBLE_COL);
	
	// Add synoptic announcements tool
	ToolConfiguration tool = page.addTool();
	Tool reg = ToolManager.getTool(toolId);
	tool.setTool(toolId, reg);
	tool.setTitle(toolTitle);
	tool.setLayoutHints(layoutHint);
	
	// count how many synoptic tools in the second/right column
	int totalSynopticTools = 0;
	for (ToolConfiguration t : page.getTools())
	{
		if (t.getToolId() != null && SYNOPTIC_TOOL_ID_MAP.containsKey(t.getToolId()))
		{
			totalSynopticTools++;
		}
	}
	// now move the newly added synoptic tool to proper position
	for (int i=0; i< (totalSynopticTools-position-1);i++)
	{
		tool.moveUp();
	}
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:27,代码来源:SiteAction.java

示例2: render

import org.sakaiproject.site.api.ToolConfiguration; //导入方法依赖的package包/类
public RenderResult render(Portal portal, ToolConfiguration configuration,
		HttpServletRequest request, HttpServletResponse response,
		ServletContext context) throws IOException
{

	for (Iterator i = renderServices.iterator(); i.hasNext();)
	{
		ToolRenderService trs = (ToolRenderService) i.next();
		if (trs.accept(portal, configuration, request, response, context))
		{
			log.debug("Rendering with " + trs);
			return trs.render(portal, configuration, request, response, context);
		}
	}
	throw new ToolRenderException("No available Tool Render Service for the tool "
			+ configuration.getToolId());
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:18,代码来源:CompatibilityToolRenderService.java

示例3: saveToolConfigTx

import org.sakaiproject.site.api.ToolConfiguration; //导入方法依赖的package包/类
/**
 * The transactino code for saving a tool config.
 */
protected void saveToolConfigTx(ToolConfiguration tool)
{
	// delete this tool and tool properties
	Object fields[] = new Object[2];
	fields[0] = caseId(tool.getSiteId());
	fields[1] = caseId(tool.getId());

	String statement = siteServiceSql.getDeleteToolPropertySql();
	m_sql.dbWrite(statement, fields);

	statement = siteServiceSql.getDeleteToolSql();
	m_sql.dbWrite(statement, fields);

	// write the tool
	statement = siteServiceSql.getInsertToolSql();

	fields = new Object[7];
	fields[0] = tool.getId();
	fields[1] = tool.getPageId();
	fields[2] = caseId(tool.getSiteId());
	fields[3] = tool.getToolId();
	fields[4] = Integer.valueOf(tool.getPageOrder());
	fields[5] = tool.getTitle();
	fields[6] = tool.getLayoutHints();
	m_sql.dbWrite(statement, fields);

	// write the tool's properties
	writeProperties("SAKAI_SITE_TOOL_PROPERTY", "TOOL_ID", tool.getId(), "SITE_ID", caseId(tool.getSiteId()), tool.getPlacementConfig());
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:33,代码来源:DbSiteService.java

示例4: checkBufferBypass

import org.sakaiproject.site.api.ToolConfiguration; //导入方法依赖的package包/类
public boolean checkBufferBypass(HttpServletRequest req, ToolConfiguration siteTool)
{
	String uri = req.getRequestURI();
	String commonToolId = siteTool.getToolId();
	boolean matched = false;
	// Check the URL for a pattern match
	String pattern = null;
	Pattern p = null;
	Matcher m = null;
	pattern = ServerConfigurationService .getString(LEGACY_BYPASS_URL_PROP, DEFAULT_BYPASS_URL);
	pattern = ServerConfigurationService .getString(BYPASS_URL_PROP, pattern);
	pattern = ServerConfigurationService .getString(LEGACY_BYPASS_URL_PROP+"."+commonToolId, pattern);
	pattern = ServerConfigurationService .getString(BYPASS_URL_PROP+"."+commonToolId, pattern);
	if ( pattern.length() > 1 ) {
		p = Pattern.compile(pattern);
		m = p.matcher(uri.toLowerCase());
		if ( m.find() ) {
			matched = true;
		}
	}

	// Check the query string for a pattern match
	pattern = ServerConfigurationService .getString(LEGACY_BYPASS_QUERY_PROP, DEFAULT_BYPASS_QUERY);
	pattern = ServerConfigurationService .getString(BYPASS_QUERY_PROP, pattern);
	pattern = ServerConfigurationService .getString(LEGACY_BYPASS_QUERY_PROP+"."+commonToolId, pattern);
	pattern = ServerConfigurationService .getString(BYPASS_QUERY_PROP+"."+commonToolId, pattern);
	String queryString = req.getQueryString();
	if ( queryString == null ) queryString = "";
	if ( pattern.length() > 1 ) {
		p = Pattern.compile(pattern);
		m = p.matcher(queryString.toLowerCase());
		if ( m.find() ) {
			matched = true;
		}
	}

	// wicket-ajax request can not be buffered (PRFL-405)
	if (Boolean.valueOf(req.getHeader("wicket-ajax"))) {
		matched = true;
	}
	return matched;
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:43,代码来源:SiteHandler.java

示例5: BaseToolConfiguration

import org.sakaiproject.site.api.ToolConfiguration; //导入方法依赖的package包/类
/**
 * Construct as a copy of another.
 * 
 * @param other
 *        The other to copy.
 * @param page
 *        The page in which this tool lives.
 * @param exact
 *        If true, we copy ids - else we generate a new one.
 */
protected BaseToolConfiguration(BaseSiteService siteService, ToolConfiguration other, SitePage page, boolean exact)
{
	this.siteService = siteService;
	m_page = page;
	BaseToolConfiguration bOther = (BaseToolConfiguration) other;

	if (exact)
	{
		m_id = other.getId();
	}
	else
	{
		m_id = siteService.idManager().createUuid();
	}
	m_toolId = other.getToolId();
	m_tool = other.getTool();
	m_title = other.getTitle();
	m_layoutHints = other.getLayoutHints();
	m_pageId = bOther.m_pageId;
	m_pageOrder = bOther.m_pageOrder;
	m_custom_title = getTitleCustom(page);

	m_siteId = getContainingPage().getContainingSite().getId();
	m_skin = bOther.m_skin;

	Hashtable h = other.getPlacementConfig();
	// exact copying of ToolConfiguration items vs replacing occurence of
	// site id within item value, depending on "exact" setting -zqian
	if (exact)
	{
		m_config.putAll(other.getPlacementConfig());
	}
	else
	{
		for (Enumeration e = h.keys(); e.hasMoreElements();)
		{
			// replace site id string inside configuration
			String pOtherConfig = (String) e.nextElement();
			String pOtherConfigValue = (String) h.get(pOtherConfig);
			m_config.put(pOtherConfig, pOtherConfigValue.replaceAll(bOther
					.getSiteId(), m_siteId));
		}
	}
	m_configLazy = bOther.m_configLazy;
	setPageCategory();
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:57,代码来源:BaseToolConfiguration.java


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