本文整理汇总了Java中com.atlassian.confluence.util.velocity.VelocityUtils类的典型用法代码示例。如果您正苦于以下问题:Java VelocityUtils类的具体用法?Java VelocityUtils怎么用?Java VelocityUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VelocityUtils类属于com.atlassian.confluence.util.velocity包,在下文中一共展示了VelocityUtils类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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());
}
}
示例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());
}
}
示例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());
}
}
示例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);
}
示例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());
}
}
示例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());
}
}
示例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());
}
}
示例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;
}
示例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);
}
示例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);
}
示例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());
}
}
示例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 );
}
示例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);
}
示例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());
}
}