/** * @return a description of the resource referenced. */ public String getDescription() { String rv = "unknown"; if (m_service != null) { rv = m_service.getEntityDescription(this); if (rv == null) { rv = m_service.getLabel() + " " + m_reference; } } return rv; }
/** * Find the Entity that is referenced. * * @return The Entity object that this references. */ public Entity getEntity() { Entity e = null; if (m_service != null) { e = m_service.getEntity(this); } return e; }
/** * {@inheritDoc} */ public Collection getAuthzGroups(String userId) { Collection realms = null; if (m_service != null) { realms = m_service.getEntityAuthzGroups(this, userId); } if (realms == null) realms = new Vector(); return realms; }
if (!service.willArchiveMerge()) continue; String msg = service.archive(siteId, doc, stack, storagePath, attachments); results.append(msg); String fileName = storagePath + service.getLabel() + ".xml"; Xml.writeDocument(doc, fileName);
for (EntityProducer entityProducer : entityProducers) { if (serviceName.equals(entityProducer.getClass().getName()) || serviceName.equals(entityProducer.getLabel()) ) { service = entityProducer; msg = service.merge(siteId, element, fileName, fromSite, attachmentNames, new HashMap() /* empty userIdTran map */, usersListAllowImport); } else { M_log.warn("Skipping merge archive data for "+serviceName+" ("+fileName+") to site "+siteId+", checked filter failed (filtersOn="+filterSakaiService+", filters="+Arrays.toString(filteredSakaiService)+")");
protected void parse(String reference, EntityProducer parent, boolean siteInfo) { // with /pres/<siteid>/<preseId>/content/etc/etc.xml String baseRef = reference.substring(parent.getLabel().length() + 2); // lenght of 2 sperators if (siteInfo) { int sep = baseRef.indexOf(Entity.SEPARATOR); siteId = baseRef.substring(0, sep); baseRef = baseRef.substring(sep + 1); sep = baseRef.indexOf(Entity.SEPARATOR); id = baseRef.substring(0, sep); ref = baseRef.substring(sep); } else { ref = Entity.SEPARATOR + baseRef; } context = parent.getLabel(); }
public void handleAccess(HttpServletRequest req, HttpServletResponse res, Reference ref, Collection copyrightAcceptedRefs) throws EntityPermissionException, EntityNotDefinedException, EntityAccessOverloadException, EntityCopyrightException { ReferenceParser parser = createParser(ref); checkSource(ref, parser); ContentEntityWrapper wrapper = (ContentEntityWrapper) ref.getEntity(); if (wrapper == null || wrapper.getBase() == null) { throw new EntityNotDefinedException(ref.getReference()); } else { Reference realRef = EntityManager.newReference(wrapper.getBase().getReference()); EntityProducer producer = realRef.getEntityProducer(); producer.getHttpAccess().handleAccess(req, res, realRef, copyrightAcceptedRefs); } }
msg = service.merge(siteId, element, fileName, fromSite, attachmentNames, userIdTrans, new HashSet()); else if ((system.equalsIgnoreCase(FROM_SAKAI) || system.equalsIgnoreCase(FROM_SAKAI_2_8)) && (checkSakaiService(serviceName))) msg = service.merge(siteId, element, fileName, fromSite, attachmentNames, new HashMap() /* empty userIdTran map */, usersListAllowImport); else if (system.equalsIgnoreCase(FROM_CT)) msg = service.merge(siteId, element, fileName, fromSite, attachmentNames, new HashMap() /* empty userIdTran map */, usersListAllowImport);
if (!service.willArchiveMerge()) continue; String msg = service.archive(siteId, doc, stack, storagePath, attachments); results.append(msg); String fileName = storagePath + service.getLabel() + ".xml"; Xml.writeDocument(doc, fileName);
HttpAccess access = service.getHttpAccess(); if (access == null) throw new EntityNotDefinedException(ref.getReference());
private String getAssignmentTitle(String assignmentRef){ if(assignmentTitleCache.containsKey(assignmentRef) && assignmentTitleCache.get(assignmentRef) != null){ return (String) assignmentTitleCache.get(assignmentRef); }else{ String assignmentTitle = null; if (assignmentRef.startsWith("/assignment/")) { try { Reference ref = entityManager.newReference(assignmentRef); EntityProducer ep = ref.getEntityProducer(); Entity ent = ep.getEntity(ref); if(ent != null){ assignmentTitle = URLDecoder.decode(ent.getClass().getMethod("getTitle").invoke(ent).toString(),"UTF-8"); assignmentTitleCache.put(assignmentRef, assignmentTitle); } } catch (Exception e) { log.error(e.getMessage(), e); } } return assignmentTitle; } }
EntityProducer ep = ref.getEntityProducer(); Entity ent = ep.getEntity(ref); log.debug("got entity " + ent); if(ent != null){