• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ConversionContext类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.atlassian.confluence.content.render.xhtml.ConversionContext的典型用法代码示例。如果您正苦于以下问题:Java ConversionContext类的具体用法?Java ConversionContext怎么用?Java ConversionContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ConversionContext类属于com.atlassian.confluence.content.render.xhtml包,在下文中一共展示了ConversionContext类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: migrate

import com.atlassian.confluence.content.render.xhtml.ConversionContext; //导入依赖的package包/类
/** {@inheritDoc} */
public MacroDefinition migrate(MacroDefinition macroDefinition,
		ConversionContext context) {

    LOGGER.debug("Beginning migration of macro {} ", macroDefinition);
	final String imports = getV3Imports(macroDefinition);
	LOGGER.trace("Migrated Parameters to : {}", imports);
	
	Map<String, String> params = new HashMap<String, String>();
	params.put(GreenPepperImport.IMPORTS_PARAM, imports);

	MacroDefinition newMacroDefinition = new MacroDefinition();
	newMacroDefinition.setName(macroDefinition.getName());
	MacroBody macroBody = new PlainTextMacroBody(imports.replaceAll(",", "\n"));
	newMacroDefinition.setBody(macroBody);
	LOGGER.debug("Migrated Macro: {}", newMacroDefinition);
	return newMacroDefinition;
}
 
开发者ID:strator-dev,项目名称:greenpepper,代码行数:19,代码来源:GreenPepperImportMigrator.java


示例2: execute

import com.atlassian.confluence.content.render.xhtml.ConversionContext; //导入依赖的package包/类
@Override
public String execute(Map<String, String> parameters, String bodyContent,
		ConversionContext conversionContext) throws MacroExecutionException {
	Params params = extractParams(parameters);

	Map<String, Object> veloContext = MacroUtils.defaultVelocityContext();
	veloContext.put(VELO_PARAM_NAME_LABEL, params.label); //$NON-NLS-1$
	veloContext.put(VELO_PARAM_NAME_COLOR,
			StatusColor.valueOf(params.color));
	veloContext.put(VELO_PARAM_NAME_HYPERLINK_URL, params.hyperlinkURL);
	veloContext.put(VELO_PARAM_NAME_HYPERLINK_TARGET,
			params.hyperlinkTarget);
	veloContext
			.put(VELO_PARAM_NAME_APPLY_OUTLINE, params.applyOutlineStyle);
	veloContext.put(VELO_PARAM_NAME_SHOWDETAILS, false);
	veloContext.put(VELO_PARAM_NAME_SHOWFAILEDTESTDETAILSASTOOLTIP, false);
	veloContext.put(VELO_PARAM_NAME_FONTSIZE, params.fontSize);

	String result = renderer.render(VelocityUtils.getRenderedTemplate(
			VELOCITY_TEMPLATE, veloContext), conversionContext);

	return result;
}
 
开发者ID:baloise,项目名称:dashboard-plus,代码行数:24,代码来源:StaticStatusLightMacro.java


示例3: execute

import com.atlassian.confluence.content.render.xhtml.ConversionContext; //导入依赖的package包/类
@Override
public String execute(Map<String, String> parameters, String body, ConversionContext context) throws MacroExecutionException {
    String[] imports = StringUtils.split(body, '\n');
    List<String> importList = Arrays.asList(imports);
    importList.addAll(getImportList(parameters));
    return executeMacro(importList);
}
 
开发者ID:strator-dev,项目名称:greenpepper,代码行数:8,代码来源:GreenPepperImport.java


示例4: execute

import com.atlassian.confluence.content.render.xhtml.ConversionContext; //导入依赖的package包/类
/** {@inheritDoc} */
public String execute(Map<String, String> parameters, String body,
		ConversionContext context) throws MacroExecutionException {
      try
        {
            return execute(parameters, body, context.getPageContext());
        }
        catch (MacroException e)
        {
            throw new MacroExecutionException(e);
        } 	
 }
 
开发者ID:strator-dev,项目名称:greenpepper,代码行数:13,代码来源:AbstractGreenPepperMacro.java


示例5: execute

import com.atlassian.confluence.content.render.xhtml.ConversionContext; //导入依赖的package包/类
/**
 * Confluence 4+
 * @param parameters
 * @param body
 * @param context
 * @return
 * @throws MacroExecutionException
 */
@Override
public String execute(Map<String, String> parameters, String body,
                      ConversionContext context) throws MacroExecutionException {
    try
    {
        String xhtmlRendered = gpUtil.getWikiStyleRenderer().convertWikiToXHtml(context.getPageContext(), body);
        LOGGER.trace("rendering : \n - source \n {} \n - output \n {}", body, xhtmlRendered);
        return xhtmlRendered;
    }
    catch (Exception e)
    {
        return getErrorView("greenpepper.info.macroid", e.getMessage());
    }
}
 
开发者ID:strator-dev,项目名称:greenpepper,代码行数:23,代码来源:GreenPepperWiki.java


示例6: execute

import com.atlassian.confluence.content.render.xhtml.ConversionContext; //导入依赖的package包/类
/** {@inheritDoc} */
public String execute(Map<String, String> parameters, String body,
		ConversionContext context) throws MacroExecutionException {
      try
        {
            return execute(parameters, body, context.getPageContext());
        }
        catch (MacroException e)
        {
            throw new MacroExecutionException(e);
        } 	
}
 
开发者ID:strator-dev,项目名称:greenpepper,代码行数:13,代码来源:AbstractHttpRetrievalMacro.java


示例7: migrate

import com.atlassian.confluence.content.render.xhtml.ConversionContext; //导入依赖的package包/类
/** {@inheritDoc} */
public MacroDefinition migrate(MacroDefinition macroDefinition,
		ConversionContext context) {
	MacroBody body = macroDefinition.getBody();
	
	WikiStyleRenderer wikiStyleRenderer = (WikiStyleRenderer) ContainerManager.getComponent("wikiStyleRenderer");
	String content= wikiStyleRenderer.convertWikiToXHtml(new PageContext(context.getEntity()), body.getBody());
	
	MacroBody newBody = new RichTextMacroBody(content);
	macroDefinition.setBody(newBody);
	
	return macroDefinition;
}
 
开发者ID:strator-dev,项目名称:greenpepper,代码行数:14,代码来源:GreenPepperMacroWithBodyMigrator.java


示例8: execute

import com.atlassian.confluence.content.render.xhtml.ConversionContext; //导入依赖的package包/类
@Override
public String execute(Map<String, String> parameters, String body, ConversionContext context)
        throws MacroExecutionException {
    try {
        return execute(parameters, body, context.getPageContext());
    } catch (MacroException e) {
        throw new MacroExecutionException(e);
    }
}
 
开发者ID:testIT-LivingDoc,项目名称:livingdoc-confluence,代码行数:10,代码来源:AbstractHttpRetrievalMacro.java


示例9: execute

import com.atlassian.confluence.content.render.xhtml.ConversionContext; //导入依赖的package包/类
@Override
public String execute(Map<String, String> parameters, String body, ConversionContext context)
    throws MacroExecutionException {
    try {
        return execute(parameters, body, context.getPageContext());
    } catch (MacroException e) {
        throw new MacroExecutionException(e);
    }
}
 
开发者ID:testIT-LivingDoc,项目名称:livingdoc-confluence,代码行数:10,代码来源:AbstractLivingDocMacro.java


示例10: migrate

import com.atlassian.confluence.content.render.xhtml.ConversionContext; //导入依赖的package包/类
@Override
public MacroDefinition migrate(MacroDefinition macroDefinition, ConversionContext context) {
    MacroBody body = macroDefinition.getBody();

    String content = wikiStyleRenderer.convertWikiToXHtml(new PageContext(context.getEntity()), body.getBody());

    MacroBody newBody = RichTextMacroBody.withStorage(Streamables.from(content));
    macroDefinition.setBody(newBody);

    return macroDefinition;
}
 
开发者ID:testIT-LivingDoc,项目名称:livingdoc-confluence,代码行数:12,代码来源:LivingDocMacroWithBodyMigrator.java


示例11: migrate

import com.atlassian.confluence.content.render.xhtml.ConversionContext; //导入依赖的package包/类
@Override
public MacroDefinition migrate(MacroDefinition macroDefinition, ConversionContext context) {
    final String imports = getV3Imports(macroDefinition);

    Map<String, String> params = new HashMap<String, String>(1) {
        private static final long serialVersionUID = 1L;

        {
            put(LivingDocImport.IMPORTS_PARAM, imports);
        }
    };
    macroDefinition.setParameters(params);

    return macroDefinition;
}
 
开发者ID:testIT-LivingDoc,项目名称:livingdoc-confluence,代码行数:16,代码来源:LivingDocImportMigrator.java


示例12: execute

import com.atlassian.confluence.content.render.xhtml.ConversionContext; //导入依赖的package包/类
@Override
public String execute(Map<String, String> parameters, String bodyContent, ConversionContext conversionContext) throws MacroExecutionException {
    URL url;
    if (parameters.get("URL") == null) {
        return "";
    }
    try {
        url = new URL(parameters.get("URL"));
    } catch (MalformedURLException e) {
        return "Cannot find valid resource.";
    }

    String markdown = fetchPage(url);
    return convertToHtml(markdown, url);
}
 
开发者ID:borisdiakur,项目名称:marked,代码行数:16,代码来源:MarkedMacro.java


示例13: execute

import com.atlassian.confluence.content.render.xhtml.ConversionContext; //导入依赖的package包/类
@Override
public String execute(Map<String, String> parameters, String body,
		ConversionContext context) throws MacroExecutionException {
       ContentEntityObject ceo = context.getPageContext().getEntity();
       Page parent = (Page) ceo ;
       List<Page> children = parent.getChildren();
       StringBuilder html = new StringBuilder();
       // Title row.
       html.append("<table class=\"childtopicpages\"><tr><th>Aihe</th><th>Viestejä</th><th>Viimeinen viesti</th></tr>");
       if (children != null) for (Page child : children) {
       	List<Comment> comments = child.getComments();
   		
       	int numberOfComments = 0;
       	if (comments != null) numberOfComments = comments.size();
       	Date latestCommentDate = null;
       	if (comments != null) for (Comment comment : comments) {
       		Date lastModificationDate = comment.getLastModificationDate();
       		Date creationDate = comment.getCreationDate();
       		if (latestCommentDate == null ||
       				(lastModificationDate != null && latestCommentDate.before(lastModificationDate))) {
       			latestCommentDate = lastModificationDate;
       		}
       		if (latestCommentDate == null ||
       				(creationDate != null && latestCommentDate.before(creationDate))) {
       			latestCommentDate = creationDate;
       		}
       	}
       	DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
       	html.append("<tr><td><a href=\"" + child.getUrlPath() + "\">" + child.getTitle() + "</a></td><td>"
       	    + numberOfComments + "</td><td>");
       	if (latestCommentDate != null) {
       		html.append(df.format(latestCommentDate));
       	}
   		html.append("</td></tr>");
       }
       // Trailer.
       html.append("</table>");
	return html.toString();
}
 
开发者ID:keskival,项目名称:confluence-social-plugin,代码行数:40,代码来源:ChildTopicPagesModule.java


示例14: execute

import com.atlassian.confluence.content.render.xhtml.ConversionContext; //导入依赖的package包/类
@Override
public String execute(Map parameters, String body, ConversionContext context) throws MacroExecutionException {
    String enablePegDownExtensions = parameters.containsKey("enable-pegdown-extensions") ?
            (String) parameters.get("enable-pegdown-extensions") : "true";
    Boolean extensionsEnabled = BooleanUtils.toBoolean(enablePegDownExtensions);

    return this.getProcessor(extensionsEnabled ? Extensions.ALL : Extensions.NONE).markdownToHtml(body);
}
 
开发者ID:CSharpRU,项目名称:simple-markdown,代码行数:9,代码来源:MarkdownMacro.java


示例15: execute

import com.atlassian.confluence.content.render.xhtml.ConversionContext; //导入依赖的package包/类
/**
 * The execute class, executes when the plugin is created.
 *
 * @param parameters
 * @param bodyContent
 * @param conversionContext
 */
@Override
public String execute(Map<String, String> parameters, String bodyContent,
                      ConversionContext conversionContext) throws MacroExecutionException {
    try {
        DefaultConversionContext defaultConversionContext = (DefaultConversionContext) conversionContext;
        RenderContext renderContext = defaultConversionContext
                .getPageContext();
        return execute(parameters, bodyContent, renderContext);
    } catch (MacroException e) {
        throw new MacroExecutionException(e);
    }
}
 
开发者ID:confluence-fourum,项目名称:Fourum-Plugin,代码行数:20,代码来源:Forum.java


示例16: execute

import com.atlassian.confluence.content.render.xhtml.ConversionContext; //导入依赖的package包/类
@Override
public String execute(@Nonnull Map<String, String> parameters, @Nullable String body, @Nonnull ConversionContext conversionContext) throws MacroExecutionException {
    final User currentUser = AuthenticatedUserThreadLocal.get();
    final User user = findUserFor(parameters);
    final Profile profile = findProfileFor(user);
    final Set<String> allowedElementIds = getAllowedElementIdsBy(parameters, currentUser);
    final List<Group> groups = _viewProvider.createGroupsFor(allowedElementIds);
    final Locale locale = getLocaleFor(currentUser);

    final Map<String, Object> context = defaultVelocityContext();
    context.putAll(parameters);
    context.put("conversionContext", conversionContext);
    context.put("currentUser", currentUser);
    context.put("user", user);
    context.put("profile", profile);
    context.put("groups", groups);
    context.put("elementRenderer", _elementRenderer);
    context.put("groupRenderer", _groupRenderer);
    context.put("localizationHelper", _localizationHelper);
    context.put("locale", locale);
    context.put("allowedElementIds", allowedElementIds);
    context.put("border", getValueFor(parameters, Border.visible, Border.visible, Border.hidden));
    context.put("avatar", getValueFor(parameters, Avatar.visible, Avatar.visible, Avatar.hidden));
    context.put("groupLabels", getValueFor(parameters, GroupLabels.visible, GroupLabels.visible, GroupLabels.hidden));
    context.put("labels", getValueFor(parameters, Labels.visible, Labels.visible, Labels.hidden));
    context.put("hints", getHintsFor(parameters));

    context.put("wikiStyleRenderer", _localeManager);
    context.put("rendererContext", conversionContext.getPageContext());

    final String templateName = getTemplateNameFor(context, user);
    return getRenderedTemplate(templateName, context);
}
 
开发者ID:echocat,项目名称:adam,代码行数:34,代码来源:UserProfileMacro.java


示例17: migrate

import com.atlassian.confluence.content.render.xhtml.ConversionContext; //导入依赖的package包/类
/** {@inheritDoc} */
public MacroDefinition migrate(MacroDefinition macroDefinition,
		ConversionContext context) {

	return macroDefinition;
}
 
开发者ID:strator-dev,项目名称:greenpepper,代码行数:7,代码来源:GreenPepperChildrenMigrator.java


示例18: migrate

import com.atlassian.confluence.content.render.xhtml.ConversionContext; //导入依赖的package包/类
@Override
public MacroDefinition migrate(MacroDefinition macroDefinition, ConversionContext context) {

    return macroDefinition;
}
 
开发者ID:testIT-LivingDoc,项目名称:livingdoc-confluence,代码行数:6,代码来源:LivingDocChildrenMigrator.java



注:本文中的com.atlassian.confluence.content.render.xhtml.ConversionContext类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Number160类代码示例发布时间:2022-05-22
下一篇:
Java SingleTableEntityPersister类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap