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


Java Configuration类代码示例

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


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

示例1: getSystemAuthorities

import com.opensymphony.xwork2.config.Configuration; //导入依赖的package包/类
@Override
public Collection<String> getSystemAuthorities()
{
    HashSet<String> authorities = new HashSet<>();

    Configuration configuration = Dispatcher.getInstance().getConfigurationManager().getConfiguration();

    for ( PackageConfig packageConfig : configuration.getPackageConfigs().values() )
    {
        for ( ActionConfig actionConfig : packageConfig.getActionConfigs().values() )
        {
            authorities.addAll( requiredAuthoritiesProvider.getAllAuthorities( actionConfig ) );
        }
    }

    return authorities;
}
 
开发者ID:dhis2,项目名称:dhis2-core,代码行数:18,代码来源:DetectingSystemAuthoritiesProvider.java

示例2: init

import com.opensymphony.xwork2.config.Configuration; //导入依赖的package包/类
@Override
public void init(Configuration configuration) throws ConfigurationException {
	Tab setupTab = configuration.getContainer().getInstance(Tab.class, "setupTab");
	if (setupTab != null) {
		// The text for the keys used below can be found in "customer.properties"
		setupTab.addChild(
				new DefaultSubTab("deviceTab", "ready.tab.device.title", "/device", "list",
						"ready.tab.device.description", Integer.valueOf(50),
						CorePermissionCodes.READY_CUSTOMER_READINESS_ACCESS), "menu.group.title.data");
		setupTab.addChild(new DefaultSubTab("limitsTab", "ready.tab.minimumRequirements.title", "/task/scope/limits",
				"limits", "ready.tab.minimumRequirements.description", Integer.valueOf(51),
				CorePermissionCodes.READY_CUSTOMER_SCOPE_MIN_SPEC), "menu.group.title.admin");
		setupTab.addChild(new DefaultSubTab("snapshotsTab", "ready.tab.snapshots.title", "/snapshot", "list",
				"ready.tab.snapshots.description", Integer.valueOf(52), CorePermissionCodes.READY_CUSTOMER_SNAPSHOT),
				"menu.group.title.admin");
		setupTab.addChild(new DefaultSubTab("surveyQuestionsTab", "ready.tab.surveyQuestions.title", "/org/survey",
				"list", "ready.tab.surveyQuestions.description", Integer.valueOf(53),
				CorePermissionCodes.READY_CUSTOMER_READINESS_ACCESS), "menu.group.title.data");
		setupTab.addChild(new DefaultSubTab("dataEntryCompleteTab", "ready.tab.dataEntryComplete.title",
				"/org/dataentry", "list", "ready.tab.dataEntryComplete.description", Integer.valueOf(54),
				CorePermissionCodes.READY_CUSTOMER_READINESS_ACCESS), "menu.group.title.data");
	}
}
 
开发者ID:SmarterApp,项目名称:TechnologyReadinessTool,代码行数:24,代码来源:ReadinessPluginInitialize.java

示例3: loadPackages

import com.opensymphony.xwork2.config.Configuration; //导入依赖的package包/类
/**
 * load packages from given bundle.
 * 
 * @param bundle the OSGi bundle to load from
 * @param objectFactory ObjectFactory to use for creating instances
 * @param pkgConfigs existing package configurations
 * @return list of new package configurations loaded
 * 
 * @throws ConfigurationException on error
 */
public List<PackageConfig> loadPackages(Bundle bundle, ObjectFactory objectFactory,
        Map<String, PackageConfig> pkgConfigs) throws ConfigurationException {
    final Configuration config = new DefaultConfiguration("struts.xml");
    final BundleConfigurationProvider prov = new BundleConfigurationProvider("struts.xml", bundle);
    for (final PackageConfig pkg : pkgConfigs.values()) {
        config.addPackageConfig(pkg.getName(), pkg);
    }
    prov.setObjectFactory(objectFactory);
    prov.init(config);
    prov.loadPackages();

    final List<PackageConfig> list = new ArrayList<PackageConfig>(config.getPackageConfigs().values());
    list.removeAll(pkgConfigs.values());

    return list;
}
 
开发者ID:NCIP,项目名称:caarray,代码行数:27,代码来源:BundlePackageLoader.java

示例4: initMockRequest

import com.opensymphony.xwork2.config.Configuration; //导入依赖的package包/类
/**
 * Initialize the mock request.
 */
@Before
public void initMockRequest() {
    ConfigurationManager configurationManager = new ConfigurationManager();
    configurationManager.addContainerProvider(new XWorkConfigurationProvider());
    Configuration config = configurationManager.getConfiguration();
    Container container = config.getContainer();

    ValueStack stack = container.getInstance(ValueStackFactory.class).createValueStack();
    stack.getContext().put(ActionContext.CONTAINER, container);
    ActionContext.setContext(new ActionContext(stack.getContext()));

    assertNotNull(ActionContext.getContext());

    MockHttpServletRequest request = new MockHttpServletRequest();
    MockHttpServletResponse response = new MockHttpServletResponse();
    request.setSession(new MockHttpSession());
    request.setRemoteUser(TEST_USER);
    ServletActionContext.setServletContext(new MockServletContext());
    ServletActionContext.setRequest(request);
    ServletActionContext.setResponse(response);

}
 
开发者ID:NCIP,项目名称:labviewer,代码行数:26,代码来源:AbstractActionTest.java

示例5: setUp

import com.opensymphony.xwork2.config.Configuration; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
    authentication = new AcegiAuthenticationStub();
    authentication.setUsername("user");
    ConfigurationManager configurationManager = new ConfigurationManager();
    configurationManager.addContainerProvider(new XWorkConfigurationProvider());
    Configuration config = configurationManager.getConfiguration();
    Container container = config.getContainer();

    ValueStack stack = container.getInstance(ValueStackFactory.class).createValueStack();
    stack.getContext().put(ActionContext.CONTAINER, container);
    ActionContext.setContext(new ActionContext(stack.getContext()));

    SecurityContextHolder.getContext().setAuthentication(authentication);
    ActionContext.getContext().setSession(new HashMap<String, Object>());

    SessionHelper.getInstance().setStudyManager(true);

    setUpWebContextBuilder();
}
 
开发者ID:NCIP,项目名称:caintegrator,代码行数:21,代码来源:AbstractSessionBasedTest.java

示例6: executeAction

import com.opensymphony.xwork2.config.Configuration; //导入依赖的package包/类
/**
 * Executes an action with extra context information
 * 
 * @param namespace The namespace
 * @param name The action name
 * @param method The method name
 * @param extraContext A map of extra context information
 * @throws XWorkException If anything goes wrong
 */
public void executeAction(String namespace, String name, String method, Map<String, Object> extraContext) throws XWorkException {
    Configuration config = configurationManager.getConfiguration();
    try {
        ActionProxy proxy = config.getContainer().getInstance(ActionProxyFactory.class).createActionProxy(
                namespace, name, method, extraContext, true, false);
    
        proxy.execute();
    } catch (Exception e) {
        throw new XWorkException(e);
    } finally {
        ActionContext.setContext(null);
    }
}
 
开发者ID:txazo,项目名称:struts2,代码行数:23,代码来源:XWork.java

示例7: getPackageConfigs

import com.opensymphony.xwork2.config.Configuration; //导入依赖的package包/类
private Collection<PackageConfig> getPackageConfigs()
{
    Configuration configuration = Dispatcher.getInstance().getConfigurationManager().getConfiguration();

    Map<String, PackageConfig> packageConfigs = configuration.getPackageConfigs();

    return packageConfigs.values();
}
 
开发者ID:dhis2,项目名称:dhis2-core,代码行数:9,代码来源:DefaultModuleManager.java

示例8: setUpActionContext

import com.opensymphony.xwork2.config.Configuration; //导入依赖的package包/类
public static void setUpActionContext() {
	ConfigurationManager configurationManager = new ConfigurationManager();
	configurationManager
		.addContainerProvider(new XWorkConfigurationProvider());
	Configuration config = configurationManager.getConfiguration();
	Container container = config.getContainer();

	ValueStack stack = container.getInstance(ValueStackFactory.class)
		.createValueStack();
	stack.getContext().put(ActionContext.CONTAINER, container);
	ActionContext.setContext(new ActionContext(stack.getContext()));
	ServletActionContext.setRequest(new MockHttpServletRequest());
}
 
开发者ID:gisgraphy,项目名称:gisgraphy,代码行数:14,代码来源:BaseActionTestCase.java

示例9: init

import com.opensymphony.xwork2.config.Configuration; //导入依赖的package包/类
/**
 * Not used.
 */
public void init(Configuration configuration) {
    if (devMode && reload && !listeningToDispatcher) {
        // this is the only way I found to be able to get added to to
        // ConfigurationProvider list
        // listening to events in Dispatcher
        listeningToDispatcher = true;
        Dispatcher.addDispatcherListener(this);
    }
}
 
开发者ID:cenobites,项目名称:struts2-json-plugin,代码行数:13,代码来源:ClasspathConfigurationProvider.java

示例10: init

import com.opensymphony.xwork2.config.Configuration; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void init(Configuration config) throws ConfigurationException {
    this.bundleAccessor = new DefaultBundleAccessor();
    this.configuration = config;

    // this class loader interface can be used by other plugins to lookup resources
    // from the bundles. A temporary class loader interface is set during other configuration
    // loading as well
    this.servletContext.setAttribute(ClassLoaderInterface.CLASS_LOADER_INTERFACE, new BundleClassLoaderInterface());
    instance = this;
}
 
开发者ID:NCIP,项目名称:caarray,代码行数:15,代码来源:OsgiConfigurationProvider.java

示例11: parseNameAndNamespace

import com.opensymphony.xwork2.config.Configuration; //导入依赖的package包/类
/**
 * Parses the name and namespace from the uri
 *
 * @param uri     The uri
 * @param mapping The action mapping to populate
 * @param configManager configuration manager
 */
protected void parseNameAndNamespace(String uri, ActionMapping mapping, ConfigurationManager configManager) {
    String namespace, name;
    int lastSlash = uri.lastIndexOf("/");
    if (lastSlash == -1) {
        namespace = "";
        name = uri;
    } else if (lastSlash == 0) {
        // ww-1046, assume it is the root namespace, it will fallback to
        // default
        // namespace anyway if not found in root namespace.
        namespace = "/";
        name = uri.substring(lastSlash + 1);
    } else if (alwaysSelectFullNamespace) {
        // Simply select the namespace as everything before the last slash
        namespace = uri.substring(0, lastSlash);
        name = uri.substring(lastSlash + 1);
    } else {
        // Try to find the namespace in those defined, defaulting to ""
        Configuration config = configManager.getConfiguration();
        String prefix = uri.substring(0, lastSlash);
        namespace = "";
        boolean rootAvailable = false;
        // Find the longest matching namespace, defaulting to the default
        for (PackageConfig cfg : config.getPackageConfigs().values()) {
            String ns = cfg.getNamespace();
            if (ns != null && prefix.startsWith(ns) && (prefix.length() == ns.length() || prefix.charAt(ns.length()) == '/')) {
                if (ns.length() > namespace.length()) {
                    namespace = ns;
                }
            }
            if ("/".equals(ns)) {
                rootAvailable = true;
            }
        }

        name = uri.substring(namespace.length() + 1);

        // Still none found, use root namespace if found
        if (rootAvailable && "".equals(namespace)) {
            namespace = "/";
        }
    }

    if (!allowSlashesInActionNames) {
        int pos = name.lastIndexOf('/');
        if (pos > -1 && pos < name.length() - 1) {
            name = name.substring(pos + 1);
        }
    }

    mapping.setNamespace(namespace);
    mapping.setName(cleanupActionName(name));
}
 
开发者ID:txazo,项目名称:struts2,代码行数:61,代码来源:DefaultActionMapper.java

示例12: init

import com.opensymphony.xwork2.config.Configuration; //导入依赖的package包/类
public void init(Configuration configuration) throws ConfigurationException {
    // NO-OP
}
 
开发者ID:txazo,项目名称:struts2,代码行数:4,代码来源:AbstractBeanSelectionProvider.java

示例13: init

import com.opensymphony.xwork2.config.Configuration; //导入依赖的package包/类
public void init(Configuration configuration) throws ConfigurationException {
}
 
开发者ID:txazo,项目名称:struts2,代码行数:3,代码来源:DefaultPropertiesProvider.java

示例14: setConfiguration

import com.opensymphony.xwork2.config.Configuration; //导入依赖的package包/类
@Inject
public void setConfiguration(Configuration configuration) {
    this.configuration = configuration;
}
 
开发者ID:txazo,项目名称:struts2,代码行数:5,代码来源:Form.java

示例15: setConfiguration

import com.opensymphony.xwork2.config.Configuration; //导入依赖的package包/类
@Inject
public void setConfiguration(Configuration config) {
    this.configuration = config;
}
 
开发者ID:txazo,项目名称:struts2,代码行数:5,代码来源:DefaultActionProxy.java


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