mirror of
https://github.com/mistergibson/gxg-server.git
synced 2026-08-15 02:15:59 -07:00
Added Call_Event
This commit is contained in:
parent
f714232854
commit
9a629ae516
3 changed files with 666 additions and 693 deletions
File diff suppressed because one or more lines are too long
|
|
@ -721,7 +721,7 @@ module GxG
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
#
|
#
|
||||||
def call_event(operation_envelope=nil, credential=:"00000000-0000-4000-0000-000000000000")
|
def call_event(operation_envelope=nil, credential=(::GxG::DB[:administrator] || :"00000000-0000-4000-0000-000000000000"))
|
||||||
result = nil
|
result = nil
|
||||||
if operation_envelope.is_a?(::Hash)
|
if operation_envelope.is_a?(::Hash)
|
||||||
the_event = operation_envelope.keys[0]
|
the_event = operation_envelope.keys[0]
|
||||||
|
|
|
||||||
|
|
@ -1110,6 +1110,26 @@ module GxGwww
|
||||||
response
|
response
|
||||||
end
|
end
|
||||||
#
|
#
|
||||||
|
def call_event(details={})
|
||||||
|
if self.closed?
|
||||||
|
response = [500, {"content-type" => "application/json"}, ({:result => false, :error => "Connector Closed.", :parameters => false}).to_json()]
|
||||||
|
else
|
||||||
|
the_service = ::GxG::SERVICES[(details[:service].to_s.downcase.to_sym)]
|
||||||
|
if the_service
|
||||||
|
the_result = the_service.call_event(details[:op_frame], @credential)
|
||||||
|
if the_result[:error]
|
||||||
|
response = [500, {"content-type" => "application/json"}, ({:result => false, :error => the_result[:error], :parameters => false}).to_json()]
|
||||||
|
else
|
||||||
|
response = [200, {"content-type" => "application/json"}, (the_result.to_json]
|
||||||
|
end
|
||||||
|
else
|
||||||
|
# err - service not found
|
||||||
|
response = [404, {"content-type" => "application/json"}, ({:result => false, :error => "Service #{details[:service].to_s} Not Found.", :parameters => false}).to_json()]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
response
|
||||||
|
end
|
||||||
|
#
|
||||||
def vfs_mkfile(details={})
|
def vfs_mkfile(details={})
|
||||||
# Review : find correct cooresponding return codes for errors.
|
# Review : find correct cooresponding return codes for errors.
|
||||||
if self.closed?
|
if self.closed?
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue