Tabnine Logo
RendererManager
Code IndexAdd Tabnine to your IDE (free)

How to use
RendererManager
in
com.atlassian.jira.issue

Best Java code snippets using com.atlassian.jira.issue.RendererManager (Showing top 20 results out of 315)

origin: com.atlassian.jira/jira-rest-plugin

private String doGetPreviewHtml(final String rendererType, final String unrenderedMarkup, final IssueRenderContext renderContext)
{
  // The issueRenderContext allows us to resolve links to attached files and is also used by the wiki renderer, if
  // the issue is null then it is probably the case that we are on the CreateIssue screen and therefore we will
  // not have any attachments. The worst that will happen rendering wiki markup without an issue context is that some links
  // will not render. JRA-11464(JIRA), JST-763(JIRA Studio).
  final String result = rendererManager.getRenderedContent(rendererType, unrenderedMarkup, renderContext);
  return (StringUtils.isBlank(result)) ? RenderersResource.NBSP : result;
}
origin: com.atlassian.jira/jira-core

  @Nonnull
  private JiraRendererPlugin getRenderer()
  {
    final JiraRendererPlugin renderer = rendererManager.getRendererForType(AtlassianWikiRenderer.RENDERER_TYPE);
    if (renderer == null)
    {
      throw new InfrastructureException("wikimarkup renderer not found, but it is required to render the project description");
    }
    return renderer;
  }
}
origin: com.atlassian.jira/jira-core

public List<String> getAllActiveRenderers()
{
  final OrderableField field = getSelectedLayoutItem().getOrderableField();
  final List<String> ret = new ArrayList<String>();
  if(hackyFieldRendererRegistry.shouldOverrideDefaultRenderers(field))
  {
    final Set<HackyRendererType> rendererTypeSet = hackyFieldRendererRegistry.getRendererTypes(field);
    for (HackyRendererType rendererType : rendererTypeSet)
    {
      ret.add(rendererType.getKey());
    }
  }
  else
  {
    final List<JiraRendererPlugin> rendererPlugins = getRendererManager().getAllActiveRenderers();
    for (JiraRendererPlugin rendererPlugin : rendererPlugins)
    {
      ret.add(rendererPlugin.getRendererType());
    }
  }
  return ret;
}
origin: com.atlassian.jira/jira-core

  public String getDescription(String fieldDescription)
  {
    String description = fieldDescription;
    if (featureManager.isOnDemand())
    {
      description = rendererManager.getRenderedContent(AtlassianWikiRenderer.RENDERER_TYPE, fieldDescription, null);
    }
    return description;
  }
}
origin: com.atlassian.jira/jira-core

private void populateRendererParams(final Map<String, Object> velocityParams, final FieldLayoutItem fieldLayoutItem)
{
  final String rendererType = (fieldLayoutItem != null) ? fieldLayoutItem.getRendererType() : null;
  velocityParams.put("rendererDescriptor", getRendererManager().getRendererForType(rendererType).getDescriptor());
  velocityParams.put("rendererParams", new HashMap());
}
origin: com.atlassian.jira/jira-core

private String getActionHtml(Comment comment)
{
  return rendererManager.getRenderedContent(new CommentFieldRenderContext(comment));
}
origin: com.atlassian.jira/jira-core

private Object processValueThroughRenderer(FieldLayoutItem fieldLayoutItem, Object value)
{
  if (isRenderable())
  {
    String rendererType = (fieldLayoutItem != null) ? fieldLayoutItem.getRendererType() : null;
    value = rendererManager.getRendererForType(rendererType).transformFromEdit(value);
  }
  return value;
}
origin: com.atlassian.jira/jira-core

private Object getRendererCustomFieldValue(FieldLayoutItem fieldLayoutItem, Issue issue, Map displayParams)
{
  Object customFieldValue = issue.getCustomFieldValue(this);
  if (isRenderable() && displayParams.get("excel_view") == null)
  {
    String renderedContent = rendererManager.getRenderedContent(fieldLayoutItem, issue);
    if (StringUtils.isNotBlank(renderedContent))
    {
      // JRA-12479 - probably the custom field is in value creation process
      customFieldValue = renderedContent;
    }
  }
  return customFieldValue;
}
origin: com.atlassian.jira/jira-core

public String getContactAdministratorsMessage()
{
  String message = getApplicationProperties().getDefaultBackedString(APKeys.JIRA_CONTACT_ADMINISTRATORS_MESSSAGE);
  return rendererManager.getRendererForType(AtlassianWikiRenderer.RENDERER_TYPE).render(message, null);
}
origin: com.atlassian.jira/jira-core

public String getViewHtml(FieldLayoutItem fieldLayoutItem, Action action, Issue issue, Map displayParameters)
{
  Map velocityParams = getVelocityParams(fieldLayoutItem, action, issue, displayParameters);
  if (isRenderable())
  {
    velocityParams.put("value", rendererManager.getRenderedContent(fieldLayoutItem, issue));
  }
  else
  {
    velocityParams.put("value", getValueFromIssue(issue));
  }
  return getViewHtml(velocityParams);
}
origin: com.atlassian.jira/jira-core

@ActionViewData(key="renderedMessageContent")
public String getRenderedMessage()
{
  String message = getApplicationProperties().getDefaultBackedText(APKeys.JIRA_CONTACT_ADMINISTRATORS_MESSSAGE);
  if (isEmpty(message) || !getShouldDisplayForm())
  {
    message = getText("admin.generalconfiguration.contact.administrators.message.default");
  }
  return rendererManager.getRendererForType(AtlassianWikiRenderer.RENDERER_TYPE).render(message, null);
}
origin: com.atlassian.jira/jira-core

@Override
public void send() throws MailException
{
  String format = recipient.getFormat();
  String bodyTemplatePath = "templates/email/" + format + "/issuementioned.vm";
  String comment = (String) context.get("comment");
  String content = rendererManager.getRenderedContent(
      AtlassianWikiRenderer.RENDERER_TYPE, comment, issueRenderContext);
  context.put("htmlComment", content);
  MailQueueItem item = new MailServiceQueueItemBuilder(from, recipient, subjectTemplatePath,
      bodyTemplatePath, context).buildQueueItemUsingProjectEmailAsReplyTo();
  mailQueue.addItem(item);
}
origin: com.atlassian.jira/jira-core

@Override
public void updateValue(FieldLayoutItem fieldLayoutItem, Issue issue, ModifiedValue modifiedValue, IssueChangeHolder issueChangeHolder)
{
  // all comment creations are seen as an update
  Map<String, Object> commentParams = (Map<String, Object>) modifiedValue.getNewValue();
  String body = (String) commentParams.get(getId());
  // allow the renderer for this field a change to transform the value
  String rendererType = (fieldLayoutItem != null) ? fieldLayoutItem.getRendererType() : null;
  body = (String) rendererManager.getRendererForType(rendererType).transformFromEdit(body);
  if (commentParams.containsKey(EDIT_COMMENT))
  {
    editComment(issueChangeHolder, commentParams, body);
  }
  else if(commentParams.containsKey(REMOVE_COMMENT))
  {
    removeComment(issueChangeHolder, commentParams);
  }
  else
  {
    if (StringUtils.isNotBlank(body))
    {
      createComment(issue, issueChangeHolder, commentParams, body);
    }
  }
}
origin: com.atlassian.jira.plugins/jira-fisheye-plugin

public String render(String text, boolean linkCruKeys) {
  if (linkCruKeys) {
    text = CrucibleRenderer.linkCrucibleKeys(text, fishEyeConfig.getCrucibleProjectToUrlMappings());
  }
  IssueRenderContext renderContext = resolveContext(text);
  return rendererManager.getRenderedContent(MESSAGE_RENDERER, text, renderContext);
}
origin: com.atlassian.jira/jira-core

velocityParams.put("rendererDescriptor", rendererManager.getRendererForType(rendererType).getDescriptor());
velocityParams.put("groupLevels", getGroupLevels());
velocityParams.put("mentionable", mentionService.isUserAbleToMention(authenticationContext.getUser()));
origin: com.atlassian.jira/jira-core

private Object getRendererCustomFieldValue(FieldLayoutItem fieldLayoutItem, Issue issue, Object value)
{
  Object customFieldValue;
  if (isRenderable() && value instanceof String)
  {
    String rendererType = (fieldLayoutItem != null) ? fieldLayoutItem.getRendererType() : null;
    customFieldValue = rendererManager.getRenderedContent(rendererType, (String) value, issue.getIssueRenderContext());
  }
  else
  {
    customFieldValue = value;
  }
  return customFieldValue;
}
origin: com.atlassian.jira/jira-core

/**
 * Returns the edit HTML for this renderable application property.
 *
 * @param fieldName the field name to use in the generated HTML
 * @return a String containing the edit HTML
 */
@Override
public final String getEditHtml(String fieldName)
{
  if (isOnDemand())
  {
    JiraRendererModuleDescriptor rendererDescriptor = rendererManager.getRendererForType(AtlassianWikiRenderer.RENDERER_TYPE).getDescriptor();
    Map<String, String> renderParams = Maps.newHashMap(ImmutableMap.of(
        "rows", "10",
        "cols", "60",
        "wrap", "virtual",
        "class", "long-field"
    ));
    return rendererDescriptor.getEditVM(getValue(), null, AtlassianWikiRenderer.RENDERER_TYPE, fieldName, fieldName, renderParams, false);
  }
  return renderTemplate(EDIT_VM, new Context(fieldName));
}
origin: com.atlassian.jira/jira-core

/**
 * Returns the view HTML for this renderable application property.
 *
 * @return a String containing the view HTML
 */
@Override
public final String getViewHtml()
{
  if (isOnDemand())
  {
    return rendererManager.getRenderedContent(AtlassianWikiRenderer.RENDERER_TYPE, getValue(), null);
  }
  // no OnDemand == no encoding
  return getValue();
}
origin: com.atlassian.jira/jira-core

public String getRendererDisplayName(String rendererType)
{
  final HackyRendererType hackyRendererType = HackyRendererType.fromKey(rendererType);
  if (hackyRendererType != null)
  {
    return getText(hackyRendererType.getDisplayNameI18nKey());
  }
  else
  {
    return rendererManager.getRendererForType(rendererType).getDescriptor().getName();
  }
}
origin: com.atlassian.jira/jira-core

protected void populateVelocityParams(Map params)
{
  params.put("action", this);
  params.put("worklog", this.getWorklog());
  params.put("content", worklog.getComment());
  params.put("userformats", userFormats);
  try
  {
    final FieldLayoutItem fieldLayoutItem = fieldLayoutManager.getFieldLayout(issue).getFieldLayoutItem(IssueFieldConstants.WORKLOG);
    if (fieldLayoutItem != null)
    {
      params.put("content", rendererManager.getRenderedContent(fieldLayoutItem.getRendererType(), worklog.getComment(), issue.getIssueRenderContext()));
    }
  }
  catch (DataAccessException e)
  {
    log.error(e.getMessage(), e);
  }
}
com.atlassian.jira.issueRendererManager

Javadoc

This is the main interface to the renderer components.

Most used methods

  • getRenderedContent
    A convienience method that is the equivilant of calling the getRendererForField method and then invo
  • getRendererForType
    Will return a field renderer for the given renderer type. If the renderer does not exist for the typ
  • getAllActiveRenderers
    Gets all the renderers in the system that have a RenderConfiguration in which the renderer is set as

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getSystemService (Context)
  • onCreateOptionsMenu (Activity)
  • runOnUiThread (Activity)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now