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


Java FacesContextUtils.getRequiredWebApplicationContext方法代码示例

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


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

示例1: evaluate

import org.springframework.web.jsf.FacesContextUtils; //导入方法依赖的package包/类
/**
 * @see org.alfresco.web.action.ActionEvaluator#evaluate(org.alfresco.web.bean.repository.Node)
 */
public boolean evaluate(Node node)
{
   FacesContext facesContext = FacesContext.getCurrentInstance();
   NavigationBean nav =
      (NavigationBean)FacesHelper.getManagedBean(facesContext, NavigationBean.BEAN_NAME);
   
   // determine whether the workflow services are active
   boolean workflowPresent = false;
   WebApplicationContext springContext = FacesContextUtils.getRequiredWebApplicationContext(facesContext);
   BPMEngineRegistry bpmReg = (BPMEngineRegistry)springContext.getBean(BPM_ENGINE_BEAN_NAME);
   if (bpmReg != null)
   {
      String[] components = bpmReg.getWorkflowComponents();
      workflowPresent = (components != null && components.length > 0);
   }
   
   return (workflowPresent && nav.getIsGuest() == false && 
           node.hasAspect(ContentModel.ASPECT_MULTILINGUAL_EMPTY_TRANSLATION) == false);
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:23,代码来源:StartWorkflowEvaluator.java

示例2: logOut

import org.springframework.web.jsf.FacesContextUtils; //导入方法依赖的package包/类
/**
 * Invalidate Alfresco ticket and Web/Portlet session and clear the Security context for this thread.
 * @param context
 */
public static void logOut(FacesContext context)
{
   String ticket = null;
   if (Application.inPortalServer())
   {
      ticket = AlfrescoFacesPortlet.onLogOut(context.getExternalContext().getRequest());
   }
   else
   {
      SessionUser user = getCurrentUser(context);
      if (user != null)
      {
         ticket = user.getTicket();
      }
      HttpServletRequest request = (HttpServletRequest) context.getExternalContext().getRequest();
      HttpSession session = request.getSession(false);
      if (session != null)
      {
         session.invalidate();
      }
   }

   // Explicitly invalidate the Alfresco ticket. This no longer happens on session expiry to allow for ticket
   // 'sharing'
   WebApplicationContext wc = FacesContextUtils.getRequiredWebApplicationContext(context);
   AuthenticationService unprotAuthService = (AuthenticationService) wc.getBean(BEAN_UNPROTECTED_AUTH_SERVICE);
   if (ticket != null)
   {
      unprotAuthService.invalidateTicket(ticket);
   }
   unprotAuthService.clearCurrentSecurityContext();      
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:37,代码来源:Application.java

示例3: getDebugData

import org.springframework.web.jsf.FacesContextUtils; //导入方法依赖的package包/类
/**
 * @see org.alfresco.web.ui.common.component.debug.BaseDebugComponent#getDebugData()
 */
@SuppressWarnings("unchecked")
public Map getDebugData()
{
   // note: sort properties
   Map properties = new TreeMap();
   
   FacesContext fc = FacesContext.getCurrentInstance();
   ServiceRegistry services = Repository.getServiceRegistry(fc);
   DescriptorService descriptorService = services.getDescriptorService();
   
   Descriptor installedRepoDescriptor = descriptorService.getInstalledRepositoryDescriptor();
   properties.put("Installed Version", installedRepoDescriptor.getVersion());
   properties.put("Installed Schema", installedRepoDescriptor.getSchema());
   
   Descriptor systemDescriptor = descriptorService.getServerDescriptor();
   properties.put("Server Version", systemDescriptor.getVersion());
   properties.put("Server Schema", systemDescriptor.getSchema());
   
   WebApplicationContext cx = FacesContextUtils.getRequiredWebApplicationContext(fc);
   PatchService patchService = (PatchService)cx.getBean("PatchService");
   List<AppliedPatch> patches = patchService.getPatches(null, null);
   for (AppliedPatch patch : patches)
   {
      StringBuilder data = new StringBuilder(256);
      data.append(patch.getAppliedOnDate())
          .append(" - ")
          .append(patch.getDescription())
          .append(" - ")
          .append(patch.getSucceeded() == true ?
                  Application.getMessage(fc, "repository_patch_succeeded") :
                  Application.getMessage(fc, "repository_patch_failed"));
      properties.put(patch.getId(), data);
   }
   
   return properties; 
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:40,代码来源:UIRepositoryProperties.java

示例4: getAsObject

import org.springframework.web.jsf.FacesContextUtils; //导入方法依赖的package包/类
@Override
public Object getAsObject(FacesContext context, UIComponent component, String value) {
	if (!Strings.isNullOrEmpty(value)) {
		WebApplicationContext applicationContext = FacesContextUtils.getRequiredWebApplicationContext(context);
		DisciplinaRepository disciplinaRepository = applicationContext.getBean(DisciplinaRepository.class);
		return disciplinaRepository.findOne(Long.valueOf(value)).get();
	}
	return null;
}
 
开发者ID:yanaga-samples,项目名称:academico,代码行数:10,代码来源:DisciplinaConverter.java

示例5: getWebApplicationContext

import org.springframework.web.jsf.FacesContextUtils; //导入方法依赖的package包/类
/**
 * Retrieve the WebApplicationContext reference to expose.
 * <p>The default implementation delegates to FacesContextUtils,
 * returning {@code null} if no WebApplicationContext found.
 * @param elContext the current JSF ELContext
 * @return the Spring web application context
 * @see org.springframework.web.jsf.FacesContextUtils#getWebApplicationContext
 */
protected WebApplicationContext getWebApplicationContext(ELContext elContext) {
	FacesContext facesContext = FacesContext.getCurrentInstance();
	return FacesContextUtils.getRequiredWebApplicationContext(facesContext);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:13,代码来源:WebApplicationContextFacesELResolver.java

示例6: getWebApplicationContext

import org.springframework.web.jsf.FacesContextUtils; //导入方法依赖的package包/类
/**
 * Retrieve the web application context to delegate bean name resolution to.
 * <p>The default implementation delegates to FacesContextUtils.
 * @param elContext the current JSF ELContext
 * @return the Spring web application context (never {@code null})
 * @see org.springframework.web.jsf.FacesContextUtils#getRequiredWebApplicationContext
 */
protected WebApplicationContext getWebApplicationContext(ELContext elContext) {
	FacesContext facesContext = FacesContext.getCurrentInstance();
	return FacesContextUtils.getRequiredWebApplicationContext(facesContext);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:12,代码来源:SpringBeanFacesELResolver.java

示例7: resolveWebDAVPath

import org.springframework.web.jsf.FacesContextUtils; //导入方法依赖的package包/类
/**
 * Resolves the given path elements to a NodeRef in the current repository
 * 
 * @param context Faces context
 * @param args    The elements of the path to lookup
 */
public static NodeRef resolveWebDAVPath(FacesContext context, String[] args)
{
   WebApplicationContext wc = FacesContextUtils.getRequiredWebApplicationContext(context);
   return resolveWebDAVPath(wc, args, true);
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:12,代码来源:BaseServlet.java


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