Package org.apache.isis.core.commons.config

Examples of org.apache.isis.core.commons.config.IsisConfiguration


        final IsisConfiguration cfg = IsisContext.getConfiguration();
        return cfg.getString(FONT_PROPERTY_STEM + "family", "SansSerif");
    }

    public static int defaultFontSizeSmall() {
        final IsisConfiguration cfg = IsisContext.getConfiguration();
        return cfg.getInteger(FONT_PROPERTY_STEM + "size.small", 10);
    }
View Full Code Here


        final IsisConfiguration cfg = IsisContext.getConfiguration();
        return cfg.getInteger(FONT_PROPERTY_STEM + "size.small", 10);
    }

    public static int defaultFontSizeMedium() {
        final IsisConfiguration cfg = IsisContext.getConfiguration();
        return cfg.getInteger(FONT_PROPERTY_STEM + "size.medium", 11);
    }
View Full Code Here

        final IsisConfiguration cfg = IsisContext.getConfiguration();
        return cfg.getInteger(FONT_PROPERTY_STEM + "size.medium", 11);
    }

    public static int defaultFontSizeLarge() {
        final IsisConfiguration cfg = IsisContext.getConfiguration();
        return cfg.getInteger(FONT_PROPERTY_STEM + "size.large", 12);
    }
View Full Code Here

    @Override
    public void init() {

        ensureDependenciesInjected();

        final IsisConfiguration configuration = isisConfigurationBuilder.getConfiguration();
        deploymentType = DeploymentType.lookup(configuration.getString(SystemConstants.DEPLOYMENT_TYPE_KEY));

        final String user = configuration.getString(SystemConstants.USER_KEY);
        final String password = configuration.getString(SystemConstants.PASSWORD_KEY);

        if (user != null) {
            authenticationRequestViaArgs = new AuthenticationRequestPassword(user, password);
        }
    }
View Full Code Here

        final IsisConfigurationBuilder isisConfigurationBuilder = injector.getInstance(IsisConfigurationBuilder.class);

        // we don't actually bootstrap the system here; instead we expect it to be bootstrapped
        // from the ServletContextInitializer in the web.xml
        final IsisConfiguration configuration = isisConfigurationBuilder.getConfiguration();
        final int port = configuration.getInteger(EMBEDDED_WEB_SERVER_PORT_KEY, EMBEDDED_WEB_SERVER_PORT_DEFAULT);
        final String webappContextPath =
            configuration.getString(EMBEDDED_WEB_SERVER_RESOURCE_BASE_KEY, EMBEDDED_WEB_SERVER_RESOURCE_BASE_DEFAULT);

        final Server server = new Server(port);
        final WebAppContext context = new WebAppContext(SRC_MAIN_WEBAPP, webappContextPath);

        copyConfigurationPrimersIntoServletContext(context);
View Full Code Here

        update(sql);
    }

    public void open() {
        final String BASE = baseName + ".jdbc.";
        final IsisConfiguration params = IsisContext.getConfiguration().getProperties(BASE);

        try {
            final String driver = params.getString(BASE + "driver");
            final String url = params.getString(BASE + "connection");
            final String user = params.getString(BASE + "user");
            final String password = params.getString(BASE + "password");

            if (connection != null) {
                throw new SqlObjectStoreException("Connection already established");
            }

            if (driver == null) {
                throw new SqlObjectStoreException("No driver specified for database connection");
            }
            if (url == null) {
                throw new SqlObjectStoreException("No connection URL specified to database");
            }
            if (user == null) {
                throw new SqlObjectStoreException("No user specified for database connection");
            }
            if (password == null) {
                throw new SqlObjectStoreException("No password specified for database connection");
            }

            Class.forName(driver);
            LOG.info("Connecting to " + url + " as " + user);
            connection = DriverManager.getConnection(url, user, password);
            if (connection == null) {
                throw new SqlObjectStoreException("No connection established to " + url);
            }
        } catch (final SQLException e) {
            throw new SqlObjectStoreException("Failed to start", e);
        } catch (final ClassNotFoundException e) {
            throw new SqlObjectStoreException("Could not find database driver", e);
        }

        final String BASE_DATATYPE = baseName + ".datatypes.";
        final IsisConfiguration dataTypes = IsisContext.getConfiguration().getProperties(BASE_DATATYPE);
        populateSqlDataTypes(dataTypes, BASE_DATATYPE);
    }
View Full Code Here

    private Location location;
    private Image logo;
    private Size logoSize;

    public LogoBackground() {
        final IsisConfiguration configuration = IsisContext.getConfiguration();

        final String fileName = configuration.getString(PARAMETER_BASE + "image", "background");
        logo = ImageFactory.getInstance().loadImage(fileName);

        if (logo == null) {
            logo = ImageFactory.getInstance().loadImage("poweredby-logo");
        }
View Full Code Here

        setUpFieldMappers(lookup, objectMapperLookup, className, parameterBase);
    }

    private void setUpFieldMappers(final FieldMappingLookup lookup, final ObjectMappingLookup objectMapperLookup,
        final String className, final String parameterBase) {
        final IsisConfiguration configParameters = IsisContext.getConfiguration();
        table = configParameters.getString(parameterBase + "table");
        if (table == null) {
            final String name = "isis_" + className.substring(className.lastIndexOf('.') + 1).toUpperCase();
            table = Sql.sqlName(name);
        }

        dbCreatesId = configParameters.getBoolean(parameterBase + "db-ids", false);
        if (configParameters.getBoolean(parameterBase + "all-fields", true)) {
            setupFullMapping(lookup, objectMapperLookup, className, configParameters, parameterBase);
        } else {
            // setupSpecifiedMapping(specification, configParameters, parameterBase);
        }
View Full Code Here

        final ObjectAssociation[] oneToOneProperties = new ObjectAssociation[simpleFieldCount];
        final ObjectAssociation[] oneToManyProperties = new ObjectAssociation[collectionFieldCount];
        collectionMappers = new CollectionMapper[collectionFieldCount];
        // Properties collectionMappings = configParameters.getPropertiesStrippingPrefix(parameterBase +
        // "collection");
        final IsisConfiguration subset = IsisContext.getConfiguration().createSubset(parameterBase + ".mapper.");

        for (int i = 0, simpleFieldNo = 0, collectionFieldNo = 0; i < fields.size(); i++) {
            final ObjectAssociation field = fields.get(i);
            if (field.isNotPersisted()) {
                continue;
            } else if (field.isOneToManyAssociation()) {
                oneToManyProperties[collectionFieldNo] = field;

                // TODO: Replace "new CombinedCollectionMapper" with a factory method(?) to allow a different
                // default CollectionMapper
                final String type = subset.getString(field.getId());
                if (type == null || type.equals("association-table")) {
                    // collectionMappers[collectionFieldNo] = new AutoCollectionMapper(specification,
                    // oneToManyProperties[collectionFieldNo], lookup);
                    // collectionMappers[collectionFieldNo] = new
                    // CombinedCollectionMapper(oneToManyProperties[collectionFieldNo], parameterBase, lookup,
View Full Code Here

    /**
     * Lazily creates an {@link AuthenticationManager} that will authenticate all requests.
     */
    private AuthenticationManager anonymousAuthenticationManager() {
        if (authenticationManager == null) {
            final IsisConfiguration configuration = IsisContext.getConfiguration();
            final AuthenticationManagerStandard authenticationManager =
                new AuthenticationManagerStandard(configuration);
            authenticationManager.addAuthenticator(new AuthenticatorAbstract(configuration) {
                @Override
                public boolean canAuthenticate(final AuthenticationRequest request) {
View Full Code Here

TOP

Related Classes of org.apache.isis.core.commons.config.IsisConfiguration

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.