org.sakaiproject.tool.api.Placement.getId()方法的使用及代码示例

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

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

Placement.getId介绍

[英]Get the tool placement id.
[中]获取工具放置id。

代码示例

代码示例来源: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: sakaiproject/sakai

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

代码示例来源: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: 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.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: org.sakaiproject.metaobj/sakai-metaobj-impl

public String getExternalUri(Id artifactId, String name) {
 //http://johnellis.rsmart.com:8080/osp/member/viewNode.osp?pid=1107451588272-643&nodeId=48D2AFE5A98453AD673579E14405607C
 return "viewNode.osp?pid=" + ToolManager.getCurrentPlacement().getId() +
    "&nodeId=" + artifactId.getValue();
}

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

protected Id getToolId() {
 Placement placement = toolManager.getCurrentPlacement();
 return idManager.getId(placement.getId());
}

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

/**
 * Setup the vm context for a courier
 * 
 * @param request
 */
protected void setVmCourier(HttpServletRequest request, int refresh)
{
  // the url for the chat courier
  Placement placement = ToolManager.getCurrentPlacement();
  if (placement != null)
  {
    String userId = SessionManager.getCurrentSessionUserId();
    StringBuilder url = new StringBuilder(Web.serverUrl(request));
    url.append("/courier/");
    url.append(placement.getId());
    url.append("?userId=");
    url.append(userId);
    
    setVmReference("courier", url.toString(), request);
    setVmReference("courierTimeout", Integer.toString(refresh), request);
  }
}

代码示例来源: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: org.sakaiproject.portal/sakai-portal-render-impl

private void createPortletWindow(Placement placement) throws ToolRenderException
{
  SakaiPortletConfig pc = new SakaiPortletConfig(placement);
  if (!pc.isPortletConfig())
  {
    return;
  }
  String windowId = placement.getId();
  SakaiPortletWindow window = new SakaiPortletWindow(windowId, pc.contextPath,
      pc.portletName);
  portletWindows.put(windowId, window);
}

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

/**
 * Setup the vm context for a courier
 * 
 * @param request
 */
protected void setVmCourier(HttpServletRequest request, int refresh)
{
  // the url for the chat courier
  Placement placement = ToolManager.getCurrentPlacement();
  if (placement != null)
  {
    String userId = SessionManager.getCurrentSessionUserId();
    StringBuilder url = new StringBuilder(Web.serverUrl(request));
    url.append("/courier/");
    url.append(placement.getId());
    url.append("?userId=");
    url.append(userId);
    
    setVmReference("courier", url.toString(), request);
    setVmReference("courierTimeout", Integer.toString(refresh), request);
  }
}

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

public static String getSourceDID(User user, Placement placement, Properties config) {
  String placementSecret = toNull(getCorrectProperty(config, "placementsecret", placement));
  if (placementSecret == null) {
    return null;
  }
  return getSourceDID(user, placement.getId(), placementSecret);
}

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

public static String getSourceDID(User user, Placement placement, Properties config)
{
  String placementSecret = toNull(getCorrectProperty(config,"placementsecret", placement));
  if ( placementSecret == null ) return null;
  return getSourceDID(user, placement.getId(), placementSecret);
}

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

public void fillComponents(UIContainer tofill, String ID, String functionname) {
  UIVerbatim.make(tofill, ID, "\n<!-- \n\tfunction " + functionname + "()" + " {\n\t\tsetMainFrameHeight('"
      + deriveFrameTitle(toolmanager.getCurrentPlacement().getId()) + "');\n\t\t}\n//-->\n");
}

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

public void fillComponents(UIContainer tofill, String ID, String functionname) {
 UIVerbatim.make(tofill, ID, "\n<!-- \n\tfunction " + functionname + "()"
   + " {\n\t\tsetMainFrameHeight('"
   + deriveFrameTitle(toolmanager.getCurrentPlacement().getId())
   + "');\n\t\t}\n//-->\n");
}

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

/**
 * Compute the deliver address for the current request. Compute the client window id, based on the float state
 * 
 * @param state
 *        The tool state.
 * @param toolId
 *        The tool instance id, which might be used as part of the client window id if floating.
 * @return The client window id, based on the float state.
 */
protected String clientWindowId(SessionState state, String toolId)
{
  // TODO: drop the params
  // get the Sakai session
  Session session = SessionManager.getCurrentSession();
  // get the current tool placement
  Placement placement = ToolManager.getCurrentPlacement();
  // compute our courier delivery address: this placement in this session
  String deliveryId = session.getId() + placement.getId();
  return deliveryId;
} // clientWindowId

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

/**
 * Compute the deliver address for the current request. Compute the client window id, based on the float state
 * 
 * @param state
 *        The tool state.
 * @param toolId
 *        The tool instance id, which might be used as part of the client window id if floating.
 * @return The client window id, based on the float state.
 */
protected String clientWindowId(SessionState state, String toolId)
{
  // TODO: drop the params
  // get the Sakai session
  Session session = SessionManager.getCurrentSession();
  // get the current tool placement
  Placement placement = ToolManager.getCurrentPlacement();
  // compute our courier delivery address: this placement in this session
  String deliveryId = session.getId() + placement.getId();
  return deliveryId;
} // clientWindowId

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

public Id evaluateQualifier() throws JspException {
 Id qual;
 if (isUseSite()) {
   qual = getIdManager().getId(ToolManager.getCurrentPlacement().getContext());
 }
 else if (qualifier == null){
   qual = getIdManager().getId(ToolManager.getCurrentPlacement().getId());
 }
 else {
   qual = qualifier;
 }
 return qual;
}

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

protected boolean isAllowed(String function) {
  boolean isAllowed = false;   
  if (getStructuredArtifactDefinitionManager().isGlobal()) {
    isAllowed = getAuthzManager().isAuthorized(function, getIdManager().getId(StructuredArtifactDefinitionManager.GLOBAL_SAD_QUALIFIER));
  }
  else {
    isAllowed = getAuthzManager().isAuthorized(function, getIdManager().getId(ToolManager.getCurrentPlacement().getId()));
  }
  return isAllowed;
}

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

public void checkPermission(String function) throws AuthorizationFailedException {
 if (getStructuredArtifactDefinitionManager().isGlobal()) {
   getAuthzManager().checkPermission(function, getIdManager().getId(StructuredArtifactDefinitionManager.GLOBAL_SAD_QUALIFIER));
 }
 else {
   getAuthzManager().checkPermission(function, getIdManager().getId(ToolManager.getCurrentPlacement().getId()));
 }
}

相关文章