nakamura 0.6 → 0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -28,8 +28,7 @@ module SlingUsers
28
28
 
29
29
  # this method follows the series of POSTs that the UI makes to create a group with a
30
30
  # full set of features including the initial sakai docs for Library and Participants
31
- def create_full_group(creator_id, groupname, title = '', description = '')
32
- creator = User.new(creator_id, "testuser")
31
+ def create_full_group(creator, groupname, title = '', description = '')
33
32
  @sling.switch_user(creator)
34
33
 
35
34
  group = Group.new(groupname)
@@ -44,7 +43,7 @@ module SlingUsers
44
43
  "worldTemplate" => "/var/templates/worlds/group/simple-group",
45
44
  "_charset_" => "utf-8",
46
45
  "usersToAdd" => [{
47
- "userid" => creator_id,
46
+ "userid" => creator.name,
48
47
  "name" => creator.name,
49
48
  "firstname" => creator.firstName,
50
49
  "role" => "manager",
@@ -12,7 +12,7 @@ module SlingMessage
12
12
 
13
13
  def create(name, type, box = "drafts", props = {})
14
14
  @home = @sling.get_user().home_path_for(@sling)
15
- return @sling.execute_post(@sling.url_for("#{@home}/message.create.html"), props.update("sakai:type" => type, "sakai:to" => name, "sakai:sendstate" => "pending", "sakai:messagebox" => box))
15
+ return @sling.execute_post(@sling.url_for("#{@home}/message.create.html"), props.update("sakai:type" => type, "sakai:to" => name, "sakai:sendstate" => "pending", "sakai:messagebox" => box, "sakai:category" => "message"))
16
16
  end
17
17
 
18
18
  def send(messageId, sender)
@@ -43,4 +43,4 @@ module SlingMessage
43
43
 
44
44
  end
45
45
 
46
- end
46
+ end
@@ -0,0 +1,31 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'logger'
4
+
5
+ module OSGIConf
6
+
7
+ class Conf
8
+
9
+ attr_accessor :log
10
+
11
+ def initialize(sling)
12
+ @sling = sling
13
+ @log = Logger.new(STDOUT)
14
+ @log.level = Logger::WARN
15
+ end
16
+
17
+ def setProperties(factoryPid, props)
18
+ path = "/system/console/configMgr/%5BTemporary%20PID%20replaced%20by%20real%20PID%20upon%20save%5D"
19
+ props["propertylist"] = props.keys.join(",")
20
+ props["apply"] = true
21
+ props["action"] = "ajaxConfigManager"
22
+ props["factoryPid"] = factoryPid
23
+ res = @sling.execute_post(@sling.url_for(path), props)
24
+ if ( res.code != "200" )
25
+ @log.debug(res.body)
26
+ @log.info(" Unable to update config for #{factoryPid}")
27
+ return false
28
+ end
29
+ end
30
+ end
31
+ end
data/lib/nakamura.rb CHANGED
@@ -176,7 +176,7 @@ module SlingInterface
176
176
  end
177
177
  set_cookies(req)
178
178
  else
179
- @log.warn("Path #{uri} is not a Sling URL, not sending state")
179
+ @log.info("#{uri.host} does not match expected #{@serverui.host}. Not sending state.")
180
180
  end
181
181
  res = createHttp(uri).start { |http| http.request(req ) }
182
182
  save_cookies(res) if (isSlingReq)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nakamura
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.6'
4
+ version: '0.7'
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,8 +9,19 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-01-17 00:00:00.000000000 Z
13
- dependencies: []
12
+ date: 2012-03-01 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: json
16
+ requirement: &21272880 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: 1.6.3
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *21272880
14
25
  description: Ruby library for interacting with Sakai Nakamura. Provides convenience
15
26
  methods for adding users and groups and other similar tasks.
16
27
  email: oae-dev@collab.sakaiproject.org
@@ -24,6 +35,7 @@ files:
24
35
  - lib/nakamura/users.rb
25
36
  - lib/nakamura/contacts.rb
26
37
  - lib/nakamura/message.rb
38
+ - lib/nakamura/osgiconf.rb
27
39
  - lib/nakamura/search.rb
28
40
  - lib/nakamura/file.rb
29
41
  - lib/nakamura.rb