org.sakaiproject.entity.api.EntityManager.newReference()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(7.0k)|赞(0)|评价(0)|浏览(131)

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

EntityManager.newReference介绍

[英]Create a new Reference object, from the given reference string.
[中]从给定的引用字符串创建新的引用对象。

代码示例

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

private Reference getReference(String reference) {
 try {
   return entityManager.newReference(reference);
 } catch ( Exception ex ) {       
 }
 return null;
}

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

public static org.sakaiproject.entity.api.Reference newReference(java.lang.String param0)
{
  org.sakaiproject.entity.api.EntityManager service = getInstance();
  if (service == null) return null;
  return service.newReference(param0);
}

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

public static org.sakaiproject.entity.api.Reference newReference(org.sakaiproject.entity.api.Reference param0)
{
  org.sakaiproject.entity.api.EntityManager service = getInstance();
  if (service == null) return null;
  return service.newReference(param0);
}

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

public static org.sakaiproject.entity.api.Reference newReference(java.lang.String param0)
{
  org.sakaiproject.entity.api.EntityManager service = getInstance();
  if (service == null) return null;
  return service.newReference(param0);
}

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

public static org.sakaiproject.entity.api.Reference newReference(org.sakaiproject.entity.api.Reference param0)
{
  org.sakaiproject.entity.api.EntityManager service = getInstance();
  if (service == null) return null;
  return service.newReference(param0);
}

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

public Object fetchEntity(String reference) {
  Object entity = null;
  try {
    // cannot test this in a meaningful way so the tests are designed to not get here -AZ
    entity = entityManager.newReference(reference).getEntity();
  } catch (Exception e) {
    log.warn("Failed to look up reference '" + reference
        + "' to an entity in Sakai legacy entity system", e);
  }
  return entity;
}

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

public String getSiteId(String resourceName)
{
  String r = getSiteId(entityManager.newReference(resourceName));
  if (log.isDebugEnabled())
  {
    log.debug("Wiki.getSiteId" + resourceName + ":" + r);
  }
  return r;
}

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

public String createPermissionsReference(String pageSpace)
{
  // Page space is assumed to be a ppage space reference
  // Turn into an entity and then get a reference
  Reference ref = entityManager
      .newReference(RWikiObjectService.REFERENCE_ROOT + pageSpace
          + "."); //$NON-NLS-1$
  return ref.getReference();
}

代码示例来源:origin: org.sakaiproject.mailarchive/sakai-search-adapters-impl

public String getSiteId(String resourceName)
{
  return getSiteId(entityManager.newReference(resourceName));
}

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

/**
 * @inheritDoc
 */
public Reference getAnnouncementReference(String context)
{
 StringBuilder refString = new StringBuilder();
  refString.append(getAccessPoint(true));
  refString.append(Entity.SEPARATOR);
  refString.append(REF_TYPE_ANNOUNCEMENT);
  refString.append(Entity.SEPARATOR);
  refString.append(context);
  
  return  m_entityManager.newReference( refString.toString() );
}

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

/**
* {@inheritDoc}
*/
public String getSiteId(String reference) {
 return getSiteId(entityManager.newReference(reference));
}

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

@Override
  public void copy(ContentResource resource) {
    Reference reference = entityManager.newReference(resource.getReference());
    citationService.copyCitationCollection(reference);
  }
}

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

/**
 * {@inheritDoc}
 * 
 * @param rwo
 * @return
 */
public Reference getReference(RWikiObject rwo)
{
  return entityManager.newReference(getEntity(rwo).getReference());
}

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

public Collection getEntityAuthzGroups(Reference ref, String userId)
{
  Collection azGroups = null;
  
  // entities that are actually in /content use the /content authz groups 
  if(ref != null && ref.getReference() != null && ref.getReference().startsWith("/citation/content/")) {
    String altRef = ref.getReference().substring("/citation".length());
    azGroups = m_contentHostingService.getEntityAuthzGroups(m_entityManager.newReference(altRef), userId);
  }
  return azGroups;
}

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

public void initEntity(String assignmentId) {
  if (StringUtils.isNotBlank(assignmentId)) {
    try {
      assignment = assignmentService.getAssignment(assignmentId);
      this.assignmentId = assignmentId;
      reference = entityManager.newReference(AssignmentReferenceReckoner.reckoner().assignment(assignment).reckon().getReference());
    } catch (Exception e) {
      log.warn("Could not initialize entity with assignment id {}", assignmentId, e);
    }
  } else {
    log.warn("Can not initialize entity with assignment id {}", assignmentId);
  }
}

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

/**
 * Return the url unchanged, unless it's a reference, then return the reference url
 */
protected String convertReferenceUrl(String url)
{
  // make a reference
  Reference ref = entityManager().newReference(url);
  // if it didn't recognize this, return it unchanged
  if (!ref.isKnownType()) return url;
  // return the reference's url
  return ref.getUrl();
}

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

/**
 * Construct with a reference.
 * 
 * @param ref
 *        The channel reference.
 */
public BaseMessageChannelEdit(String ref)
{
  // set the ids
  Reference r = m_entityManager.newReference(ref);
  m_context = r.getContext();
  m_id = r.getId();
  // setup for properties
  m_properties = new BaseResourcePropertiesEdit();
} // BaseMessageChannelEdit

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

public boolean parseEntityReference(String reference, Reference ref) {
 if (reference.startsWith(getContext())) {
   
   // removing our label, we expose the wrapped Entity reference
   String wrappedRef = reference.substring(getLabel().length() + 1);
   // make a reference for this
   Reference wrapped = entityManager.newReference(wrappedRef);
   // use the wrapped id, container and context - our own type (no subtype)
   ref.set(getLabel(), null, wrapped.getId(), wrapped.getContainer(), wrapped.getContext());
   return true;
 }
 return false;
}

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

public void initEntity(Assignment assignment) {
  if (assignment != null && StringUtils.isNotBlank(assignment.getId())) {
    // if assignment has an id assume its been persisted
    this.assignment = assignment;
    this.assignmentId = assignment.getId();
    reference = entityManager.newReference(AssignmentReferenceReckoner.reckoner().assignment(assignment).reckon().getReference());
  } else {
    log.warn("Can not initialize entity with assignment {}", assignment);
  }
}

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

protected ContentEntityWrapper getContentEntityWrapper(Reference ref) {
 String wholeRef = ref.getReference();
 ReferenceParser parser = parseReference(wholeRef);
 ContentResource base =
    (ContentResource) entityManager.newReference(parser.getRef()).getEntity();
 //base could be null because we have a second level of wrapping
 if (base == null) {
   parser = parseReference(ref.getReference());
   base = (ContentResource) entityManager.newReference(parser.getRef()).getEntity();
 }
 return new ContentEntityWrapper(base, wholeRef);
}

相关文章