Package org.zanata.model

Examples of org.zanata.model.HApplicationConfiguration


            setPropertyFromConfigIfNotNull(property);
        }
    }

    private void setPropertyFromConfigIfNotNull(PropertyWithKey<String> property) {
        HApplicationConfiguration valueHolder =
                applicationConfigurationDAO
                        .findByKey(property.getKey());
        if (valueHolder != null) {
            try {
                property.set(valueHolder.getValue());
            } catch (InvocationTargetException e) {
                e.printStackTrace();
            } catch (IllegalAccessException e) {
                e.printStackTrace();
            }
View Full Code Here


            }
        }
    }

    private void setBooleanPropertyFromConfigIfNotNull(PropertyWithKey<Boolean> property) {
        HApplicationConfiguration valueHolder = applicationConfigurationDAO.findByKey(property.getKey());
        if (valueHolder != null) {
            try {
                property.set(Boolean.parseBoolean(valueHolder.getValue()));
            } catch (InvocationTargetException e) {
                e.printStackTrace();
            } catch (IllegalAccessException e) {
                e.printStackTrace();
            }
View Full Code Here

    @Transactional
    public String update() {
        persistPropertiesToDatabase(commonStringProperties);
        persistPropertyToDatabase(fromEmailAddrProperty);

        HApplicationConfiguration emailLogEventsValue =
                applicationConfigurationDAO
                        .findByKey(HApplicationConfiguration.KEY_EMAIL_LOG_EVENTS);
        if (emailLogEventsValue == null) {
            emailLogEventsValue =
                    new HApplicationConfiguration(
                            HApplicationConfiguration.KEY_EMAIL_LOG_EVENTS,
                            Boolean.toString(enableLogEmail));
        } else {
            emailLogEventsValue.setValue(Boolean.toString(enableLogEmail));
        }
        applicationConfigurationDAO.makePersistent(emailLogEventsValue);

        applicationConfigurationDAO.flush();
        FacesMessages facesMessages = FacesMessages.instance();
View Full Code Here

            persistPropertyToDatabase(property);
        }
    }

    private void persistPropertyToDatabase(PropertyWithKey<String> property) {
        HApplicationConfiguration registerUrlValue =
                applicationConfigurationDAO
                        .findByKey(property.getKey());
        try {
            ServerConfigurationService.persistApplicationConfig(
                    property.getKey(),
View Full Code Here

            setPropertyFromConfigIfNotNull(property);
        }
    }

    private void setPropertyFromConfigIfNotNull(PropertyWithKey<String> property) {
        HApplicationConfiguration valueHolder =
                applicationConfigurationDAO
                        .findByKey(property.getKey());
        if (valueHolder != null) {
            try {
                property.set(valueHolder.getValue());
            } catch (InvocationTargetException e) {
                e.printStackTrace();
            } catch (IllegalAccessException e) {
                e.printStackTrace();
            }
View Full Code Here

            }
        }
    }

    private void setBooleanPropertyFromConfigIfNotNull(PropertyWithKey<Boolean> property) {
        HApplicationConfiguration valueHolder = applicationConfigurationDAO.findByKey(property.getKey());
        if (valueHolder != null) {
            try {
                property.set(Boolean.parseBoolean(valueHolder.getValue()));
            } catch (InvocationTargetException e) {
                e.printStackTrace();
            } catch (IllegalAccessException e) {
                e.printStackTrace();
            }
View Full Code Here

    @Transactional
    public String update() {
        persistPropertiesToDatabase(commonStringProperties);
        persistPropertyToDatabase(fromEmailAddrProperty);

        HApplicationConfiguration emailLogEventsValue =
                applicationConfigurationDAO
                        .findByKey(HApplicationConfiguration.KEY_EMAIL_LOG_EVENTS);
        if (emailLogEventsValue == null) {
            emailLogEventsValue =
                    new HApplicationConfiguration(
                            HApplicationConfiguration.KEY_EMAIL_LOG_EVENTS,
                            Boolean.toString(enableLogEmail));
        } else {
            emailLogEventsValue.setValue(Boolean.toString(enableLogEmail));
        }
        applicationConfigurationDAO.makePersistent(emailLogEventsValue);

        applicationConfigurationDAO.flush();
        FacesMessages facesMessages = FacesMessages.instance();
View Full Code Here

            persistPropertyToDatabase(property);
        }
    }

    private void persistPropertyToDatabase(PropertyWithKey<String> property) {
        HApplicationConfiguration registerUrlValue =
                applicationConfigurationDAO
                        .findByKey(property.getKey());
        try {
            ServerConfigurationService.persistApplicationConfig(
                    property.getKey(),
View Full Code Here

    private String getConfigValue(String key) {
        if (!configurationValues.containsKey(key)) {
            ApplicationConfigurationDAO appConfigDAO =
                    serviceLocator.getInstance(ApplicationConfigurationDAO.class);
            HApplicationConfiguration configRecord =
                    appConfigDAO.findByKey(key);
            String storedVal = null;
            if (configRecord != null) {
                storedVal = configRecord.getValue();
            }
            configurationValues.put(key, storedVal);
        }
        return configurationValues.get(key);
    }
View Full Code Here

     *         the server while performing this operation.
     */
    @GET
    @Path("c/{configKey}")
    public Response get(@PathParam("configKey") @Nonnull String configKey) {
        HApplicationConfiguration config =
                applicationConfigurationDAO.findByKey(configKey);
        if (config == null) {
            return Response.status(Response.Status.NOT_FOUND).build();
        }
        Configuration configuration =
View Full Code Here

TOP

Related Classes of org.zanata.model.HApplicationConfiguration

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.