Package org.lightadmin.core.config.domain

Examples of org.lightadmin.core.config.domain.GlobalAdministrationConfiguration


    }

    @Override
    @SuppressWarnings("unchecked")
    public void registerDomainTypeConfiguration(ConfigurationUnits... configurationUnits) {
        GlobalAdministrationConfiguration administrationConfiguration = newGlobalAdministrationConfiguration(configurationUnits);

        for (Class<?> managedType : administrationConfiguration.getManagedDomainTypes()) {
            globalAdministrationConfiguration.registerDomainTypeConfiguration(administrationConfiguration.forManagedDomainType(managedType));
        }

        for (Class<?> nonManagedType : administrationConfiguration.getNonManagedDomainTypes()) {
            globalAdministrationConfiguration.registerNonDomainTypeConfiguration(administrationConfiguration.forDomainType(nonManagedType));
        }

        repositoryRestConfiguration.exposeIdsFor(administrationConfiguration.getAllDomainTypesAsArray());
    }
View Full Code Here


        return GlobalAdministrationConfiguration.class;
    }

    @Override
    protected GlobalAdministrationConfiguration createInstance() throws Exception {
        GlobalAdministrationConfiguration globalAdministrationConfiguration = new GlobalAdministrationConfiguration();

        ProblemReporter problemReporter = failFastReporter();

        for (ConfigurationUnits configurationUnits : domainTypeConfigurationUnits) {
            if (nonPersistentEntityType(configurationUnits.getDomainType())) {
                problemReporter.error(new DomainConfigurationProblem(configurationUnits, format("Administration of non-persistent type %s is not supported.", configurationUnits.getDomainType().getSimpleName())));
                continue;
            }

            configurationUnits = preprocessConfigurationUnits(configurationUnits);

            configurationUnitsValidator.validate(configurationUnits, problemReporter);

            DomainTypeAdministrationConfiguration domainTypeAdministrationConfiguration = domainTypeAdministrationConfigurationFactory.createAdministrationConfiguration(configurationUnits);

            globalAdministrationConfiguration.registerDomainTypeConfiguration(domainTypeAdministrationConfiguration);

            registerAssociationDomainTypeConfigurations(domainTypeAdministrationConfiguration, globalAdministrationConfiguration);
        }

        return globalAdministrationConfiguration;
View Full Code Here

    }

    private GlobalAdministrationConfiguration globalAdministrationConfiguration() {
        final Collection<DomainTypeAdministrationConfiguration> configurations = newArrayList(domainTypeAdministrationConfiguration(Address.class, "AddressConfiguration"), domainTypeAdministrationConfiguration(Customer.class, "CustomerConfiguration"));

        GlobalAdministrationConfiguration globalAdministrationConfiguration = EasyMock.createMock(GlobalAdministrationConfiguration.class);
        EasyMock.expect(globalAdministrationConfiguration.getDomainTypeConfigurationsValues()).andReturn(configurations).once();
        EasyMock.replay(globalAdministrationConfiguration);

        return globalAdministrationConfiguration;
    }
View Full Code Here

TOP

Related Classes of org.lightadmin.core.config.domain.GlobalAdministrationConfiguration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.