/** * 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; }
/** * {@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; }
/** * @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; }
/** * @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; }
/** * {@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; }
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; }
/** * {@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; }
/** * {@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; }
ref.set(APPLICATION_ID, subType, id, container, context);
/** * {@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; }
ref.set(ChatManager.APPLICATION_ID, subType, id, container, context);
ref.set(APPLICATION_ID, subType, id, container, context);
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; }
ref.set(APPLICATION_ID, subType, id, container, context);
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; } }
/** * {@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 "); } }
ref.set(APPLICATION_ID, null, id, null, context);