org.sakaiproject.entity.api.Reference.getUrl()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(6.3k)|赞(0)|评价(0)|浏览(143)

本文整理了Java中org.sakaiproject.entity.api.Reference.getUrl方法的一些代码示例,展示了Reference.getUrl的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Reference.getUrl方法的具体详情如下:
包路径:org.sakaiproject.entity.api.Reference
类名称:Reference
方法名:getUrl

Reference.getUrl介绍

[英]Access the URL which can be used to access the referenced resource.
[中]访问可用于访问引用资源的URL。

代码示例

代码示例来源:origin: org.sakaiproject/sakai-rwiki-impl

public String getUrl(String reference)
{
  Reference ref = getReference(reference);
  return ref.getUrl() + "html";
}

代码示例来源:origin: org.sakaiproject.mailarchive/sakai-search-adapters-impl

/**
 * @{inheritDoc}
 */
public String getUrl(String reference)
{
  Reference ref = getReference(reference);
  return ref.getUrl();
}

代码示例来源:origin: org.sakaiproject/sakai-chat-impl

/**
* {@inheritDoc}
*/
public String getUrl(String reference) {
 Reference ref = getReference(reference);
 return ref.getUrl();
}

代码示例来源:origin: org.sakaiproject.sitestats/sitestats-impl

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;
  }
}

代码示例来源:origin: org.sakaiproject.kernel/sakai-kernel-impl

/**
 * 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();
}

代码示例来源:origin: org.sakaiproject.announcement/sakai-announcement-impl

el.appendChild(doc.createTextNode( msgRef.getUrl() )); 
item.appendChild(el);
    el.setAttribute("url",attachment.getUrl());
    el.setAttribute("type",attachment.getType());
    item.appendChild(el);

代码示例来源:origin: org.sakaiproject.mailarchive/sakai-mailarchive-impl

@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();
}

代码示例来源:origin: org.sakaiproject/sakai-rwiki-impl

if (r != null)
  String s = r.getUrl();
  if (s != null)

代码示例来源:origin: org.sakaiproject.mailarchive/sakai-mailarchive-impl

String attachmentTitle = attachment.getProperties().getPropertyFormatted(ResourceProperties.PROP_DISPLAY_NAME);
buf.append("\n" + attachmentTitle);
buf.append("\n" + attachment.getUrl() + "\n");

代码示例来源:origin: org.sakaiproject.assignment/sakai-assignment-impl

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();
}

代码示例来源:origin: org.sakaiproject.metaobj/sakai-metaobj-tool-lib

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();
}

代码示例来源:origin: org.sakaiproject.announcement/sakai-announcement-impl

buf.append("<a href=\"" + attachment.getUrl() + "\">");
buf.append(attachmentTitle);
buf.append("</a>" + newline);

代码示例来源:origin: org.sakaiproject.kernel/sakai-kernel-impl

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";

代码示例来源:origin: org.sakaiproject.announcement/sakai-announcement-impl

buf.append(attachmentTitle + ": " +attachment.getUrl() + newline);

代码示例来源:origin: org.sakaiproject.kernel/sakai-kernel-impl

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";

代码示例来源:origin: org.sakaiproject.announcement/sakai-announcement-impl

out.println("<a href=\"" + Validator.escapeHtml(attachment.getUrl()) + "\">"
    + Validator.escapeHtml(attachment.getUrl()) + "</a><br />");

代码示例来源:origin: org.sakaiproject/sakai-rwiki-impl

messageContent.url = ref.getUrl() + "html"; //$NON-NLS-1$

相关文章