roadforest 0.1 → 0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/examples/file-management.rb +12 -13
- data/lib/roadforest-client.rb +3 -0
- data/lib/roadforest-common.rb +2 -0
- data/lib/roadforest-server.rb +7 -0
- data/lib/roadforest-testing.rb +1 -0
- data/lib/roadforest/application.rb +9 -7
- data/lib/roadforest/application/dispatcher.rb +39 -63
- data/lib/roadforest/application/parameters.rb +1 -1
- data/lib/roadforest/application/path-provider.rb +2 -2
- data/lib/roadforest/application/route-adapter.rb +130 -18
- data/lib/roadforest/application/services-host.rb +0 -4
- data/lib/roadforest/augment/affordance.rb +78 -0
- data/lib/roadforest/augment/augmentation.rb +97 -0
- data/lib/roadforest/augment/augmenter.rb +54 -0
- data/lib/roadforest/augmentations.rb +1 -0
- data/lib/roadforest/content-handling.rb +1 -0
- data/lib/roadforest/content-handling/common-engines.rb +67 -0
- data/lib/roadforest/content-handling/engine.rb +2 -14
- data/lib/roadforest/content-handling/handler-wrap.rb +29 -31
- data/lib/roadforest/content-handling/media-type.rb +6 -0
- data/lib/roadforest/{rdf.rb → graph.rb} +1 -1
- data/lib/roadforest/{rdf → graph}/access-manager.rb +12 -74
- data/lib/roadforest/{rdf → graph}/document.rb +1 -1
- data/lib/roadforest/{rdf → graph}/etagging.rb +2 -2
- data/lib/roadforest/{rdf → graph}/focus-list.rb +1 -9
- data/lib/roadforest/{rdf → graph}/graph-copier.rb +2 -2
- data/lib/roadforest/{rdf → graph}/graph-focus.rb +5 -7
- data/lib/roadforest/{rdf → graph}/normalization.rb +1 -1
- data/lib/roadforest/{rdf → graph}/post-focus.rb +2 -3
- data/lib/roadforest/graph/vocabulary.rb +96 -0
- data/lib/roadforest/http/graph-transfer.rb +2 -2
- data/lib/roadforest/interface/application.rb +145 -0
- data/lib/roadforest/interface/blob.rb +38 -0
- data/lib/roadforest/interface/rdf.rb +77 -0
- data/lib/roadforest/interfaces.rb +2 -0
- data/lib/roadforest/remote-host.rb +17 -17
- data/lib/roadforest/resource.rb +4 -0
- data/lib/roadforest/resource/{rdf/leaf-item.rb → leaf-item.rb} +1 -1
- data/lib/roadforest/resource/{rdf/list.rb → list.rb} +1 -1
- data/lib/roadforest/resource/{rdf/parent-item.rb → parent-item.rb} +1 -1
- data/lib/roadforest/resource/{rdf/read-only.rb → read-only.rb} +18 -18
- data/lib/roadforest/resource/role/has-children.rb +1 -1
- data/lib/roadforest/resource/role/writable.rb +2 -2
- data/lib/roadforest/server.rb +1 -1
- data/lib/roadforest/source-rigor.rb +9 -0
- data/lib/roadforest/{rdf/source-rigor → source-rigor}/credence-annealer.rb +2 -2
- data/lib/roadforest/{rdf/source-rigor → source-rigor}/credence.rb +5 -5
- data/lib/roadforest/{rdf/source-rigor → source-rigor}/credence/any.rb +1 -1
- data/lib/roadforest/{rdf/source-rigor → source-rigor}/credence/none-if-role-absent.rb +1 -1
- data/lib/roadforest/{rdf/source-rigor → source-rigor}/credence/role-if-available.rb +1 -1
- data/lib/roadforest/source-rigor/engine.rb +45 -0
- data/lib/roadforest/{rdf → source-rigor}/graph-store.rb +9 -9
- data/lib/roadforest/{rdf/source-rigor → source-rigor}/http-investigator.rb +2 -2
- data/lib/roadforest/{rdf → source-rigor}/investigation.rb +2 -2
- data/lib/roadforest/{rdf/source-rigor → source-rigor}/investigator.rb +3 -3
- data/lib/roadforest/{rdf/source-rigor → source-rigor}/null-investigator.rb +3 -2
- data/lib/roadforest/{rdf → source-rigor}/parcel.rb +5 -5
- data/lib/roadforest/{rdf → source-rigor}/resource-pattern.rb +6 -6
- data/lib/roadforest/{rdf → source-rigor}/resource-query.rb +2 -2
- data/lib/roadforest/source-rigor/rigorous-access.rb +101 -0
- data/lib/roadforest/templates/affordance-doc.haml +23 -0
- data/lib/roadforest/templates/affordance-property-values.haml +13 -0
- data/lib/roadforest/templates/affordance-subject.haml +9 -0
- data/lib/roadforest/templates/affordance-uri-object.haml +2 -0
- data/lib/roadforest/templates/base/{property_value.haml → property-value.haml} +0 -0
- data/lib/roadforest/templates/base/{property_values.haml → property-values.haml} +0 -0
- data/lib/roadforest/templates/distiller/{property_value.haml → property-value.haml} +0 -0
- data/lib/roadforest/templates/distiller/{property_values.haml → property-values.haml} +0 -0
- data/lib/roadforest/templates/min/{property_values.haml → property-values.haml} +0 -0
- data/lib/roadforest/templates/rdfpost-curie.haml +6 -0
- data/lib/roadforest/test-support/dispatcher-facade.rb +2 -0
- data/lib/roadforest/test-support/matchers.rb +169 -5
- data/lib/roadforest/test-support/remote-host.rb +2 -2
- data/lib/roadforest/type-handlers/handler.rb +74 -0
- data/lib/roadforest/type-handlers/jsonld.rb +34 -0
- data/lib/roadforest/type-handlers/rdf-handler.rb +36 -0
- data/lib/roadforest/{content-handling/type-handlers → type-handlers}/rdfa-writer.rb +2 -2
- data/lib/roadforest/{content-handling/type-handlers → type-handlers}/rdfa-writer/document-environment.rb +9 -8
- data/lib/roadforest/type-handlers/rdfa-writer/environment-decorator.rb +312 -0
- data/lib/roadforest/{content-handling/type-handlers → type-handlers}/rdfa-writer/object-environment.rb +3 -3
- data/lib/roadforest/{content-handling/type-handlers → type-handlers}/rdfa-writer/property-environment.rb +5 -11
- data/lib/roadforest/type-handlers/rdfa-writer/render-engine.rb +427 -0
- data/lib/roadforest/{content-handling/type-handlers → type-handlers}/rdfa-writer/render-environment.rb +33 -26
- data/lib/roadforest/{content-handling/type-handlers → type-handlers}/rdfa-writer/subject-environment.rb +7 -23
- data/lib/roadforest/type-handlers/rdfa.rb +73 -0
- data/lib/roadforest/type-handlers/rdfpost.rb +301 -0
- data/lib/roadforest/utility/class-registry.rb +23 -5
- data/spec/.ctrlp-root +0 -0
- data/spec/affordance-augmenter.rb +75 -0
- data/spec/affordances-flow.rb +438 -0
- data/spec/authorization.rb +34 -0
- data/spec/client.rb +13 -12
- data/spec/credence-annealer.rb +5 -5
- data/spec/focus-list.rb +8 -8
- data/spec/full-integration.rb +3 -3
- data/spec/graph-copier.rb +4 -4
- data/spec/graph-store.rb +19 -31
- data/spec/keychain.rb +82 -0
- data/spec/rdf-normalization.rb +2 -2
- data/spec/rdf-parcel.rb +3 -3
- data/spec/rdfa-handler.rb +514 -0
- data/spec/rdfpost.rb +96 -0
- data/spec/source-rigor.rb +57 -0
- data/spec/update-focus.rb +11 -10
- metadata +91 -66
- data/lib/roadforest/blob-model.rb +0 -53
- data/lib/roadforest/content-handling/type-handler.rb +0 -76
- data/lib/roadforest/content-handling/type-handlers/jsonld.rb +0 -36
- data/lib/roadforest/content-handling/type-handlers/rdf-handler.rb +0 -38
- data/lib/roadforest/content-handling/type-handlers/rdfa-writer/render-engine.rb +0 -574
- data/lib/roadforest/content-handling/type-handlers/rdfa.rb +0 -175
- data/lib/roadforest/content-handling/type-handlers/rdfpost.rb +0 -297
- data/lib/roadforest/model.rb +0 -209
- data/lib/roadforest/models.rb +0 -2
- data/lib/roadforest/rdf/source-rigor.rb +0 -44
- data/lib/roadforest/rdf/vocabulary.rb +0 -11
- data/lib/roadforest/resource/http/form-parsing.rb +0 -81
- data/lib/roadforest/resource/rdf.rb +0 -4
- data/spec/form-parsing.rb +0 -1
@@ -1,17 +1,14 @@
|
|
1
1
|
require 'rdf'
|
2
|
-
require 'roadforest/
|
3
|
-
require 'roadforest/rdf/resource-pattern'
|
4
|
-
require 'roadforest/rdf/normalization'
|
5
|
-
require 'roadforest/rdf/parcel'
|
2
|
+
require 'roadforest/graph/normalization'
|
6
3
|
|
7
|
-
module RoadForest::
|
4
|
+
module RoadForest::Graph
|
8
5
|
class ReadOnlyManager
|
9
6
|
include ::RDF::Countable
|
10
7
|
include ::RDF::Enumerable
|
11
8
|
include ::RDF::Queryable
|
12
9
|
include Normalization
|
13
10
|
|
14
|
-
attr_accessor :resource, :
|
11
|
+
attr_accessor :resource, :source_graph
|
15
12
|
|
16
13
|
def resource=(resource)
|
17
14
|
@resource = normalize_context(resource)
|
@@ -20,7 +17,6 @@ module RoadForest::RDF
|
|
20
17
|
def dup
|
21
18
|
other = self.class.allocate
|
22
19
|
other.resource = self.resource
|
23
|
-
other.rigor = self.rigor
|
24
20
|
other.source_graph = self.source_graph
|
25
21
|
|
26
22
|
return other
|
@@ -29,32 +25,28 @@ module RoadForest::RDF
|
|
29
25
|
alias origin_graph source_graph
|
30
26
|
alias destination_graph source_graph
|
31
27
|
|
28
|
+
def relevant_prefixes
|
29
|
+
relevant_prefixes_for_graph(origin_graph)
|
30
|
+
end
|
31
|
+
|
32
|
+
def each(&block)
|
33
|
+
origin_graph.each(&block)
|
34
|
+
end
|
35
|
+
|
32
36
|
def build_query
|
33
|
-
|
34
|
-
query.subject_context = resource
|
35
|
-
query.source_rigor = rigor
|
37
|
+
::RDF::Query.new([], {}) do |query|
|
36
38
|
yield query
|
37
39
|
end
|
38
40
|
end
|
39
41
|
|
40
|
-
def relevant_prefixes
|
41
|
-
relevant_prefixes_for_graph(origin_graph)
|
42
|
-
end
|
43
|
-
|
44
42
|
def query_execute(query, &block)
|
45
|
-
query = ResourceQuery.from(query, resource, rigor)
|
46
43
|
execute_search(query, &block)
|
47
44
|
end
|
48
45
|
|
49
46
|
def query_pattern(pattern, &block)
|
50
|
-
pattern = ResourcePattern.from(pattern, {:context_roles => {:subject => resource}, :source_rigor => rigor})
|
51
47
|
execute_search(pattern, &block)
|
52
48
|
end
|
53
49
|
|
54
|
-
def each(&block)
|
55
|
-
origin_graph.each(&block)
|
56
|
-
end
|
57
|
-
|
58
50
|
def execute_search(search, &block)
|
59
51
|
search.execute(origin_graph, &block)
|
60
52
|
end
|
@@ -73,9 +65,6 @@ module RoadForest::RDF
|
|
73
65
|
end
|
74
66
|
end
|
75
67
|
|
76
|
-
class PostManager < WriteManager
|
77
|
-
end
|
78
|
-
|
79
68
|
class SplitManager < WriteManager
|
80
69
|
attr_accessor :target_graph
|
81
70
|
|
@@ -92,57 +81,6 @@ module RoadForest::RDF
|
|
92
81
|
end
|
93
82
|
end
|
94
83
|
|
95
|
-
class UpdateManager < SplitManager
|
96
|
-
def initialize
|
97
|
-
@copied_contexts = {}
|
98
|
-
end
|
99
|
-
|
100
|
-
attr_accessor :copied_contexts
|
101
|
-
|
102
|
-
def dup
|
103
|
-
other = super
|
104
|
-
other.copied_contexts = self.copied_contexts
|
105
|
-
return other
|
106
|
-
end
|
107
|
-
|
108
|
-
def execute_search(search, &block)
|
109
|
-
enum = search.execute(destination_graph)
|
110
|
-
if enum.any?{ true }
|
111
|
-
enum.each(&block)
|
112
|
-
return enum
|
113
|
-
end
|
114
|
-
search.execute(origin_graph, &block)
|
115
|
-
end
|
116
|
-
|
117
|
-
def insert(statement)
|
118
|
-
copy_context
|
119
|
-
super
|
120
|
-
end
|
121
|
-
|
122
|
-
def delete(statement)
|
123
|
-
copy_context
|
124
|
-
super
|
125
|
-
end
|
126
|
-
|
127
|
-
def parceller
|
128
|
-
@parceller ||=
|
129
|
-
begin
|
130
|
-
parceller = Parcel.new
|
131
|
-
parceller.graph = source_graph
|
132
|
-
parceller
|
133
|
-
end
|
134
|
-
end
|
135
|
-
|
136
|
-
def copy_context
|
137
|
-
return if copied_contexts[resource]
|
138
|
-
parceller.graph_for(resource).each_statement do |statement|
|
139
|
-
statement.context = resource
|
140
|
-
destination_graph << statement
|
141
|
-
end
|
142
|
-
copied_contexts[resource] = true
|
143
|
-
end
|
144
|
-
end
|
145
|
-
|
146
84
|
class CopyManager < SplitManager
|
147
85
|
def execute_search(search, &block)
|
148
86
|
super(search) do |statement|
|
@@ -1,18 +1,10 @@
|
|
1
1
|
require 'rdf'
|
2
2
|
|
3
|
-
|
4
|
-
require 'roadforest/rdf/resource-pattern'
|
5
|
-
|
6
|
-
module RoadForest::RDF
|
3
|
+
module RoadForest::Graph
|
7
4
|
class FocusList < ::RDF::List
|
8
5
|
|
9
6
|
attr_accessor :root_url, :base_node
|
10
7
|
|
11
|
-
#XXX Can delete?
|
12
|
-
def source_rigor
|
13
|
-
graph.rigor
|
14
|
-
end
|
15
|
-
|
16
8
|
alias car first
|
17
9
|
alias cdr rest
|
18
10
|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
require 'rdf'
|
2
|
-
require 'roadforest/
|
2
|
+
require 'roadforest/graph/graph-focus'
|
3
3
|
|
4
4
|
module RoadForest
|
5
|
-
module
|
5
|
+
module Graph
|
6
6
|
class GraphCopier < GraphFocus
|
7
7
|
def query_value(query)
|
8
8
|
#This isn't the most efficient way to do this (the query essentially
|
@@ -1,13 +1,11 @@
|
|
1
1
|
require 'rdf'
|
2
2
|
require 'rdf/model/node'
|
3
|
-
require 'roadforest/
|
4
|
-
require 'roadforest/
|
5
|
-
require 'roadforest/
|
6
|
-
require 'roadforest/
|
7
|
-
require 'roadforest/rdf/access-manager'
|
3
|
+
require 'roadforest/graph'
|
4
|
+
require 'roadforest/graph/focus-list'
|
5
|
+
require 'roadforest/graph/normalization'
|
6
|
+
require 'roadforest/graph/access-manager'
|
8
7
|
|
9
|
-
|
10
|
-
module RoadForest::RDF
|
8
|
+
module RoadForest::Graph
|
11
9
|
class NullFocus < ::BasicObject
|
12
10
|
def initialize(focus, pattern, callsite)
|
13
11
|
@focus, @pattern, @callsite = focus, pattern, callsite
|
@@ -1,6 +1,6 @@
|
|
1
|
-
require 'roadforest/
|
1
|
+
require 'roadforest/graph/graph-focus'
|
2
2
|
|
3
|
-
module RoadForest::
|
3
|
+
module RoadForest::Graph
|
4
4
|
class PostFocus < GraphFocus
|
5
5
|
|
6
6
|
attr_accessor :graphs
|
@@ -14,7 +14,6 @@ module RoadForest::RDF
|
|
14
14
|
def post_to
|
15
15
|
graph = ::RDF::Graph.new
|
16
16
|
access = WriteManager.new
|
17
|
-
access.rigor = access_manager.rigor
|
18
17
|
access.source_graph = graph
|
19
18
|
focus = GraphFocus.new(access, subject)
|
20
19
|
|
@@ -0,0 +1,96 @@
|
|
1
|
+
require 'roadforest/graph'
|
2
|
+
require 'rdf'
|
3
|
+
|
4
|
+
module RoadForest::Graph
|
5
|
+
module Vocabulary
|
6
|
+
class RF < ::RDF::Vocabulary("http://lrdesign.com/graph/roadforest#")
|
7
|
+
property :Impulse
|
8
|
+
property :impulse
|
9
|
+
property :begunAt
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
class Af < ::RDF::StrictVocabulary("http://judsonlester.info/affordance#")
|
14
|
+
|
15
|
+
# Class definitions
|
16
|
+
property :Affordance, :comment =>
|
17
|
+
%(Base class for all affordances)
|
18
|
+
property :Control
|
19
|
+
property :Create, :comment =>
|
20
|
+
%(Triggering this affordance implies a request to create a new
|
21
|
+
resource)
|
22
|
+
property :Embed, :comment =>
|
23
|
+
%(A resource that should be properly displayed in-line rather
|
24
|
+
than provided as a hyperlink)
|
25
|
+
property :Idempotent, :comment =>
|
26
|
+
%(An affordance that will cause a change, but that can be
|
27
|
+
repeated without further hazard)
|
28
|
+
property :LiteralTemplate
|
29
|
+
property :Metadata, :comment =>
|
30
|
+
%(There is extra metadata available about this resource)
|
31
|
+
property :Mutate, :comment =>
|
32
|
+
%(Triggering this affordance expresses a desire to make changes
|
33
|
+
to a resource)
|
34
|
+
property :Navigate, :comment =>
|
35
|
+
%(A link to another resource. The assumption is that otherwise
|
36
|
+
undescribed URLs have a navigation affordance)
|
37
|
+
property :Null, :comment =>
|
38
|
+
%(The provided affordance is null. i.e. not dereferenceable, no
|
39
|
+
actions provided)
|
40
|
+
property :Remove, :comment =>
|
41
|
+
%(Triggering this affordance is a request to delete the resource)
|
42
|
+
property :ResourceTemplate
|
43
|
+
property :Safe, :comment =>
|
44
|
+
%(A safe affordance - it is asserted that no change will be
|
45
|
+
triggered by activating the affordance)
|
46
|
+
property :Unsafe, :comment =>
|
47
|
+
%(Affordances whose effects cannot be simply modeled and should
|
48
|
+
be triggered with care)
|
49
|
+
property :Update, :comment =>
|
50
|
+
%(Acting on this affordance will update the targeted resource.
|
51
|
+
Repeated updates will have not further effect)
|
52
|
+
|
53
|
+
# Property definitions
|
54
|
+
property :authorizedBy, :comment =>
|
55
|
+
%(Opaque descriptors of authorization tokens - resource can be
|
56
|
+
dereferenced by users with that token. It's recommended that
|
57
|
+
the tokens be defreferenceable, and that they be accessible
|
58
|
+
iff the user is authorized to activate the affordance in
|
59
|
+
question.)
|
60
|
+
property :controlName, :comment =>
|
61
|
+
%(Valid values are limited per application. Examples include
|
62
|
+
'Media-Type', 'Encoding' or 'EntityTag')
|
63
|
+
property :controlValue
|
64
|
+
property :controlledBy
|
65
|
+
property :defaultValue
|
66
|
+
property :label
|
67
|
+
property :name
|
68
|
+
property :objectTemplate, :comment =>
|
69
|
+
%(Used to indicate that a resource or literal template can be
|
70
|
+
used as the property in a statement)
|
71
|
+
property :pattern, :comment =>
|
72
|
+
%(An IRITemplate \(RFC 5xxx\) that defines how the template is
|
73
|
+
rendered - implicitly, all the parameters of the template are
|
74
|
+
provided as a key, value set called param_list, so something
|
75
|
+
like \(?param_list*\) should work like an HTML action=GET form)
|
76
|
+
property :payload
|
77
|
+
property :predicateTemplate, :comment =>
|
78
|
+
%(Used to indicate that a resource template can be used as the
|
79
|
+
property in a statement)
|
80
|
+
property :range
|
81
|
+
property :statement
|
82
|
+
property :subjectTemplate, :comment =>
|
83
|
+
%(Used to indicate that a resource template can be used as the
|
84
|
+
subject in a statement)
|
85
|
+
property :target, :comment =>
|
86
|
+
%(Could be a templated URL, or a URL resource. If not a
|
87
|
+
template, but the Affordance has one or more uriVariable
|
88
|
+
properties, the implication is that the target resource should
|
89
|
+
be used as the basis of a URI template by appending
|
90
|
+
\(?name,other,...\) to the URI.)
|
91
|
+
property :var, :comment =>
|
92
|
+
%(When the object is list, the members of the list should be
|
93
|
+
Parameters, the the list order implies the order in which the
|
94
|
+
parameters should be used)
|
95
|
+
end
|
96
|
+
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'roadforest/http'
|
2
|
-
require 'roadforest/content-handling/
|
2
|
+
require 'roadforest/content-handling/common-engines'
|
3
3
|
|
4
4
|
module RoadForest
|
5
5
|
module HTTP
|
@@ -50,7 +50,7 @@ module RoadForest
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def type_handling
|
53
|
-
@type_handling
|
53
|
+
@type_handling || ContentHandling.rdf_engine
|
54
54
|
end
|
55
55
|
|
56
56
|
def best_type_for(url)
|
@@ -0,0 +1,145 @@
|
|
1
|
+
require 'roadforest/source-rigor/graph-store'
|
2
|
+
require 'roadforest/graph/etagging'
|
3
|
+
require 'roadforest/graph/access-manager'
|
4
|
+
require 'roadforest/graph/graph-focus'
|
5
|
+
|
6
|
+
module RoadForest
|
7
|
+
module Interface
|
8
|
+
class ProcessingSequenceError < StandardError
|
9
|
+
end
|
10
|
+
|
11
|
+
class Application
|
12
|
+
def initialize(route_name, params, router, services)
|
13
|
+
@route_name = route_name
|
14
|
+
@params = params
|
15
|
+
@router = router
|
16
|
+
@services = services
|
17
|
+
@data = nil
|
18
|
+
@response_values = {}
|
19
|
+
end
|
20
|
+
attr_reader :route_name, :params, :services, :data, :router
|
21
|
+
attr_reader :response_values
|
22
|
+
|
23
|
+
#@!group Utility methods
|
24
|
+
|
25
|
+
def path_for(route_name = nil, params = nil)
|
26
|
+
router.path_for(route_name, params || self.params)
|
27
|
+
end
|
28
|
+
|
29
|
+
def url_for(route_name, params = nil)
|
30
|
+
Addressable::URI.parse(canonical_host.to_s).join(path_for(route_name, params))
|
31
|
+
end
|
32
|
+
|
33
|
+
def interface_for(route_name = nil, params = nil)
|
34
|
+
router.interface_for(route_name, params || self.params)
|
35
|
+
end
|
36
|
+
|
37
|
+
def canonical_uri
|
38
|
+
url_for(route_name, params)
|
39
|
+
end
|
40
|
+
|
41
|
+
def my_path
|
42
|
+
path_for(route_name, params)
|
43
|
+
end
|
44
|
+
|
45
|
+
def my_url
|
46
|
+
canonical_uri.to_s
|
47
|
+
end
|
48
|
+
|
49
|
+
#@!endgroup
|
50
|
+
|
51
|
+
#@!group Authorization
|
52
|
+
|
53
|
+
def required_grants(method)
|
54
|
+
services.authz.build_grants do |grants|
|
55
|
+
grants.add(:admin)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
def authorization(method, header)
|
60
|
+
required = required_grants(method)
|
61
|
+
if required.empty?
|
62
|
+
:public
|
63
|
+
else
|
64
|
+
services.authz.authorization(header, required_grants(method))
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
def authentication_challenge
|
69
|
+
services.authz.challenge(:realm => "Roadforest")
|
70
|
+
end
|
71
|
+
|
72
|
+
#@!endgroup
|
73
|
+
|
74
|
+
def canonical_host
|
75
|
+
services.canonical_host
|
76
|
+
end
|
77
|
+
|
78
|
+
def reset #XXX remove?
|
79
|
+
end
|
80
|
+
|
81
|
+
#group Resource interface
|
82
|
+
|
83
|
+
def exists?
|
84
|
+
!data.nil?
|
85
|
+
end
|
86
|
+
|
87
|
+
def etag
|
88
|
+
nil
|
89
|
+
end
|
90
|
+
|
91
|
+
def last_modified
|
92
|
+
nil
|
93
|
+
end
|
94
|
+
|
95
|
+
def response_location
|
96
|
+
@response_values.fetch(:location) do
|
97
|
+
raise ProcessingSequenceError, "Location not available until request processed"
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
def response_location=(location)
|
102
|
+
@response_values[:location] = location
|
103
|
+
end
|
104
|
+
|
105
|
+
def response_data
|
106
|
+
@response_values.fetch(:data) do
|
107
|
+
raise ProcessingSequenceError, "Location not available until request processed"
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
def response_data=(data)
|
112
|
+
@response_values[:data] = data
|
113
|
+
end
|
114
|
+
|
115
|
+
def processed
|
116
|
+
[:location, :data].each do |key|
|
117
|
+
unless @response_values.has_key?(key)
|
118
|
+
@response_values[key] = nil
|
119
|
+
end
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
def expires
|
124
|
+
nil
|
125
|
+
end
|
126
|
+
|
127
|
+
def update(data)
|
128
|
+
raise NotImplementedError
|
129
|
+
end
|
130
|
+
|
131
|
+
def add_child(results)
|
132
|
+
raise NotImplementedError
|
133
|
+
end
|
134
|
+
|
135
|
+
def retrieve
|
136
|
+
raise NotImplementedError
|
137
|
+
end
|
138
|
+
alias retreive retrieve
|
139
|
+
|
140
|
+
def delete
|
141
|
+
false
|
142
|
+
end
|
143
|
+
end
|
144
|
+
end
|
145
|
+
end
|