rtm-javatmapi 0.2.0

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.
Files changed (53) hide show
  1. data/DISCLAIMER +13 -0
  2. data/LICENSE +201 -0
  3. data/README +4 -0
  4. data/lib/rtm/javatmapi.rb +189 -0
  5. data/lib/rtm/javatmapi/aliases.rb +43 -0
  6. data/lib/rtm/javatmapi/base.rb +30 -0
  7. data/lib/rtm/javatmapi/core.rb +16 -0
  8. data/lib/rtm/javatmapi/core/association.rb +71 -0
  9. data/lib/rtm/javatmapi/core/construct.rb +68 -0
  10. data/lib/rtm/javatmapi/core/locator.rb +24 -0
  11. data/lib/rtm/javatmapi/core/name.rb +101 -0
  12. data/lib/rtm/javatmapi/core/occurrence.rb +56 -0
  13. data/lib/rtm/javatmapi/core/reifiable.rb +48 -0
  14. data/lib/rtm/javatmapi/core/role.rb +49 -0
  15. data/lib/rtm/javatmapi/core/scoped.rb +99 -0
  16. data/lib/rtm/javatmapi/core/topic.rb +454 -0
  17. data/lib/rtm/javatmapi/core/topic_map.rb +632 -0
  18. data/lib/rtm/javatmapi/core/topic_map_system.rb +6 -0
  19. data/lib/rtm/javatmapi/core/typed.rb +31 -0
  20. data/lib/rtm/javatmapi/core/variant.rb +19 -0
  21. data/lib/rtm/javatmapi/ext.rb +4 -0
  22. data/lib/rtm/javatmapi/ext/java_util_set.rb +10 -0
  23. data/lib/rtm/javatmapi/inclusion.rb +46 -0
  24. data/lib/rtm/javatmapi/java_implementations.rb +40 -0
  25. data/lib/rtm/javatmapi/javalibs/asm-2.2.3.jar +0 -0
  26. data/lib/rtm/javatmapi/javalibs/asm-commons-2.2.3.jar +0 -0
  27. data/lib/rtm/javatmapi/javalibs/ctm-writer-1.0.0a.jar +0 -0
  28. data/lib/rtm/javatmapi/javalibs/jing.jar +0 -0
  29. data/lib/rtm/javatmapi/javalibs/json_simple.jar +0 -0
  30. data/lib/rtm/javatmapi/javalibs/log4j-1.2.14.jar +0 -0
  31. data/lib/rtm/javatmapi/javalibs/ocutil-2.4.2.jar +0 -0
  32. data/lib/rtm/javatmapi/javalibs/openrdf-sesame-2.2.1-onejar.jar +0 -0
  33. data/lib/rtm/javatmapi/javalibs/poi-3.2-FINAL.jar +0 -0
  34. data/lib/rtm/javatmapi/javalibs/poi-3.5-beta6-20090622.jar +0 -0
  35. data/lib/rtm/javatmapi/javalibs/poi-contrib-3.5-beta6-20090622.jar +0 -0
  36. data/lib/rtm/javatmapi/javalibs/poi-ooxml-3.5-beta6-20090622.jar +0 -0
  37. data/lib/rtm/javatmapi/javalibs/poi-scratchpad-3.2-FINAL.jar +0 -0
  38. data/lib/rtm/javatmapi/javalibs/poi-scratchpad-3.5-beta6-20090622.jar +0 -0
  39. data/lib/rtm/javatmapi/javalibs/semagia-mio-0.9.5.jar +0 -0
  40. data/lib/rtm/javatmapi/javalibs/semagia-mio-ctm-0.9.3-working-draft-2009-02-18.jar +0 -0
  41. data/lib/rtm/javatmapi/javalibs/semagia-mio-jtm-0.9.4.jar +0 -0
  42. data/lib/rtm/javatmapi/javalibs/semagia-mio-ltm-0.9.5.jar +0 -0
  43. data/lib/rtm/javatmapi/javalibs/semagia-mio-snello-0.9.3.jar +0 -0
  44. data/lib/rtm/javatmapi/javalibs/semagia-mio-tmxml-0.9.5.jar +0 -0
  45. data/lib/rtm/javatmapi/javalibs/semagia-mio-xtm-0.9.5.jar +0 -0
  46. data/lib/rtm/javatmapi/javalibs/slf4j-api-1.5.8.jar +0 -0
  47. data/lib/rtm/javatmapi/javalibs/slf4j-log4j12-1.5.8.jar +0 -0
  48. data/lib/rtm/javatmapi/javalibs/tinytim-mio-2.0.0a5.jar +0 -0
  49. data/lib/rtm/javatmapi/javalibs/tmapi-2.0a2.jar +0 -0
  50. data/lib/rtm/javatmapi/javalibs/tmapix-io-0.3.0-snapshot-200910281502.jar +0 -0
  51. data/lib/rtm/javatmapi/javalibs/trove-2.0.4.jar +0 -0
  52. data/lib/rtm/javatmapi/superiseable.rb +74 -0
  53. metadata +118 -0
@@ -0,0 +1,6 @@
1
+ # Copyright: Copyright 2009 Topic Maps Lab, University of Leipzig.
2
+ # License: Apache License, Version 2.0
3
+
4
+ module Java::OrgTmapiCore::TopicMapSystem
5
+
6
+ end
@@ -0,0 +1,31 @@
1
+ # Copyright: Copyright 2009 Topic Maps Lab, University of Leipzig.
2
+ # License: Apache License, Version 2.0
3
+
4
+ module Java::OrgTmapiCore::Typed
5
+
6
+ #include RTM::Typed
7
+ extend Superiseable
8
+
9
+ # Returns the type of this typed construct
10
+ # (occurrence, role, association or name).
11
+ #
12
+ # :call-seq:
13
+ # type -> Topic
14
+ #
15
+ def type
16
+ getType
17
+ end
18
+
19
+ superised
20
+ # Sets the type of this typed Construct. Any previous type is overridden.
21
+ #
22
+ # Identifier may be a topic reference.
23
+ #
24
+ # :call-seq:
25
+ # type=(identifier)
26
+ #
27
+ def type=(identifier)
28
+ setType(topic_map.get!(identifier))
29
+ end
30
+
31
+ end
@@ -0,0 +1,19 @@
1
+ # Copyright: Copyright 2009 Topic Maps Lab, University of Leipzig.
2
+ # License: Apache License, Version 2.0
3
+
4
+ module Java::OrgTmapiCore::Variant
5
+
6
+ #include RTM::Variant
7
+ #extend Superiseable
8
+
9
+ # Returns the Name this Variant belongs to.
10
+ #
11
+ # :call-seq:
12
+ # parent -> Name
13
+ #
14
+ def parent
15
+ getParent
16
+ end
17
+ alias :reverse_children :parent
18
+
19
+ end
@@ -0,0 +1,4 @@
1
+ # Copyright: Copyright 2009 Topic Maps Lab, University of Leipzig.
2
+ # License: Apache License, Version 2.0
3
+
4
+ require 'rtm/javatmapi/ext/java_util_set'
@@ -0,0 +1,10 @@
1
+ # Copyright: Copyright 2009 Topic Maps Lab, University of Leipzig.
2
+ # License: Apache License, Version 2.0
3
+
4
+ module Java::JavaLang::Iterable
5
+ def first
6
+ it = self.iterator
7
+ return it.next if it.has_next
8
+ nil
9
+ end unless self.method_defined?(:first)
10
+ end
@@ -0,0 +1,46 @@
1
+ # Copyright: Copyright 2009 Topic Maps Lab, University of Leipzig.
2
+ # License: Apache License, Version 2.0
3
+
4
+ module Java::OrgTmapiCore::TopicMap
5
+ include RTM::TopicMap
6
+ end
7
+
8
+ module Java::OrgTmapiCore::Topic
9
+ include RTM::Topic
10
+ end
11
+
12
+ module Java::OrgTmapiCore::Association
13
+ include RTM::Association
14
+ end
15
+
16
+ module Java::OrgTmapiCore::Name
17
+ include RTM::Name
18
+ end
19
+
20
+ module Java::OrgTmapiCore::Occurrence
21
+ include RTM::Occurrence
22
+ end
23
+
24
+ module Java::OrgTmapiCore::Variant
25
+ include RTM::Variant
26
+ end
27
+
28
+ module Java::OrgTmapiCore::Role
29
+ include RTM::Role
30
+ end
31
+
32
+ module Java::OrgTmapiCore::Locator
33
+ include RTM::Locator
34
+ end
35
+
36
+ module Java::OrgTmapiCore::Reifiable
37
+ include RTM::Reifiable
38
+ end
39
+
40
+ module Java::OrgTmapiCore::Scoped
41
+ include RTM::Scoped
42
+ end
43
+
44
+ module Java::OrgTmapiCore::Typed
45
+ include RTM::Typed
46
+ end
@@ -0,0 +1,40 @@
1
+ # Copyright: Copyright 2009 Topic Maps Lab, University of Leipzig.
2
+ # License: Apache License, Version 2.0
3
+
4
+ module Superiseable
5
+ module WithJavaImplementations
6
+
7
+ class CJavaImplementations
8
+ def initialize
9
+ @java_implementations = Hash.new{|h,k| h[k] = []}
10
+ end
11
+
12
+ def [](interface)
13
+ @java_implementations[interface]
14
+ end
15
+
16
+ def add(interface,impl)
17
+ begin
18
+ begin
19
+ impl
20
+ rescue
21
+ puts "Error in java_implementations.rb: #{interface}: #{impl}"
22
+ end
23
+ @java_implementations[interface] << impl
24
+ rescue
25
+ puts "Something went wrong in java_implementations.rb"
26
+ end
27
+ end
28
+ end
29
+
30
+ JavaImplementations = CJavaImplementations.new
31
+ end
32
+ end
33
+
34
+ module Java::OrgTmapiCore::Construct
35
+ include Superiseable::WithJavaImplementations
36
+ end
37
+
38
+ module Java::OrgTmapiCore::Locator
39
+ include Superiseable::WithJavaImplementations
40
+ end
Binary file
@@ -0,0 +1,74 @@
1
+ # Copyright: Copyright 2009 Topic Maps Lab, University of Leipzig.
2
+ # License: Apache License, Version 2.0
3
+
4
+ module Superiseable
5
+
6
+ def superised
7
+ @superised = true
8
+ end
9
+
10
+ def method_added(method_name)
11
+ if @superised
12
+ superising method_name
13
+ end
14
+ @superised = false
15
+ end
16
+
17
+ def superising method_name
18
+ @to_superize ||= []
19
+ @to_superize << method_name
20
+ end
21
+
22
+ def superize
23
+ @to_superize.each do |method_name|
24
+ self::JavaImplementations[self].each do |c|
25
+ # puts "Superising #{method_name} in #{self} (#{c})"
26
+ c.class_eval do
27
+ define_method(method_name) { |*args| super *args}
28
+ end
29
+ end
30
+ end
31
+ end
32
+
33
+
34
+ # def superising method_name
35
+ # start = Time.now
36
+ #
37
+ # puts self
38
+ # puts self::JavaImplementations[self]
39
+ #
40
+ # todo = self
41
+ #
42
+ ## # TODO docu
43
+ ## if todo == RTM::Scoped
44
+ ## todo = [Java::OrgTmapiCore::Name, Java::OrgTmapiCore::Occurrence, Java::OrgTmapiCore::Association, Java::OrgTmapiCore::Variant]
45
+ ## elsif todo == RTM::Reifiable
46
+ ## todo = [Java::OrgTmapiCore::Association, Java::OrgTmapiCore::Name, Java::OrgTmapiCore::Occurrence, Java::OrgTmapiCore::Role, Java::OrgTmapiCore::TopicMap, Java::OrgTmapiCore::Variant]
47
+ ## elsif todo == RTM::Construct
48
+ ## todo = [Java::OrgTmapiCore::Association, Java::OrgTmapiCore::Name, Java::OrgTmapiCore::Occurrence, Java::OrgTmapiCore::Role, Java::OrgTmapiCore::TopicMap, Java::OrgTmapiCore::Variant, Java::OrgTmapiCore::Topic]
49
+ ## elsif todo == RTM::Typed
50
+ ## todo = [Java::OrgTmapiCore::Association, Java::OrgTmapiCore::Name, Java::OrgTmapiCore::Occurrence, Java::OrgTmapiCore::Role]
51
+ ## end
52
+ # todo = [todo].flatten
53
+ #
54
+ #
55
+ # implFinder = ::ImplementationsForInterface.new
56
+ # if $CLASSPATH
57
+ # $CLASSPATH.to_a.each do |entry|
58
+ # entry.slice!(/^file:/)
59
+ # implFinder.addPathEntry(entry)
60
+ # end
61
+ # end
62
+ #
63
+ # todo.each do |i|
64
+ # IMPLEMENTATIONS[i.java_class] ||= implFinder.classInformationsFor(i.java_class).select {|c| !c.getClassName.include? "$" }.map {|c| eval(c.getClassName) }
65
+ # IMPLEMENTATIONS[i.java_class].each do |c|
66
+ # c.class_eval do
67
+ # define_method(method_name) { |*args| super *args}
68
+ # end
69
+ # end
70
+ # end
71
+ # #puts "Und so lange hat es gedauert:" + (Time.now - start).to_s
72
+ # end
73
+
74
+ end
metadata ADDED
@@ -0,0 +1,118 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rtm-javatmapi
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ platform: ruby
6
+ authors:
7
+ - Benjamin Bock
8
+ - Arnim Bleier
9
+ - Uta Schulze
10
+ - Daniel Exner
11
+ autorequire:
12
+ bindir: bin
13
+ cert_chain: []
14
+
15
+ date: 2010-02-05 00:00:00 +01:00
16
+ default_executable:
17
+ dependencies:
18
+ - !ruby/object:Gem::Dependency
19
+ name: rtm
20
+ type: :runtime
21
+ version_requirement:
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 0.2.0
27
+ version:
28
+ description: " Ruby Topic Maps is a Topic Maps engine written in Ruby.\n This backend engine uses any Java TMAPI 2.0 compatible backend. See http://www.tmapi.org/2.0/.\n You can provide your own TMAPI 2.0 compatible implementation or use one of the existing ones:\n * rtm-ontopia\n * rtm-tinytim\n * rtm-sesametm \n"
29
+ email: "#rtm+rtm-javatmapi-gem-20100205@topicmapslab.de"
30
+ executables: []
31
+
32
+ extensions: []
33
+
34
+ extra_rdoc_files: []
35
+
36
+ files:
37
+ - lib/rtm/javatmapi/aliases.rb
38
+ - lib/rtm/javatmapi/base.rb
39
+ - lib/rtm/javatmapi/core/association.rb
40
+ - lib/rtm/javatmapi/core/construct.rb
41
+ - lib/rtm/javatmapi/core/locator.rb
42
+ - lib/rtm/javatmapi/core/name.rb
43
+ - lib/rtm/javatmapi/core/occurrence.rb
44
+ - lib/rtm/javatmapi/core/reifiable.rb
45
+ - lib/rtm/javatmapi/core/role.rb
46
+ - lib/rtm/javatmapi/core/scoped.rb
47
+ - lib/rtm/javatmapi/core/topic.rb
48
+ - lib/rtm/javatmapi/core/topic_map.rb
49
+ - lib/rtm/javatmapi/core/topic_map_system.rb
50
+ - lib/rtm/javatmapi/core/typed.rb
51
+ - lib/rtm/javatmapi/core/variant.rb
52
+ - lib/rtm/javatmapi/core.rb
53
+ - lib/rtm/javatmapi/ext/java_util_set.rb
54
+ - lib/rtm/javatmapi/ext.rb
55
+ - lib/rtm/javatmapi/inclusion.rb
56
+ - lib/rtm/javatmapi/java_implementations.rb
57
+ - lib/rtm/javatmapi/superiseable.rb
58
+ - lib/rtm/javatmapi.rb
59
+ - lib/rtm/javatmapi/javalibs/asm-2.2.3.jar
60
+ - lib/rtm/javatmapi/javalibs/asm-commons-2.2.3.jar
61
+ - lib/rtm/javatmapi/javalibs/ctm-writer-1.0.0a.jar
62
+ - lib/rtm/javatmapi/javalibs/jing.jar
63
+ - lib/rtm/javatmapi/javalibs/json_simple.jar
64
+ - lib/rtm/javatmapi/javalibs/log4j-1.2.14.jar
65
+ - lib/rtm/javatmapi/javalibs/ocutil-2.4.2.jar
66
+ - lib/rtm/javatmapi/javalibs/openrdf-sesame-2.2.1-onejar.jar
67
+ - lib/rtm/javatmapi/javalibs/poi-3.2-FINAL.jar
68
+ - lib/rtm/javatmapi/javalibs/poi-3.5-beta6-20090622.jar
69
+ - lib/rtm/javatmapi/javalibs/poi-contrib-3.5-beta6-20090622.jar
70
+ - lib/rtm/javatmapi/javalibs/poi-ooxml-3.5-beta6-20090622.jar
71
+ - lib/rtm/javatmapi/javalibs/poi-scratchpad-3.2-FINAL.jar
72
+ - lib/rtm/javatmapi/javalibs/poi-scratchpad-3.5-beta6-20090622.jar
73
+ - lib/rtm/javatmapi/javalibs/semagia-mio-0.9.5.jar
74
+ - lib/rtm/javatmapi/javalibs/semagia-mio-ctm-0.9.3-working-draft-2009-02-18.jar
75
+ - lib/rtm/javatmapi/javalibs/semagia-mio-jtm-0.9.4.jar
76
+ - lib/rtm/javatmapi/javalibs/semagia-mio-ltm-0.9.5.jar
77
+ - lib/rtm/javatmapi/javalibs/semagia-mio-snello-0.9.3.jar
78
+ - lib/rtm/javatmapi/javalibs/semagia-mio-tmxml-0.9.5.jar
79
+ - lib/rtm/javatmapi/javalibs/semagia-mio-xtm-0.9.5.jar
80
+ - lib/rtm/javatmapi/javalibs/slf4j-api-1.5.8.jar
81
+ - lib/rtm/javatmapi/javalibs/slf4j-log4j12-1.5.8.jar
82
+ - lib/rtm/javatmapi/javalibs/tinytim-mio-2.0.0a5.jar
83
+ - lib/rtm/javatmapi/javalibs/tmapi-2.0a2.jar
84
+ - lib/rtm/javatmapi/javalibs/tmapix-io-0.3.0-snapshot-200910281502.jar
85
+ - lib/rtm/javatmapi/javalibs/trove-2.0.4.jar
86
+ - LICENSE
87
+ - DISCLAIMER
88
+ - README
89
+ has_rdoc: true
90
+ homepage: http://rtm.topicmapslab.de/
91
+ licenses: []
92
+
93
+ post_install_message: You have successfully installed rtm-javatmapi.
94
+ rdoc_options: []
95
+
96
+ require_paths:
97
+ - lib
98
+ required_ruby_version: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ version: "0"
103
+ version:
104
+ required_rubygems_version: !ruby/object:Gem::Requirement
105
+ requirements:
106
+ - - ">="
107
+ - !ruby/object:Gem::Version
108
+ version: "0"
109
+ version:
110
+ requirements: []
111
+
112
+ rubyforge_project: rtm
113
+ rubygems_version: 1.3.5
114
+ signing_key:
115
+ specification_version: 3
116
+ summary: Ruby Topic Maps is a Topic Maps engine written in Ruby. The javatmapi gem holds common code for Java TMAPI-based engines.
117
+ test_files: []
118
+