本文整理了Java中org.sakaiproject.entity.api.Reference.set
方法的一些代码示例,展示了Reference.set
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Reference.set
方法的具体详情如下:
包路径:org.sakaiproject.entity.api.Reference
类名称:Reference
方法名:set
[英]Accept the settings for a reference - may be rejected if already set
[中]接受参考设置-如果已设置,则可能会被拒绝
代码示例来源:origin: sakaiproject/sakai
/**
* From EntityProducer
*/
public boolean parseEntityReference(String referenceString, Reference reference) {
String[] parts = referenceString.split(Entity.SEPARATOR);
if (parts.length < 2 || !parts[1].equals("commons")) // Leading slash adds
// an empty element
return false;
if (parts.length == 2) {
reference.set("sakai:commons", "", "", null, "");
return true;
}
String siteId = parts[2];
String subType = parts[3];
/*String entityId = parts[4];
if ("posts".equals(subType)) {
reference.set("commons", "posts", entityId, null, siteId);
return true;
}*/
return false;
}
代码示例来源:origin: org.sakaiproject.kernel/sakai-kernel-impl
/**
* {@inheritDoc}
*/
public boolean parseEntityReference(String reference, Reference ref)
{
// for azGroup access
String id = extractEntityId(reference);
if (id != null)
{
ref.set(APPLICATION_ID, null, id, null, null);
return true;
}
return false;
}
代码示例来源:origin: org.sakaiproject.kernel/sakai-kernel-impl
/**
* @inheritDoc
*/
public boolean parseEntityReference(String reference, Reference ref)
{
// for preferences access
if (reference.startsWith(REFERENCE_ROOT))
{
String id = null;
// we will get null, service, user/preferences Id
String[] parts = StringUtil.split(reference, Entity.SEPARATOR);
if (parts.length > 2)
{
id = parts[2];
}
ref.set(APPLICATION_ID, null, id, null, null);
return true;
}
return false;
}
代码示例来源:origin: org.sakaiproject.kernel/sakai-kernel-impl
/**
* @inheritDoc
*/
public boolean parseEntityReference(String reference, Reference ref)
{
// for user access
if (reference.startsWith(REFERENCE_ROOT))
{
String id = null;
// we will get null, service, userId
String[] parts = StringUtil.split(reference, Entity.SEPARATOR);
if (parts.length > 2)
{
id = parts[2];
}
ref.set(APPLICATION_ID, null, id, null, null);
return true;
}
return false;
}
代码示例来源:origin: org.sakaiproject.kernel/sakai-kernel-impl
/**
* {@inheritDoc}
*/
public boolean parseEntityReference(String reference, Reference ref)
{
// for preferences access
if (reference.startsWith(REFERENCE_ROOT))
{
String id = null;
// we will get null, service, userId
String[] parts = StringUtil.split(reference, Entity.SEPARATOR);
if (parts.length > 2)
{
id = parts[2];
}
ref.set(APPLICATION_ID, null, id, null, null);
return true;
}
return false;
}
代码示例来源:origin: org.sakaiproject.polls/polls-impl
public boolean parseEntityReference(String reference, Reference ref) {
if (reference.startsWith(REFERENCE_ROOT)) {
// /syllabus/siteid/syllabusid
String[] parts = split(reference, Entity.SEPARATOR);
String subType = "";
String context = null;
String id = null;
String container = "";
if (parts.length > 2) {
// the site/context
context = parts[2];
// the id
if (parts.length > 3) {
id = parts[3];
}
}
ref.set(PollListManager.class.getName(), subType, id, container, context);
return true;
}
return false;
}
代码示例来源:origin: org.sakaiproject.basiclti/basiclti-impl
/**
* {@inheritDoc}
/access/basiclti/site/12-siteid-456/98-placement-id
/access/basiclti/content/ --- content path ---- (Future)
*/
public boolean parseEntityReference(String reference, Reference ref)
{
if (reference.startsWith(REFERENCE_ROOT))
{
// we will get null, simplelti, site, <context>, <placement>
// we will store the context, and the ContentHosting reference in our id field.
String id = null;
String context = null;
String[] parts = StringUtil.split(reference, Entity.SEPARATOR);
if ( parts.length == 5 && parts[2].equals("site") )
{
context = parts[3];
id = parts[4];
//Should the slashes below be entityseparator
// id = "/" + StringUtil.unsplit(parts, 2, parts.length - 2, "/");
}
ref.set(APPLICATION_ID, "site", id, null, context);
return true;
}
return false;
}
代码示例来源:origin: org.sakaiproject.kernel/sakai-kernel-impl
/**
* {@inheritDoc}
*/
public boolean parseEntityReference(String reference, Reference ref)
{
// for site access
if (reference.startsWith(REFERENCE_ROOT))
{
String id = null;
String container = null;
String subType = SITE_SUBTYPE;
// we will get null, service, siteId, page | group | tool, page/group/tool id
String[] parts = StringUtil.split(reference, Entity.SEPARATOR);
if (parts.length > 2)
{
id = parts[2];
container = id;
if (parts.length > 4)
{
subType = parts[3];
id = parts[4];
}
}
ref.set(APPLICATION_ID, subType, id, container, null);
return true;
}
return false;
}
代码示例来源:origin: org.sakaiproject.mailarchive/sakai-mailarchive-impl
ref.set(APPLICATION_ID, subType, id, container, context);
代码示例来源:origin: org.sakaiproject/sakai-syllabus-impl
/**
* {@inheritDoc}
*/
public boolean parseEntityReference(String reference, Reference ref)
{
if (reference.startsWith(REFERENCE_ROOT))
{
// /syllabus/siteid/syllabusid
String[] parts = split(reference, Entity.SEPARATOR);
String subType = null;
String context = null;
String id = null;
String container = null;
// the first part will be null, then next the service, the third will be "calendar" or "event"
if (parts.length > 2)
{
// the site/context
context = parts[2];
// the id
if (parts.length > 3)
{
id = parts[3];
}
}
ref.set(APPLICATION_ID, subType, id, container, context);
return true;
}
return false;
}
代码示例来源:origin: org.sakaiproject/sakai-chat-impl
ref.set(ChatManager.APPLICATION_ID, subType, id, container, context);
代码示例来源:origin: org.sakaiproject.assignment/sakai-assignment-impl
ref.set(APPLICATION_ID, subType, id, container, context);
代码示例来源:origin: org.sakaiproject/sakai-citations-impl
ref.set(APPLICATION_ID, subType, id, container, context);
M_log.warn("CitationService.parseEntityReference called with null Reference object", new Throwable());
} else {
ref.set(APPLICATION_ID, REF_TYPE_VIEW_LIST, wrapped.getId(), wrapped
.getContainer(), wrapped.getContext());
代码示例来源: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: org.sakaiproject.announcement/sakai-announcement-impl
ref.set(APPLICATION_ID, subType, id, container, context);
代码示例来源:origin: sakaiproject/sakai
public boolean parseEntityReference(String reference, Reference ref) {
EntityReference entityref = null;
try {
entityref = entityBrokerManager.parseReference(reference);
if (entityref == null) {
return false;
}
} catch (Exception e) {
return false;
}
// We will not attempt to check that the entity actually exists here,
// only that the reference has a recognised prefix.
EntityProvider entityProvider = entityProviderManager.getProviderByPrefix(entityref.prefix);
if (entityProvider != null) {
ref.set(entityref.getPrefix(), null, entityref.getId(), null, null);
return true;
} else {
return false;
}
}
代码示例来源:origin: org.sakaiproject/sakai-rwiki-impl
/**
* {@inheritDoc}
*/
public void setReference(String majorType, Reference ref, String reference)
{
if (!isAvailable()) return;
Decoded decoded = decode(reference);
if (decoded != null)
{
ref.set(majorType, minorType, decoded.getId(), decoded
.getContainer(), decoded.getContext());
}
else
{
throw new RuntimeException(this
+ " Failed to setReference in EntityHelper " + majorType
+ ":" + minorType
+ " reference not for this EntityHandler ");
}
}
代码示例来源:origin: org.sakaiproject.kernel/sakai-kernel-impl
ref.set(APPLICATION_ID, null, id, null, context);
内容来源于网络,如有侵权,请联系作者删除!