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

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


    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


     */
    protected final IsisSessionFactory createSessionFactory(final DeploymentType deploymentType,
        final UserProfileLoader userProfileLoader, final PersistenceSessionFactory persistenceSessionFactory)
        throws IsisSystemException {

        final IsisConfiguration configuration = getConfiguration();
        final AuthenticationManager authenticationManager = obtainAuthenticationManager(deploymentType);
        final AuthorizationManager authorizationManager = obtainAuthorizationManager(deploymentType);
        final TemplateImageLoader templateImageLoader = obtainTemplateImageLoader();
        final ObjectReflector reflector = obtainReflector(deploymentType);

View Full Code Here

    // Authentication & Authorization
    // ///////////////////////////////////////////

    public void lookupAndSetAuthenticatorAndAuthorization(final DeploymentType deploymentType) {

        final IsisConfiguration configuration = installerLookup.getConfiguration();
        final String connection = configuration.getString(SystemConstants.CLIENT_CONNECTION_KEY);

        if (connection != null) {
            lookupAndSetAuthenticatorAndAuthorizationUsingClientConnectionInstaller(connection);
        } else {
            lookupAndSetAuthenticatorAndAuthorizationInstallers(deploymentType);
View Full Code Here

    // ///////////////////////////////////////////
    // Fixtures
    // ///////////////////////////////////////////

    public void lookupAndSetFixturesInstaller() {
        final IsisConfiguration configuration = installerLookup.getConfiguration();
        final String fixture = configuration.getString(SystemConstants.FIXTURES_INSTALLER_KEY);

        final FixturesInstaller fixturesInstaller = installerLookup.fixturesInstaller(fixture);
        if (fixturesInstaller != null) {
            this.fixtureInstaller = fixturesInstaller;
        }
View Full Code Here

    // ///////////////////////////////////////////
    // User Profile Loader/Store
    // ///////////////////////////////////////////

    public void lookupAndSetUserProfileFactoryInstaller() {
        final IsisConfiguration configuration = installerLookup.getConfiguration();
        final String persistor = configuration.getString(SystemConstants.PROFILE_PERSISTOR_INSTALLER_KEY);

        final UserProfileStoreInstaller userProfilePersistenceMechanismInstaller =
            installerLookup.userProfilePersistenceMechanismInstaller(persistor, getDeploymentType());
        if (userProfilePersistenceMechanismInstaller != null) {
            setUserProfileStoreInstaller(userProfilePersistenceMechanismInstaller);
View Full Code Here

    public GetPropertiesResponse getProperties(final GetPropertiesRequest request) {
        final Properties properties = new Properties();
        properties.put("test-client", "true");

        // pass over services
        final IsisConfiguration configuration = IsisContext.getConfiguration();
        final IsisConfiguration serviceProperties =
            configuration.getProperties(ConfigurationConstants.ROOT + "services");

        for (final String propertyName : serviceProperties) {
            properties.put(propertyName, serviceProperties.getString(propertyName));
        }

        // pass over OID generator
        final String oidGeneratorClass = getPersistenceSession().getOidGenerator().getClass().getName();
        if (oidGeneratorClass != null) {
View Full Code Here

     * <p>
     * By default, returns a {@link RuntimeContextFromSession}.
     */
    protected RuntimeContext createRuntimeContext(final IsisConfiguration configuration) {
        final Properties properties = new Properties();
        final IsisConfiguration applicationConfiguration = configuration.getProperties("application");
        for (final String key : applicationConfiguration) {
            final String value = applicationConfiguration.getString(key);
            final String newKey = key.substring("application.".length());
            properties.setProperty(newKey, value);
        }
        final RuntimeContextFromSession runtimeContext = new RuntimeContextFromSession();
        runtimeContext.setProperties(properties);
View Full Code Here

    public void init() {
        fieldMappingLookup.init();

        final String prefix = SqlObjectStore.BASE_NAME + ".mapper.";
        final IsisConfiguration subset = IsisContext.getConfiguration().createSubset(prefix);
        for (final String className : subset) {
            final String value = subset.getString(className);

            if (value.startsWith("auto.")) {
                final String propertiesBase = SqlObjectStore.BASE_NAME + ".automapper." + value.substring(5) + ".";
                add(className, objectMappingFactory.createMapper(className, propertiesBase, fieldMappingLookup, this));
            } else if (value.trim().equals("auto")) {
View Full Code Here

    private int maxCharWidth;
    private final FontMetrics metrics;
    private final String propertyName;

    protected AwtText(final String propertyName, final String defaultFont) {
        final IsisConfiguration cfg = IsisContext.getConfiguration();
        font = cfg.getFont(FONT_PROPERTY_STEM + propertyName, Font.decode(defaultFont));
        LOG.info("font " + propertyName + " loaded as " + font);

        this.propertyName = propertyName;

        if (font == null) {
            font = cfg.getFont(FONT_PROPERTY_STEM + ColorsAndFonts.TEXT_DEFAULT, new Font("SansSerif", Font.PLAIN, 12));
        }

        metrics = fontMetricsComponent.getFontMetrics(font);

        maxCharWidth = metrics.getMaxAdvance() + 1;
        if (maxCharWidth == 0) {
            maxCharWidth = (charWidth('X') + 3);
        }

        lineSpacing = cfg.getInteger(SPACING_PROPERTYSTEM + propertyName, 0);

        ascentAdjust = cfg.getBoolean(ASCENT_ADJUST, false);

        LOG.debug("font " + propertyName + " height=" + metrics.getHeight() + ", leading=" + metrics.getLeading()
            + ", ascent=" + metrics.getAscent() + ", descent=" + metrics.getDescent() + ", line spacing=" + lineSpacing);
    }
View Full Code Here

    public String toString() {
        return font.toString();
    }

    public static String defaultFontFamily() {
        final IsisConfiguration cfg = IsisContext.getConfiguration();
        return cfg.getString(FONT_PROPERTY_STEM + "family", "SansSerif");
    }
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.