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

Java ConfigService类代码示例

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

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



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

示例1: setConfigService

import org.springframework.extensions.config.ConfigService; //导入依赖的package包/类
private void setConfigService(final String mimetypes)
{
    ConfigSource configSource = new ConfigSource()
    {
        @Override
        public List<ConfigDeployment> getConfigDeployments()
        {
            String xml =
                "<alfresco-config area=\"mimetype-map\">" +
                "  <config evaluator=\"string-compare\" condition=\"Mimetype Map\">" +
                "    <mimetypes>" +
                       mimetypes +
                "    </mimetypes>" +
                "  </config>" +
                "</alfresco-config>";
            List<ConfigDeployment> configs = new ArrayList<ConfigDeployment>();
            configs.add(new ConfigDeployment("name", new ByteArrayInputStream(xml.getBytes())));
            return configs;
        }
    };

    ConfigService configService = new XMLConfigService(configSource);
    ((XMLConfigService) configService).initConfig();
    ((MimetypeMap)mimetypeService).setConfigService(configService);
}
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:26,代码来源:MimetypeMapTest.java


示例2: getLanguage

import org.springframework.extensions.config.ConfigService; //导入依赖的package包/类
/**
 * Return the configured language Locale for the application context
 * 
 * @param ctx
 *           the application context
 * @return Current language Locale set or the VM default if none set - never null
 */
public static Locale getLanguage(ApplicationContext ctx)
{
   // get from web-client config - the first item in the configured list of languages
   Config config = ((ConfigService) ctx.getBean(Application.BEAN_CONFIG_SERVICE)).getConfig("Languages");
   LanguagesConfigElement langConfig = (LanguagesConfigElement) config
         .getConfigElement(LanguagesConfigElement.CONFIG_ELEMENT_ID);
   List<String> languages = langConfig.getLanguages();
   if (languages != null && languages.size() != 0)
   {
      return I18NUtil.parseLocale(languages.get(0));
   }
   else
   {
      // failing that, use the server default locale
      return Locale.getDefault();
   }
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:25,代码来源:Application.java


示例3: getErrorPage

import org.springframework.extensions.config.ConfigService; //导入依赖的package包/类
/**
 * Retrieves the configured error page for the application
 * 
 * @param context The Spring context
 * @return The configured error page or null if the configuration is missing
 */
public static String getErrorPage(ApplicationContext context)
{
   String errorPage = null;
   
   ConfigService svc = (ConfigService)context.getBean(BEAN_CONFIG_SERVICE);
   ClientConfigElement clientConfig = (ClientConfigElement)svc.getGlobalConfig().
         getConfigElement(ClientConfigElement.CONFIG_ELEMENT_ID);
   
   if (clientConfig != null)
   {
      errorPage = clientConfig.getErrorPage();
   }
   
   return errorPage;
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:22,代码来源:Application.java


示例4: getLoginPage

import org.springframework.extensions.config.ConfigService; //导入依赖的package包/类
/**
 * Retrieves the configured login page for the application
 * 
 * @param context The Spring contexr
 * @return The configured login page or null if the configuration is missing
 */
public static String getLoginPage(ApplicationContext context)
{
   String loginPage = null;
   
   ConfigService svc = (ConfigService)context.getBean(BEAN_CONFIG_SERVICE);
   ClientConfigElement clientConfig = (ClientConfigElement)svc.getGlobalConfig().
         getConfigElement(ClientConfigElement.CONFIG_ELEMENT_ID);
   
   if (clientConfig != null)
   {
      loginPage = clientConfig.getLoginPage();
   }
   
   return loginPage;
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:22,代码来源:Application.java


示例5: getDialogContainers

import org.springframework.extensions.config.ConfigService; //导入依赖的package包/类
/**
 * Retrieves the list of configured dialog container pages
 * 
 * @param context FacesContext
 * @return The container pages
 */
protected List<String> getDialogContainers(FacesContext context)
{
 if ((this.dialogContainers == null) || (Application.isDynamicConfig(FacesContext.getCurrentInstance())))
   {
    this.dialogContainers = new ArrayList<String>(2);
    
      ConfigService configSvc = Application.getConfigService(context);
      Config globalConfig = configSvc.getGlobalConfig();
      
      if (globalConfig != null)
      {
         this.dialogContainers.add(globalConfig.getConfigElement("dialog-container").getValue());
         this.dialogContainers.add(globalConfig.getConfigElement("plain-dialog-container").getValue());
      }
   }
   
   return this.dialogContainers;
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:25,代码来源:AlfrescoVariableResolver.java


示例6: getWizardContainers

import org.springframework.extensions.config.ConfigService; //导入依赖的package包/类
/**
 * Retrieves the list of configured wizard container pages
 * 
 * @param context FacesContext
 * @return The container page
 */
protected List<String> getWizardContainers(FacesContext context)
{
 if ((this.wizardContainers == null) || (Application.isDynamicConfig(FacesContext.getCurrentInstance())))
   {
    this.wizardContainers = new ArrayList<String>(2);
    
      ConfigService configSvc = Application.getConfigService(context);
      Config globalConfig = configSvc.getGlobalConfig();
      
      if (globalConfig != null)
      {
         this.wizardContainers.add(globalConfig.getConfigElement("wizard-container").getValue());
         this.wizardContainers.add(globalConfig.getConfigElement("plain-wizard-container").getValue());
      }
   }
   
   return this.wizardContainers;
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:25,代码来源:AlfrescoVariableResolver.java


示例7: init

import org.springframework.extensions.config.ConfigService; //导入依赖的package包/类
/**
 *
 * @deprecated
 */
public void init()
{
	// TODO - see JIRA Task AR-1715 - refactor calling modules to inject webClientConfigService, and use init-method="register" directly 
	// (instead of init-method="init"). Can then remove applicationContext and no longer implement ApplicationContextAware
    
    if (this.applicationContext.containsBean("webClientConfigService") == true)
    {    
        ConfigService configService = (ConfigService)this.applicationContext.getBean("webClientConfigService"); 
        if (configService != null)
        {
            setConfigService(configService);
            register();
        }
    }
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:20,代码来源:WebClientConfigBootstrap.java


示例8: getOtherPropertiesPresent

import org.springframework.extensions.config.ConfigService; //导入依赖的package包/类
/**
 * Determines whether this document has any other properties other than the 
 * default set to display to the user.
 * 
 * @return true of there are properties to show, false otherwise
 */
public boolean getOtherPropertiesPresent()
{
   if ((this.hasOtherProperties == null) || (Application.isDynamicConfig(FacesContext.getCurrentInstance())))
   {
      // we need to use the config service to see whether there are any
      // editable properties configured for this document.
      ConfigService configSvc = Application.getConfigService(FacesContext.getCurrentInstance());
      Config configProps = configSvc.getConfig(this.editableNode);
      PropertySheetConfigElement propsToDisplay = (PropertySheetConfigElement)configProps.
            getConfigElement("property-sheet");
      
      if (propsToDisplay != null && propsToDisplay.getEditableItemNamesToShow().size() > 0)
      {
         this.hasOtherProperties = Boolean.TRUE;
      }
      else
      {
         this.hasOtherProperties = Boolean.FALSE;
      }
   }
   
   return this.hasOtherProperties.booleanValue();
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:30,代码来源:DocumentPropertiesDialog.java


示例9: getInlineEditableMimeTypes

import org.springframework.extensions.config.ConfigService; //导入依赖的package包/类
protected List<String> getInlineEditableMimeTypes()
{
   if ((this.inlineEditableMimeTypes == null) || (Application.isDynamicConfig(FacesContext.getCurrentInstance())))	  
   {
      this.inlineEditableMimeTypes = new ArrayList<String>(8);
      
      // get the create mime types list from the config
      ConfigService svc = Application.getConfigService(FacesContext.getCurrentInstance());
      Config wizardCfg = svc.getConfig("Content Wizards");
      if (wizardCfg != null)
      {
         ConfigElement typesCfg = wizardCfg.getConfigElement("create-mime-types");
         if (typesCfg != null)
         {
            for (ConfigElement child : typesCfg.getChildren())
            {
               String currentMimeType = child.getAttribute("name");
               this.inlineEditableMimeTypes.add(currentMimeType);
            }
         }
      }
   }
   
   return this.inlineEditableMimeTypes;
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:26,代码来源:AddContentDialog.java


示例10: MimetypeMap

import org.springframework.extensions.config.ConfigService; //导入依赖的package包/类
@Deprecated
public MimetypeMap(ConfigService configService)
{
    logger.warn("MimetypeMap(ConfigService configService) has been deprecated.  "
            + "Use the default constructor and property 'configService'");
    this.configService = configService;
}
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:8,代码来源:MimetypeMap.java


示例11: init

import org.springframework.extensions.config.ConfigService; //导入依赖的package包/类
/**
 * @see javax.servlet.GenericServlet#init()
 */
@Override
public void init(ServletConfig sc) throws ServletException
{
   super.init(sc);
   
   WebApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(sc.getServletContext());
   this.configService = (ConfigService)ctx.getBean("webClientConfigService");
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:12,代码来源:UploadFileServlet.java


示例12: getDialogConfig

import org.springframework.extensions.config.ConfigService; //导入依赖的package包/类
/**
 * Returns the dialog configuration object for the given dialog name.
 * If there is a node in the dispatch context a lookup is performed using
 * the node otherwise the global config section is used.
 * 
 * 
 * @param name The name of dialog being launched
 * @param dispatchContext The node being acted upon
 * @return The DialogConfig for the dialog or null if no config could be found
 */
protected DialogConfig getDialogConfig(FacesContext context, String name, Node dispatchContext)
{
   DialogConfig dialogConfig = null;
   ConfigService configSvc = Application.getConfigService(context);
   
   Config config = null;
   
   if (dispatchContext != null)
   {
      if (logger.isDebugEnabled())
         logger.debug("Using dispatch context for dialog lookup: " + 
               dispatchContext.getType().toString());
      
      // use the node to perform the lookup (this will include the global section)
      config = configSvc.getConfig(dispatchContext);
   }
   else
   {
      if (logger.isDebugEnabled())
         logger.debug("Looking up dialog in global config");
         
      // just use the global 
      config = configSvc.getGlobalConfig();
   }

   if (config != null)
   {
      DialogsConfigElement dialogsCfg = (DialogsConfigElement)config.getConfigElement(
            DialogsConfigElement.CONFIG_ELEMENT_ID);
      if (dialogsCfg != null)
      {
         dialogConfig = dialogsCfg.getDialog(name);
      }
   }
   
   return dialogConfig;
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:48,代码来源:AlfrescoNavigationHandler.java


示例13: getWizardConfig

import org.springframework.extensions.config.ConfigService; //导入依赖的package包/类
/**
 * Returns the wizard configuration object for the given wizard name.
 * If there is a node in the dispatch context a lookup is performed using
 * the node otherwise the global config section is used.
 * 
 * @param name The name of wizard being launched
 * @param dispatchContext The node being acted upon
 * @return The WizardConfig for the wizard or null if no config could be found
 */
protected WizardConfig getWizardConfig(FacesContext context, String name, Node dispatchContext)
{
   WizardConfig wizardConfig = null;
   ConfigService configSvc = Application.getConfigService(context);
   
   Config config = null;
   
   if (dispatchContext != null)
   {
      if (logger.isDebugEnabled())
         logger.debug("Using dispatch context for wizard lookup: " + 
               dispatchContext.getType().toString());
      
      // use the node to perform the lookup (this will include the global section)
      config = configSvc.getConfig(dispatchContext);
   }
   else
   {
      if (logger.isDebugEnabled())
         logger.debug("Looking up wizard in global config");
      
      // just use the global 
      config = configSvc.getGlobalConfig();
   }

   if (config != null)
   {
      WizardsConfigElement wizardsCfg = (WizardsConfigElement)config.getConfigElement(
            WizardsConfigElement.CONFIG_ELEMENT_ID);
      if (wizardsCfg != null)
      {
         wizardConfig = wizardsCfg.getWizard(name);
      }
   }
   
   return wizardConfig;
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:47,代码来源:AlfrescoNavigationHandler.java


示例14: getEncoding

import org.springframework.extensions.config.ConfigService; //导入依赖的package包/类
/**
 * @return  Returns the encoding currently selected
 */
public String getEncoding()
{
   if (encoding == null)
   {
      ConfigService configSvc = Application.getConfigService(FacesContext.getCurrentInstance());
      Config config = configSvc.getConfig("Import Dialog");
      if (config != null)
      {
         ConfigElement defaultEncCfg = config.getConfigElement("default-encoding");
         if (defaultEncCfg != null)
         {
            String value = defaultEncCfg.getValue();
            if (value != null)
            {
               encoding = value.trim();
            }
         }
      }
      if (encoding == null || encoding.length() == 0)
      {
         // if not configured, set to a sensible default for most character sets
         encoding = "UTF-8";
      }
   }
   return encoding;
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:30,代码来源:ImportDialog.java


示例15: getEncodings

import org.springframework.extensions.config.ConfigService; //导入依赖的package包/类
public List<SelectItem> getEncodings()
{
    if ((this.encodings == null) || (Application.isDynamicConfig(FacesContext.getCurrentInstance())))
    {
        FacesContext context = FacesContext.getCurrentInstance();
        
        this.encodings = new ArrayList<SelectItem>(3);
        
        ConfigService svc = Application.getConfigService(context);
        Config cfg = svc.getConfig("Import Dialog");
        if (cfg != null)
        {
            ConfigElement typesCfg = cfg.getConfigElement("encodings");
            if (typesCfg != null)
            {
                for (ConfigElement child : typesCfg.getChildren())
                {
                    String encoding = child.getAttribute("name");
                    if (encoding != null)
                    {
                        this.encodings.add(new SelectItem(encoding, encoding));
                    }
                }
            }
            else
            {
                logger.warn("Could not find 'encodings' configuration element");
            }
        }
        else
        {
            encodings = UICharsetSelector.getCharsetEncodingList();
        }
    }
   
    return this.encodings;
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:38,代码来源:ImportDialog.java


示例16: getDashboardConfig

import org.springframework.extensions.config.ConfigService; //导入依赖的package包/类
/**
 * @return The externally configured WebClient config element for the Dashboards
 */
public static DashboardsConfigElement getDashboardConfig()
{
   ConfigService service = Application.getConfigService(FacesContext.getCurrentInstance());
   DashboardsConfigElement config = (DashboardsConfigElement)service.getConfig("Dashboards").getConfigElement(
         DashboardsConfigElement.CONFIG_ELEMENT_ID);
   return config;
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:11,代码来源:DashboardManager.java


示例17: initFromClientConfig

import org.springframework.extensions.config.ConfigService; //导入依赖的package包/类
/**
 * Initialise default values from client configuration
 */
private void initFromClientConfig()
{
   // TODO - review implications of these default values on dynamic/MT client: viewsConfig & browseViewMode, as well as page size content/spaces ...
   ConfigService config = Application.getConfigService(FacesContext.getCurrentInstance());

   this.viewsConfig = (ViewsConfigElement)config.getConfig("Views").
         getConfigElement(ViewsConfigElement.CONFIG_ELEMENT_ID);

   this.browseViewMode = this.viewsConfig.getDefaultView(PAGE_NAME_BROWSE);
   int pageSize = this.viewsConfig.getDefaultPageSize(PAGE_NAME_BROWSE, this.browseViewMode);
   setPageSizeContent(pageSize);
   setPageSizeSpaces(pageSize);
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:17,代码来源:BrowseBean.java


示例18: getRemovableAspects

import org.springframework.extensions.config.ConfigService; //导入依赖的package包/类
/**
 * Returns a list of aspects that can be removed
 * 
 * @return List of SelectItem objects representing the aspects that can be removed
 */
public List<SelectItem> getRemovableAspects()
{
   if ((this.removableAspects == null) || (Application.isDynamicConfig(FacesContext.getCurrentInstance())))
   {
      // get the list of common aspects
      this.removableAspects = new ArrayList<SelectItem>();
      this.removableAspects.addAll(getCommonAspects());
      
      // get those aspects configured to appear only in the remove aspect action
      ConfigService svc = Application.getConfigService(FacesContext.getCurrentInstance());
      Config wizardCfg = svc.getConfig("Action Wizards");
      if (wizardCfg != null)
      {
         ConfigElement aspectsCfg = wizardCfg.getConfigElement("aspects-remove");
         if (aspectsCfg != null)
         {
            List<SelectItem> aspects = readAspectsConfig(FacesContext.getCurrentInstance(), aspectsCfg);
            this.removableAspects.addAll(aspects);
         }
         else
         {
            logger.warn("Could not find 'aspects-remove' configuration element");
         }
      }
      else
      {
         logger.warn("Could not find 'Action Wizards' configuration section");
      }
      
      // make sure the list is sorted by the label
      QuickSort sorter = new QuickSort(this.removableAspects, "label", true, IDataContainer.SORT_CASEINSENSITIVE);
      sorter.sort();
   }
   
   return this.removableAspects;
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:42,代码来源:BaseActionWizard.java


示例19: getAddableAspects

import org.springframework.extensions.config.ConfigService; //导入依赖的package包/类
/**
 * Returns a list of aspects that can be added
 * 
 * @return List of SelectItem objects representing the aspects that can be added
 */
public List<SelectItem> getAddableAspects()
{
   if ((this.addableAspects == null) || (Application.isDynamicConfig(FacesContext.getCurrentInstance())))
   {
      // get the list of common aspects
      this.addableAspects = new ArrayList<SelectItem>();
      this.addableAspects.addAll(getCommonAspects());
      
      // get those aspects configured to appear only in the remove aspect action
      ConfigService svc = Application.getConfigService(FacesContext.getCurrentInstance());
      Config wizardCfg = svc.getConfig("Action Wizards");
      if (wizardCfg != null)
      {
         ConfigElement aspectsCfg = wizardCfg.getConfigElement("aspects-add");
         if (aspectsCfg != null)
         {
            List<SelectItem> aspects = readAspectsConfig(FacesContext.getCurrentInstance(), aspectsCfg);
            this.addableAspects.addAll(aspects);
         }
         else
         {
            logger.warn("Could not find 'aspects-add' configuration element");
         }
      }
      else
      {
         logger.warn("Could not find 'Action Wizards' configuration section");
      }
      
      // make sure the list is sorted by the label
      QuickSort sorter = new QuickSort(this.addableAspects, "label", true, IDataContainer.SORT_CASEINSENSITIVE);
      sorter.sort();
   }
   
   return this.addableAspects;
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:42,代码来源:BaseActionWizard.java


示例20: getTestableAspects

import org.springframework.extensions.config.ConfigService; //导入依赖的package包/类
/**
 * Returns a list of aspects that can be tested i.e. hasAspect
 * 
 * @return List of SelectItem objects representing the aspects that can be tested for
 */
public List<SelectItem> getTestableAspects()
{
   if ((this.testableAspects == null) || (Application.isDynamicConfig(FacesContext.getCurrentInstance())))
   {
      // get the list of common aspects
      this.testableAspects = new ArrayList<SelectItem>();
      this.testableAspects.addAll(getCommonAspects());
      
      // get those aspects configured to appear only in the remove aspect action
      ConfigService svc = Application.getConfigService(FacesContext.getCurrentInstance());
      Config wizardCfg = svc.getConfig("Action Wizards");
      if (wizardCfg != null)
      {
         ConfigElement aspectsCfg = wizardCfg.getConfigElement("aspects-test");
         if (aspectsCfg != null)
         {
            List<SelectItem> aspects = readAspectsConfig(FacesContext.getCurrentInstance(), aspectsCfg);
            this.testableAspects.addAll(aspects);
         }
         else
         {
            logger.warn("Could not find 'aspects-test' configuration element");
         }
      }
      else
      {
         logger.warn("Could not find 'Action Wizards' configuration section");
      }
      
      // make sure the list is sorted by the label
      QuickSort sorter = new QuickSort(this.testableAspects, "label", true, IDataContainer.SORT_CASEINSENSITIVE);
      sorter.sort();
   }
   
   return this.testableAspects;
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:42,代码来源:BaseActionWizard.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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