@Override public String getId() { return (reference != null) ? reference.getId() : null; }
public String getId() { return reference.getId(); }
protected String convertRef(Reference reference) { return reference.getId(); }
public String getEntityDescription(Reference ref) { return ref.getId(); }
/** * 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()); }
/** * 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; }
/** * {@inheritDoc} */ public String getId() { if (rwo == null) return reference.getId(); return rwo.getId(); }
/** * {@inheritDoc} */ public String getId(String reference) { try { return getReference(reference).getId(); } catch ( Exception ex ) { return ""; } }
/** * {@inheritDoc} */ public String getReference() { if (rwo == null) return RWikiObjectService.REFERENCE_ROOT + reference.getId() + "."; return RWikiObjectService.REFERENCE_ROOT + rwo.getName() + "."; }
@Override public void initializeAction(Reference reference) { try { contentHostingService.expandZippedResource(reference.getId()); } catch (Exception e) { LOG.error("Exception extracting zip content", e); } }
/** * 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()); }
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(); }
/** * 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; }
public ChatMessage getMessage(Reference reference) throws IdUnusedException, PermissionException { return getChatManager().getMessage(reference.getId()); //return null; }
public ChatChannel getChannel(Reference reference) throws IdUnusedException, PermissionException { return getChatManager().getChatChannel(reference.getId()); //return null; }
/** * {@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())); }
/** * 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
/** * 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
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; }
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; }