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

x33g5p2x  于2022-01-29 转载在 其他  
字(5.9k)|赞(0)|评价(0)|浏览(156)

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

Reference.getId介绍

[英]Access the primary id.
[中]访问主id。

代码示例

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

@Override
public String getId() {
  return (reference != null) ? reference.getId() : null;
}

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

public String getId() {
 return reference.getId();
}

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

protected String convertRef(Reference reference) {
 return reference.getId();
}

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

public String getEntityDescription(Reference ref) {
 return ref.getId();
}

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

/**
 * Get a list of the files in a zip and their size
 * @param reference the sakai entity reference
 * @return a map of file names to file sizes in the zip archive
 * @deprecated 11 Oct 2011 -AZ, use {@link #getZipManifest(String)}
 */
public Map<String, Long> getZipManifest(Reference reference) {
  if (reference == null) {
    throw new IllegalArgumentException("reference cannot be null");
  }
  return getZipManifest(reference.getId());
}

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

/**
 * From EntityProducer
 */
public Collection getEntityAuthzGroups(Reference ref, String userId) {
  log.debug("getEntityAuthzGroups(Ref ID:{},{})", ref.getId(), userId);
  List ids = new ArrayList();
  ids.add("/site/" + ref.getContext());
  return ids;
}

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

/**
 * {@inheritDoc}
 */
public String getId()
{
  if (rwo == null) return reference.getId();
  return rwo.getId();
}

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

/**
* {@inheritDoc}
*/
public String getId(String reference)
{
 try {
   return getReference(reference).getId();
 } catch ( Exception ex ) {
   return "";
 }
}

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

/**
 * {@inheritDoc}
 */
public String getReference()
{
  if (rwo == null)
    return RWikiObjectService.REFERENCE_ROOT + reference.getId() + ".";
  return RWikiObjectService.REFERENCE_ROOT + rwo.getName() + ".";
}

代码示例来源:origin: org.sakaiproject.content/content-types

@Override
public void initializeAction(Reference reference) {
  try {
      contentHostingService.expandZippedResource(reference.getId());
  } catch (Exception e) {
    LOG.error("Exception extracting zip content", e);
  }
}

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

/**
 * Extracts a compressed (zip) ContentResource to a new folder with the same name.
 * 
 * @param reference the sakai entity reference
 * @throws Exception on failure
 * @deprecated 11 Oct 2011 -AZ, use {@link #extractArchive(String)} instead
 */
public void extractArchive(Reference reference) throws Exception {
  if (reference == null) {
    throw new IllegalArgumentException("reference cannot be null");
  }
  extractArchive(reference.getId());
}

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

public Object getPropertyValue(Object source) throws Exception {
 Method objectMethodGetProperty = getPropertyGettor(source);
 if(objectMethodGetProperty == null)
   throw new NullPointerException(source.getClass().getName() +
      " has no get for property \"" + propertyName + "\"");
 Object value = objectMethodGetProperty.invoke(source, new Object[]{});
 ReferenceHolder refHolder = null;
 try {
   refHolder = (ReferenceHolder)value;
 } catch(ClassCastException e) {
   throw new Exception("The source could not be cast into an ReferenceHolder for property \"" + propertyName +  "\"", e);
 }
 return refHolder.getBase().getId();
}

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

/**
* not currently used... will use if we move to storing id rather than ref in the
* xml form data
* @param refs
* @return list of converted guids
*/
protected List convertToGuidList(List refs) {
 List idList = new ArrayList();
 for (Iterator i=refs.iterator();i.hasNext();) {
   Reference ref = (Reference) i.next();
   idList.add(getContentHostingService().getUuid(ref.getId()));
 }
 return idList;
}

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

public ChatMessage getMessage(Reference reference) throws IdUnusedException, PermissionException {
 return getChatManager().getMessage(reference.getId());
 //return null;
}

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

public ChatChannel getChannel(Reference reference) throws IdUnusedException, PermissionException {
 return getChatManager().getChatChannel(reference.getId());
 //return null;
}

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

/**
 * {@inheritDoc}
 */
public String getEntityUrl(Reference ref)
{
  // double check that it's mine
  if (!APPLICATION_ID.equals(ref.getType())) return null;
  return getUrl(convertIdToUserEid(ref.getId()));
}

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

/**
 * 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 Entity getEntity(Reference ref) {
 CoreEntityProvider entityProvider = (CoreEntityProvider) entityProviderManager
    .getProviderByPrefix(ref.getType());
 if (entityProvider != null) {
   if (entityProvider.entityExists(ref.getId())) {
    Entity togo = newEntity(ref);
    return togo;
   }
 }
 return null;
}

相关文章