Class: WirisPlugin::DefaultConfigurationUpdater

Inherits:
Object
  • Object
show all
Extended by:
ConfigurationUpdaterInterface
Includes:
Wiris
Defined in:
lib/com/wiris/plugin/impl/DefaultConfigurationUpdater.rb

Instance Method Summary collapse

Methods included from ConfigurationUpdaterInterface

ConfigurationUpdater

Constructor Details

#initializeDefaultConfigurationUpdater

Returns a new instance of DefaultConfigurationUpdater.



11
12
13
# File 'lib/com/wiris/plugin/impl/DefaultConfigurationUpdater.rb', line 11

def initialize()
    super()
end

Instance Method Details

#init(obj) ⇒ Object



14
15
# File 'lib/com/wiris/plugin/impl/DefaultConfigurationUpdater.rb', line 14

def init(obj)
end

#updateConfiguration(ref_configuration) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/com/wiris/plugin/impl/DefaultConfigurationUpdater.rb', line 16

def updateConfiguration(ref_configuration)
    configuration = ref_configuration
    s = Storage::newResourceStorage("default-configuration.ini")::read()
    defaultIniFile = IniFile::newIniFileFromString(s)
    h = defaultIniFile::getProperties()
    iter = h::keys()
    while iter::hasNext()
        key = iter::next()
        if PropertiesTools::getProperty(configuration,key) == nil
            PropertiesTools::setProperty(configuration,key,h::get(key))
        end
    end
end