Class: Mediaflux::ProjectCreateServiceRequest
- Defined in:
- app/models/mediaflux/project_create_service_request.rb
Instance Attribute Summary collapse
-
#document ⇒ Object
readonly
Returns the value of attribute document.
-
#service_name ⇒ Object
readonly
Returns the value of attribute service_name.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Attributes inherited from Request
Class Method Summary collapse
-
.service ⇒ String
Specifies the Mediaflux service to use when creating project.
Instance Method Summary collapse
-
#debug_output ⇒ Object
Returns the entire response returned by the project create service.
-
#initialize(session_token:, project:, token: nil) ⇒ ProjectCreateServiceRequest
constructor
Constructor.
-
#mediaflux_id ⇒ Object
Returns the id of the collection created in Mediaflux.
Methods inherited from Request
build_post_request, default_xml_namespace, default_xml_namespace_uri, #error?, find_or_create_http_client, format_date_for_mediaflux, request_path, #resolve, #resolved?, #response_body, #response_error, #response_xml, uri, #xml_payload, #xtoshell_xml
Constructor Details
#initialize(session_token:, project:, token: nil) ⇒ ProjectCreateServiceRequest
Constructor
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'app/models/mediaflux/project_create_service_request.rb', line 10 def initialize(session_token:, project:, token: nil) super(session_token: session_token) @token = token @project = project @data_manager = @project..data_manager @data_sponsor = @project..data_sponsor @title = @project..title @description = @project..description @directory = @project..project_directory @project_id = @project..project_id @department = departments_string(@project..departments) @quota = "#{@project..storage_capacity['size']['approved']} #{@project..storage_capacity['unit']['approved']}" # We set the datastore to "db" because the default is a store that # only exists in the production Mediaflux. @store = "db" unless Rails.env.production? end |
Instance Attribute Details
#document ⇒ Object (readonly)
Returns the value of attribute document.
4 5 6 |
# File 'app/models/mediaflux/project_create_service_request.rb', line 4 def document @document end |
#service_name ⇒ Object (readonly)
Returns the value of attribute service_name.
4 5 6 |
# File 'app/models/mediaflux/project_create_service_request.rb', line 4 def service_name @service_name end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
4 5 6 |
# File 'app/models/mediaflux/project_create_service_request.rb', line 4 def token @token end |
Class Method Details
.service ⇒ String
Specifies the Mediaflux service to use when creating project
29 30 31 |
# File 'app/models/mediaflux/project_create_service_request.rb', line 29 def self.service "tigerdata.project.create" end |
Instance Method Details
#debug_output ⇒ Object
Returns the entire response returned by the project create service. This includes debug information that is useful to troubleshoot issues if the request fails.
36 37 38 |
# File 'app/models/mediaflux/project_create_service_request.rb', line 36 def debug_output response_xml.xpath("response/reply/result/result").to_s end |
#mediaflux_id ⇒ Object
Returns the id of the collection created in Mediaflux
41 42 43 44 45 46 |
# File 'app/models/mediaflux/project_create_service_request.rb', line 41 def mediaflux_id # Extract the <id>nnnn</id> value from the output and then extract the # numeric value inside of it. id_xml = debug_output.match("\<\;id\>\;[0-9]*\<\;\/id\>\;").to_s id_xml.gsub("<id>", "").gsub("</id>", "").to_i end |