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

Java VelocityUtils类代码示例

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

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



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

示例1: getTemplate

import com.atlassian.confluence.util.velocity.VelocityUtils; //导入依赖的package包/类
private String getTemplate(String apiUrl, String callbackUrl, String fileUrl, String key, String fileName, ConfluenceUser user, String errorMessage)
		throws UnsupportedEncodingException
{
	Map<String, Object> contextMap = MacroUtils.defaultVelocityContext();

	contextMap.put("docserviceApiUrl", apiUrl + properties.getProperty("files.docservice.url.api"));
	contextMap.put("callbackUrl", callbackUrl);
	contextMap.put("fileUrl", fileUrl);
	contextMap.put("key", key);
	contextMap.put("fileName", fileName);
	contextMap.put("errorMessage", errorMessage);
	if (user != null)
	{
		contextMap.put("userId", user.getName());
		contextMap.put("userName", user.getFullName());
	}

	return VelocityUtils.getRenderedTemplate("templates/editor.vm", contextMap);
}
 
开发者ID:ONLYOFFICE,项目名称:onlyoffice-confluence,代码行数:20,代码来源:OnlyOfficeEditorServlet.java


示例2: execute

import com.atlassian.confluence.util.velocity.VelocityUtils; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public String execute(Map parameters, String body, RenderContext renderContext) throws MacroException 
{
    try
    {
        Map contextMap = MacroUtils.defaultVelocityContext();
        contextMap.put("body", body);
        contextMap.put("title", (String) parameters.get("title"));
        contextMap.put("bgcolor", getHexColor((String) parameters.get("bgcolor")));
        return VelocityUtils.getRenderedTemplate("/templates/greenpepper/confluence/macros/greenPepperTest.vm", contextMap);
    }
    catch (Exception e)
    {
        return getErrorView("greenpepper.test.macroid", e.getMessage());
    }
}
 
开发者ID:strator-dev,项目名称:greenpepper,代码行数:17,代码来源:GreenPepperExample.java


示例3: execute

import com.atlassian.confluence.util.velocity.VelocityUtils; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public String execute(Map parameters, String body, RenderContext renderContext) throws MacroException 
{
    try
    {
        Map contextMap = MacroUtils.defaultVelocityContext();
        contextMap.put("body", body);
        contextMap.put("title", (String) parameters.get("title"));
        contextMap.put("bgcolor", getHexColor((String) parameters.get("bgcolor")));
        return VelocityUtils.getRenderedTemplate("/templates/greenpepper/confluence/macros/greenPepperInfo.vm", contextMap);
    }
    catch (Exception e)
    {
        return getErrorView("greenpepper.info.macroid", e.getMessage());
    }
}
 
开发者ID:strator-dev,项目名称:greenpepper,代码行数:17,代码来源:GreenPepperInfo.java


示例4: execute

import com.atlassian.confluence.util.velocity.VelocityUtils; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public String execute(Map parameters, String body, RenderContext renderContext) 
{
    try
    {
        Map contextMap = MacroUtils.defaultVelocityContext();
        contextMap.put("title", (String)parameters.get("title"));
        contextMap.put("bulkUID", getBulkUID(parameters));
        
        return VelocityUtils.getRenderedTemplate("/templates/greenpepper/confluence/macros/greenPepperGroup.vm", contextMap);
    }
    catch (Exception e)
    {
        return getErrorView("greenpepper.group.macroid", e.getMessage());
    }
}
 
开发者ID:strator-dev,项目名称:greenpepper,代码行数:17,代码来源:GreenPepperGroup.java


示例5: getCombinedCss

import com.atlassian.confluence.util.velocity.VelocityUtils; //导入依赖的package包/类
private String getCombinedCss(final Space space)
{
	final ThemeManager themeManager = (ThemeManager) ContainerManager.getComponent("themeManager");

	final String spaceKey = space == null ? "" : space.getKey();

	Theme activeTheme = themeManager.getGlobalTheme();

	if (StringUtils.isNotEmpty(spaceKey))
	{
		activeTheme = themeManager.getSpaceTheme(spaceKey);
	}

	final ConfluenceWebResourceManager webResourceManager = (ConfluenceWebResourceManager)ContainerManager.getComponent("webResourceManager");

	Map<String, Object> contextMap = new HashMap<String, Object>();
	contextMap.put("spaceKey", spaceKey);
	contextMap.put("globalPrefix", gpUtil.getBaseUrl() + webResourceManager.getGlobalCssResourcePrefix());
	contextMap.put("prefix", gpUtil.getBaseUrl() + webResourceManager.getSpaceCssPrefix(spaceKey));
	contextMap.put("theme", activeTheme);
	contextMap.put("forWysiwyg", Boolean.TRUE);
	contextMap.put("generalUtil", new GeneralUtil());

	return VelocityUtils.getRenderedTemplate("styles/combined-css.vm", contextMap);
}
 
开发者ID:strator-dev,项目名称:greenpepper,代码行数:26,代码来源:DefaultStyleSheetExtractorImpl.java


示例6: execute

import com.atlassian.confluence.util.velocity.VelocityUtils; //导入依赖的package包/类
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
public String execute(Map parameters, String body, RenderContext renderContext) throws MacroException 
{
    try
    {
        Map contextMap = MacroUtils.defaultVelocityContext();
        contextMap.put("body", body);
        contextMap.put("title", (String) parameters.get("title"));
        contextMap.put("bgcolor", getHexColor((String) parameters.get("bgcolor")));
        return VelocityUtils.getRenderedTemplate("/templates/greenpepper/confluence/macros/greenPepperTest.vm", contextMap);
    }
    catch (Exception e)
    {
        return getErrorView("greenpepper.test.macroid", e.getMessage());
    }
}
 
开发者ID:strator-dev,项目名称:greenpepper,代码行数:18,代码来源:GreenPepperExample.java


示例7: execute

import com.atlassian.confluence.util.velocity.VelocityUtils; //导入依赖的package包/类
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
public String execute(Map parameters, String body, RenderContext renderContext) throws MacroException 
{
    try
    {
        Map contextMap = MacroUtils.defaultVelocityContext();
        contextMap.put("body", body);
        contextMap.put("title", (String) parameters.get("title"));
        contextMap.put("bgcolor", getHexColor((String) parameters.get("bgcolor")));
        return VelocityUtils.getRenderedTemplate("/templates/greenpepper/confluence/macros/greenPepperInfo.vm", contextMap);
    }
    catch (Exception e)
    {
        return getErrorView("greenpepper.info.macroid", e.getMessage());
    }
}
 
开发者ID:strator-dev,项目名称:greenpepper,代码行数:18,代码来源:GreenPepperInfo.java


示例8: execute

import com.atlassian.confluence.util.velocity.VelocityUtils; //导入依赖的package包/类
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
public String execute(Map parameters, String body, RenderContext renderContext) 
{
    try
    {
        Map contextMap = MacroUtils.defaultVelocityContext();
        contextMap.put("title", (String)parameters.get("title"));
        contextMap.put("bulkUID", getBulkUID(parameters));
        
        return VelocityUtils.getRenderedTemplate("/templates/greenpepper/confluence/macros/greenPepperGroup.vm", contextMap);
    }
    catch (Exception e)
    {
        return getErrorView("greenpepper.group.macroid", e.getMessage());
    }
}
 
开发者ID:strator-dev,项目名称:greenpepper,代码行数:18,代码来源:GreenPepperGroup.java


示例9: execute

import com.atlassian.confluence.util.velocity.VelocityUtils; //导入依赖的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


示例10: execute

import com.atlassian.confluence.util.velocity.VelocityUtils; //导入依赖的package包/类
/**
 * The execute class, executes when the plugin is created.
 *
 * @param parameters
 * @param bodyContext
 * @param renderContext
 */
@Override
public String execute(Map parameters, String bodyContext,
                      RenderContext renderContext) throws MacroException {
    /**
     * Checks if Forum doesn't exsist. If it doenst it creates a new one,
     * Else it uses the one that already exsist.
     */
    Map context = MacroUtils.defaultVelocityContext();
    if (ao.find(ForumAO.class, "TITLE = ?",
            (String) parameters.get(forumTitel)).length == 0) {
        if (hasEmptyTitle(parameters)) {
            context.put("title", "Demo Forum");
            context.put("description", "This is a Demo of the Forum Macro");
            context.put("forumID", "-1");
            return VelocityUtils.getRenderedTemplate("templates/body.vm", context);
        }
        forum = createNewForum(parameters);
    } else {
        forum = getExistingForum(parameters);
    }
    context.put("title", forum.getTitle());
    context.put("description", forum.getDescription());
    context.put("forumID", forum.getID());
    return VelocityUtils.getRenderedTemplate("templates/body.vm", context);
}
 
开发者ID:confluence-fourum,项目名称:Fourum-Plugin,代码行数:33,代码来源:Forum.java


示例11: getTemplate

import com.atlassian.confluence.util.velocity.VelocityUtils; //导入依赖的package包/类
private String getTemplate(String apiUrl)
		throws UnsupportedEncodingException
{
	Map<String, Object> contextMap = MacroUtils.defaultVelocityContext();

	contextMap.put("docserviceApiUrl", apiUrl);

	return VelocityUtils.getRenderedTemplate("templates/configure.vm", contextMap);
}
 
开发者ID:ONLYOFFICE,项目名称:onlyoffice-confluence,代码行数:10,代码来源:OnlyOfficeConfServlet.java


示例12: execute

import com.atlassian.confluence.util.velocity.VelocityUtils; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public String execute(Map parameters, String body, RenderContext renderContext) throws MacroException 
{
    try
    {
        Map contextMap = MacroUtils.defaultVelocityContext();
        contextMap.put("imports", getImportList(parameters));
        return VelocityUtils.getRenderedTemplate("/templates/greenpepper/confluence/macros/greenPepperImport.vm", contextMap);
    }
    catch (Exception e)
    {
        return getErrorView("greenpepper.import.macroid", e.getMessage());
    }
}
 
开发者ID:strator-dev,项目名称:greenpepper,代码行数:15,代码来源:GreenPepperImport.java


示例13: render

import com.atlassian.confluence.util.velocity.VelocityUtils; //导入依赖的package包/类
private String render(@SuppressWarnings("rawtypes") Map parameters, PageContext context, String pageTitle, Page page)
{
    Map<String, Object> contextMap = MacroUtils.defaultVelocityContext();

    String title = (String) parameters.get( "title" );
    contextMap.put( "title", title != null ? title : pageTitle );

    contextMap.put( "includeHtml", gpUtil.getWikiStyleRenderer().convertWikiToXHtml( context, page.getContent() ) );
    contextMap.put( "executionUID", "GP_INCLUDE_" + MacroCounter.instance().getNextCount() );
    contextMap.put( "expanded", isExpanded( parameters ) );

    return VelocityUtils.getRenderedTemplate( "/templates/greenpepper/confluence/macros/greenPepperInclude.vm", contextMap );
}
 
开发者ID:strator-dev,项目名称:greenpepper,代码行数:14,代码来源:GreenPepperInclude.java


示例14: getErrorView

import com.atlassian.confluence.util.velocity.VelocityUtils; //导入依赖的package包/类
public static String getErrorView(String macroId, String errorId, String message) {
    Map<String,Object> contextMap = MacroUtils.defaultVelocityContext();
    contextMap.put("macroId", macroId);
    contextMap.put("errorId", errorId);
    contextMap.put("errorMessage", message != null ? message : "");

    return VelocityUtils.getRenderedTemplate("/templates/greenpepper/confluence/macros/greenPepperMacros-error.vm", contextMap);
}
 
开发者ID:strator-dev,项目名称:greenpepper,代码行数:9,代码来源:AbstractGreenPepperMacro.java


示例15: execute

import com.atlassian.confluence.util.velocity.VelocityUtils; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public String execute(Map parameters, String body, RenderContext renderContext) throws MacroException 
{
    try
    {
        Map contextMap = MacroUtils.defaultVelocityContext();
        return VelocityUtils.getRenderedTemplate("/templates/greenpepper/confluence/macros/greenPepperLogo.vm", contextMap);
    }
    catch (Exception e)
    {
        return getErrorView("greenpepper.logo.macroid", e.getMessage());
    }
}
 
开发者ID:strator-dev,项目名称:greenpepper,代码行数:14,代码来源:GreenPepperLogo.java


示例16: executeMacro

import com.atlassian.confluence.util.velocity.VelocityUtils; //导入依赖的package包/类
private String executeMacro(Collection<String> importList) {
    try
    {
        Map<String, Object> contextMap = MacroUtils.defaultVelocityContext();
        contextMap.put(IMPORTS_PARAM, importList);
        return VelocityUtils.getRenderedTemplate("/templates/greenpepper/confluence/macros/greenPepperImport.vm", contextMap);
    }
    catch (Exception e)
    {
        return getErrorView("greenpepper.import.macroid", e.getMessage());
    }
}
 
开发者ID:strator-dev,项目名称:greenpepper,代码行数:13,代码来源:GreenPepperImport.java


示例17: getErrorView

import com.atlassian.confluence.util.velocity.VelocityUtils; //导入依赖的package包/类
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
public static String getErrorView(String macroId, String errorId)
{
    Map contextMap = MacroUtils.defaultVelocityContext();
    contextMap.put("macroId", macroId);
    contextMap.put("errorId", errorId);
    return VelocityUtils.getRenderedTemplate("/templates/greenpepper/confluence/macros/greenPepperMacros-error.vm", contextMap);
}
 
开发者ID:strator-dev,项目名称:greenpepper,代码行数:10,代码来源:GreenPepperImport.java


示例18: render

import com.atlassian.confluence.util.velocity.VelocityUtils; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private String render(@SuppressWarnings("rawtypes") Map parameters, PageContext context, String pageTitle, Page page)
{
    Map<String,Object> contextMap = MacroUtils.defaultVelocityContext();

    String title = (String) parameters.get( "title" );
    contextMap.put( "title", title != null ? title : pageTitle );
    contextMap.put( "includeHtml", gpUtil.getViewRenderer().render(page));
    contextMap.put( "executionUID", "GP_INCLUDE_" + MacroCounter.instance().getNextCount() );
    contextMap.put( "expanded", isExpanded( parameters ) );

    return VelocityUtils.getRenderedTemplate( "/templates/greenpepper/confluence/macros/greenPepperInclude.vm", contextMap );
}
 
开发者ID:strator-dev,项目名称:greenpepper,代码行数:14,代码来源:GreenPepperInclude.java


示例19: getErrorView

import com.atlassian.confluence.util.velocity.VelocityUtils; //导入依赖的package包/类
/**
 * <p>getErrorView.</p>
 *
 * @param macroId a {@link java.lang.String} object.
 * @param errorId a {@link java.lang.String} object.
 * @param message a {@link java.lang.String} object.
 * @return a {@link java.lang.String} object.
 */
public static String getErrorView(String macroId, String errorId, String message)
{
    Map<String,Object> contextMap = MacroUtils.defaultVelocityContext();
    contextMap.put("macroId", macroId);
    contextMap.put("errorId", errorId);
    contextMap.put("errorMessage", message != null ? message : "");
    return VelocityUtils.getRenderedTemplate("/templates/greenpepper/confluence/macros/greenPepperMacros-error.vm", contextMap);
}
 
开发者ID:strator-dev,项目名称:greenpepper,代码行数:17,代码来源:AbstractGreenPepperMacro.java


示例20: execute

import com.atlassian.confluence.util.velocity.VelocityUtils; //导入依赖的package包/类
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
public String execute(Map parameters, String body, RenderContext renderContext) throws MacroException 
{
    try
    {
        Map contextMap = MacroUtils.defaultVelocityContext();
        return VelocityUtils.getRenderedTemplate("/templates/greenpepper/confluence/macros/greenPepperLogo.vm", contextMap);
    }
    catch (Exception e)
    {
        return getErrorView("greenpepper.logo.macroid", e.getMessage());
    }
}
 
开发者ID:strator-dev,项目名称:greenpepper,代码行数:15,代码来源:GreenPepperLogo.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java JXMultiSplitPane类代码示例发布时间:2022-05-22
下一篇:
Java TilesUtil类代码示例发布时间: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