Package org.internna.iwebmvc.model

Examples of org.internna.iwebmvc.model.I18nText


        if (logger.isInfoEnabled()) logger.info("Executing startup task [GenerateSexTableDataStartupTask]");
        Long count = (Long) dao.executeQuery("SELECT COUNT(s) FROM Sex s").get(0);
        if (count <= 0) {
            if (logger.isInfoEnabled()) logger.info("Sex table is empty. Generating data...");
            Sex male = new Sex();
            I18nText dataMale = new I18nText();
            male.setSex(dataMale);
            Sex female = new Sex();
            I18nText dataFemale = new I18nText();
            female.setSex(dataFemale);
            for (Locale locale : supportedLocales) {
                dataMale.add(locale, MALE_VALUES.get(locale));
                dataFemale.add(locale, FEMALE_VALUES.get(locale));
            }
            if (logger.isInfoEnabled()) logger.info("Saving male data...");
            dao.create(male);
            if (logger.isInfoEnabled()) logger.info("Saving female data...");
            dao.create(female);
View Full Code Here


                try {
                    java.util.Currency currency = java.util.Currency.getInstance(code);
                    if (currency != null) {
                        Currency c = new Currency();
                        c.setCurrency(currency);
                        c.setName(new I18nText());
                        for (int index = 0; index < entries.length; index++)
                            c.getName().add(entries[index].getKey(), entries[index].getValue().getProperty(code));
                        c.setExchangeRate(1.0);
                        c.setDefaultCurrency(code.equals(defaultCurrency));
                        dao.create(c, false);
View Full Code Here

    }

    @Override
    public I18nText parse(I18nText txt) {
        if ((txt != null) && (txt.getId() != null)) {
            I18nText loaded = getDao().find(I18nText.class, txt.getId());
            if (loaded != null) {
                List<LocalizedValue> oldData = loaded.getData();
                List<LocalizedValue> newData = txt.getData();
                for (int index = 0; index < oldData.size(); index++) {
                    LocalizedValue localized = oldData.get(index);
                    localized.setTranslation(newData.get(index).getTranslation());
                }
View Full Code Here

            Properties allTypes = addressTypes.entrySet().iterator().next().getValue();
            for (String code : allTypes.stringPropertyNames()) {
                if (logger.isDebugEnabled()) logger.debug("Creating address type [" + code + "]");
                try {
                    AddressType type = new AddressType();
                    type.setType(new I18nText());
                    for (Locale locale : addressTypes.keySet())
                      type.getType().add(locale, addressTypes.get(locale).getProperty(code));
                    dao.create(type);
                } catch (Exception ex) {
                    if (logger.isDebugEnabled()) logger.debug("Address type [" + code + "] could not be saved: " + ex.getMessage());
View Full Code Here

TOP

Related Classes of org.internna.iwebmvc.model.I18nText

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.