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

How to use
RenderContext
in
com.atlassian.renderer

Best Java code snippets using com.atlassian.renderer.RenderContext (Showing top 20 results out of 315)

origin: com.atlassian.confluence.plugins/confluence-advanced-macros

private Integer nextGalleryId(RenderContext renderContext) {
  Integer galleryId = (Integer) renderContext.getParam("nextGalleryId");
  if (galleryId == null) {
    galleryId = 0;
  }
  renderContext.addParam("nextGalleryId", galleryId + 1);
  return galleryId;
}
origin: com.atlassian.applinks/applinks-core

  public String render(final RenderContext renderContext, final String linkText, final String url)
  {
    final StringBuilder sb = new StringBuilder();
    sb.append("<a wysiwyg=\"macro:_appLink\" href=\"");
    sb.append(url);
    sb.append("\">");
    sb.append(linkText);
    sb.append("</a>");
    if (renderContext.isRenderingForWysiwyg())
    {
      sb.append("&#8201;");
    }
    return sb.toString();
  }
}
origin: com.atlassian.confluence.extra/dynamictasklist2

  private boolean renderAsEditable(Map params, RenderContext renderContext) {
    String outputType = renderContext.getOutputType();

    return !(
        RenderContext.PDF.equals(outputType)
            || RenderContext.WORD.equals(outputType)
            || RenderContext.EMAIL.equals(outputType)
            || RenderContext.FEED.equals(outputType)
            || RenderContext.HTML_EXPORT.equals(outputType)
            || ConfluenceRenderContextOutputType.PAGE_GADGET.toString().equals(outputType)
            || STATIC_RENDER_MODE.equals(params.get(RENDER_MODE_PARAM))
    );
  }
}
origin: com.atlassian.jira/jira-core

@Nonnull
RenderContext getRenderContext(@Nullable IssueRenderContext context)
{
  RenderContext renderContext = new RenderContext();
  // Add params from the jira render context
  if (context != null)
  {
    renderContext.getParams().putAll(context.getParams());
    renderContext.addParam(ISSUE_CONTEXT_KEY, context.getIssue());
  }
  renderContext.setBaseUrl(velocityRequestContextFactory.getJiraVelocityRequestContext().getCanonicalBaseUrl());
  renderContext.pushRenderMode(buildConfiguredRenderMode(context));
  return renderContext;
}
origin: org.randombits.storage/storage-confluence

@Override
protected Object getBaseObject( String name ) {
  return renderContext.getParam( name );
}
origin: org.randombits.storage/storage-confluence

@Override
protected void setBaseObject( String name, Object value ) {
  renderContext.addParam( name, value );
}
origin: com.atlassian.labs/confluence-mentions-plugin

context.setOutputType(RenderContext.EMAIL);
ConversionContext conversionContext = new DefaultConversionContext(context);
origin: com.atlassian.studio/applinks-core

buff.append(context.getRenderedContentStore().addInline(render(context, util.group(2),
    assoc.getInstance(), assoc.getRemoteKey())));
origin: org.randombits.storage/storage-confluence

@Override
protected Set<String> baseNameSet() {
  Map<Object, Object> params = renderContext.getParams();
  if ( params != null ) {
    Set<String> names = new java.util.HashSet<String>();
    for ( Object o : params.keySet() ) {
      if ( o instanceof String )
        names.add( ( String ) o );
    }
    return names;
  }
  return Collections.EMPTY_SET;
}
origin: com.atlassian.applinks/applinks-jira-plugin

/**
 * @inheritDoc
 */
public String locate(RenderContext context)
{
  return searchIssueForKey((Issue) context.getParam(AtlassianWikiRenderer.ISSUE_CONTEXT_KEY));
}
origin: com.atlassian.confluence.plugins/confluence-mentions-plugin

renderContext.setOutputType(RenderContext.EMAIL);
origin: com.atlassian.applinks/applinks-core

  assoc.getRemoteKey());
url = RendererUtils.substituteMatchGroups(url, matcher);
buff.append(context.getRenderedContentStore().addInline(render(context, key,
  url)));
origin: com.atlassian.ext/atlassian-plugin-repository-confluence-plugin

public String execute(Map parameters, String body, RenderContext renderContext) throws MacroException
  if (renderContext.getParam("com.atlassian.plugin.repository.plugin.RepositoryMacro:running") != null)
    renderContext.addParam("com.atlassian.plugin.repository.plugin.RepositoryMacro:running", Boolean.TRUE);
origin: com.atlassian.jira/jira-core

public JiraAttachmentLink(GenericLinkParser parser, RenderContext context) throws ParseException
{
  super(parser);
  Issue issue = (Issue) context.getParam(AtlassianWikiRenderer.ISSUE_CONTEXT_KEY);
  if(issue == null || issue.getGenericValue() == null)
  {
    throw new ParseException("Can not resolve attachment with name " + parser.getAttachmentName() + " no issue in context.", 0);
  }
  try
  {
    attachment = getAttachment(issue, parser.getAttachmentName());
    if (attachment != null)
    {
      url = buildAttachmentUrl(context, attachment);
      setTitle(attachment.getFilename() + " attached to " + issue.getKey());
      iconName = ATTACHMENT_ICON;
    }
    if (linkBody.startsWith("^") && linkBody.length() > 1)
      linkBody = linkBody.substring(1);
  }
  catch(Exception e)
  {
    // just don't create a link
    attachment = null;
  }
}
origin: com.atlassian.studio/applinks-core

public String render(RenderContext renderContext, String linkText, ApplicationInstance app, String remoteKey)
{
  StringBuilder sb = new StringBuilder();
  sb.append("<a wysiwyg=\"macro:_appLink\" href=\"");
  sb.append(buildUrl(linkText, app, remoteKey));
  sb.append("\">");
  sb.append(linkText);
  sb.append("</a>");
  if (renderContext.isRenderingForWysiwyg())
  {
    sb.append("&#8201;");
  }
  return sb.toString();
}
origin: com.atlassian.streams/streams-confluence-plugin

private Option<String> content(ContentEntityObject entity, ContentEntityObject lastVersion,
    final BodyContent bodyContent)
{
  if (entity.isVersionCommentAvailable())
  {
    return some(blockquote(escapeHtml4(entity.getVersionComment())));
  }
  //we handle multiple page versions but only the latest comment version
  else if (lastVersion != null && entity instanceof AbstractPage)
  {
    boolean renamed = !entity.getTitle().equals(lastVersion.getTitle());
    return getEditedPageContent(entity, lastVersion, renamed);
  }
  else
  {
    RenderContext renderContext = entity.toPageContext();
    renderContext.setOutputType(RenderContextOutputType.FEED);
    if (BodyType.XHTML.equals(bodyContent.getBodyType()))
    {
      String xml = stripGadgetMacros(entity, entity.getBodyAsString());
      return some(replaceNbsp(xhtmlRenderer.render(xml, new DefaultConversionContext(renderContext))));
    }
    else
    {
      return none();
    }
  }
}
origin: com.atlassian.jira/jira-core

buff.append(context.getRenderedContentStore().addInline(new LinkDecorator(link)));
origin: com.atlassian.confluence.plugins/confluence-advanced-macros

public String execute(Map params, String body, RenderContext renderContext) throws MacroException {
  @SuppressWarnings("unchecked")
  Map<String, String> typeSafeMacroParams = (Map<String, String>) params;
  if (!isThumbnailSupported()) {
    return "<p><span class=\"error\">"
        + getConfluenceActionSupport().getText("gallery.error.thumbnails-not-supported")
        + "</span></p>";
  }
  Integer galleryId = nextGalleryId(renderContext);
  String title = typeSafeMacroParams.get("title");
  Thumbnails thumbnails = findThumbnails(typeSafeMacroParams, renderContext);
  boolean slideshow = renderContext.getOutputType().equals(RenderContextOutputType.DISPLAY);
  String template = getTemplate(null);
  VelocityContext contextMap = createVelocityContext(galleryId, title, thumbnails, slideshow);
  try {
    return getRenderedTemplateWithoutSwallowingErrors(template, contextMap);
  } catch (ResourceNotFoundException e) {
    return "<p><span class='error'>"
        + getConfluenceActionSupport().getText("gallery.error.unable-to-find-render-template", new String[]{escapeHtml4(typeSafeMacroParams.get("theme"))})
        + "</span></p>";
  } catch (Exception exception) {
    log.error("Error while trying to draw the image gallery", exception);
    return "<p><span class='error'>"
        + getConfluenceActionSupport().getText("gallery.error.unable-to-render", new String[]{escapeHtml4(exception.toString())})
        + "</span></p>";
  }
}
origin: com.atlassian.jira/jira-core

public RendererAttachment getAttachment(RenderContext context, EmbeddedResource resource)
{
  // Make sure we have an issue and a usable issueGV from the issue
  Issue issue = (Issue) context.getParam(AtlassianWikiRenderer.ISSUE_CONTEXT_KEY);
  if (resource.isInternal() && issue == null || issue.getGenericValue() == null)
  {
    log.debug("No usable issue stored in the context, unable to resolve filename '" + resource.getFilename() + "'");
    throw new RuntimeException("No usable issue stored in the context, unable to resolve filename '" + resource.getFilename() + "'");
  }
  Attachment attachment = null;
  Collection<Attachment> attachments;
  attachments = issue.getAttachments();
  for (final Attachment tempAttachement : attachments)
  {
    if (tempAttachement.getFilename().equals(resource.getFilename()))
    {
      // Since the list is sorted by filename and date we know the first is the most recent
      attachment = tempAttachement;
      break;
    }
  }
  if (attachment == null)
  {
    return null;
  }
  else
  {
    return convertToRendererAttachment(attachment, context, resource);
  }
}
origin: com.atlassian.confluence.plugins/confluence-advanced-macros

private static void writeHeader(RenderContext renderContext, StringBuilder buffer, String title,
                String borderStyle, String borderColor, int borderWidth, String titleBackgroundColor,
                String panelHeaderCSSClass) {
  buffer.append("<div class=\"").append(panelHeaderCSSClass).append("\"").append(
      renderContext.isRenderingForWysiwyg() ? " wysiwyg=\"ignore\" " : "");
  buffer.append(" style=\"");
  buffer.append("border-bottom-width: ").append(borderWidth).append("px;");
  if (borderWidth > 0) {
    if (isNotBlank(borderStyle))
      buffer.append("border-bottom-style: ").append(borderStyle).append(";");
    if (isNotBlank(borderColor))
      buffer.append("border-bottom-color: ").append(borderColor).append(";");
  }
  if (isNotBlank(titleBackgroundColor))
    buffer.append("background-color: ").append(titleBackgroundColor).append(";");
  buffer.append("\"");
  buffer.append("><b>");
  buffer.append(StringEscapeUtils.escapeHtml4(title));
  buffer.append("</b></div>");
}
com.atlassian.rendererRenderContext

Most used methods

  • getParam
  • addParam
  • getRenderedContentStore
  • isRenderingForWysiwyg
  • setOutputType
  • getOutputType
  • getParams
  • <init>
  • addRenderedContent
  • getBaseUrl
  • getCharacterEncoding
  • getRenderMode
  • getCharacterEncoding,
  • getRenderMode,
  • getSiteRoot,
  • pushRenderMode,
  • setBaseUrl

Popular in Java

  • Updating database using SQL prepared statement
  • scheduleAtFixedRate (Timer)
  • getContentResolver (Context)
  • getResourceAsStream (ClassLoader)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • Menu (java.awt)
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • 14 Best Plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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