Tabnine Logo
XhtmlContent.convertStorageToView
Code IndexAdd Tabnine to your IDE (free)

How to use
convertStorageToView
method
in
com.atlassian.confluence.xhtml.api.XhtmlContent

Best Java code snippets using com.atlassian.confluence.xhtml.api.XhtmlContent.convertStorageToView (Showing top 10 results out of 315)

origin: com.atlassian.confluence.plugins/confluence-masterdetail-plugin

  private String convertWikimarkupToViewFormat(String value, ConversionContext conversionContext, List<RuntimeException> errors) throws XhtmlException, XMLStreamException
  {
    return xhtmlUtils.convertStorageToView(xhtmlUtils.convertWikiToStorage(value, conversionContext, errors), conversionContext);
  }
}
origin: com.atlassian.confluence.plugins.socialbookmarking/socialbookmarking

private String getBookmarkDescriptionRendered(ContentEntityObject contentEntityObject)
{
  String bookmarkDescription = StringUtils.defaultString(bookmarkMacroParser.getParameters(contentEntityObject).get("description"));
  try
  {
    return xhtmlContent.convertStorageToView(
        bookmarkDescription,
        new DefaultConversionContext(contentEntityObject.toPageContext())
    );
  }
  catch (Exception e)
  {
    LOG.error("Error rendering bookmark description. Returning markup instead", e);
    return bookmarkDescription;
  }
}
origin: com.atlassian.confluence.plugins.toc/toc-plugin

/**
 * This macro operates on the body of the content entity (e.g. the page) on which the macro is a part of. This
 * method fetches the content body (which should be in XHTML storage-format), renders that to view-format, then
 * returns that to be used as the basis of the TOC generation.
 */
@Override
protected String getContent(final Map<String, String> parameters, final String body, final ConversionContext conversionContext)
{
  final ContentEntityObject contentEntity = conversionContext.getEntity();
  if (contentEntity == null)
  {
    log.warn("There was an error converting the preview content to view - content entity object was null.");
    return "";
  }
  try
  {
    return xhtmlContent.convertStorageToView(contentEntity.getBodyAsString(), conversionContext);
  }
  catch (Exception ex)
  {
    log.warn("There was an error converting the content for id " + contentEntity.getId() + " to storage format.", ex);
    return "";
  }
}
origin: net.customware.confluence.plugin.toc/toc-plugin

protected String getContent(Map<String, String> parameters , String body, ConversionContext conversionContext) 
{
  ContentEntityObject ceo = conversionContext.getEntity();
  
  if (ceo == null)
  {
    log.warn("There was an error converting the preview content to view - content entity object was null.");
    return "";
  }
  
  String pageContent = ceo.getBodyAsString();
  try
  {
    return getXhtmlContent().convertStorageToView(pageContent, conversionContext);
  }
  catch (Exception ex)
  {
    log.warn("There was an error converting the content for id " + ceo.getId() + " to storage format.", ex);
    return "";
  }
}
origin: com.atlassian.confluence.plugins.socialbookmarking/socialbookmarking

final String xhtml = xhtmlContent.convertStorageToView(
    xhtmlContent.convertWikiToStorage(bodyText, conversionContext, conversionErrors),
    conversionContext
origin: com.atlassian.confluence.plugins/confluence-masterdetail-plugin

renderedValue = xhtmlContent.convertStorageToView(headingStorageFormat, context);
origin: com.atlassian.confluence.plugin/func-test

@Override
public String getViewFormat(String authToken, String pageId) throws XMLStreamException, XhtmlException
{
  ContentEntityObject contentEntityObject = getContentEntityObject(pageId);
  return null == contentEntityObject ? null : xhtmlContent.convertStorageToView(contentEntityObject.getBodyAsString(), new DefaultConversionContext(contentEntityObject.toPageContext()));
}
origin: org.randombits.support/support-confluence

  private String renderRichText( Renderable renderable ) throws RenderException {
    try {
      return XhtmlUtils.stripParagraphWrapper( 
          xhtmlContent.convertStorageToView( renderable.getText(), renderable.getConversionContext()) );
    } catch ( XMLStreamException e ) {
      throw new RenderException( e.getMessage(), e );
    } catch ( XhtmlException e ) {
      throw new RenderException( e.getMessage(), e );
    }
  }
}
origin: com.atlassian.confluence.extra.webdav/webdav-plugin

protected InputStream getContentInternal() throws IOException {
  /* Mostly copied from PageWordExportAction to generate MS Word exports of a page */
  Page page = getPage();
  PageContext context = page.toPageContext();
  Settings globalSettings = settingsManager.getGlobalSettings();
  Map<String, Object> contextMap;
  context.setBaseUrl(globalSettings.getBaseUrl());
  context.setSiteRoot(bootstrapManager.getWebAppContextPath());
  context.setOutputType(RenderContextOutputType.WORD);
  context.setLinkRenderer(new WordDocLinkRenderer(context));
  String renderedContent = "";
  try {
    renderedContent = xhtmlContent.convertStorageToView(page.getBodyContent().getBody(), new DefaultConversionContext(context));
  } catch (XMLStreamException e) {
    throw new IOException(e);
  } catch (XhtmlException e) {
    throw new IOException(e);
  }
  contextMap = new HashMap<String, Object>();
  contextMap.put("renderedContent", renderedContent);
  contextMap.put("domainName", globalSettings.getBaseUrl());
  contextMap.put("page", page);
  return new ByteArrayInputStream(
      VelocityUtils.getRenderedTemplate("templates/extra/webdav/exportword.vm", contextMap).getBytes(globalSettings.getDefaultEncoding()));
}
origin: com.atlassian.confluence.plugins/confluence-masterdetail-plugin

try
  final String renderedValue = xhtmlContent.convertStorageToView(value, subContext);
com.atlassian.confluence.xhtml.apiXhtmlContentconvertStorageToView

Popular methods of XhtmlContent

  • handleMacroDefinitions
  • convertWikiToStorage
  • convertWikiToView
  • updateMacroDefinitions

Popular in Java

  • Making http post requests using okhttp
  • getSupportFragmentManager (FragmentActivity)
  • runOnUiThread (Activity)
  • getSystemService (Context)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • Kernel (java.awt.image)
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • Runner (org.openjdk.jmh.runner)
  • 21 Best Atom Packages for 2021
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