org.sakaiproject.tool.api.Placement类的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(9.5k)|赞(0)|评价(0)|浏览(120)

本文整理了Java中org.sakaiproject.tool.api.Placement类的一些代码示例,展示了Placement类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Placement类的具体详情如下:
包路径:org.sakaiproject.tool.api.Placement
类名称:Placement

Placement介绍

[英]Tool Placement models a particular tool places in a particular place within a Sakai navigation or portal location.
[中]工具放置模型将特定工具放置在Sakai导航或门户位置内的特定位置。

代码示例

代码示例来源:origin: sakaiproject/sakai

public String getContext() {
  return placement == null ? "" : placement.getContext();
}

代码示例来源:origin: org.sakaiproject.metaobj/sakai-metaobj-tool-lib

protected Map getParameters(HttpServletRequest request) {
 Map params = super.getParameters(request);
 if (params == null) {
   params = new Hashtable();
 }
 if (ToolManager.getCurrentPlacement() != null) {
   params.put("panelId", Web.escapeJavascript("Main" + ToolManager.getCurrentPlacement().getId()));
   params.put(FormHelper.XSL_SITE_ID, ToolManager.getCurrentPlacement().getContext());
 }
 if ( request.getAttribute(STYLESHEET_PARAMS) != null )
   params.putAll((Map) request.getAttribute(STYLESHEET_PARAMS));
 if ( request.getAttribute(STYLESHEET_LOCATION) != null )
   params.put(STYLESHEET_LOCATION, request.getAttribute(STYLESHEET_LOCATION));
 return params;
}

代码示例来源:origin: sakaiproject/sakai

private String placementDisplay()
{
  ResourceBundle rb = rbDefault;
  StringBuilder sb = new StringBuilder();
  try
  {
    Placement p = ToolManager.getCurrentPlacement();
    if (p != null)
    {
      sb.append(rb.getString("bugreport.placement")).append("\n");
      sb.append(rb.getString("bugreport.placement.id")).append(p.getToolId())
          .append("\n");
      sb.append(rb.getString("bugreport.placement.context")).append(
          p.getContext()).append("\n");
      sb.append(rb.getString("bugreport.placement.title")).append(p.getTitle())
          .append("\n");
    }
    else
    {
      sb.append(rb.getString("bugreport.placement")).append("\n");
      sb.append(rb.getString("bugreport.placement.none")).append("\n");
    }
  }
  catch (Exception ex)
  {
    log.error("Failed to generate placement display", ex);
    sb.append("Error " + ex.getMessage());
  }
  return sb.toString();
}

代码示例来源:origin: sakaiproject/sakai

public static boolean sakaiInfo(Properties props, Placement placement, ResourceLoader rb) {
  log.debug("placement={}", placement.getId());
  log.debug("placement title={}", placement.getTitle());
  String context = placement.getContext();
  log.debug("ContextID={}", context);
  return sakaiInfo(props, context, placement.getId(), rb);
}

代码示例来源:origin: org.sakaiproject.portal/sakai-portal-render-impl

public SakaiPortletConfig(Placement placement)
{
  if (placement == null)
  {
    return;
  }
  Properties toolProperties = placement.getPlacementConfig();
  if (toolProperties != null)
  {
    contextPath = toolProperties
        .getProperty(PortalService.TOOL_PORTLET_CONTEXT_PATH);
    portletName = toolProperties.getProperty(PortalService.TOOL_PORTLET_NAME);
  }
  Properties configProperties = placement.getConfig();
  if (configProperties != null)
  {
    if (isEmpty(contextPath))
    {
      contextPath = configProperties
          .getProperty(PortalService.TOOL_PORTLET_CONTEXT_PATH);
    }
    if (isEmpty(portletName))
    {
      portletName = configProperties
          .getProperty(PortalService.TOOL_PORTLET_NAME);
    }
  }
  portlet = !(isEmpty(contextPath) || isEmpty(portletName));
}

代码示例来源:origin: sakaiproject/sakai

public String getCurrentToolId() {
  return toolManager.getCurrentPlacement().getId();
}

代码示例来源:origin: org.sakaiproject.basiclti/basiclti-common

public static String getCorrectProperty(Properties config,
    String propName, Placement placement)
{
  // Check for global overrides in properties
  String allowSettings = ServerConfigurationService.getString(BASICLTI_SETTINGS_ENABLED, BASICLTI_SETTINGS_ENABLED_DEFAULT);
  if ( LTIService.LTI_ALLOWSETTINGS.equals(propName) && ! "true".equals(allowSettings) ) return "false";
  String allowRoster = ServerConfigurationService.getString(BASICLTI_ROSTER_ENABLED, BASICLTI_ROSTER_ENABLED_DEFAULT);
  if ( LTIService.LTI_ALLOWROSTER.equals(propName) && ! "true".equals(allowRoster) ) return "false";
  String allowContentLink = ServerConfigurationService.getString(BASICLTI_CONTENTLINK_ENABLED, BASICLTI_CONTENTLINK_ENABLED_DEFAULT);
  if ( "contentlink".equals(propName) && ! "true".equals(allowContentLink) ) return null;
  // Check for explicit setting in properties
  String propertyName = placement.getToolId() + "." + propName;
  String propValue = ServerConfigurationService.getString(propertyName,null);
  if ( propValue != null && propValue.trim().length() > 0 ) {
    log.debug("Sakai.home {}={}", propName, propValue);
    return propValue;
  }
  // Take it from the placement
  return config.getProperty("imsti."+propName, null);
}

代码示例来源:origin: org.sakaiproject.kernel/sakai-kernel-impl

String requiredPermissionsString = placement.getConfig().getProperty(TOOLCONFIG_REQUIRED_PERMISSIONS);
if (log.isDebugEnabled()) log.debug("requiredPermissionsString=" + requiredPermissionsString + " for " + placement.getToolId());
if (requiredPermissionsString == null)
  return true;

代码示例来源:origin: org.sakaiproject.kernel/sakai-kernel-impl

/**
   * Check if the placement is hidden.
   * @param placement
   * @return <code>true</code> if the current placement is hidden.
   */
  public boolean isHidden(Placement placement)
  {
    if (placement == null) return true;
    String visibility = placement.getConfig().getProperty(PORTAL_VISIBLE);
    if ( "false".equals(visibility) ) return true;
    String requiredPermissionsString = StringUtils.trimToNull(placement.getConfig().getProperty(TOOLCONFIG_REQUIRED_PERMISSIONS));
    if (requiredPermissionsString == null)
      return false;
    return requiredPermissionsString.contains("site.upd");
  }
}

代码示例来源:origin: sakaiproject/sakai

public String getTitle()
{
  if (m_placement != null)
  {
    return m_placement.getTitle();
  }
  return "";
}

代码示例来源:origin: org.sakaiproject.basiclti/basiclti-common

public static boolean sakaiInfo(Properties props, Placement placement, ResourceLoader rb)
{
  log.debug("placement={}", placement.getId());
  log.debug("placement title={}", placement.getTitle());
  String context = placement.getContext();
  log.debug("ContextID={}", context);
  return sakaiInfo(props, context, placement.getId(), rb);
}

代码示例来源:origin: org.sakaiproject.portal/sakai-portal-render-impl

/**
 * Retrieve the portlet window for the specified placement.
 * 
 * @param placement
 * @return
 * @throws ToolRenderException
 */
public SakaiPortletWindow getOrCreatePortletWindow(Placement placement)
    throws ToolRenderException
{
  if (!portletWindows.containsKey(placement.getId()))
  {
    createPortletWindow(placement);
  }
  return getPortletWindow(placement.getId());
}

代码示例来源:origin: sakaiproject/sakai

public static String getCorrectProperty(Properties config,
    String propName, Placement placement) {
  // Check for global overrides in properties
  if (LTIService.LTI_ALLOWSETTINGS.equals(propName) && !settingsEnabled()) {
    return "false";
  }
  if (LTIService.LTI_ALLOWROSTER.equals(propName) && !rosterEnabled()) {
    return "false";
  }
  if ("contentlink".equals(propName) && !contentLinkEnabled()) {
    return null;
  }
  // Check for explicit setting in properties
  String propertyName = placement.getToolId() + "." + propName;
  String propValue = ServerConfigurationService.getString(propertyName, null);
  if (propValue != null && propValue.trim().length() > 0) {
    log.debug("Sakai.home {}={}", propName, propValue);
    return propValue;
  }
  // Take it from the placement
  return config.getProperty("imsti." + propName, null);
}

代码示例来源:origin: org.sakaiproject.portal/sakai-portal-render-impl

public PortletDD getPortletDD(Placement placement)
  Properties toolProperties = placement.getPlacementConfig();
  String portletName = null;
  String appName = null;
  Properties configProperties = placement.getConfig();
  if (configProperties != null)

代码示例来源:origin: org.sakaiproject.basiclti/basiclti-common

public static boolean loadFromPlacement(Properties info, Properties launch, Placement placement)
  Properties config = placement.getConfig();
  log.debug("Sakai properties={}", config);
  String launch_url = toNull(getCorrectProperty(config,LTIService.LTI_LAUNCH, placement));

代码示例来源:origin: org.sakaiproject.velocity/sakai-velocity-tool

public String getTitle()
{
  if (m_placement != null)
  {
    return m_placement.getTitle();
  }
  return "";
}

代码示例来源:origin: uk.org.ponder.sakairsf/sakairsf

public String getContext() {
 return placement == null? "" : placement.getContext();
}

代码示例来源:origin: sakaiproject/sakai

public void setupForward(HttpServletRequest req, HttpServletResponse res,
    Placement p, String skin) throws ToolException
  {
      Site site = null;
  if ( p != null ) {
    try {
      site = SiteService.getSite(p.getContext());
    }
    catch (IdUnusedException ex) {
      log.debug(ex.getMessage());
    }
      }
  // Get the tool header properties
  Properties props = toolHeaderProperties(req, skin, site, p);
  for(Object okey : props.keySet() ) 
  {
    String key = (String) okey;
    req.setAttribute(key,props.getProperty(key));
  }
  StringBuilder bodyonload = new StringBuilder();
  if (p != null)
  {
    String element = Web.escapeJavascript("Main" + p.getId());
    bodyonload.append("setMainFrameHeight('" + element + "');");
  }
  bodyonload.append("setFocus(focus_path);");
  req.setAttribute("sakai.html.body.onload", bodyonload.toString());
  portalService.getRenderEngine(portalContext, req).setupForward(req, res, p, skin);
}

代码示例来源:origin: org.sakaiproject.metaobj/sakai-metaobj-tool-lib

public ModelAndView handleRequest(Object requestModel, Map request, Map session, Map application, Errors errors) {
 Map model = new HashMap();
 model.put("tool", getWorksiteManager().getTool(ToolManager.getCurrentPlacement().getId()));
 model.put("mainPanel", Web.escapeJavascript("Main" + ToolManager.getCurrentPlacement().getId()));
 return new ModelAndView("success", model);
}

代码示例来源:origin: sakaiproject/sakai

if (placement != null)
  toolId = placement.getToolId();

相关文章