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

Java ContainerManager类代码示例

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

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



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

示例1: checkAccess

import com.atlassian.spring.container.ContainerManager; //导入依赖的package包/类
public static boolean checkAccess(Attachment attachment, User user, boolean forEdit)
{
	if (user == null)
	{
		return false;
	}

	PermissionManager permissionManager = (PermissionManager) ContainerManager.getComponent("permissionManager");

	Permission permission = Permission.VIEW;
	if (forEdit)
	{
		permission = Permission.EDIT;
	}

	boolean access = permissionManager.hasPermission(user, permission, attachment);
	return access;
}
 
开发者ID:ONLYOFFICE,项目名称:onlyoffice-confluence,代码行数:19,代码来源:AttachmentUtil.java


示例2: doGet

import com.atlassian.spring.container.ContainerManager; //导入依赖的package包/类
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response)
		throws ServletException, IOException
{
	String username = userManager.getRemoteUsername(request);
	if (username == null || !userManager.isSystemAdmin(username))
	{
		SettingsManager settingsManager = (SettingsManager) ContainerManager.getComponent("settingsManager");
		String baseUrl = settingsManager.getGlobalSettings().getBaseUrl();
		response.sendRedirect(baseUrl);
		return;
	}

	PluginSettings pluginSettings = pluginSettingsFactory.createGlobalSettings();
	String apiUrl = (String) pluginSettings.get("onlyoffice.apiUrl");
	if (apiUrl == null || apiUrl.isEmpty())
	{
		apiUrl = "";
	}

	response.setContentType("text/html;charset=UTF-8");
	PrintWriter writer = response.getWriter();

	writer.write(getTemplate(apiUrl));
}
 
开发者ID:ONLYOFFICE,项目名称:onlyoffice-confluence,代码行数:26,代码来源:OnlyOfficeConfServlet.java


示例3: startup

import com.atlassian.spring.container.ContainerManager; //导入依赖的package包/类
public void startup(LifecycleContext lifecycleContext)
		throws Exception
{
	log.debug(GreenPepperLifeCycle.class.getName() + "#startup(" + String.valueOf(lifecycleContext) + ")");
	log.info(String.format("*** Starting GreenPepper-Confluence-Plugin (v%s - %s ) ***",
						   ConfluencePlugin.VERSION, ConfluencePlugin.versionDate()));
	
	try
	{
		activator = (GreenPepperServerConfigurationActivator)ContainerManager.getComponent(
						"greenPepperServerConfigurationActivator");
		
		activator.setServletContext(lifecycleContext.getServletContext()); // sync

		log.debug("Configuration:" + activator.getConfiguration());
		activator.startup(false);
	}
	catch (Exception e)
	{
		throw new RuntimeException(e);
	}
}
 
开发者ID:strator-dev,项目名称:greenpepper,代码行数:23,代码来源:GreenPepperLifeCycle.java


示例4: getCombinedCss

import com.atlassian.spring.container.ContainerManager; //导入依赖的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


示例5: startup

import com.atlassian.spring.container.ContainerManager; //导入依赖的package包/类
/** {@inheritDoc} */
public void startup(LifecycleContext lifecycleContext)
		throws Exception
{
	log.debug(GreenPepperLifeCycle.class.getName() + "#startup(" + String.valueOf(lifecycleContext) + ")");
	log.info(String.format("*** Starting GreenPepper-Confluence-Plugin (v%s - %s ) ***",
						   GreenPepperServer.VERSION, GreenPepperServer.versionDate()));
	
	try
	{
		activator = (GreenPepperServerConfigurationActivator)ContainerManager.getComponent(
						"greenPepperServerConfigurationActivator");
		
		log.debug("Configuration:" + activator.getConfiguration());
		activator.startup(false);
	}
	catch (Exception e)
	{
		throw new RuntimeException(e);
	}
}
 
开发者ID:strator-dev,项目名称:greenpepper,代码行数:22,代码来源:GreenPepperLifeCycle.java


示例6: authenticateUserAndLogin

import com.atlassian.spring.container.ContainerManager; //导入依赖的package包/类
protected void authenticateUserAndLogin(HttpServletRequest request,
		HttpServletResponse response, String username)
		throws Exception {

	Authenticator authenticator = SecurityConfigFactory.getInstance().getAuthenticator();

       if (authenticator instanceof ConfluenceAuthenticator) {
           UserAccessor userAccessor = (UserAccessor) ContainerManager.getComponent("userAccessor");
           ConfluenceUser confluenceUser = userAccessor.getUserByName(username);

           if (confluenceUser == null) {
               confluenceUser = tryCreateOrUpdateUser(username);
           }

           if (confluenceUser != null) {
               Boolean result = authoriseUserAndEstablishSession((DefaultAuthenticator) authenticator, confluenceUser, request, response);

               if (result) {
                   redirectToSuccessfulAuthLandingPage(request, response);
                   return;
               }
           }
       }

       redirectToLoginWithSAMLError(response, null, "user_not_found");
}
 
开发者ID:bitium,项目名称:confluence-saml-plugin,代码行数:27,代码来源:SsoConfluenceLoginServlet.java


示例7: GetUri

import com.atlassian.spring.container.ContainerManager; //导入依赖的package包/类
public static String GetUri(Long attachmentId) throws Exception
{
	SettingsManager settingsManager = (SettingsManager) ContainerManager.getComponent("settingsManager");
	String baseUrl = settingsManager.getGlobalSettings().getBaseUrl();

	String hash = CreateHash(Long.toString(attachmentId));

	String callbackUrl = baseUrl + callbackServler + "?vkey=" + GeneralUtil.urlEncode(hash);
	log.info("callbackUrl " + callbackUrl);

	return callbackUrl;
}
 
开发者ID:ONLYOFFICE,项目名称:onlyoffice-confluence,代码行数:13,代码来源:DocumentManager.java


示例8: getCallbackUrl

import com.atlassian.spring.container.ContainerManager; //导入依赖的package包/类
public static String getCallbackUrl(Long attachmentId)
{
	SettingsManager settingsManager = (SettingsManager) ContainerManager.getComponent("settingsManager");
	String baseUrl = settingsManager.getGlobalSettings().getBaseUrl();

	String hash = CreateHash(Long.toString(attachmentId));

	String callbackUrl = baseUrl + callbackServler + "?vkey=" + GeneralUtil.urlEncode(hash);
	log.info("callbackUrl " + callbackUrl);

	return callbackUrl;
}
 
开发者ID:ONLYOFFICE,项目名称:onlyoffice-confluence,代码行数:13,代码来源:DocumentManager.java


示例9: saveAttachment

import com.atlassian.spring.container.ContainerManager; //导入依赖的package包/类
public static void saveAttachment(Long attachmentId, InputStream attachmentData, int size, ConfluenceUser user)
		throws IOException, IllegalArgumentException
{
	AttachmentManager attachmentManager = (AttachmentManager) ContainerManager.getComponent("attachmentManager");
	Attachment attachment = attachmentManager.getAttachment(attachmentId);
	
	Attachment oldAttachment = attachment.copy();
	attachment.setFileSize(size);

	AuthenticatedUserThreadLocal.set(user);

	attachmentManager.saveAttachment(attachment, oldAttachment, attachmentData);
}
 
开发者ID:ONLYOFFICE,项目名称:onlyoffice-confluence,代码行数:14,代码来源:AttachmentUtil.java


示例10: getHashCode

import com.atlassian.spring.container.ContainerManager; //导入依赖的package包/类
public static String getHashCode(Long attachmentId)
{
	AttachmentManager attachmentManager = (AttachmentManager) ContainerManager.getComponent("attachmentManager");
	Attachment attachment = attachmentManager.getAttachment(attachmentId);
	int hashCode = attachment.hashCode();
	log.info("hashCode = " + hashCode);

	int version = attachment.getVersion();
	return attachmentId + "_" + version + "_" + hashCode;
}
 
开发者ID:ONLYOFFICE,项目名称:onlyoffice-confluence,代码行数:11,代码来源:AttachmentUtil.java


示例11: getImportExportManager

import com.atlassian.spring.container.ContainerManager; //导入依赖的package包/类
public ImportExportManager getImportExportManager()
  {
if (importExportManager == null)
{
	importExportManager = (ImportExportManager)ContainerManager.getComponent("importExportManager");
}

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


示例12: getTablesCssContent

import com.atlassian.spring.container.ContainerManager; //导入依赖的package包/类
private String getTablesCssContent()
{
	if (tableCssContent == null)
	{
		InputStream tableCssStream = null;

		try
		{
			ResourceAccessor resourceAccessor = (ResourceAccessor)ContainerManager.getComponent("resourceAccessor");

			tableCssStream = resourceAccessor.getResource("/includes/css/tables.css");

			tableCssContent = IOUtils.toString(tableCssStream);
		}
		catch (Exception ex)
		{
			log.error("Failed to get tables stylesheet. Omitting tables styles.", ex);
			tableCssContent = "/* Failed to get tables stylesheet. Omitting tables styles. */";
		}
		finally
		{
			IOUtils.closeQuietly(tableCssStream);
		}
	}

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


示例13: getGPServerService

import com.atlassian.spring.container.ContainerManager; //导入依赖的package包/类
/*************************************************************************************************/

    public GreenPepperServerService getGPServerService()
    {
        if (service != null){return service;}
        service = (GreenPepperServerService) ContainerManager.getComponent("greenPepperServerService");
        return service;
    }
 
开发者ID:strator-dev,项目名称:greenpepper,代码行数:9,代码来源:ConfluenceGreenPepper.java


示例14: getGPServerConfigurationActivator

import com.atlassian.spring.container.ContainerManager; //导入依赖的package包/类
public GreenPepperServerConfigurationActivator getGPServerConfigurationActivator()
{
	if (configurationActivator != null){return configurationActivator;}
	configurationActivator = (GreenPepperServerConfigurationActivator)ContainerManager.getComponent(
					"greenPepperServerConfigurationActivator");
	return configurationActivator;
}
 
开发者ID:strator-dev,项目名称:greenpepper,代码行数:8,代码来源:ConfluenceGreenPepper.java


示例15: getServerConfigurationActivator

import com.atlassian.spring.container.ContainerManager; //导入依赖的package包/类
private GreenPepperServerConfigurationActivator getServerConfigurationActivator()
{
	if (configurationActivator == null)
	{
		configurationActivator = (GreenPepperServerConfigurationActivator)ContainerManager.getComponent(
						"greenPepperServerConfigurationActivator");
	}

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


示例16: getImportExportManager

import com.atlassian.spring.container.ContainerManager; //导入依赖的package包/类
/**
 * <p>Getter for the field <code>importExportManager</code>.</p>
 *
 * @return a {@link com.atlassian.confluence.importexport.ImportExportManager} object.
 */
public ImportExportManager getImportExportManager()
   {
	if (importExportManager == null)
	{
		importExportManager = (ImportExportManager)ContainerManager.getComponent("importExportManager");
	}

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


示例17: migrate

import com.atlassian.spring.container.ContainerManager; //导入依赖的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


示例18: getGPServerService

import com.atlassian.spring.container.ContainerManager; //导入依赖的package包/类
/**
 * <p>getGPServerService.</p>
 *
 * @return a {@link com.greenpepper.server.GreenPepperServerService} object.
 */
public GreenPepperServerService getGPServerService() {
    if (service != null) {
        return service;
    }
    service = (GreenPepperServerService) ContainerManager.getComponent("greenPepperServerService");
    return service;
}
 
开发者ID:strator-dev,项目名称:greenpepper,代码行数:13,代码来源:ConfluenceGreenPepper.java


示例19: getContentPermissionManager

import com.atlassian.spring.container.ContainerManager; //导入依赖的package包/类
/**
 * <p>Getter for the field <code>contentPermissionManager</code>.</p>
 *
 * @return a {@link com.atlassian.confluence.core.ContentPermissionManager} object.
 */
public ContentPermissionManager getContentPermissionManager() {
    if (contentPermissionManager != null) {
        return contentPermissionManager;
    }
    contentPermissionManager = (ContentPermissionManager) ContainerManager.getComponent("contentPermissionManager");
    return contentPermissionManager;
}
 
开发者ID:strator-dev,项目名称:greenpepper,代码行数:13,代码来源:ConfluenceGreenPepper.java


示例20: getContentPropertyManager

import com.atlassian.spring.container.ContainerManager; //导入依赖的package包/类
/**
 * <p>Getter for the field <code>contentPropertyManager</code>.</p>
 *
 * @return a {@link com.atlassian.confluence.core.ContentPropertyManager} object.
 */
public ContentPropertyManager getContentPropertyManager() {
    if (contentPropertyManager != null) {
        return contentPropertyManager;
    }
    contentPropertyManager = (ContentPropertyManager) ContainerManager.getComponent("contentPropertyManager");
    return contentPropertyManager;
}
 
开发者ID:strator-dev,项目名称:greenpepper,代码行数:13,代码来源:ConfluenceGreenPepper.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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