wirispluginengine 3.62.0.1322 → 7.14.0.1422
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Rakefile +34 -34
- data/app/assets/javascripts/wirispluginengine/WIRISplugins.js +1040 -64
- data/app/controllers/wirispluginengine/application_controller.rb +84 -75
- data/app/helpers/wirispluginengine/application_helper.rb +4 -4
- data/config/routes.rb +4 -4
- data/lib/com/wiris/common/WInteger.rb +52 -51
- data/lib/com/wiris/plugin/api/Cas.rb +5 -5
- data/lib/com/wiris/plugin/api/CleanCache.rb +5 -5
- data/lib/com/wiris/plugin/api/Configuration.rb +5 -5
- data/lib/com/wiris/plugin/api/ConfigurationKeys.rb +94 -91
- data/lib/com/wiris/plugin/api/Editor.rb +5 -5
- data/lib/com/wiris/plugin/api/Filter.rb +5 -5
- data/lib/com/wiris/plugin/api/ImageFormatController.rb +5 -5
- data/lib/com/wiris/plugin/api/ParamsProvider.rb +5 -5
- data/lib/com/wiris/plugin/api/PluginBuilder.rb +88 -74
- data/lib/com/wiris/plugin/api/Render.rb +5 -5
- data/lib/com/wiris/plugin/api/ServiceResourceLoader.rb +5 -5
- data/lib/com/wiris/plugin/api/Test.rb +5 -5
- data/lib/com/wiris/plugin/api/TextService.rb +5 -5
- data/lib/com/wiris/plugin/configuration/ConfigurationUpdater.rb +5 -5
- data/lib/com/wiris/plugin/impl/CacheFormulaImpl.rb +15 -0
- data/lib/com/wiris/plugin/impl/CacheImpl.rb +124 -0
- data/lib/com/wiris/plugin/impl/CasImpl.rb +140 -138
- data/lib/com/wiris/plugin/impl/CleanCacheImpl.rb +103 -101
- data/lib/com/wiris/plugin/impl/ConfigurationImpl.rb +165 -166
- data/lib/com/wiris/plugin/impl/CustomConfigurationUpdater.rb +32 -30
- data/lib/com/wiris/plugin/impl/DefaultConfigurationUpdater.rb +24 -22
- data/lib/com/wiris/plugin/impl/EditorImpl.rb +80 -78
- data/lib/com/wiris/plugin/impl/FileConfigurationUpdater.rb +29 -27
- data/lib/com/wiris/plugin/impl/FileStorageAndCache.rb +55 -53
- data/lib/com/wiris/plugin/impl/FolderTreeStorageAndCache.rb +65 -134
- data/lib/com/wiris/plugin/impl/GenericParamsProviderImpl.rb +50 -48
- data/lib/com/wiris/plugin/impl/HttpImpl.rb +49 -48
- data/lib/com/wiris/plugin/impl/HttpListener.rb +5 -5
- data/lib/com/wiris/plugin/impl/ImageFormatControllerPng.rb +71 -63
- data/lib/com/wiris/plugin/impl/ImageFormatControllerSvg.rb +37 -28
- data/lib/com/wiris/plugin/impl/PluginBuilderImpl.rb +280 -248
- data/lib/com/wiris/plugin/impl/RenderImpl.rb +303 -257
- data/lib/com/wiris/plugin/impl/ServiceResourceLoaderImpl.rb +41 -39
- data/lib/com/wiris/plugin/impl/TestImpl.rb +177 -157
- data/lib/com/wiris/plugin/impl/TextFilter.rb +210 -194
- data/lib/com/wiris/plugin/impl/TextFilterTags.rb +57 -50
- data/lib/com/wiris/plugin/impl/TextServiceImpl.rb +158 -107
- data/lib/com/wiris/plugin/storage/StorageAndCache.rb +5 -5
- data/lib/com/wiris/util/json/JSon.rb +505 -493
- data/lib/com/wiris/util/json/JSonIntegerFormat.rb +17 -16
- data/lib/com/wiris/util/json/JsonAPIResponse.rb +70 -0
- data/lib/com/wiris/util/json/StringParser.rb +57 -56
- data/lib/com/wiris/util/sys/AccessProvider.rb +8 -0
- data/lib/com/wiris/util/sys/Cache.rb +8 -0
- data/lib/com/wiris/util/sys/HttpConnection.rb +14 -13
- data/lib/com/wiris/util/sys/HttpConnectionListener.rb +5 -5
- data/lib/com/wiris/util/sys/HttpSync.rb +28 -0
- data/lib/com/wiris/util/sys/IniFile.rb +132 -131
- data/lib/com/wiris/util/sys/Lock.rb +8 -0
- data/lib/com/wiris/util/sys/LockProvider.rb +8 -0
- data/lib/com/wiris/util/sys/Store.rb +126 -101
- data/lib/com/wiris/util/sys/StoreCache.rb +63 -0
- data/lib/com/wiris/util/sys/TimerProxy.rb +21 -0
- data/lib/com/wiris/util/sys/TimerTask.rb +8 -0
- data/lib/com/wiris/util/type/Arrays.rb +275 -0
- data/lib/com/wiris/util/type/ByteBuffer.rb +69 -0
- data/lib/com/wiris/util/type/Comparator.rb +8 -0
- data/lib/com/wiris/util/type/DataUtils.rb +24 -0
- data/lib/com/wiris/util/type/DoubleTools.rb +14 -0
- data/lib/com/wiris/util/type/HashCache.rb +43 -0
- data/lib/com/wiris/util/type/IntegerTools.rb +32 -0
- data/lib/com/wiris/util/type/Queue.rb +31 -0
- data/lib/com/wiris/util/type/SortArrayByStringLength.rb +26 -0
- data/lib/com/wiris/util/type/SortStringByLength.rb +26 -0
- data/lib/com/wiris/util/type/SortedHash.rb +45 -0
- data/lib/com/wiris/util/type/Stack.rb +31 -0
- data/lib/com/wiris/util/type/StringUtils.rb +56 -0
- data/lib/com/wiris/util/type/Tokenizer.rb +40 -0
- data/lib/com/wiris/util/type/UrlUtils.rb +78 -0
- data/lib/com/wiris/util/xml/ContentHandler.rb +8 -0
- data/lib/com/wiris/util/xml/DefaultHandler.rb +25 -0
- data/lib/com/wiris/util/xml/EntityResolver.rb +8 -0
- data/lib/com/wiris/util/xml/MathMLEntityResolver.rb +19 -0
- data/lib/com/wiris/util/xml/SAXParser.rb +470 -0
- data/lib/com/wiris/util/xml/SerializableImpl.rb +16 -15
- data/lib/com/wiris/util/xml/WCharacterBase.rb +968 -627
- data/lib/com/wiris/util/xml/WEntities.rb +11 -9
- data/lib/com/wiris/util/xml/WXmlUtils.rb +660 -490
- data/lib/com/wiris/util/xml/XmlSerializer.rb +517 -471
- data/lib/com/wiris/util/xml/XmlWriter.rb +260 -262
- data/lib/loader.rb +15 -12
- data/lib/src-generic/Array.rb +22 -22
- data/lib/src-generic/ArrayInt.rb +31 -31
- data/lib/src-generic/Base64.rb +14 -14
- data/lib/src-generic/BaseCode.rb +93 -93
- data/lib/src-generic/Boolean.rb +27 -0
- data/lib/src-generic/Bytes.rb +50 -50
- data/lib/src-generic/BytesInput.rb +37 -37
- data/lib/src-generic/EReg.rb +55 -55
- data/lib/src-generic/File.rb +35 -35
- data/lib/src-generic/FileLock.rb +26 -26
- data/lib/src-generic/FileSystem.rb +37 -37
- data/lib/src-generic/Hash.rb +42 -42
- data/lib/src-generic/Http.rb +111 -107
- data/lib/src-generic/HttpRequest.rb +25 -25
- data/lib/src-generic/HttpResponse.rb +70 -70
- data/lib/src-generic/Iterator.rb +20 -19
- data/lib/src-generic/Math.rb +14 -14
- data/lib/src-generic/Md5.rb +8 -8
- data/lib/src-generic/Md5Tools.rb +11 -11
- data/lib/src-generic/PropertiesTools.rb +32 -32
- data/lib/src-generic/Reflect.rb +16 -16
- data/lib/src-generic/RubyConfigurationUpdater.rb +49 -45
- data/lib/src-generic/Serializer.rb +84 -84
- data/lib/src-generic/Std.rb +74 -74
- data/lib/src-generic/Storage.rb +152 -152
- data/lib/src-generic/StringBuf.rb +40 -40
- data/lib/src-generic/StringTools.rb +44 -46
- data/lib/src-generic/Timer.rb +6 -6
- data/lib/src-generic/Type.rb +18 -18
- data/lib/src-generic/TypeTools.rb +31 -31
- data/lib/src-generic/Unserializer.rb +72 -72
- data/lib/src-generic/Utf8.rb +26 -26
- data/lib/src-generic/Xml.rb +199 -198
- data/lib/src-generic/extended/Integer.rb +5 -5
- data/lib/src-generic/extended/Math.rb +6 -6
- data/lib/src-generic/extended/Properties.rb +11 -11
- data/lib/src-generic/extended/String.rb +38 -38
- data/lib/src-generic/settings/PlatformSettings.rb +18 -18
- data/lib/src-generic/system/HttpProxy.rb +23 -0
- data/lib/src-generic/system/HttpProxyAuth.rb +10 -0
- data/lib/wirispluginengine.rb +5 -5
- data/lib/wirispluginengine/engine.rb +5 -5
- data/lib/wirispluginengine/integration/cleancache.rb +8 -8
- data/lib/wirispluginengine/integration/configurationjs.rb +8 -15
- data/lib/wirispluginengine/integration/configurationjson.rb +6 -6
- data/lib/wirispluginengine/integration/createimage.rb +7 -7
- data/lib/wirispluginengine/integration/getmathml.rb +18 -18
- data/lib/wirispluginengine/integration/resource.rb +8 -8
- data/lib/wirispluginengine/integration/service.rb +5 -5
- data/lib/wirispluginengine/integration/showimage.rb +28 -21
- data/lib/wirispluginengine/integration/test.rb +5 -5
- data/lib/wirispluginengine/integration/testfilter.rb +10 -0
- data/lib/wirispluginengine/version.rb +2 -2
- data/resources/VERSION +1 -1
- data/resources/WEB-INF/web.xml +25 -0
- data/resources/WIRISplugins.js +3809 -0
- data/resources/default-configuration.ini +47 -45
- data/resources/tech.txt +1 -1
- data/resources/wirisplugin.css +43 -42
- metadata +40 -4
- data/configuration.ini.dist +0 -104
data/lib/src-generic/Http.rb
CHANGED
@@ -1,107 +1,111 @@
|
|
1
|
-
require "net/http"
|
2
|
-
require "uri"
|
3
|
-
|
4
|
-
module Wiris
|
5
|
-
class Http
|
6
|
-
#
|
7
|
-
# The server myURL.
|
8
|
-
#
|
9
|
-
#
|
10
|
-
|
11
|
-
@postData
|
12
|
-
@headers
|
13
|
-
@params
|
14
|
-
@connection
|
15
|
-
@@
|
16
|
-
|
17
|
-
|
18
|
-
def self.
|
19
|
-
@@
|
20
|
-
end
|
21
|
-
|
22
|
-
def self.
|
23
|
-
@@
|
24
|
-
end
|
25
|
-
|
26
|
-
def initialize(url)
|
27
|
-
@url = url
|
28
|
-
@headers = Hash.new()
|
29
|
-
@params = Hash.new()
|
30
|
-
end
|
31
|
-
|
32
|
-
def request(post)
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
@
|
98
|
-
|
99
|
-
|
100
|
-
def
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
1
|
+
require "net/http"
|
2
|
+
require "uri"
|
3
|
+
|
4
|
+
module Wiris
|
5
|
+
class Http
|
6
|
+
#
|
7
|
+
# The server myURL.
|
8
|
+
#
|
9
|
+
#
|
10
|
+
attr_accessor :url
|
11
|
+
@postData
|
12
|
+
@headers
|
13
|
+
@params
|
14
|
+
@connection
|
15
|
+
@@proxy=nil
|
16
|
+
|
17
|
+
|
18
|
+
def self.proxy=(proxy)
|
19
|
+
@@proxy = proxy
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.proxy
|
23
|
+
@@proxy
|
24
|
+
end
|
25
|
+
|
26
|
+
def initialize(url)
|
27
|
+
@url = url
|
28
|
+
@headers = Hash.new()
|
29
|
+
@params = Hash.new()
|
30
|
+
end
|
31
|
+
|
32
|
+
def request(post)
|
33
|
+
serializedParams = formEncode(@params)
|
34
|
+
uri = URI.parse(@url)
|
35
|
+
if !@@proxy.nil? && !@@proxy.host.nil? && @@proxy.host != ""
|
36
|
+
host = @@proxy.host
|
37
|
+
port = @@proxy.port
|
38
|
+
auth = @@proxy.auth
|
39
|
+
unless auth.nil?
|
40
|
+
user = auth.user
|
41
|
+
pass = auth.pass
|
42
|
+
end
|
43
|
+
@connection = Net::HTTP.new(uri.host, uri.port, host, port)
|
44
|
+
else
|
45
|
+
@connection = Net::HTTP.new(uri.host, uri.port)
|
46
|
+
end
|
47
|
+
|
48
|
+
if !post
|
49
|
+
if (serializedParams != "")
|
50
|
+
uri.query = serializedParams
|
51
|
+
end
|
52
|
+
request = Net::HTTP::Get.new(uri.request_uri)
|
53
|
+
else
|
54
|
+
request = Net::HTTP::Post.new(uri.request_uri)
|
55
|
+
request.body = @postData != nil ? @postData : serializedParams
|
56
|
+
end
|
57
|
+
|
58
|
+
keys = @headers.keys()
|
59
|
+
|
60
|
+
while keys.hasNext()
|
61
|
+
key = keys.next()
|
62
|
+
request.add_field(key, @headers.get(key))
|
63
|
+
end
|
64
|
+
|
65
|
+
response = @connection.request(request)
|
66
|
+
onData(response.body)
|
67
|
+
end
|
68
|
+
|
69
|
+
def formEncode(params)
|
70
|
+
i = params.keys()
|
71
|
+
sb = StringBuf.new()
|
72
|
+
first = true
|
73
|
+
while (i.hasNext())
|
74
|
+
if(!first)
|
75
|
+
sb.add("&")
|
76
|
+
else
|
77
|
+
first = false
|
78
|
+
end
|
79
|
+
key = i.next()
|
80
|
+
sb.add(StringTools.urlEncode(key))
|
81
|
+
sb.add("=")
|
82
|
+
sb.add(StringTools.urlEncode(params.get(key)))
|
83
|
+
end
|
84
|
+
return sb.toString()
|
85
|
+
end
|
86
|
+
|
87
|
+
|
88
|
+
def setHeader(header, value)
|
89
|
+
@headers.set(header,value)
|
90
|
+
end
|
91
|
+
|
92
|
+
#
|
93
|
+
# Sets a parameter to be sent in the request. Multiple parameters can be set
|
94
|
+
# by making multiple setParameter calls.
|
95
|
+
#
|
96
|
+
def setParameter(param, value)
|
97
|
+
@params.set(param,value)
|
98
|
+
end
|
99
|
+
|
100
|
+
def setPostData(data)
|
101
|
+
@postData = data
|
102
|
+
end
|
103
|
+
|
104
|
+
def onData(data)
|
105
|
+
end
|
106
|
+
|
107
|
+
def onError(msg)
|
108
|
+
end
|
109
|
+
|
110
|
+
end
|
111
|
+
end
|
@@ -1,25 +1,25 @@
|
|
1
|
-
module Wiris
|
2
|
-
class HttpRequest
|
3
|
-
attr_accessor :params
|
4
|
-
|
5
|
-
def initialize(params)
|
6
|
-
@params = params;
|
7
|
-
end
|
8
|
-
|
9
|
-
def getParameter(key)
|
10
|
-
if (self.params[key].nil?)
|
11
|
-
return nil
|
12
|
-
end
|
13
|
-
return self.params[key]
|
14
|
-
end
|
15
|
-
|
16
|
-
def getContextURL()
|
17
|
-
return nil
|
18
|
-
end
|
19
|
-
|
20
|
-
def getParameterNames
|
21
|
-
return params.keys
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
1
|
+
module Wiris
|
2
|
+
class HttpRequest
|
3
|
+
attr_accessor :params
|
4
|
+
|
5
|
+
def initialize(params)
|
6
|
+
@params = params;
|
7
|
+
end
|
8
|
+
|
9
|
+
def getParameter(key)
|
10
|
+
if (self.params[key].nil?)
|
11
|
+
return nil
|
12
|
+
end
|
13
|
+
return self.params[key]
|
14
|
+
end
|
15
|
+
|
16
|
+
def getContextURL()
|
17
|
+
return nil
|
18
|
+
end
|
19
|
+
|
20
|
+
def getParameterNames
|
21
|
+
return params.keys
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
@@ -1,71 +1,71 @@
|
|
1
|
-
module Wiris
|
2
|
-
class HttpResponse
|
3
|
-
def actionController
|
4
|
-
@actionController
|
5
|
-
end
|
6
|
-
|
7
|
-
def actionController=(actionController)
|
8
|
-
@actionController=actionController
|
9
|
-
end
|
10
|
-
def res
|
11
|
-
@res
|
12
|
-
end
|
13
|
-
def headers=(headers)
|
14
|
-
@headers = headers
|
15
|
-
end
|
16
|
-
|
17
|
-
def headers
|
18
|
-
@headers
|
19
|
-
end
|
20
|
-
|
21
|
-
def out=(out)
|
22
|
-
@out=out
|
23
|
-
end
|
24
|
-
|
25
|
-
def out
|
26
|
-
@out
|
27
|
-
end
|
28
|
-
|
29
|
-
def writing
|
30
|
-
@writing
|
31
|
-
end
|
32
|
-
|
33
|
-
def writing=(writing)
|
34
|
-
@writing=writing
|
35
|
-
end
|
36
|
-
|
37
|
-
def writeString(s)
|
38
|
-
@writing = true
|
39
|
-
@out = @out + s
|
40
|
-
end
|
41
|
-
|
42
|
-
def writeBinary(data)
|
43
|
-
writeString(data.toString())
|
44
|
-
end
|
45
|
-
|
46
|
-
def initialize(actionController)
|
47
|
-
@closed=false
|
48
|
-
@actionController = actionController
|
49
|
-
@writing=false
|
50
|
-
@out = ""
|
51
|
-
@res = actionController.response
|
52
|
-
@headers = Hash.new()
|
53
|
-
end
|
54
|
-
|
55
|
-
def setHeader(name, value)
|
56
|
-
@headers.set(name, value)
|
57
|
-
@res.headers[name] = value
|
58
|
-
end
|
59
|
-
|
60
|
-
def getHeader(name)
|
61
|
-
return @headers.get(name)
|
62
|
-
end
|
63
|
-
|
64
|
-
def close
|
65
|
-
@res.close
|
66
|
-
if @writing
|
67
|
-
actionController.render :text => @out
|
68
|
-
end
|
69
|
-
end
|
70
|
-
end
|
1
|
+
module Wiris
|
2
|
+
class HttpResponse
|
3
|
+
def actionController
|
4
|
+
@actionController
|
5
|
+
end
|
6
|
+
|
7
|
+
def actionController=(actionController)
|
8
|
+
@actionController=actionController
|
9
|
+
end
|
10
|
+
def res
|
11
|
+
@res
|
12
|
+
end
|
13
|
+
def headers=(headers)
|
14
|
+
@headers = headers
|
15
|
+
end
|
16
|
+
|
17
|
+
def headers
|
18
|
+
@headers
|
19
|
+
end
|
20
|
+
|
21
|
+
def out=(out)
|
22
|
+
@out=out
|
23
|
+
end
|
24
|
+
|
25
|
+
def out
|
26
|
+
@out
|
27
|
+
end
|
28
|
+
|
29
|
+
def writing
|
30
|
+
@writing
|
31
|
+
end
|
32
|
+
|
33
|
+
def writing=(writing)
|
34
|
+
@writing=writing
|
35
|
+
end
|
36
|
+
|
37
|
+
def writeString(s)
|
38
|
+
@writing = true
|
39
|
+
@out = @out + s
|
40
|
+
end
|
41
|
+
|
42
|
+
def writeBinary(data)
|
43
|
+
writeString(data.toString())
|
44
|
+
end
|
45
|
+
|
46
|
+
def initialize(actionController)
|
47
|
+
@closed=false
|
48
|
+
@actionController = actionController
|
49
|
+
@writing=false
|
50
|
+
@out = ""
|
51
|
+
@res = actionController.response
|
52
|
+
@headers = Hash.new()
|
53
|
+
end
|
54
|
+
|
55
|
+
def setHeader(name, value)
|
56
|
+
@headers.set(name, value)
|
57
|
+
@res.headers[name] = value
|
58
|
+
end
|
59
|
+
|
60
|
+
def getHeader(name)
|
61
|
+
return @headers.get(name)
|
62
|
+
end
|
63
|
+
|
64
|
+
def close
|
65
|
+
@res.close
|
66
|
+
if @writing
|
67
|
+
actionController.render :text => @out
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
71
|
end
|
data/lib/src-generic/Iterator.rb
CHANGED
@@ -1,20 +1,21 @@
|
|
1
|
-
module Wiris
|
2
|
-
class Iterator < Enumerator
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
1
|
+
module Wiris
|
2
|
+
class Iterator < Enumerator
|
3
|
+
@enumeration
|
4
|
+
def initialize(enum)
|
5
|
+
@enumeration = enum.map
|
6
|
+
end
|
7
|
+
|
8
|
+
def next
|
9
|
+
@enumeration.next
|
10
|
+
end
|
11
|
+
|
12
|
+
def hasNext()
|
13
|
+
begin
|
14
|
+
@enumeration.peek
|
15
|
+
return true
|
16
|
+
rescue StopIteration
|
17
|
+
return false
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
20
21
|
end
|