ref: refs/heads/eula
commit 706b2ac2a5a69c81d4f18ea566fb9e57d46a9f4c
Author: J. Daniel Schmidt
Date: Thu Oct 8 17:15:09 2009 +0200
configuration controller
---
.../app/controllers/configuration_controller.rb | 27 ++++++++++++++++++++
.../app/controllers/registration_controller.rb | 15 +++++++---
plugins/registration/app/models/registration.rb | 2 +-
.../app/views/configuration/show.html.erb | 11 ++++++++
.../app/views/configuration/show.json.erb | 1 +
.../app/views/configuration/show.xml.erb | 1 +
.../resources/registration_configuration.yml | 4 +++
.../config/resources/registration_registration.yml | 4 +++
8 files changed, 59 insertions(+), 6 deletions(-)
diff --git a/plugins/registration/app/controllers/configuration_controller.rb b/plugins/registration/app/controllers/configuration_controller.rb
new file mode 100644
index 0000000..765c709
--- /dev/null
+++ b/plugins/registration/app/controllers/configuration_controller.rb
@@ -0,0 +1,27 @@
+# = RegistrationConfiguration controller
+# Provides access to the configuration of the registration system
+class ConfigurationController < ApplicationController
+
+ before_filter :login_required
+
+
+ def update
+ # PUT
+ # setRegistrationServerDetails
+ @registration = "PUT to /registration/configuration"
+ end
+
+
+ def show
+ @registration = Registration.new( { } )
+ # do not run registration
+ # only get the server url and certificate -> to be done in YSR.pm
+
+ # @registration = "GET to /registration/configuration"
+ end
+
+ def index
+ @registration = "GET to INDEX /registration/configuration"
+ end
+
+end
diff --git a/plugins/registration/app/controllers/registration_controller.rb b/plugins/registration/app/controllers/registration_controller.rb
index e77fa7d..56cb2f1 100644
--- a/plugins/registration/app/controllers/registration_controller.rb
+++ b/plugins/registration/app/controllers/registration_controller.rb
@@ -5,7 +5,7 @@ class RegistrationController < ApplicationController
before_filter :login_required
- # @@registration = Registration.new( { :doo => :daa } )
+ # @registration = Registration.new( { :doo => :daa } )
def update
@@ -13,10 +13,12 @@ class RegistrationController < ApplicationController
def create
# POST to registration => run registration
- @registration = Registration.new( { } )
+ @registration = Registration.new({})
+
+ # TODO: parse post data and set context data
+ #@registration.set_context( { } )
@registration.register
- # @registration = "POST to /registration/ ... so we run the registration"
end
def show
@@ -24,9 +26,12 @@ class RegistrationController < ApplicationController
#@registration = @@registration
#@registration = Registration.new( getRegistrationServerDetails.to_s )
- #
+
@registration = Registration.new( { } )
- @registration.register
+ # do not run registration
+ # only get the uuid, server url and certificate -> to be done in YSR.pm
+
+ #@registration.register
#@registration = "GET to /registration/"
end
diff --git a/plugins/registration/app/models/registration.rb b/plugins/registration/app/models/registration.rb
index 133675f..772e154 100644
--- a/plugins/registration/app/models/registration.rb
+++ b/plugins/registration/app/models/registration.rb
@@ -50,7 +50,7 @@ class Registration
end
def to_xml( options = {} )
- #return "This function should output XML"
+ #return "This function outputs XML :)"
xml = options[:builder] ||= Builder::XmlMarkup.new(options)
xml.instruct! unless options[:skip_instruct]
diff --git a/plugins/registration/app/views/configuration/show.html.erb b/plugins/registration/app/views/configuration/show.html.erb
new file mode 100644
index 0000000..6ed6334
--- /dev/null
+++ b/plugins/registration/app/views/configuration/show.html.erb
@@ -0,0 +1,11 @@
+<%= # @registration == nil ? "@registration is nil - FIXME" : @registration.to_xml
+ -%>
+<%= case @registration.class.to_s
+ when 'NilClass'
+ "@registration is nil"
+ when 'String'
+ @registration.to_s
+ when 'Registration'
+ @registration.to_xml
+ end
+ -%>
diff --git a/plugins/registration/app/views/configuration/show.json.erb b/plugins/registration/app/views/configuration/show.json.erb
new file mode 100644
index 0000000..277ef41
--- /dev/null
+++ b/plugins/registration/app/views/configuration/show.json.erb
@@ -0,0 +1 @@
+<%= @registration == nil ? "@registration is nil - FIXME" : @registration.to_json -%>
diff --git a/plugins/registration/app/views/configuration/show.xml.erb b/plugins/registration/app/views/configuration/show.xml.erb
new file mode 100644
index 0000000..c1a1254
--- /dev/null
+++ b/plugins/registration/app/views/configuration/show.xml.erb
@@ -0,0 +1 @@
+<%= @registration == nil ? "@registration is nil - FIXME" : @registration.to_xml -%>
diff --git a/plugins/registration/config/resources/registration_configuration.yml b/plugins/registration/config/resources/registration_configuration.yml
new file mode 100644
index 0000000..6835a5b
--- /dev/null
+++ b/plugins/registration/config/resources/registration_configuration.yml
@@ -0,0 +1,4 @@
+interface: org.opensuse.yast.modules.yapi.registration.configuration
+policy: org.opensuse.yast.modules.yapi.registration.configuration
+controller: registration/configuration
+singular: true
diff --git a/plugins/registration/config/resources/registration_registration.yml b/plugins/registration/config/resources/registration_registration.yml
new file mode 100644
index 0000000..701aad8
--- /dev/null
+++ b/plugins/registration/config/resources/registration_registration.yml
@@ -0,0 +1,4 @@
+interface: org.opensuse.yast.modules.yapi.registration.registration
+policy: org.opensuse.yast.modules.yapi.registration.registration
+controller: registration/registration
+singular: true
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org