public
Description: RESTful workflow / bpm engine based on Rack and OpenWFEru
Homepage: http://openwferu.rubyforge.org
Clone URL: git://github.com/jmettraux/ruote-rest.git
link method renamed href
jmettraux (author)
Sun Jun 08 16:24:22 -0700 2008
commit  4109e5fba46092888665e5bd7d8beef72f0f67d3
tree    644cc4f22fc8db1004b3b690e1614fe45fb0a4b4
parent  a876257ffab280607f7702da3ee687f79f8089f8
...
44
45
46
47
 
48
49
50
 
51
52
53
...
71
72
73
74
 
75
76
77
 
78
79
80
 
81
82
83
 
84
85
86
 
87
88
89
90
 
91
92
93
...
98
99
100
101
 
102
103
 
104
105
 
106
107
108
...
113
114
115
116
 
117
118
 
119
120
 
121
122
123
124
125
126
127
 
128
129
 
130
131
 
132
133
134
...
145
146
147
148
 
149
150
 
151
152
 
153
154
155
...
44
45
46
 
47
48
49
 
50
51
52
53
...
71
72
73
 
74
75
76
 
77
78
79
 
80
81
82
 
83
84
85
 
86
87
88
89
 
90
91
92
93
...
98
99
100
 
101
102
 
103
104
 
105
106
107
108
...
113
114
115
 
116
117
 
118
119
 
120
121
122
123
124
125
126
 
127
128
 
129
130
 
131
132
133
134
...
145
146
147
 
148
149
 
150
151
 
152
153
154
155
0
@@ -44,10 +44,10 @@
0
 class Rack::Request
0
 
0
   #
0
- # request.link(:expressions, "abc", "0_0_1")
0
+ # request.href(:expressions, "abc", "0_0_1")
0
   # #=> "http://example.org:4567/expressions/abc/0_0_1"
0
   #
0
- def link (*args)
0
+ def href (*args)
0
 
0
     base = "#{scheme}://#{host}"
0
 
0
@@ -71,23 +71,23 @@ class OpenWFE::FlowExpressionId
0
   # Returns the relative link to the expression pointed at by this
0
   # FlowExpressionId.
0
   #
0
- # fei.link
0
+ # fei.href
0
   # # => "/expressions/{wfid}/{expid}"
0
   #
0
- # fei.link(request)
0
+ # fei.href(request)
0
   # # => "http://host:port/expressions/{wfid}/{expid}"
0
   #
0
- # fei.link(request, 'smurfs')
0
+ # fei.href(request, 'smurfs')
0
   # # => "http://host:port/smurfs/{wfid}/{expid}"
0
   #
0
- # fei.link(nil, 'smurfs')
0
+ # fei.href(nil, 'smurfs')
0
   # # => "smurfs/{wfid}/{expid}"
0
   #
0
- def link (req=nil, resource_name='expressions')
0
+ def href (req=nil, resource_name='expressions')
0
 
0
     ei = swapdots self.expid
0
 
0
- return req.link(resource_name, wfid, ei) if req
0
+ return req.href(resource_name, wfid, ei) if req
0
 
0
     env = self.expname == "environment" ? "e" : ""
0
 
0
@@ -98,11 +98,11 @@ end
0
 class OpenWFE::ProcessStatus
0
 
0
   #
0
- # Returns the 'ruote-rest' link for this ProcessError instance
0
+ # Returns the 'ruote-rest' href for this ProcessError instance
0
   #
0
- def link (request=nil)
0
+ def href (request=nil)
0
 
0
- return request.link(:processes, wfid) if request
0
+ return request.href(:processes, wfid) if request
0
 
0
     "/processes/#{wfid}"
0
   end
0
@@ -113,22 +113,22 @@ class OpenWFE::FlowExpression
0
   #
0
   # a shortcut for
0
   #
0
- # self.fei.link(req)
0
+ # self.fei.href(req)
0
   #
0
- def link (request=nil)
0
+ def href (request=nil)
0
 
0
- self.fei.link(request)
0
+ self.fei.href(request)
0
   end
0
 end
0
 
0
 class OpenWFE::InFlowWorkItem
0
 
0
   #
0
- # Returns the 'ruote-rest' link for this workitem
0
+ # Returns the 'ruote-rest' href for this workitem
0
   #
0
- def link (request=nil)
0
+ def href (request=nil)
0
 
0
- return request.link(:workitems, db_id) if request
0
+ return request.href(:workitems, db_id) if request
0
 
0
     "/workitems/#{db_id}"
0
   end
0
@@ -145,11 +145,11 @@ class OpenWFE::ProcessError
0
   end
0
 
0
   #
0
- # Returns the 'ruote-rest' link for this ProcessError instance
0
+ # Returns the 'ruote-rest' href for this ProcessError instance
0
   #
0
- def link (request=nil)
0
+ def href (request=nil)
0
 
0
- return request.link(:errors, wfid, expid) if request
0
+ return request.href(:errors, wfid, expid) if request
0
 
0
     "/errors/#{wfid}/#{error_id}"
0
   end
...
57
58
59
60
 
61
62
63
...
57
58
59
 
60
61
62
63
0
@@ -57,7 +57,7 @@ helpers do
0
 
0
     xml.error do
0
       #xml.raw error.inspect
0
- xml.link error.error_id
0
+ xml.href error.error_id
0
       xml.wfid error.fei.wfid
0
       xml.fei error.fei
0
       xml.call error.message.to_s
...
126
127
128
129
 
130
131
132
...
136
137
138
139
 
140
141
142
...
126
127
128
 
129
130
131
132
...
136
137
138
 
139
140
141
142
0
@@ -126,7 +126,7 @@ def _expression_link (xml, tagname, fei, env=false)
0
   xml.tag!(
0
     tagname,
0
     fei.to_s,
0
- :href => request.link(
0
+ :href => request.href(
0
       :expressions,
0
       fei.wfid,
0
       swapdots(expid)))
0
@@ -136,7 +136,7 @@ def _render_expression_xml (xml, e, detailed=false)
0
 
0
   params = {}
0
 
0
- params[:href] = request.link(
0
+ params[:href] = request.href(
0
     :expressions, e.fei.wfid, swapdots(e.fei.expid)) unless detailed
0
 
0
   xml.expression params do
...
53
54
55
56
 
57
58
59
...
53
54
55
 
56
57
58
59
0
@@ -53,7 +53,7 @@ end
0
 
0
 def render_fei_xml (fei)
0
 
0
- #header 'Location' => request.link(:processes, fei.wfid)
0
+ #header 'Location' => request.href(:processes, fei.wfid)
0
 
0
   OpenWFE::Xml.fei_to_xml fei
0
 end
...
101
102
103
104
 
105
106
107
...
101
102
103
 
104
105
106
107
0
@@ -101,7 +101,7 @@ helpers do
0
 
0
     opts = {
0
       :href =>
0
- request.link(:participants, uri_escape(regex.original_string)) }
0
+ request.href(:participants, uri_escape(regex.original_string)) }
0
 
0
     xml.participant opts do
0
       xml.regex regex.original_string
...
91
92
93
94
 
95
96
97
...
110
111
112
113
 
114
115
116
...
119
120
121
122
 
123
124
125
...
137
138
139
140
 
141
142
143
...
91
92
93
 
94
95
96
97
...
110
111
112
 
113
114
115
116
...
119
120
121
 
122
123
124
125
...
137
138
139
 
140
141
142
143
0
@@ -91,7 +91,7 @@ helpers do
0
 
0
   def _render_process_xml (xml, p, detailed=false)
0
 
0
- xml.process :href => request.link(:processes, p.wfid) do
0
+ xml.process :href => request.href(:processes, p.wfid) do
0
 
0
       xml.wfid p.wfid
0
       xml.wfname p.wfname
0
@@ -110,7 +110,7 @@ helpers do
0
 
0
         hash_to_xml xml, :variables, p, :variables
0
 
0
- xml.active_expressions :href => request.link(:expressions, p.wfid) do
0
+ xml.active_expressions :href => request.href(:expressions, p.wfid) do
0
 
0
           p.expressions.each do |fexp|
0
 
0
@@ -119,7 +119,7 @@ helpers do
0
             xml.expression(
0
               "#{fei.to_s}",
0
               :short => fei.to_web_s,
0
- :href => fei.link(request))
0
+ :href => fei.href(request))
0
           end
0
         end
0
 
0
@@ -137,7 +137,7 @@ helpers do
0
 
0
         xml.representation(
0
           p.process_stack.representation.to_json.to_s,
0
- :href => request.link(:processes, p.wfid, :representation))
0
+ :href => request.href(:processes, p.wfid, :representation))
0
 
0
       else
0
 
...
70
71
72
73
 
74
75
76
...
82
83
84
85
 
86
87
88
...
70
71
72
 
73
74
75
76
...
82
83
84
 
85
86
87
88
0
@@ -70,7 +70,7 @@ helpers do
0
       xml.workitems :count => wis.size do
0
         wis.each do |wi|
0
           owi = wi.as_owfe_workitem
0
- owi._uri = request.link(:workitems, wi.id)
0
+ owi._uri = request.href(:workitems, wi.id)
0
           OpenWFE::Xml._workitem_to_xml xml, owi
0
         end
0
       end
0
@@ -82,7 +82,7 @@ helpers do
0
     builder do |xml|
0
       xml.instruct!
0
       owi = wi.as_owfe_workitem
0
- owi._uri = request.link(:workitems, wi.id)
0
+ owi._uri = request.href(:workitems, wi.id)
0
       OpenWFE::Xml._workitem_to_xml xml, owi
0
     end
0
   end
...
54
55
56
57
 
58
59
60
...
70
71
72
73
74
 
 
75
76
77
...
54
55
56
 
57
58
59
60
...
70
71
72
 
 
73
74
75
76
77
0
@@ -54,7 +54,7 @@ put "/expressions/:wfid/:expid" do
0
 
0
   $engine.update_expression expression
0
 
0
- header "Location" => expression.link(request)
0
+ header "Location" => expression.href(request)
0
   rrender :expression, find_expression
0
 end
0
 
0
@@ -70,8 +70,8 @@ delete "/expressions/:wfid/:expid" do
0
   $engine.cancel_expression e
0
 
0
   response.status = 303
0
- header "Location" => request.link(:expressions, params[:wfid])
0
- "expression at #{e.link} cancelled (terminated)"
0
+ header "Location" => request.href(:expressions, params[:wfid])
0
+ "expression at #{e.href} cancelled (terminated)"
0
 end
0
 
0
 
...
63
64
65
66
 
67
68
69
...
63
64
65
 
66
67
68
69
0
@@ -63,7 +63,7 @@ delete "/participants/:pid" do
0
   Participants.remove pid
0
 
0
   response.status = 303
0
- header "Location" => request.link(:participants)
0
+ header "Location" => request.href(:participants)
0
   "participant #{pid} removed"
0
 end
0
 
...
57
58
59
60
 
61
62
63
...
113
114
115
116
 
117
118
119
...
57
58
59
 
60
61
62
63
...
113
114
115
 
116
117
118
119
0
@@ -57,7 +57,7 @@ post "/processes" do
0
 
0
   rrender(
0
     :fei, fei,
0
- :status => 201, 'Location' => request.link(:processes, fei.wfid))
0
+ :status => 201, 'Location' => request.href(:processes, fei.wfid))
0
 end
0
 
0
 #
0
@@ -113,7 +113,7 @@ delete "/processes/:wfid" do
0
   sleep 0.350
0
 
0
   response.status = 303
0
- header "Location" => request.link(:processes)
0
+ header "Location" => request.href(:processes)
0
   "process #{wfid} deleted"
0
 end
0
 
...
64
65
66
67
 
68
69
70
...
64
65
66
 
67
68
69
70
0
@@ -64,7 +64,7 @@ put "/workitems/:wid" do
0
     $engine.reply owi
0
     wi.destroy
0
 
0
- header 'Location' => request.link(:workitems)
0
+ header 'Location' => request.href(:workitems)
0
     rrender :workitems, find_workitems
0
   else
0
 
...
88
89
90
91
 
92
93
94
...
88
89
90
 
91
92
93
94
0
@@ -88,7 +88,7 @@ load 'res/workitems.rb'
0
 get "/" do
0
 
0
   response.status = 303
0
- header "Location" => request.link(:processes)
0
+ header "Location" => request.href(:processes)
0
   ""
0
 end
0
 

Comments

    No one has commented yet.