public String getUrl(String reference) { Reference ref = getReference(reference); return ref.getUrl() + "html"; }
/** * @{inheritDoc} */ public String getUrl(String reference) { Reference ref = getReference(reference); return ref.getUrl(); }
/** * {@inheritDoc} */ public String getUrl(String reference) { Reference ref = getReference(reference); return ref.getUrl(); }
public String getResourceURL(String ref){ try{ String tmp = ref.replaceFirst("/content", ""); if(tmp.endsWith("/")) M_chs.checkCollection(tmp); else M_chs.checkResource(tmp); }catch(IdUnusedException e){ return null; }catch(Exception e){ // TypeException or PermissionException // It's OK since it exists } Reference r = M_em.newReference(ref); if(r != null) { return StringEscapeUtils.escapeHtml(r.getUrl()); }else{ return null; } }
/** * Return the url unchanged, unless it's a reference, then return the reference url */ protected String convertReferenceUrl(String url) { // make a reference Reference ref = entityManager().newReference(url); // if it didn't recognize this, return it unchanged if (!ref.isKnownType()) return url; // return the reference's url return ref.getUrl(); }
@Override protected String htmlContent(Event event) { StringBuilder buf = new StringBuilder(); // get the message Reference ref = EntityManager.newReference(event.getResource()); MailArchiveMessage msg = (MailArchiveMessage) ref.getEntity(); MailArchiveMessageHeader hdr = (MailArchiveMessageHeader) msg.getMailArchiveHeader(); // if html isn't available, convert plain-text into html buf.append( msg.getFormattedBody() ); // add any attachments List attachments = hdr.getAttachments(); if (attachments.size() > 0) { buf.append("<br/>" + "Attachments:<br/>"); for (Iterator iAttachments = attachments.iterator(); iAttachments.hasNext();) { Reference attachment = (Reference) iAttachments.next(); String attachmentTitle = attachment.getProperties().getPropertyFormatted(ResourceProperties.PROP_DISPLAY_NAME); buf.append("<br/><a href=\"" + attachment.getUrl() + "\" >" + attachmentTitle + "</a><br/>"); } } return buf.toString(); }
if (r != null) String s = r.getUrl(); if (s != null)
String attachmentTitle = attachment.getProperties().getPropertyFormatted(ResourceProperties.PROP_DISPLAY_NAME); buf.append("\n" + attachmentTitle); buf.append("\n" + attachment.getUrl() + "\n");
private String htmlContentAttachments(AssignmentSubmission s){ StringBuffer body = new StringBuffer(); String newline = "<br />\n"; if (s.getFeedbackAttachments() != null && s.getFeedbackAttachments().size() > 0) { body.append(newline).append(newline); if (s.getAssignment().getContent().getTypeOfSubmission() == Assignment.SINGLE_ATTACHMENT_SUBMISSION) { body.append(rb.getString("gen.att.single")); } else { body.append(rb.getString("gen.att")); } body.append(newline); for (Reference attachment : (List<Reference>)s.getFeedbackAttachments()) { String attachmentName = attachment.getProperties().getProperty(ResourceProperties.PROP_DISPLAY_NAME); String attachmentSize = attachment.getProperties().getPropertyFormatted(ResourceProperties.PROP_CONTENT_LENGTH); body.append("<a href=\"" + attachment.getUrl() + "\">" + attachmentName + " (" + attachmentSize + ")" + "</a>"); body.append(newline); } } return body.toString(); }
public static String getReferenceUrl(String idString, String decoration) { String refString = getContentHostingService().getReference(idString); String contentRef = refString; if (decoration != null && !decoration.equals("")) { refString = decoration + refString; } getSecurityService().pushAdvisor( new LocalSecurityAdvisor(ContentHostingService.EVENT_RESOURCE_READ, contentRef)); Reference ref = EntityManager.newReference(refString); if (ref == null || ref.getEntity() == null) { return ""; } return ref.getUrl(); }
buf.append("<a href=\"" + attachment.getUrl() + "\">"); buf.append(attachmentTitle); buf.append("</a>" + newline);
String resourceName = props.getPropertyFormatted(ResourceProperties.PROP_DISPLAY_NAME); String description = props.getPropertyFormatted(ResourceProperties.PROP_DESCRIPTION); String url = ref.getUrl(); String blankLine = "\n\n"; String newLine = "\n";
buf.append(attachmentTitle + ": " +attachment.getUrl() + newline);
String resourceName = props.getPropertyFormatted(ResourceProperties.PROP_DISPLAY_NAME); String description = props.getPropertyFormatted(ResourceProperties.PROP_DESCRIPTION); String url = ref.getUrl(); String blankLine = "\n\n"; String newLine = "\n";
messageContent.url = ref.getUrl() + "html"; //$NON-NLS-1$