Commit dc667f5a authored by Mateus Rambo Strey's avatar Mateus Rambo Strey

Merge branch 'master' of gitlab.c3sl.ufpr.br:c3sl/dspace-rest-client

parents c3bc96c2 2dcf0a2b
......@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'dspace/version'
Gem::Specification.new do |spec|
spec.date = '2016-01-23'
spec.date = '2016-02-29'
spec.name = "dspace_rest_client"
spec.version = Dspace::VERSION
spec.authors = ["Mauricio Giacomini Girardello", "Lucas Ernesto Kindinger", "Bruno N. Zanette", "Mateus Rambo Strey"]
......
......@@ -6,7 +6,7 @@ module Dspace
attr_reader :id, :handle, :type, :link, :last_modified, :parent_collection,
:parent_collection_list, :parent_community_list, :bit_streams,
:expand, :limit, :offset, :metadata
:expand, :metadata
def initialize args
@id = args['id']
......@@ -22,8 +22,6 @@ module Dspace
@archived = args['archived']
@withdrawn = args['withdrawn']
@expand = args['expand']
@limit = args['limit']
@offset = args['offset']
@metadata = Dspace::Builders::ModelBuilder.build_metadatas(args['metadata'])
end
......@@ -42,8 +40,6 @@ module Dspace
archived: @archived,
withdrawn: @withdrawn,
expand: @expand,
limit: @limit,
offset: @offset,
metadata: obj2hash(@metadata)
}
end
......
......@@ -6,7 +6,7 @@ module Dspace
default_handler(401) { raise NotAuthorizedError, 'This request requires authentication' }
action :all, 'GET /rest/collections' do
query_keys :expand
query_keys :expand, :limit, :offset
handler(200) do |response|
Dspace::Builders::ModelBuilder.build_collections(JSON.parse(response.body))
end
......
......@@ -6,14 +6,14 @@ module Dspace
default_handler(401) { raise NotAuthorizedError, 'This request requires authentication' }
action :all, 'GET /rest/communities' do
query_keys :expand
query_keys :expand, :limit, :offset
handler(200) do |response|
Dspace::Builders::ModelBuilder.build_communities(JSON.parse(response.body))
end
end
action :top_communities, 'GET /rest/communities/top-communities' do
query_keys :expand
query_keys :expand, :limit, :offset
handler(200) do |response|
Dspace::Builders::ModelBuilder.build_communities(JSON.parse(response.body))
end
......@@ -27,14 +27,14 @@ module Dspace
end
action :collections, 'GET /rest/communities/:id/collections' do
query_keys :expand
query_keys :expand, :limit, :offset
handler(200) do |response|
Dspace::Builders::ModelBuilder.build_collections(JSON.parse(response.body))
end
end
action :sub_communities, 'GET /rest/communities/:id/communities' do
query_keys :expand
query_keys :expand, :limit, :offset
handler(200) do |response|
Dspace::Builders::ModelBuilder.build_communities(JSON.parse(response.body))
end
......
......@@ -45,7 +45,7 @@ module Dspace
end
action :add_metadata, 'POST /rest/items/:id/metadata' do
body { |objects| Dspace::Builders::HashBuilder.models2hash(objects) }
body { |objects| Dspace::Builders::ModelBuilder.models2hash(objects) }
handler(200, 201) { |response| true }
end
......
module Dspace
VERSION = "2.2.1"
VERSION = "2.2.5"
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment