com.atlassian.confluence.util
Class ConfluenceRenderUtils

java.lang.Object
  extended by com.atlassian.confluence.util.ConfluenceRenderUtils

public final class ConfluenceRenderUtils
extends Object

Utilities for rendering Confluence wiki content.


Constructor Summary
ConfluenceRenderUtils()
           
 
Method Summary
static String getAbsoluteAttachmentRemotePath(Attachment attachment)
          Returns the remote path to the given attachment and its siblings.
static String getAttachmentRemotePath(Attachment attachment)
          Returns the remote path to the given attachment and its siblings.
static String getAttachmentRemotePath(ContentEntityObject content)
          Returns the remote path to the attachments of the given ContentEntityObject.
static String getAttachmentsPathForContent(ContentEntityObject content)
          Returns the download path for all the attachments on a given content object, excluding the context path and base URL.
static String getAttachmentsRemotePath(PageContext context)
          Returns the remote path to files attached to the contextual page.
static String renderDefaultStylesheet()
          Returns a default stylesheet for Confluence.
static String renderSpaceStylesheet(Space space)
          Returns a default stylesheet for Confluence.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfluenceRenderUtils

public ConfluenceRenderUtils()
Method Detail

getAttachmentsRemotePath

public static String getAttachmentsRemotePath(PageContext context)
Returns the remote path to files attached to the contextual page. The path commences with the application's context path.

Parameters:
context - must contain an existing ContentEntityObject
Returns:
null if context or its CEO is null, or else the path to the attachments of that ceo. Eg "/confluence/download/attachments/34253"

getAttachmentRemotePath

public static String getAttachmentRemotePath(Attachment attachment)
Returns the remote path to the given attachment and its siblings. NOTE: this path does not include the attachment itself, just the path the attachment is located immediately within. The path commences with the application's context path.

Parameters:
attachment - must be attached to an existing ContentEntityObject
Returns:
null if attachment is null, or else the path to the attachments of the content to which the attachment belongs. Eg "/confluence/download/attachments/34253"

getAbsoluteAttachmentRemotePath

public static String getAbsoluteAttachmentRemotePath(Attachment attachment)
Returns the remote path to the given attachment and its siblings. NOTE: this path does not include the attachment itself, just the path the attachment is located immediately within. The path commences with the application's base URL.

Parameters:
attachment - must be attached to an existing ContentEntityObject
Returns:
null if attachment is null, or else the path to the attachments of the content to which the attachment belongs. Eg "http://example.com/confluence/download/attachments/34253"

getAttachmentRemotePath

public static String getAttachmentRemotePath(ContentEntityObject content)
Returns the remote path to the attachments of the given ContentEntityObject. The path commences with the application's context path.

Returns:
null if content is null, or else the path its attachments. Eg "/confluence/download/attachments/34253"

getAttachmentsPathForContent

public static String getAttachmentsPathForContent(ContentEntityObject content)
Returns the download path for all the attachments on a given content object, excluding the context path and base URL. For example, "/download/attachments/downloads/34253". You can append a slash and a filename to get the path to a particular attachment.


renderDefaultStylesheet

public static String renderDefaultStylesheet()
Returns a default stylesheet for Confluence. This includes the master styles, default theme styles and the globally configured colour scheme.

Returns:
string representation of a default stylesheet for Confluence
See Also:
DefaultTheme

renderSpaceStylesheet

public static String renderSpaceStylesheet(Space space)
Returns a default stylesheet for Confluence. This includes the master styles, default theme styles and the space's configured colour scheme.



Copyright © 2003–2015 Atlassian. All rights reserved.