14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
# File 'lib/src-generic/RubyConfigurationUpdater.rb', line 14
def updateConfiguration(configuration)
v =PropertiesTools::getProperty(configuration, ConfigurationKeys::CACHE_FOLDER, nil)
if v.nil?
configuration[ConfigurationKeys::CACHE_FOLDER] = File.dirname(__FILE__) + "/../../cache"
end
v =PropertiesTools::getProperty(configuration, ConfigurationKeys::FORMULA_FOLDER, nil)
if v.nil?
configuration[ConfigurationKeys::FORMULA_FOLDER] = File.dirname(__FILE__) + "/../../formulas"
end
v =PropertiesTools::getProperty(configuration, ConfigurationKeys::SHOWIMAGE_PATH, nil)
if v.nil?
configuration[ConfigurationKeys::SHOWIMAGE_PATH] = "wirispluginengine/integration/showimage?formula="
end
v =PropertiesTools::getProperty(configuration, ConfigurationKeys::CLEAN_CACHE_PATH, nil)
if v.nil?
configuration[ConfigurationKeys::CLEAN_CACHE_PATH] = "cleancache"
end
v =PropertiesTools::getProperty(configuration, ConfigurationKeys::RESOURCE_PATH, nil)
if v.nil?
configuration[ConfigurationKeys::RESOURCE_PATH] = "resource"
end
v =PropertiesTools::getProperty(configuration, ConfigurationKeys::CONFIGURATION_PATH, nil)
if v.nil?
if File.file?(Rails.root.join('vendor', 'wiris', 'configuration.ini'))
configuration[ConfigurationKeys::CONFIGURATION_PATH] = Rails.root.join('vendor', 'wiris').to_s
else
configuration[ConfigurationKeys::CONFIGURATION_PATH] = File.dirname(__FILE__) + "/../../"
end
end
v = PropertiesTools::getProperty(configuration, ConfigurationKeys::REFERER, nil)
if v.nil?
configuration[ConfigurationKeys::REFERER] = request.original_url
end
end
|