当前位置: 首页>>代码示例>>Java>>正文


Java VelocityUtils.getRenderedTemplate方法代码示例

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


在下文中一共展示了VelocityUtils.getRenderedTemplate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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

示例2: 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

示例3: 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

示例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: 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

示例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/greenPepperInfo.vm", contextMap);
    }
    catch (Exception e)
    {
        return getErrorView("greenpepper.info.macroid", e.getMessage());
    }
}
 
开发者ID:strator-dev,项目名称:greenpepper,代码行数:18,代码来源:GreenPepperInfo.java

示例7: 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

示例8: 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

示例9: 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

示例10: 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

示例11: render

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

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

    return VelocityUtils.getRenderedTemplate("/templates/livingdoc/confluence/macros/livingDocInclude.vm", contextMap);
}
 
开发者ID:testIT-LivingDoc,项目名称:livingdoc-confluence,代码行数:13,代码来源:LivingDocInclude.java

示例12: getErrorView

import com.atlassian.confluence.util.velocity.VelocityUtils; //导入方法依赖的package包/类
public static String getErrorView(String macroId, String errorId) {
    Map<String, Object> contextMap = MacroUtils.defaultVelocityContext();
    contextMap.put("macroId", macroId);
    contextMap.put("errorId", errorId);
    return VelocityUtils.getRenderedTemplate("/templates/livingdoc/confluence/macros/livingDocMacros-error.vm",
        contextMap);
}
 
开发者ID:testIT-LivingDoc,项目名称:livingdoc-confluence,代码行数:8,代码来源:AbstractLivingDocMacro.java

示例13: execute

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

示例14: 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

示例15: 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


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