com.atlassian.jira.sharing.type
Interface ShareTypeRenderer

All Known Implementing Classes:
GlobalShareTypeRenderer, GroupShareTypeRenderer, ProjectShareTypeRenderer, VelocityShareTypeRenderer

public interface ShareTypeRenderer

Implemented by ShareTypes to render their representation on the UI.

Since:
v3.13

Nested Class Summary
static class ShareTypeRenderer.RenderMode
          Enumeration representing the modes that shared can be rendered in Javascript.
 
Method Summary
 String getShareTypeEditor(JiraAuthenticationContext userCtx)
          Return the HTML of the component that is used to configure the ShareType when necessary.
 String getShareTypeLabel(JiraAuthenticationContext userCtx)
          Return a string that can be used to differentiate the associated ShareType.
 String getSimpleDescription(SharePermission permission, JiraAuthenticationContext userCtx)
          Return a simple text only description of the share.
 Map getTranslatedTemplates(JiraAuthenticationContext userCtx, SharedEntity.TypeDescriptor type, ShareTypeRenderer.RenderMode mode)
          Return map of key -> template that can be used to show a configured shares in Javascript.
 boolean isAddButtonNeeded(JiraAuthenticationContext userCtx)
          Return whether or not the component needs a button.
 String renderPermission(SharePermission permission, JiraAuthenticationContext userCtx)
          Return HTML that shows the configured share.
 

Method Detail

renderPermission

String renderPermission(SharePermission permission,
                        JiraAuthenticationContext userCtx)
Return HTML that shows the configured share.

Parameters:
permission - the share to render.
userCtx - the context of the user calling this method.
Returns:
the HTML that shows the passed share.

getSimpleDescription

String getSimpleDescription(SharePermission permission,
                            JiraAuthenticationContext userCtx)
Return a simple text only description of the share.

Parameters:
permission - the share to describe, containing permission params.
userCtx - the context of the user calling this method.
Returns:
the text description of the share.

getShareTypeEditor

String getShareTypeEditor(JiraAuthenticationContext userCtx)
Return the HTML of the component that is used to configure the ShareType when necessary.

Parameters:
userCtx - the context of the user calling this method.
Returns:
The HTML component to render the ShareType.

isAddButtonNeeded

boolean isAddButtonNeeded(JiraAuthenticationContext userCtx)
Return whether or not the component needs a button.

Parameters:
userCtx - the context of the user calling this method.
Returns:
true if the HTML component needs a button or false otherwise.

getShareTypeLabel

String getShareTypeLabel(JiraAuthenticationContext userCtx)
Return a string that can be used to differentiate the associated ShareType. This string is used in the web component that selects a particular ShareType.

Parameters:
userCtx - the context of the user calling this method.
Returns:
A ShareType description.

getTranslatedTemplates

Map getTranslatedTemplates(JiraAuthenticationContext userCtx,
                           SharedEntity.TypeDescriptor type,
                           ShareTypeRenderer.RenderMode mode)
Return map of key -> template that can be used to show a configured shares in Javascript.

Parameters:
userCtx - the context of the user calling this method.
type - the type of the shared entity .
mode - the mode that should be rendered.
Returns:
a map of key -> templates that can be used to render a share type.


Copyright © 2002-2009 Atlassian. All Rights Reserved.