private boolean isToolAlreadyAdded(SitePage homePage, String homeToolId) { for (ToolConfiguration tool : homePage.getTools()) { if (StringUtils.equals(tool.getToolId(), homeToolId)) { return true; } } return false; }
public boolean summarizePage(Map m, Site site, SitePage page) { List pTools = page.getTools(); Iterator iPt = pTools.iterator(); while (iPt.hasNext()) { ToolConfiguration placement = (ToolConfiguration) iPt.next(); if (summarizeTool(m, site, placement.getToolId())) { return true; } } return false; }
public List getSiteTools(String toolId, Site site) { List tools = new ArrayList(); List pages = site.getPages(); for (Iterator i = pages.iterator(); i.hasNext();) { SitePage page = (SitePage) i.next(); for (Iterator j = page.getTools().iterator(); j.hasNext();) { ToolConfiguration tool = (ToolConfiguration) j.next(); if (toolId == null) { tools.add(tool); } else if (toolId.equals(tool.getToolId())) { tools.add(tool); } } } return tools; }
/** * Captures the rules for the various tools and when they want a popup * * @param <code>pageTool</code> * The tools configuration object. * @return The url to be uded in the popup of null of there is no * tool-requested popup. */ public static String getToolPopupUrl(ToolConfiguration pageTool) { Properties pro = pageTool.getConfig(); String source = null; if ( "sakai.web.168".equals(pageTool.getToolId()) && "true".equals(pro.getProperty("popup")) ) { source = pro.getProperty("source"); } else if ( "sakai.iframe".equals(pageTool.getToolId()) && "true".equals(pro.getProperty("popup")) ) { source = pro.getProperty("source"); } else if ( "sakai.basiclti".equals(pageTool.getToolId()) && "on".equals(pro.getProperty("imsti.newpage")) ) { source = "/access/basiclti/site/"+pageTool.getContext()+"/"+pageTool.getId(); } return source; }
public boolean summarizePage(Map m, Site site, SitePage page) { List pTools = page.getTools(); Iterator iPt = pTools.iterator(); while (iPt.hasNext()) { ToolConfiguration placement = (ToolConfiguration) iPt.next(); if (summarizeTool(m, site, placement.getToolId())) { return true; } } return false; }
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()); }
public boolean allowBufferContent(HttpServletRequest req, Site site, ToolConfiguration siteTool) { String tidAllow = ServerConfigurationService.getString(LEGACY_IFRAME_SUPPRESS_PROP, IFRAME_SUPPRESS_DEFAULT); tidAllow = ServerConfigurationService.getString(IFRAME_SUPPRESS_PROP, tidAllow); if (tidAllow.indexOf(":none:") >= 0) return false; // JSR-168 portlets do not operate in iframes if ( portal.isPortletPlacement(siteTool) ) return false; // If the property is set and :all: is not specified, then the // tools in the list are the ones that we accept if (tidAllow.trim().length() > 0 && tidAllow.indexOf(":all:") < 0) { if (tidAllow.indexOf(siteTool.getToolId()) < 0) return false; } // If the property is set and :all: is specified, then the // tools in the list are the ones that we render the old way if (tidAllow.indexOf(":all:") >= 0) { if (tidAllow.indexOf(siteTool.getToolId()) >= 0) return false; } // Need to make sure the user is allowed to visit this tool ToolManager toolManager = (ToolManager) ComponentManager.get(ToolManager.class.getName()); boolean allowedUser = toolManager.allowTool(site, siteTool); if ( ! allowedUser ) return false; return true; }
public boolean allowBufferContent(HttpServletRequest req, Site site, ToolConfiguration siteTool) { String tidAllow = ServerConfigurationService.getString(LEGACY_IFRAME_SUPPRESS_PROP, IFRAME_SUPPRESS_DEFAULT); tidAllow = ServerConfigurationService.getString(IFRAME_SUPPRESS_PROP, tidAllow); if (tidAllow.indexOf(":none:") >= 0) return false; // JSR-168 portlets do not operate in iframes if ( portal.isPortletPlacement(siteTool) ) return false; // If the property is set and :all: is not specified, then the // tools in the list are the ones that we accept if (tidAllow.trim().length() > 0 && tidAllow.indexOf(":all:") < 0) { if (tidAllow.indexOf(siteTool.getToolId()) < 0) return false; } // If the property is set and :all: is specified, then the // tools in the list are the ones that we render the old way if (tidAllow.indexOf(":all:") >= 0) { if (tidAllow.indexOf(siteTool.getToolId()) >= 0) return false; } // Need to make sure the user is allowed to visit this tool ToolManager toolManager = (ToolManager) ComponentManager.get(ToolManager.class.getName()); boolean allowedUser = toolManager.allowTool(site, siteTool); if ( ! allowedUser ) return false; return true; }
while (iST.hasNext()){ ToolConfiguration tc = iST.next(); if(tc.getToolId().equals(t.getToolId())){ intersected.add(t); break;
log.debug("tool: " + config.getToolId() + ", permissions: " + toolPermissionsStr);
public boolean checkBufferBypass(HttpServletRequest req, ToolConfiguration siteTool) String commonToolId = siteTool.getToolId(); boolean matched = false;
public boolean checkBufferBypass(HttpServletRequest req, ToolConfiguration siteTool) String commonToolId = siteTool.getToolId(); boolean matched = false;
String toolId = toolConfig.getToolId();
String toolId = toolConf.getToolId(); if (toolId.equalsIgnoreCase(signupToolId)) { return page.getId();
if (tool.getToolId().equals(toolId))
ActiveTool tool = ActiveToolManager.getActiveTool(siteTool.getToolId()); if (tool == null)
ActiveTool tool = ActiveToolManager.getActiveTool(siteTool.getToolId()); if (tool == null)
/** * 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()); }