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

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

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

Placement.getContext介绍

[英]Access the placement context.
[中]访问放置上下文。

代码示例

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

/**
  * Get the current site id.
  * @return the site id.
  */
 public String getCurrentSiteId(boolean accessViaUrl){
  // access via url => users does not login via any sites
  String currentSiteId = null;
  if (!accessViaUrl)
  {
//    cwen
   Placement thisPlacement = ToolManager.getCurrentPlacement();
   if(thisPlacement != null)
    currentSiteId = thisPlacement.getContext();
  }
  return currentSiteId;
 }

代码示例来源:origin: org.sakaiproject.profile/profile-component-shared

/**
 * @return
 */
private String getCurrentSiteId()
{
  LOG.debug("getCurrentSiteId()");
  Placement placement = ToolManager.getCurrentPlacement();
  return placement.getContext();
}

代码示例来源:origin: org.sakaiproject.samigo/samigo-services

/**
  * Get the current site id.
  * @return the site id.
  */
 public String getCurrentSiteId(boolean accessViaUrl){
  // access via url => users does not login via any sites
  String currentSiteId = null;
  if (!accessViaUrl)
  {
//    cwen
   Placement thisPlacement = ToolManager.getCurrentPlacement();
   if(thisPlacement != null)
    currentSiteId = thisPlacement.getContext();
  }
  return currentSiteId;
 }

代码示例来源:origin: org.sakaiproject.edu-services.gradebook/gradebook-service-impl

/**
   * @see org.sakaiproject.tool.gradebook.facades.ContextManagement#getGradebookUid(java.lang.Object)
   */
  public String getGradebookUid(Object notNeededInSakai) {
    // get the Tool Placement, and return the tool's context if available
    Placement placement = ToolManager.getCurrentPlacement();
    if(placement == null) {
      log.error("Placement is null");
      return DEFAULT_GRADEBOOK_NAME;
    }

    return placement.getContext();
  }
}

代码示例来源:origin: org.sakaiproject.edu-services.sections/sections-model

/**
   * @return The current sakai authz reference
   */
  public static final String getSiteReference() {
    Placement placement = ToolManager.getCurrentPlacement();
    String context = placement.getContext();
    return SiteService.siteReference(context);
  }
}

代码示例来源:origin: org.sakaiproject.samigo/samigo-services

/**
 * Returns all groups for site
 */
public Map getGroupsForSite() {
  String siteId = ToolManager.getCurrentPlacement().getContext();
  return getGroupsForSite(siteId);
}

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

private String getCurrentSiteReference() {
  //sakai2 - use Placement to get context instead of getting currentSitePageId from PortalService in sakai.
  Placement placement = ToolManager.getCurrentPlacement();
  String currentSiteId = placement.getContext(); 
  return siteService.siteReference(currentSiteId);
}

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

/**
 * Returns all groups for site
 */
public Map getGroupsForSite() {
  String siteId = ToolManager.getCurrentPlacement().getContext();
  return getGroupsForSite(siteId);
}

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

public boolean hasPrivilege(String functionName)
{
  String context = ToolManager.getCurrentPlacement().getContext();
  boolean privilege = SecurityService.unlock(functionName, "/site/"+context);
  return privilege;
}

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

/**
   * @return The current sakai authz reference
   */
  public static final String getSiteReference() {
    Placement placement = ToolManager.getCurrentPlacement();
    String context = placement.getContext();
    return SiteService.siteReference(context);
  }
}

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

public void deletePostedSyllabus(SyllabusData data)
{
  Placement placement = ToolManager.getCurrentPlacement();
  String siteId = placement.getContext();
  deletePostedSyllabus(data, siteId);
}

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

public void draftChangeSyllabus(SyllabusData data)
{
  Placement placement = ToolManager.getCurrentPlacement();
  String siteId = placement.getContext();
  draftChangeSyllabus(data, siteId);
}
public void draftChangeSyllabus(SyllabusData data, String siteId){

代码示例来源:origin: org.sakaiproject.samigo/samigo-services

public boolean hasPrivilege(String functionName)
{
  String context = ToolManager.getCurrentPlacement().getContext();
  boolean privilege = SecurityService.unlock(functionName, "/site/"+context);
  return privilege;
}

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

public List getWorksiteRoles() {
 Placement currentPlacement = ToolManager.getCurrentPlacement();
 if (currentPlacement == null) {
   return new ArrayList();
 }
 return getWorksiteRoles(currentPlacement.getContext());
}

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

/**
 * Check if the current user is allowed to do options for the current context (site based)
 * @return true if the user is allowed to modify the current context's options, false if not.
 */
protected boolean allowedToOptions()
{
  Placement placement = ToolManager.getCurrentPlacement();
  String context = null;
  if (placement != null) context = placement.getContext();
  // TODO: stolen from site -ggolden
  if (SecurityService.unlock("site.upd", "/site/" + context))
  {
    return true;
  }
  return false;
}

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

public Agent getWorksiteRole(String roleName) {
 return getWorksiteRole(roleName, ToolManager.getCurrentPlacement().getContext());
}

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

/**
 * Check if the current user is allowed to do options for the current context (site based)
 * @return true if the user is allowed to modify the current context's options, false if not.
 */
protected boolean allowedToOptions()
{
  Placement placement = ToolManager.getCurrentPlacement();
  String context = null;
  if (placement != null) context = placement.getContext();
  // TODO: stolen from site -ggolden
  if (SecurityService.unlock("site.upd", "/site/" + context))
  {
    return true;
  }
  return false;
}

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

protected String getCurrentRealm() {
 if (getAuthzGroupsList().size() == 0) {
   return "/site/" + ToolManager.getCurrentPlacement().getContext();
 }
 else {
   return "/site/" + getAuthzGroupsList().get(0);
 }
}

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

public Boolean getCalendarExistsForSite(){
  String siteContext = ToolManager.getCurrentPlacement().getContext();
  Site site = null;
  try
  {
    site = SiteService.getSite(siteContext);
    if (site.getToolForCommonId("sakai.schedule") != null)
    {
      return true;
    }else{
      return false;
    }
  }
  catch (Exception e) {
    log.warn("Exception thrown while getting site", e);
  }
  return false;
}

相关文章