/**
  * Returns the URL to the resource of this bean (mapped and with the appropriate extension).
  *
  * @see LinkUtil#getUrl(SlingHttpServletRequest, String)
  */
 public String getUrl() {
   if (url == null) {
     RequestHandle request = getRequest();
     url = LinkUtil.getUrl(request, getPath(), request.getSelectors(), null);
   }
   return url;
 }
Example #2
0
 public String getThumbnailUrl() {
   if (thumbnailUrl == null) {
     StringBuilder builder = new StringBuilder();
     try {
       String path = PackageUtil.getThumbnailPath(pckgDef);
       if (StringUtils.isNotBlank(path)) {
         builder.append(LinkUtil.getUrl(request, path));
       }
     } catch (RepositoryException rex) {
       LOG.error(rex.getMessage(), rex);
     }
     thumbnailUrl = builder.toString();
   }
   return thumbnailUrl;
 }
Example #3
0
 public String getAuditLogUrl() {
   if (auditLogUrl == null) {
     auditLogUrl = LinkUtil.getUrl(getRequest(), AUDIT_LOG_BASE + getPath());
   }
   return auditLogUrl;
 }
Example #4
0
 public String getDownloadUrl() {
   if (downloadUrl == null) {
     downloadUrl = LinkUtil.getUrl(getRequest(), PackageUtil.getDownloadUrl(pckg));
   }
   return downloadUrl;
 }
Example #5
0
 @Override
 public String getUrl() {
   return LinkUtil.getUrl(getRequest(), PackagesServlet.SERVLET_PATH + getPath());
 }