• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java ConfigType类的典型用法和代码示例

java 1次浏览

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

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

示例1: init

点赞 3

import org.guvnor.structure.server.config.ConfigType; //导入依赖的package包/类
@PostConstruct
void init() {
    try {
        configurationService.startBatch();

        //Define mandatory properties
        setupConfigurationGroup(ConfigType.GLOBAL,
                                GLOBAL_SETTINGS,
                                getGlobalConfiguration());

        applicationStartedEvent.fire(new ApplicationStarted());
    } catch (final Exception e) {
        logger.error("Error during update config",
                     e);
        throw new RuntimeException(e);
    } finally {
        configurationService.endBatch();
    }
}
 

开发者ID:kiegroup,
项目名称:optaplanner-wb,
代码行数:20,
代码来源:AppSetup.java

示例2: getGlobalConfiguration

点赞 3

import org.guvnor.structure.server.config.ConfigType; //导入依赖的package包/类
protected ConfigGroup getGlobalConfiguration() {
    final ConfigGroup group = configurationFactory.newConfigGroup(ConfigType.GLOBAL,
                                                                  GLOBAL_SETTINGS,
                                                                  "");
    group.addConfigItem(configurationFactory.newConfigItem("drools.dateformat",
                                                           "dd-MMM-yyyy"));
    group.addConfigItem(configurationFactory.newConfigItem("drools.datetimeformat",
                                                           "dd-MMM-yyyy hh:mm:ss"));
    group.addConfigItem(configurationFactory.newConfigItem("drools.defaultlanguage",
                                                           "en"));
    group.addConfigItem(configurationFactory.newConfigItem("drools.defaultcountry",
                                                           "US"));
    group.addConfigItem(configurationFactory.newConfigItem("build.enable-incremental",
                                                           "true"));
    group.addConfigItem(configurationFactory.newConfigItem("rule-modeller-onlyShowDSLStatements",
                                                           "false"));
    return group;
}
 

开发者ID:kiegroup,
项目名称:optaplanner-wb,
代码行数:19,
代码来源:AppSetup.java

示例3: init

点赞 3

import org.guvnor.structure.server.config.ConfigType; //导入依赖的package包/类
@Test
public void init() {
    when(configurationFactory.newConfigGroup(ConfigType.GLOBAL,
                                             "settings",
                                             "")).thenReturn(new ConfigGroup());

    ConfigItem configItem = new ConfigItem<>();
    configItem.setName("name");
    configItem.setName("value");
    when(configurationFactory.newConfigItem(anyString(),
                                            anyString())).thenReturn(configItem);

    appSetup.init();

    verify(applicationStartedEvent,
           times(1)).fire(any(ApplicationStarted.class));
}
 

开发者ID:kiegroup,
项目名称:optaplanner-wb,
代码行数:18,
代码来源:AppSetupTest.java

示例4: addGroup

点赞 3

import org.guvnor.structure.server.config.ConfigType; //导入依赖的package包/类
@SuppressWarnings({"rawtypes"})
@Override
public void addGroup(final Project project,
                     final String group) {
    ConfigGroup thisProjectConfig = resourceResolver.findProjectConfig(project.getRootPath());

    if (thisProjectConfig == null) {
        thisProjectConfig = configurationFactory.newConfigGroup(ConfigType.PROJECT,
                                                                project.getRootPath().toURI(),
                                                                "Project '" + project.getProjectName() + "' configuration");
        thisProjectConfig.addConfigItem(configurationFactory.newConfigItem("security:groups",
                                                                           new ArrayList<String>()));
        configurationService.addConfiguration(thisProjectConfig);
    }

    if (thisProjectConfig != null) {
        final ConfigItem<List> groups = backward.compat(thisProjectConfig).getConfigItem("security:groups");
        groups.getValue().add(group);

        configurationService.updateConfiguration(thisProjectConfig);
    } else {
        throw new IllegalArgumentException("Project " + project.getProjectName() + " not found");
    }
}
 

开发者ID:kiegroup,
项目名称:appformer,
代码行数:25,
代码来源:AbstractProjectService.java

示例5: loadOrganizationalUnits

点赞 3

import org.guvnor.structure.server.config.ConfigType; //导入依赖的package包/类
@PostConstruct
public void loadOrganizationalUnits() {
    Collection<ConfigGroup> groups = configurationService.getConfiguration(ConfigType.ORGANIZATIONAL_UNIT);
    if (groups != null) {
        for (ConfigGroup groupConfig : groups) {
            // Make sure existing Organizational Units are correctly initialized with a default group id.
            String ouName = groupConfig.getName();
            String defaultGroupId = groupConfig.getConfigItemValue("defaultGroupId");
            if (defaultGroupId == null || defaultGroupId.trim().isEmpty()) {
                groupConfig.setConfigItem(configurationFactory.newConfigItem("defaultGroupId",
                                                                             getSanitizedDefaultGroupId(ouName)));
                configurationService.updateConfiguration(groupConfig);
            }

            OrganizationalUnit ou = organizationalUnitFactory.newOrganizationalUnit(groupConfig);
            registeredOrganizationalUnits.put(ou.getName(),
                                              ou);
        }
    }
}
 

开发者ID:kiegroup,
项目名称:appformer,
代码行数:21,
代码来源:OrganizationalUnitServiceImpl.java

示例6: backwardCompatibilityExistingSecurityRolesTest

点赞 3

import org.guvnor.structure.server.config.ConfigType; //导入依赖的package包/类
@Test
public void backwardCompatibilityExistingSecurityRolesTest() {
    final ConfigurationFactory factory = new ConfigurationFactoryImpl();
    final BackwardCompatibleUtil backwardUtil = new BackwardCompatibleUtil(factory);

    final ConfigGroup group = factory.newConfigGroup(ConfigType.PROJECT,
                                                     "cool2",
                                                     "test2");

    group.addConfigItem(factory.newConfigItem("security:roles",
                                              new ArrayList() {{
                                                  add("group1");
                                              }}));
    assertNotNull(backwardUtil.compat(group).getConfigItem("security:groups"));
    assertEquals(1,
                 ((List<String>) (backwardUtil.compat(group).getConfigItem("security:groups")).getValue()).size());
    assertNull(backwardUtil.compat(group).getConfigItem("security:roles"));
}
 

开发者ID:kiegroup,
项目名称:appformer,
代码行数:19,
代码来源:BackwardCompatibleUtilTest.java

示例7: backwardCompatibilityEmptySecurityRolesTest

点赞 3

import org.guvnor.structure.server.config.ConfigType; //导入依赖的package包/类
@Test
public void backwardCompatibilityEmptySecurityRolesTest() {
    final ConfigurationFactory factory = new ConfigurationFactoryImpl();
    final BackwardCompatibleUtil backwardUtil = new BackwardCompatibleUtil(factory);

    final ConfigGroup group = factory.newConfigGroup(ConfigType.PROJECT,
                                                     "cool3",
                                                     "test3");

    group.addConfigItem(factory.newConfigItem("security:roles",
                                              new ArrayList()));
    assertNotNull(backwardUtil.compat(group).getConfigItem("security:groups"));
    assertEquals(0,
                 ((List<String>) (backwardUtil.compat(group).getConfigItem("security:groups")).getValue()).size());
    assertNull(backwardUtil.compat(group).getConfigItem("security:roles"));
}
 

开发者ID:kiegroup,
项目名称:appformer,
代码行数:17,
代码来源:BackwardCompatibleUtilTest.java

示例8: init

点赞 3

import org.guvnor.structure.server.config.ConfigType; //导入依赖的package包/类
@PostConstruct
public void init() {
    try {
        configurationService.startBatch();

        // Setup mandatory properties for Drools-Workbench
        setupConfigurationGroup( ConfigType.GLOBAL,
                                 GLOBAL_SETTINGS,
                                 getGlobalConfiguration() );

        // Setup properties required by the Work Items Editor
        setupConfigurationGroup( ConfigType.EDITOR,
                                 WorkItemsEditorService.WORK_ITEMS_EDITOR_SETTINGS,
                                 workbenchConfigurationHelper.getWorkItemElementDefinitions() );


        // notify components that bootstrap is completed to start post setups
        applicationStartedEvent.fire( new ApplicationStarted() );
    } catch ( final Exception e ) {
        logger.error( "Error during update config", e );
        throw new RuntimeException( e );
    } finally {
        configurationService.endBatch();
    }
}
 

开发者ID:kiegroup,
项目名称:kie-wb-distributions,
代码行数:26,
代码来源:AppSetup.java

示例9: getGlobalConfiguration

点赞 3

import org.guvnor.structure.server.config.ConfigType; //导入依赖的package包/类
protected ConfigGroup getGlobalConfiguration() {
    //Global Configurations used by many of Drools Workbench editors
    final ConfigGroup group = configurationFactory.newConfigGroup( ConfigType.GLOBAL,
                                                                   GLOBAL_SETTINGS,
                                                                   "" );
    group.addConfigItem( configurationFactory.newConfigItem( "drools.dateformat",
                                                             "dd-MMM-yyyy" ) );
    group.addConfigItem( configurationFactory.newConfigItem( "drools.datetimeformat",
                                                             "dd-MMM-yyyy HH:mm:ss" ) );
    group.addConfigItem( configurationFactory.newConfigItem( "drools.defaultlanguage",
                                                             "en" ) );
    group.addConfigItem( configurationFactory.newConfigItem( "drools.defaultcountry",
                                                             "US" ) );
    group.addConfigItem( configurationFactory.newConfigItem( "build.enable-incremental",
                                                             "true" ) );
    group.addConfigItem( configurationFactory.newConfigItem( "rule-modeller-onlyShowDSLStatements",
                                                             "false" ) );
    group.addConfigItem( configurationFactory.newConfigItem( "support.runtime.deploy",
                                                             "false" ) );
    return group;
}
 

开发者ID:kiegroup,
项目名称:kie-wb-distributions,
代码行数:22,
代码来源:AppSetup.java

示例10: init

点赞 3

import org.guvnor.structure.server.config.ConfigType; //导入依赖的package包/类
@PostConstruct
public void init() {
    try {
        configurationService.startBatch();

        // Setup mandatory properties for Drools-Workbench
        setupConfigurationGroup( ConfigType.GLOBAL,
                                 GLOBAL_SETTINGS,
                                 getGlobalConfiguration() );

        // Setup properties required by the Work Items Editor
        setupConfigurationGroup( ConfigType.EDITOR,
                                 WorkItemsEditorService.WORK_ITEMS_EDITOR_SETTINGS,
                                 workbenchConfigurationHelper.getWorkItemElementDefinitions() );

        // notify components that bootstrap is completed to start post setups
        applicationStartedEvent.fire( new ApplicationStarted() );
    } catch ( final Exception e ) {
        logger.error( "Error during update config", e );
        throw new RuntimeException( e );
    } finally {
        configurationService.endBatch();
    }
}
 

开发者ID:kiegroup,
项目名称:kie-wb-distributions,
代码行数:25,
代码来源:AppSetup.java

示例11: getGlobalConfiguration

点赞 3

import org.guvnor.structure.server.config.ConfigType; //导入依赖的package包/类
protected ConfigGroup getGlobalConfiguration() {
    final ConfigGroup group = configurationFactory.newConfigGroup( ConfigType.GLOBAL,
                                                                   GLOBAL_SETTINGS,
                                                                   "" );
    group.addConfigItem( configurationFactory.newConfigItem( "drools.dateformat",
                                                             "dd-MMM-yyyy" ) );
    group.addConfigItem( configurationFactory.newConfigItem( "drools.datetimeformat",
                                                             "dd-MMM-yyyy HH:mm:ss" ) );
    group.addConfigItem( configurationFactory.newConfigItem( "drools.defaultlanguage",
                                                             "en" ) );
    group.addConfigItem( configurationFactory.newConfigItem( "drools.defaultcountry",
                                                             "US" ) );
    group.addConfigItem( configurationFactory.newConfigItem( "build.enable-incremental",
                                                             "true" ) );
    group.addConfigItem( configurationFactory.newConfigItem( "rule-modeller-onlyShowDSLStatements",
                                                             "false" ) );
    group.addConfigItem( configurationFactory.newConfigItem( "designer.context",
                                                             "designer" ) );
    group.addConfigItem( configurationFactory.newConfigItem( "designer.profile",
                                                             "jbpm" ) );
    group.addConfigItem( configurationFactory.newConfigItem( "support.runtime.deploy",
                                                             "true" ) );
    return group;
}
 

开发者ID:kiegroup,
项目名称:kie-wb-distributions,
代码行数:25,
代码来源:AppSetup.java

示例12: loadWorkDefinitions

点赞 3

import org.guvnor.structure.server.config.ConfigType; //导入依赖的package包/类
public Map<String, WorkDefinition> loadWorkDefinitions() {
    //Find all configured WIDs
    final Map<String, WorkDefinition> workDefinitions = new HashMap<String, WorkDefinition>();
    final List<ConfigGroup> configGroups = configurationService.getConfiguration( ConfigType.EDITOR );
    if ( configGroups == null || configGroups.isEmpty() ) {
        return workDefinitions;
    }

    //Load configured WIDs
    final List<String> definitions = new ArrayList<String>();
    for ( ConfigGroup configGroup : configGroups ) {
        if ( WorkItemsEditorService.WORK_ITEM_DEFINITION.equals( configGroup.getName() ) ) {
            for ( ConfigItem configItem : configGroup.getItems() ) {
                definitions.add( configGroup.getConfigItemValue( configItem.getName() ) );
            }
        }
    }

    //Parse MVEL expressions into model
    workDefinitions.putAll( WorkDefinitionsParser.parse( definitions ) );

    return workDefinitions;
}
 

开发者ID:kiegroup,
项目名称:drools-wb,
代码行数:24,
代码来源:ConfigWorkDefinitionsLoader.java

示例13: testWorkitemDefinitions

点赞 3

import org.guvnor.structure.server.config.ConfigType; //导入依赖的package包/类
@Test
public void testWorkitemDefinitions() throws Exception {
    ConfigGroup group = workbenchConfigurationHelper.getWorkItemElementDefinitions();

    assertEquals(ConfigType.EDITOR, group.getType());
    assertEquals(WorkItemsEditorService.WORK_ITEMS_EDITOR_SETTINGS, group.getName());
    assertEquals("", group.getDescription());

    assertEquals(6, group.getItems().size());

    assertEquals("\"customEditor\" : \"true\"", group.getConfigItemValue(WorkItemsEditorService.WORK_ITEMS_EDITOR_SETTINGS_CUSTOM_EDITOR));

    assertEquals("\"parameterValues\" : [\n" +
            "   \"MyFirstParam\" : \"A,B,C\",   \n" +
            "   \"MySecondParam\" : \"X,Y,Z\"\n" +
            "]", group.getConfigItemValue(WorkItemsEditorService.WORK_ITEMS_EDITOR_SETTINGS_PARAMETER_VALUES));

}
 

开发者ID:kiegroup,
项目名称:drools-wb,
代码行数:19,
代码来源:WorkbenchConfigurationHelperTest.java

示例14: getGlobalConfiguration

点赞 3

import org.guvnor.structure.server.config.ConfigType; //导入依赖的package包/类
private ConfigGroup getGlobalConfiguration() {
    //Global Configurations used by many of Drools Workbench editors
    final ConfigGroup group = configurationFactory.newConfigGroup(ConfigType.GLOBAL,
                                                                  GLOBAL_SETTINGS,
                                                                  "");
    group.addConfigItem(configurationFactory.newConfigItem("drools.dateformat",
                                                           "dd-MMM-yyyy"));
    group.addConfigItem(configurationFactory.newConfigItem("drools.datetimeformat",
                                                           "dd-MMM-yyyy hh:mm:ss"));
    group.addConfigItem(configurationFactory.newConfigItem("drools.defaultlanguage",
                                                           "en"));
    group.addConfigItem(configurationFactory.newConfigItem("drools.defaultcountry",
                                                           "US"));
    group.addConfigItem(configurationFactory.newConfigItem("build.enable-incremental",
                                                           "true"));
    group.addConfigItem(configurationFactory.newConfigItem("rule-modeller-onlyShowDSLStatements",
                                                           "false"));
    return group;
}
 

开发者ID:kiegroup,
项目名称:drools-wb,
代码行数:20,
代码来源:AppSetup.java

示例15: setupUndefinedConfigurationGroupTest

点赞 3

import org.guvnor.structure.server.config.ConfigType; //导入依赖的package包/类
@Test
public void setupUndefinedConfigurationGroupTest() {
    doReturn(new ArrayList<>()).when(configurationService).getConfiguration(eq(ConfigType.GLOBAL));

    final ConfigType configType = ConfigType.GLOBAL;
    final String configGroupName = BaseAppSetup.GLOBAL_SETTINGS;
    final ConfigGroup configGroup = setupPredefinedGlobalConfiguration();

    baseAppSetup.setupConfigurationGroup(configType,
                                         configGroupName,
                                         configGroup);

    verify(configurationService).addConfiguration(any(ConfigGroup.class));
    verify(configurationService,
           never()).updateConfiguration(any(ConfigGroup.class));
}
 

开发者ID:kiegroup,
项目名称:kie-wb-common,
代码行数:17,
代码来源:BaseAppSetupTest.java

示例16: setupPredefinedGlobalConfiguration

点赞 3

import org.guvnor.structure.server.config.ConfigType; //导入依赖的package包/类
private ConfigGroup setupPredefinedGlobalConfiguration() {
    ConfigItem<String> droolsDefaultLanguageConfigItem = new ConfigItem<>();
    droolsDefaultLanguageConfigItem.setName("drools.defaultlanguage");
    droolsDefaultLanguageConfigItem.setValue("pt");
    droolsDefaultLanguageConfigItem = spy(droolsDefaultLanguageConfigItem);

    ConfigItem<String> supportRuntimeDeployConfigItem = new ConfigItem<>();
    supportRuntimeDeployConfigItem.setName("support.runtime.deploy");
    supportRuntimeDeployConfigItem.setValue("true");
    supportRuntimeDeployConfigItem = spy(supportRuntimeDeployConfigItem);

    configItemsByName = new HashMap<>(2);
    configItemsByName.put("drools.defaultlanguage",
                          droolsDefaultLanguageConfigItem);
    configItemsByName.put("support.runtime.deploy",
                          supportRuntimeDeployConfigItem);

    final ConfigGroup group = spy(configurationFactory.newConfigGroup(ConfigType.GLOBAL,
                                                                      BaseAppSetup.GLOBAL_SETTINGS,
                                                                      ""));
    group.setName(BaseAppSetup.GLOBAL_SETTINGS);
    group.addConfigItem(droolsDefaultLanguageConfigItem);
    group.addConfigItem(supportRuntimeDeployConfigItem);

    return group;
}
 

开发者ID:kiegroup,
项目名称:kie-wb-common,
代码行数:27,
代码来源:BaseAppSetupTest.java

示例17: setUp

点赞 3

import org.guvnor.structure.server.config.ConfigType; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
    //Define mandatory properties
    List<ConfigGroup> globalConfigGroups = configurationService.getConfiguration(ConfigType.GLOBAL);
    boolean globalSettingsDefined = false;
    for (ConfigGroup globalConfigGroup : globalConfigGroups) {
        if (GLOBAL_SETTINGS.equals(globalConfigGroup.getName())) {
            globalSettingsDefined = true;
            break;
        }
    }
    if (!globalSettingsDefined) {
        configurationService.addConfiguration(getGlobalConfiguration());
    }

    final URL pomUrl = this.getClass().getResource("/BuildChangeListenerRepo/pom.xml");
    final org.uberfire.java.nio.file.Path nioPomPath = fs.getPath(pomUrl.toURI());
    pomPath = paths.convert(nioPomPath);

    final URL resourceUrl = this.getClass().getResource("/BuildChangeListenerRepo/src/main/resources/update.drl");
    final org.uberfire.java.nio.file.Path nioResourcePath = fs.getPath(resourceUrl.toURI());
    resourcePath = paths.convert(nioResourcePath);

    executor = (ThreadPoolExecutor) Executors.newCachedThreadPool();
    executorManagerFactory.getExecutorManager().setExecutorService(executor);
}
 

开发者ID:kiegroup,
项目名称:kie-wb-common,
代码行数:27,
代码来源:ResourceChangeIncrementalBuilderConcurrencyTest.java

示例18: setUp

点赞 3

import org.guvnor.structure.server.config.ConfigType; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
    //Define mandatory properties
    List<ConfigGroup> globalConfigGroups = configurationService.getConfiguration( ConfigType.GLOBAL );
    boolean globalSettingsDefined = false;
    for ( ConfigGroup globalConfigGroup : globalConfigGroups ) {
        if ( GLOBAL_SETTINGS.equals( globalConfigGroup.getName() ) ) {
            globalSettingsDefined = true;
            break;
        }
    }
    if ( !globalSettingsDefined ) {
        configurationService.addConfiguration( getGlobalConfiguration() );
    }

}
 

开发者ID:kiegroup,
项目名称:kie-wb-common,
代码行数:17,
代码来源:ResourceChangeIncrementalBuilderWithoutFullBuildTest.java

示例19: load

点赞 2

import org.guvnor.structure.server.config.ConfigType; //导入依赖的package包/类
@Override
public Map<String, String> load() {
    final Map<String, String> preferences = new HashMap<String, String>();
    final List<ConfigGroup> configs = configurationService.getConfiguration(ConfigType.GLOBAL);
    for (ConfigGroup config : configs) {
        for (ConfigItem item : config.getItems()) {
            final String name = item.getName();
            final String value = config.getConfigItemValue(name);
            log.info("Setting preference '" + name + "' to '" + value + "'.");
            preferences.put(name,
                            value);
        }
    }
    return preferences;
}
 

开发者ID:kiegroup,
项目名称:appformer,
代码行数:16,
代码来源:DefaultApplicationPreferencesLoader.java

示例20: findProjectConfig

点赞 2

import org.guvnor.structure.server.config.ConfigType; //导入依赖的package包/类
protected ConfigGroup findProjectConfig(final Path projectRoot) {
    final Collection<ConfigGroup> groups = configurationService.getConfiguration(ConfigType.PROJECT);
    if (groups != null) {
        for (ConfigGroup groupConfig : groups) {
            if (groupConfig.getName().equals(projectRoot.toURI())) {
                return groupConfig;
            }
        }
    }
    return null;
}
 

开发者ID:kiegroup,
项目名称:appformer,
代码行数:12,
代码来源:ResourceResolver.java

示例21: loadGroups

点赞 2

import org.guvnor.structure.server.config.ConfigType; //导入依赖的package包/类
@PostConstruct
public void loadGroups() {
    Collection<ConfigGroup> deployments = configurationService.getConfiguration(ConfigType.DEPLOYMENT);
    if (deployments != null) {
        for (ConfigGroup deploymentConfig : deployments) {
            DeploymentConfig deployment = deploymentFactory.newDeployment(deploymentConfig);
            registeredDeployments.put(deployment.getIdentifier(),
                                      deployment);
        }
    }
}
 

开发者ID:kiegroup,
项目名称:appformer,
代码行数:12,
代码来源:DeploymentConfigServiceImpl.java

示例22: addDeployment

点赞 2

import org.guvnor.structure.server.config.ConfigType; //导入依赖的package包/类
@Override
public void addDeployment(String identifier,
                          Object deploymentUnit) {
    ConfigGroup deploymentConfig = configurationFactory.newConfigGroup(ConfigType.DEPLOYMENT,
                                                                       identifier,
                                                                       "");
    deploymentConfig.addConfigItem(configurationFactory.newConfigItem("unit",
                                                                      deploymentUnit));

    configurationService.addConfiguration(deploymentConfig);

    DeploymentConfig deployment = deploymentFactory.newDeployment(deploymentConfig);
    registeredDeployments.put(deployment.getIdentifier(),
                              deployment);
}
 

开发者ID:kiegroup,
项目名称:appformer,
代码行数:16,
代码来源:DeploymentConfigServiceImpl.java

示例23: removeDeployment

点赞 2

import org.guvnor.structure.server.config.ConfigType; //导入依赖的package包/类
@Override
public void removeDeployment(String identifier) {
    ConfigGroup deploymentConfig = configurationFactory.newConfigGroup(ConfigType.DEPLOYMENT,
                                                                       identifier,
                                                                       "");
    configurationService.removeConfiguration(deploymentConfig);

    registeredDeployments.remove(identifier);
}
 

开发者ID:kiegroup,
项目名称:appformer,
代码行数:10,
代码来源:DeploymentConfigServiceImpl.java

示例24: findGroupConfig

点赞 2

import org.guvnor.structure.server.config.ConfigType; //导入依赖的package包/类
protected ConfigGroup findGroupConfig(final String name) {
    final Collection<ConfigGroup> groups = configurationService.getConfiguration(ConfigType.ORGANIZATIONAL_UNIT);
    if (groups != null) {
        for (ConfigGroup groupConfig : groups) {
            if (groupConfig.getName().equals(name)) {
                return groupConfig;
            }
        }
    }
    return null;
}
 

开发者ID:kiegroup,
项目名称:appformer,
代码行数:12,
代码来源:OrganizationalUnitServiceImpl.java

示例25: findRepositoryConfig

点赞 2

import org.guvnor.structure.server.config.ConfigType; //导入依赖的package包/类
protected ConfigGroup findRepositoryConfig(final String alias) {
    final Collection<ConfigGroup> groups = configurationService.getConfiguration(ConfigType.REPOSITORY);
    if (groups != null) {
        for (ConfigGroup groupConfig : groups) {
            if (groupConfig.getName().equals(alias)) {
                return groupConfig;
            }
        }
    }
    return null;
}
 

开发者ID:kiegroup,
项目名称:appformer,
代码行数:12,
代码来源:RepositoryServiceImpl.java

示例26: newConfigGroup

点赞 2

import org.guvnor.structure.server.config.ConfigType; //导入依赖的package包/类
@Override
public ConfigGroup newConfigGroup(final ConfigType type,
                                  final String name,
                                  final String description) {
    final ConfigGroup configGroup = new ConfigGroup();
    configGroup.setDescription(description);
    configGroup.setName(name);
    configGroup.setType(type);
    configGroup.setEnabled(true);
    return configGroup;
}
 

开发者ID:kiegroup,
项目名称:appformer,
代码行数:12,
代码来源:ConfigurationFactoryImpl.java

示例27: ConfigGroupMarshaller

点赞 2

import org.guvnor.structure.server.config.ConfigType; //导入依赖的package包/类
public ConfigGroupMarshaller() {

        String[] voidDeny = {"void.class", "Void.class"};

        backwardCompatibleXstream.alias("group",
                                     ConfigGroup.class );
        backwardCompatibleXstream.alias("item",
                                        ConfigItem.class );
        backwardCompatibleXstream.alias("type",
                                        ConfigType.class );
        backwardCompatibleXstream.alias("secureitem",
                                        SecureConfigItem.class);
        // for backward compatibility only
        backwardCompatibleXstream.alias("org.uberfire.backend.server.config.SecureConfigItem",
                                        SecureConfigItem.class);
        backwardCompatibleXstream.denyTypes(voidDeny);

        xstream.alias("group",
                      ConfigGroup.class);
        xstream.alias("item",
                      ConfigItem.class);
        xstream.alias("type",
                      ConfigType.class);
        xstream.alias("secureitem",
                      SecureConfigItem.class);
        xstream.denyTypes(voidDeny);


    }
 

开发者ID:kiegroup,
项目名称:appformer,
代码行数:30,
代码来源:ConfigGroupMarshaller.java

示例28: getConfiguration

点赞 2

import org.guvnor.structure.server.config.ConfigType; //导入依赖的package包/类
@Override
public List<ConfigGroup> getConfiguration(final ConfigType type) {
    if (configuration.containsKey(type)) {
        return configuration.get(type);
    }
    final List<ConfigGroup> configGroups = new ArrayList<ConfigGroup>();
    final DirectoryStream<Path> foundConfigs = ioService.newDirectoryStream(ioService.get(systemRepository.getUri()),
                                                                            new DirectoryStream.Filter<Path>() {
                                                                                @Override
                                                                                public boolean accept(final Path entry) throws IOException {
                                                                                    if (!Files.isDirectory(entry) &&
                                                                                            !entry.getFileName().toString().startsWith(".") &&
                                                                                            entry.getFileName().toString().endsWith(type.getExt())) {
                                                                                        return true;
                                                                                    }
                                                                                    return false;
                                                                                }
                                                                            }
    );
    //Only load and cache if a file was found!
    final Iterator<Path> it = foundConfigs.iterator();
    if (it.hasNext()) {
        while (it.hasNext()) {
            final String content = ioService.readAllString(it.next());
            final ConfigGroup configGroup = marshaller.unmarshall(content);
            configGroups.add(configGroup);
        }
        configuration.put(type,
                          configGroups);
    }
    return configGroups;
}
 

开发者ID:kiegroup,
项目名称:appformer,
代码行数:33,
代码来源:ConfigurationServiceImpl.java

示例29: backwardCompatibilityNullSecurityRolesTest

点赞 2

import org.guvnor.structure.server.config.ConfigType; //导入依赖的package包/类
@Test
public void backwardCompatibilityNullSecurityRolesTest() {
    final ConfigurationFactory factory = new ConfigurationFactoryImpl();
    final BackwardCompatibleUtil backwardUtil = new BackwardCompatibleUtil(factory);

    final ConfigGroup group = factory.newConfigGroup(ConfigType.PROJECT,
                                                     "cool",
                                                     "test");
    assertNotNull(backwardUtil.compat(group));
    assertNotNull(backwardUtil.compat(group).getConfigItem("security:groups"));
}
 

开发者ID:kiegroup,
项目名称:appformer,
代码行数:12,
代码来源:BackwardCompatibleUtilTest.java

示例30: getMaxRuleFirings

点赞 2

import org.guvnor.structure.server.config.ConfigType; //导入依赖的package包/类
private int getMaxRuleFirings() {
    for (ConfigGroup editorConfigGroup : configurationService.getConfiguration(ConfigType.EDITOR)) {
        if (ScenarioTestEditorService.TEST_SCENARIO_EDITOR_SETTINGS.equals(editorConfigGroup.getName())) {
            for (ConfigItem item : editorConfigGroup.getItems()) {
                String itemName = item.getName();
                if (itemName.equals(ScenarioTestEditorService.TEST_SCENARIO_EDITOR_MAX_RULE_FIRINGS)) {
                    return (Integer) item.getValue();
                }
            }
        }
    }
    return 0;
}
 

开发者ID:kiegroup,
项目名称:drools-wb,
代码行数:14,
代码来源:ScenarioRunnerService.java

示例31: loadWorkItemDefinitionElements

点赞 2

import org.guvnor.structure.server.config.ConfigType; //导入依赖的package包/类
Map<String, String> loadWorkItemDefinitionElements() {
    final Map<String, String> workItemDefinitionElements = new HashMap<String, String>();
    final List<ConfigGroup> editorConfigGroups = configurationService.getConfiguration(ConfigType.EDITOR);
    for (ConfigGroup editorConfigGroup : editorConfigGroups) {
        if (WORK_ITEMS_EDITOR_SETTINGS.equals(editorConfigGroup.getName())) {
            for (ConfigItem item : editorConfigGroup.getItems()) {
                final String itemName = item.getName();
                final String itemValue = editorConfigGroup.getConfigItemValue(itemName);
                workItemDefinitionElements.put(itemName,
                                               itemValue);
            }
        }
    }
    return workItemDefinitionElements;
}
 

开发者ID:kiegroup,
项目名称:drools-wb,
代码行数:16,
代码来源:WorkItemsEditorServiceImpl.java

示例32: assertPlayground

点赞 2

import org.guvnor.structure.server.config.ConfigType; //导入依赖的package包/类
@PostConstruct
public void assertPlayground() {
    try {
        configurationService.startBatch();

        // Setup mandatory properties for Drools-Workbench
        final ConfigItem<String> supportRuntimeDeployConfigItem = new ConfigItem<>();
        supportRuntimeDeployConfigItem.setName("support.runtime.deploy");
        supportRuntimeDeployConfigItem.setValue("false");
        setupConfigurationGroup(ConfigType.GLOBAL,
                                GLOBAL_SETTINGS,
                                getGlobalConfiguration(),
                                supportRuntimeDeployConfigItem);

        // Setup properties required by the Work Items Editor
        setupConfigurationGroup(ConfigType.EDITOR,
                                WorkItemsEditorService.WORK_ITEMS_EDITOR_SETTINGS,
                                workbenchConfigurationHelper.getWorkItemElementDefinitions());

        // Setup test scenario properties
        // TODO : get TEST SCENARIO ELEMENT DEFINITIONS
        setupConfigurationGroup(ConfigType.EDITOR,
                                ScenarioTestEditorService.TEST_SCENARIO_EDITOR_SETTINGS,
                                getTestScenarioElementDefinitions());

        // notify components that bootstrap is completed to start post setups
        applicationStartedEvent.fire(new ApplicationStarted());
    } catch (final Exception e) {
        logger.error("Error during update config", e);
        throw new RuntimeException(e);
    } finally {
        configurationService.endBatch();
    }
}
 

开发者ID:kiegroup,
项目名称:drools-wb,
代码行数:35,
代码来源:AppSetup.java

示例33: getTestScenarioElementDefinitions

点赞 2

import org.guvnor.structure.server.config.ConfigType; //导入依赖的package包/类
private ConfigGroup getTestScenarioElementDefinitions() {
    final ConfigGroup group = configurationFactory.newConfigGroup(ConfigType.EDITOR,
                                                                  ScenarioTestEditorService.TEST_SCENARIO_EDITOR_SETTINGS,
                                                                  "");

    ConfigItem<Integer> configItem = new ConfigItem<Integer>();
    configItem.setName(ScenarioTestEditorService.TEST_SCENARIO_EDITOR_MAX_RULE_FIRINGS);
    configItem.setValue(10000);
    group.addConfigItem(configItem);

    return group;
}
 

开发者ID:kiegroup,
项目名称:drools-wb,
代码行数:13,
代码来源:AppSetup.java

示例34: migrateAllProjects

点赞 2

import org.guvnor.structure.server.config.ConfigType; //导入依赖的package包/类
public void migrateAllProjects(Path niogitDir) {
    List<ConfigGroup> orgUnitConfigs = configService.getConfiguration(ConfigType.ORGANIZATIONAL_UNIT);
    List<ConfigGroup> repoConfigs = configService.getConfiguration(ConfigType.REPOSITORY);
    Map<String, String> orgUnitByRepo = getOrgUnitsByRepo(orgUnitConfigs);

    if (repoConfigs.isEmpty()) {
        printNoReposMessage();
    }
    else {
        prepareRepositoriesForMigration(niogitDir, orgUnitConfigs, repoConfigs, orgUnitByRepo);
        migrateProjectsToIndividualRepos();
    }
}
 

开发者ID:kiegroup,
项目名称:kie-wb-common,
代码行数:14,
代码来源:InternalMigrationService.java

示例35: testCheckRepositoryConfig_NoIndex

点赞 2

import org.guvnor.structure.server.config.ConfigType; //导入依赖的package包/类
@Test
public void testCheckRepositoryConfig_NoIndex() {
    final ConfigGroup configGroup = new ConfigGroup();
    when(configurationFactory.newConfigGroup(any(ConfigType.class),
                                             anyString(),
                                             anyString())).thenReturn(configGroup);

    service.getProjects(new ExampleRepository("https://github.com/guvnorngtestuser1/guvnorng-playground.git"));

    final ConfigItem item = configGroup.getConfigItem(EnvironmentParameters.AVOID_INDEX);
    assertNotNull(item);

    assertEquals("true", item.getValue());
}
 

开发者ID:kiegroup,
项目名称:kie-wb-common,
代码行数:15,
代码来源:ExamplesServiceImplCheckNoIndexConfigTest.java

示例36: resolveGitRepositoryNotClonedBefore

点赞 2

import org.guvnor.structure.server.config.ConfigType; //导入依赖的package包/类
@Test
public void resolveGitRepositoryNotClonedBefore() {
    ExampleRepository playgroundRepository = new ExampleRepository("file:///home/user/folder/.kie-wb-playground");
    service.setPlaygroundRepository(playgroundRepository);

    ConfigGroup configGroup = new ConfigGroup();
    when(configurationFactory.newConfigGroup(any(ConfigType.class),
                                             anyString(),
                                             anyString())).thenReturn(configGroup);
    doCallRealMethod().when(configurationFactory).newConfigItem(anyString(),
                                                                anyBoolean());
    doCallRealMethod().when(configurationFactory).newConfigItem(anyString(),
                                                                anyString());
    doCallRealMethod().when(configurationFactory).newConfigItem(anyString(),
                                                                any(Object.class));

    Repository repository = mock(Repository.class);
    when(repositoryFactory.newRepository(configGroup)).thenReturn(repository);

    Repository result = service.resolveGitRepository(playgroundRepository);

    assertEquals(repository,
                 result);
    assertEquals(false,
                 configGroup.getConfigItem(EnvironmentParameters.MIRROR).getValue());

    verify(repositoryFactory,
           times(1)).newRepository(configGroup);
}
 

开发者ID:kiegroup,
项目名称:kie-wb-common,
代码行数:30,
代码来源:ExamplesServiceImplTest.java

示例37: setupConfigurationGroup

点赞 2

import org.guvnor.structure.server.config.ConfigType; //导入依赖的package包/类
protected void setupConfigurationGroup(ConfigType configType,
                                       String configGroupName,
                                       ConfigGroup configGroup,
                                       ConfigItem... configItemsToSetManually) {
    List<ConfigGroup> existentConfigGroups = configurationService.getConfiguration(configType);
    boolean settingsDefined = false;

    for (ConfigGroup existentConfigGroup : existentConfigGroups) {
        if (configGroupName.equals(existentConfigGroup.getName())) {
            settingsDefined = true;

            if (configItemsToSetManually != null) {
                for (ConfigItem configItem : configItemsToSetManually) {
                    ConfigItem existentConfigItem = existentConfigGroup.getConfigItem(configItem.getName());
                    if (existentConfigItem == null) {
                        existentConfigGroup.addConfigItem(configItem);
                        configurationService.updateConfiguration(existentConfigGroup);
                    } else if (!existentConfigItem.getValue().equals(configItem.getValue())) {
                        existentConfigItem.setValue(configItem.getValue());
                        configurationService.updateConfiguration(existentConfigGroup);
                    }
                }
            }

            break;
        }
    }

    if (!settingsDefined) {
        configurationService.addConfiguration(configGroup);
    }
}
 

开发者ID:kiegroup,
项目名称:kie-wb-common,
代码行数:33,
代码来源:BaseAppSetup.java

示例38: mockConfigurations

点赞 2

import org.guvnor.structure.server.config.ConfigType; //导入依赖的package包/类
private void mockConfigurations() {
    //doReturn( new ArrayList<ConfigGroup>() ).when( configurationService ).getConfiguration( any( ConfigType.class ) );
    doReturn(true).when(configurationService).updateConfiguration(any(ConfigGroup.class));
    doReturn(true).when(configurationService).addConfiguration(any(ConfigGroup.class));

    doReturn(new ConfigGroup()).when(configurationFactory).newConfigGroup(any(ConfigType.class),
                                                                          anyString(),
                                                                          anyString());
}
 

开发者ID:kiegroup,
项目名称:kie-wb-common,
代码行数:10,
代码来源:BaseAppSetupTest.java

示例39: setUp

点赞 2

import org.guvnor.structure.server.config.ConfigType; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
    //Define mandatory properties
    List<ConfigGroup> globalConfigGroups = configurationService.getConfiguration(ConfigType.GLOBAL);
    boolean globalSettingsDefined = false;
    for (ConfigGroup globalConfigGroup : globalConfigGroups) {
        if (GLOBAL_SETTINGS.equals(globalConfigGroup.getName())) {
            globalSettingsDefined = true;
            break;
        }
    }
    if (!globalSettingsDefined) {
        configurationService.addConfiguration(getGlobalConfiguration());
    }
}
 

开发者ID:kiegroup,
项目名称:kie-wb-common,
代码行数:16,
代码来源:ResourceChangeIncrementalBuilderTest.java

示例40: getGlobalConfiguration

点赞 2

import org.guvnor.structure.server.config.ConfigType; //导入依赖的package包/类
private ConfigGroup getGlobalConfiguration() {
    //Global Configurations used by many of Drools Workbench editors
    final ConfigGroup group = configurationFactory.newConfigGroup(ConfigType.GLOBAL,
                                                                  GLOBAL_SETTINGS,
                                                                  "");
    group.addConfigItem(configurationFactory.newConfigItem("build.enable-incremental",
                                                           "true"));
    return group;
}
 

开发者ID:kiegroup,
项目名称:kie-wb-common,
代码行数:10,
代码来源:ResourceChangeIncrementalBuilderTest.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)