Package org.sf.bee.runtime.configuration.items.impl

Examples of org.sf.bee.runtime.configuration.items.impl.ConfigItemSMS


        ConfigurationFileUtils instance = new ConfigurationFileUtils();
       
        List result = instance.getConfigParams(xml);
        assertNotNull(result);
        assertTrue(!CollectionUtils.isEmpty(result));
        ConfigItemSMS cs = new ConfigItemSMS((ConfigItemSysParameter) result.get(0));
        System.out.println(cs);
    }
View Full Code Here


    @Test
    public void testGetConfigParams() throws Exception {
        System.out.println("getConfigParams");
        String xml = "<sms><!-- SMS gateway properties --><property group=\"gateway\" name=\"method\" value=\"GET\"/><property group=\"gateway\" name=\"host\" value=\"https://www.gatewaysms.it/gateway.php\"/><property group=\"gateway\" name=\"username\" value=\"xxxx\"/><property group=\"gateway\" name=\"password\" value=\"xxxx\"/><property group=\"gateway\" name=\"from\" value=\"BEEing\"/><property group=\"gateway\" name=\"optionals\" value=\"credit=1\"/><property group=\"gateway\" name=\"replace00\" value=\"\"/><!-- SMS gateway Fieldnames --><property group=\"fieldmap\" name=\"fnphone\" value=\"numero\"/><property group=\"fieldmap\" name=\"fnmessage\" value=\"testo\"/><property group=\"fieldmap\" name=\"fnfrom\" value=\"mittente\"/><property group=\"fieldmap\" name=\"fnusername\" value=\"login\"/><property group=\"fieldmap\" name=\"fnpassword\" value=\"pwd\"/>        </sms>";
       
        ConfigItemSMS cs = ConfigurationUtils.getInstance().getSMS(xml);
        assertNotNull(cs);
        System.out.println(cs);
    }
View Full Code Here

    }

    public ConfigItemSMS getSMS() {
        final AbstractRuntimeConfiguration config = getRuntimeConfig();
        if (null != config) {
            final ConfigItemSMS result = config.getSMS();
            if (null != result) {
                final boolean valid = StringUtils.hasText(result.getMethod())
                        && StringUtils.hasText(result.getHost());
                return valid ? result : null;
            }
        }
        return null;
    }
View Full Code Here

    public ConfigItemSMS getSMS(final String text) {
        try {
            final ConfigItemSysParameter config = CollectionUtils.getFirst(
                    ConfigurationFileUtils.getInstance().getConfigParams(text));
            if (null != config) {
                final ConfigItemSMS result = new ConfigItemSMS(config);
                if (null != result) {
                    final boolean valid = StringUtils.hasText(result.getMethod())
                            && StringUtils.hasText(result.getHost());
                    return valid ? result : null;
                }
            }
        } catch (Throwable t) {
            // invalid xml text
View Full Code Here

    protected final void reloadSms(final ConfigItemSysParameter item) {
        if (null == item) {
            return;
        }
        _sms = new ConfigItemSMS(item);
    }
View Full Code Here

TOP

Related Classes of org.sf.bee.runtime.configuration.items.impl.ConfigItemSMS

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.