bosdk 0.1.2-universal-java-1.6 → 1.0.0-universal-java-1.6
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +14 -4
- data/Rakefile +1 -1
- data/bosdk.gemspec +1 -1
- data/lib/bosdk.rb +9 -0
- data/lib/bosdk/info_object.rb +2 -0
- metadata +1 -1
data/README.rdoc
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
= BOSDK.gem
|
1
|
+
= BOSDK.gem v1.0.0
|
2
2
|
|
3
3
|
== Description
|
4
4
|
|
@@ -15,14 +15,24 @@ A JRuby wrapper for the Business Objects SDK
|
|
15
15
|
|
16
16
|
require 'bosdk'
|
17
17
|
include BOSDK
|
18
|
-
|
18
|
+
session = EnterpriseSession.new('cms', 'Administrator', '')
|
19
19
|
|
20
20
|
stmt = "SELECT TOP 10 * FROM CI_SYSTEMOBJECTS WHERE SI_KIND='User'"
|
21
|
-
|
21
|
+
session.query(stmt).each do |obj|
|
22
22
|
puts obj.path
|
23
23
|
end
|
24
24
|
|
25
|
-
|
25
|
+
session.disconnect
|
26
|
+
|
27
|
+
Alternatively you can use the #connect closure.
|
28
|
+
|
29
|
+
require 'bosdk'
|
30
|
+
BOSDK.connect('cms', 'Administrator', '') do |session|
|
31
|
+
stmt = "SELECT TOP 10 * FROM CI_SYSTEMOBJECTS WHERE SI_KIND='User'"
|
32
|
+
session.query(stmt).each do |obj|
|
33
|
+
puts obj.path
|
34
|
+
end
|
35
|
+
end
|
26
36
|
|
27
37
|
== Resources
|
28
38
|
|
data/Rakefile
CHANGED
data/bosdk.gemspec
CHANGED
data/lib/bosdk.rb
CHANGED
@@ -26,3 +26,12 @@ include_class "com.crystaldecisions.sdk.framework.CrystalEnterprise"
|
|
26
26
|
|
27
27
|
require 'bosdk/enterprise_session'
|
28
28
|
require 'bosdk/info_object'
|
29
|
+
|
30
|
+
module BOSDK
|
31
|
+
# A closure over EnterpriseSession
|
32
|
+
def BOSDK.connect(cms, username, password, &block)
|
33
|
+
session = EnterpriseSession.new(cms, username, password)
|
34
|
+
yield session
|
35
|
+
session.disconnect
|
36
|
+
end
|
37
|
+
end
|
data/lib/bosdk/info_object.rb
CHANGED
@@ -31,6 +31,7 @@ module BOSDK
|
|
31
31
|
title <=> other_infoobject.title
|
32
32
|
end
|
33
33
|
|
34
|
+
# Forwards method to underlying IInfoObject and stores the results
|
34
35
|
def method_missing(method, *args)
|
35
36
|
eval "return @#{method.to_s}" if instance_variables.include?("@#{method.to_s}")
|
36
37
|
if @obj.respond_to?(method)
|
@@ -39,6 +40,7 @@ module BOSDK
|
|
39
40
|
super
|
40
41
|
end
|
41
42
|
|
43
|
+
# Returns true if underlying IInfoObject#respond_to? is true
|
42
44
|
def respond_to?(method)
|
43
45
|
@obj.respond_to?(method) || super
|
44
46
|
end
|