class KualiRice::KualiRESTInterface

Public Instance Methods

getPersonByEmployeeId(emplid) click to toggle source
# File lib/kuali-rice/KualiRESTInterface/PersonInterface.rb, line 10
def getPersonByEmployeeId(emplid)
  Person.new(rest_call("/Person/byemployeeid/#{emplid}"))
end
getPersonByExternalIdentifier(type, id) click to toggle source
# File lib/kuali-rice/KualiRESTInterface/PersonInterface.rb, line 18
def getPersonByExternalIdentifier(type, id)
  Person.new(rest_call("/Person/byexternalid/type/#{type}/id/#{id}"))
end
getPersonByPrincipalID(prncpl_id) click to toggle source
# File lib/kuali-rice/KualiRESTInterface/PersonInterface.rb, line 14
def getPersonByPrincipalID(prncpl_id)
  Person.new(rest_call("/Person/byprincipalid/#{prncpl_id}"))
end
getPersonByPrincipalName(prncpl_nm) click to toggle source
# File lib/kuali-rice/KualiRESTInterface/PersonInterface.rb, line 6
def getPersonByPrincipalName(prncpl_nm)
  Person.new(rest_call("/Person/byprincipalname/#{prncpl_nm}"))
end
getPrincipalsByPremissionName(perm_nm, nmspc_cd) click to toggle source
# File lib/kuali-rice/KualiRESTInterface/PermissionInterface.rb, line 6
def getPrincipalsByPremissionName(perm_nm, nmspc_cd)
  Assignees.new(rest_call("/prinicpalsbypermission/#{perm_nm}/namespace/#{nmspc_cd}")).assignees
end
rest_call(path, verb = "get", post_data = "") click to toggle source
# File lib/kuali-rice/KualiRESTInterface/RestAPI.rb, line 6
    def rest_call (path, verb = "get", post_data = "")
                  
      http = Net::HTTP.new(@server, @use_ssl ? 443 : @port)
      http.use_ssl = true if @use_ssl
      http.verify_mode = OpenSSL::SSL::VERIFY_NONE
      
      path = @remoting_path + path
      path = URI.escape(path)

puts "#{path}, #{verb}"   
         
      http.start do |http|
        response = (verb.eql?(:post) ? http.post(path, encode_params(post_data),  @headers) : http.request_get(path, @headers))
       
        response.body
      end
    end

Protected Instance Methods

encode_params(param_hash) click to toggle source
# File lib/kuali-rice/KualiRESTInterface/RestAPI.rb, line 26
def encode_params(param_hash)
  param_hash
end