本文整理汇总了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();
}
}
示例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());
}
示例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());
}
示例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;
}
示例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();
}