infopark_fiona7 1.6.1.1.0 → 1.6.1.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cd5af32d592de98bf21bad9ae13300a9c5a17786
4
- data.tar.gz: 45b0946e073a24b93b2b418770c8de7eee312889
3
+ metadata.gz: 8619bcb34e8b06c4499cce99ce0cad5609cc5691
4
+ data.tar.gz: 2d10b5a8e74cfc9139ff9d10f27e7a478da66645
5
5
  SHA512:
6
- metadata.gz: 1e33280b118ab2e9b6b023450be624fc0f223f8e894195493aa6aa342d7ab937e23b58bf8dd0d0910bc8e4cd4a4e17951d894c1d39b27b4fa45492c12fe29af3
7
- data.tar.gz: 26841cfc7effbc06117518a6e2e1585ae44dbaf5534749015c3e8bcdf76ca7a9e07b87534ded47391e96caef0cdfbb13467bcd15bd63d659e54bcc7f263f04a4
6
+ metadata.gz: 2da3e5d4a375674f33e7f8003eb5bdf85e6a1a48c83c74abcd92fcacbbe7d152ba8f4b2b49d76d80bfa8e60d5f59e30861992f3afcd7d6a4288e5ea56fd987b2
7
+ data.tar.gz: 81be495b06b82580e67a75c229d0eca2d8162813068b900b78e19b8119a1db931530fb51be78ee6701445869045de8e8d85bdf3086da9eb36d0bb3a16899d578
@@ -75,6 +75,35 @@ module Fiona7
75
75
 
76
76
  return binary_spec
77
77
  end
78
+
79
+ def parse_blob_id_from_url( url )
80
+ return unless url.present?
81
+ match_result = url.match(/\/_b\/([a-zA-Z0-9_-]+)(\Z|\/)/)
82
+ return match_result[1] if match_result
83
+ end
84
+
85
+ def obj_id_from_blob_id(blob_id)
86
+ return unless blob_id.present?
87
+ binary = BinaryHandling::MetaBinary.new(blob_id)
88
+ return binary.implementation.obj.id if binary.implementation.obj.present?
89
+ end
90
+
91
+ def resolve_urls(params)
92
+ if urls = params[:urls]
93
+ if Array === urls
94
+ {
95
+ results: urls.map do |url|
96
+ obj_id = obj_id_from_blob_id( parse_blob_id_from_url( url ) )
97
+ {obj_id: obj_id} if obj_id.present?
98
+ end
99
+ }
100
+ else
101
+ "The value for “urls” is not an array."
102
+ end
103
+ else
104
+ "Missing value for the key “urls”."
105
+ end
106
+ end
78
107
  end
79
108
  end
80
109
  end
@@ -17,7 +17,7 @@ class Scrivito::CmsRestApi
17
17
  def get(resource_path, payload = nil, options = nil)
18
18
  @number_of_requests += 1 if resource_path == @count_requests
19
19
 
20
-
20
+
21
21
  action = :get
22
22
  ActiveSupport::Notifications.instrumenter.instrument(
23
23
  "backend_request.scrivito",
@@ -57,12 +57,16 @@ class Scrivito::CmsRestApi
57
57
  when /\A\/?workspaces\/[a-zA-Z0-9_-]+\/changes\Z/
58
58
  _, _, workspace_id,_ = *resource_path.split("/")
59
59
  Fiona7::Controllers::RestAPI::WorkspaceController.new.changes(workspace_id)
60
- when /\A\/?workspaces\/[a-zA-Z0-9_-]+\/objs\/mget+\Z/
60
+ when /\A\/?workspaces\/[a-zA-Z0-9_-]+\/objs\/mget\Z/
61
61
  _, _, workspace_id, _, _ = *resource_path.split("/")
62
62
  Fiona7::Controllers::RestAPI::ObjController.new.fetch_multiple2(workspace_id, payload)
63
+ when /\A\/?workspaces\/[a-zA-Z0-9_-]+\/base_objs\/mget\Z/
64
+ Fiona7::Controllers::RestAPI::ObjController.new.fetch_multiple2('published', payload)
63
65
  when /\A\/?workspaces\/[a-zA-Z0-9_-]+\/objs\/[a-zA-Z0-9_-]+\Z/
64
66
  _, _, workspace_id, _, obj_id = *resource_path.split("/")
65
67
  Fiona7::Controllers::RestAPI::ObjController.new.fetch_by_id(workspace_id, obj_id)
68
+ when /\A\/?blobs\/resolve_urls\Z/
69
+ Fiona7::Controllers::RestAPI::BlobController.new.resolve_urls(payload)
66
70
  when /\A\/?blobs\/[a-zA-Z0-9_-]+\Z/
67
71
  _, _, blob_id = *resource_path.split("/")
68
72
  Fiona7::Controllers::RestAPI::BlobController.new.fetch(blob_id)
@@ -1,3 +1,3 @@
1
1
  module Fiona7
2
- VERSION = "1.6.1.1.0"
2
+ VERSION = "1.6.1.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: infopark_fiona7
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.1.1.0
4
+ version: 1.6.1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomasz Przedmojski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-15 00:00:00.000000000 Z
11
+ date: 2018-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -365,7 +365,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
365
365
  version: '0'
366
366
  requirements: []
367
367
  rubyforge_project:
368
- rubygems_version: 2.2.2
368
+ rubygems_version: 2.5.2
369
369
  signing_key:
370
370
  specification_version: 4
371
371
  summary: scrivito-compatible interface for classic Fiona