jinda 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/lib/generators/jinda/install_generator.rb +5 -0
- data/lib/generators/jinda/templates/README.md +1 -1
- data/lib/generators/jinda/templates/app/controllers/concerns/jinda_general_concern.rb +27 -4
- data/lib/generators/jinda/templates/app/controllers/concerns/jinda_run_concern.rb +121 -6
- data/lib/generators/jinda/templates/app/controllers/jinda_org/docs_controller.rb +55 -0
- data/lib/generators/jinda/templates/app/controllers/jinda_org/jinda_controller.rb +22 -2
- data/lib/generators/jinda/templates/app/jinda/index.mm +83 -14
- data/lib/generators/jinda/templates/app/jinda/template/view.html.erb +22 -23
- data/lib/generators/jinda/templates/app/models/jinda/doc.rb +5 -0
- data/lib/generators/jinda/templates/app/views/docs/doc_edit/doc_edit.html.erb +21 -0
- data/lib/generators/jinda/templates/app/views/docs/doc_edit/doc_select.html.erb +14 -0
- data/lib/generators/jinda/templates/app/views/docs/doc_new/doc_form.html.erb +26 -0
- data/lib/generators/jinda/templates/app/views/docs/doc_new/doc_form.md +36 -0
- data/lib/generators/jinda/templates/app/views/docs/doc_xedit/doc_edit.html.erb +21 -0
- data/lib/generators/jinda/templates/app/views/docs/edit/select_note.html.erb +14 -0
- data/lib/generators/jinda/templates/app/views/docs/index.haml +21 -0
- data/lib/generators/jinda/templates/app/views/docs/my.haml +27 -0
- data/lib/generators/jinda/templates/app/views/jinda/index.html.haml +3 -3
- data/lib/generators/jinda/templates/app/views/jinda/run_output.haml +3 -3
- data/lib/jinda/helpers.rb +8 -15
- data/lib/jinda/version.rb +1 -1
- metadata +11 -5
- data/lib/jinda/ template/view.html.erb +0 -25
- data/lib/jinda/app/jinda/index.mm +0 -309
- data/lib/jinda/app/jinda/template/view.html.erb +0 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69bfafef87f66a61669d13ec1fb0e35b33856d04c4c0576a3195db8f4afa2cd4
|
4
|
+
data.tar.gz: a9e44d8bdb20895533f9f98386df69fd9a1b5d70e80202bca462842cd518489b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8b323cfb30d466d54619b7df410e11ee6cdf0c1c3527ec1be81e775228d1d47803ed51441054bbeb31e950e95e583b14431a41bc26f3236bd8e13cd232378ce
|
7
|
+
data.tar.gz: 34ba2f9c60c3934aa957ae288161126566255dc83401840477a37fd19b22d4b010fa2bc20deb4de2517365045912fb67306bdcfcee718e1d6619bde276821946
|
data/README.md
CHANGED
@@ -14,8 +14,8 @@ Rails Application Generator using Freemind
|
|
14
14
|
|
15
15
|
These versions works for sure but others may do.
|
16
16
|
|
17
|
-
* Ruby 2.7.
|
18
|
-
* Rails 6.0.
|
17
|
+
* Ruby 2.7.1
|
18
|
+
* Rails 6.0.3
|
19
19
|
* MongoDB 6
|
20
20
|
* Freemind 1.0.1
|
21
21
|
|
@@ -40,7 +40,7 @@ app without ActiveRecord
|
|
40
40
|
|
41
41
|
## Add jinda to your Gemfile:
|
42
42
|
|
43
|
-
gem 'jinda', '~> 0.5.
|
43
|
+
gem 'jinda', '~> 0.5.3'
|
44
44
|
|
45
45
|
For Development (most updated)
|
46
46
|
|
@@ -83,6 +83,7 @@ module Jinda
|
|
83
83
|
inside("app/controllers") {(File.file? "admins_controller.rb") ? ( say "Please merge existing jinda_org/admins_controller.rb after this installation", :red) : (FileUtils.mv 'jinda_org/admins_controller.rb', 'admins_controller.rb')}
|
84
84
|
inside("app/controllers") {(File.file? "articles_controller.rb") ? ( say "Please merge existing jinda_org/articles_controller.rb after this installation", :red) : (FileUtils.mv 'jinda_org/articles_controller.rb', 'articles_controller.rb')}
|
85
85
|
inside("app/controllers") {(File.file? "comments_controller.rb") ? ( say "Please merge existing jinda_org/comments_controller.rb after this installation", :red) : (FileUtils.mv 'jinda_org/comments_controller.rb', 'comments_controller.rb')}
|
86
|
+
inside("app/controllers") {(File.file? "docs_controller.rb") ? ( say "Please merge existing jinda_org/docs_controller.rb after this installation", :red) : (FileUtils.mv 'jinda_org/docs_controller.rb', 'docs_controller.rb')}
|
86
87
|
inside("app/controllers") {(File.file? "identities_controller.rb") ? ( say "Please merge existing jinda_org/identities_controller.rb after this installation", :red) : (FileUtils.mv 'jinda_org/identities_controller.rb', 'identities_controller.rb')}
|
87
88
|
inside("app/controllers") {(File.file? "jinda_controller.rb") ? ( say "Please merge existing jinda_org/jinda_controller.rb after this installation", :red) : (FileUtils.mv 'jinda_org/jinda_controller.rb', 'jinda_controller.rb')}
|
88
89
|
inside("app/controllers") {(File.file? "password_resets_controller.rb") ? ( say "Please merge existing jinda_org/password_resets_controller.rb after this installation", :red) : (FileUtils.mv 'jinda_org/password_resets_controller.rb', 'password_resets_controller.rb')}
|
@@ -107,11 +108,15 @@ module Jinda
|
|
107
108
|
route "resources :sessions"
|
108
109
|
route "resources :identities"
|
109
110
|
route "resources :users"
|
111
|
+
route "resources :docs"
|
110
112
|
route "resources :notes"
|
111
113
|
route "resources :articles"
|
114
|
+
route "get '/jinda/document/:id' => 'jinda#document'"
|
112
115
|
route "get '/notes/destroy/:id' => 'notes#destroy'"
|
113
116
|
route "get '/notes/my/destroy/:id' => 'notes#destroy'"
|
117
|
+
route "get '/docs/my/destroy' => 'docs#destroy'"
|
114
118
|
route "get '/notes/my' => 'notes/my'"
|
119
|
+
route "get '/docs/my' => 'docs/my'"
|
115
120
|
route "get '/articles/my/destroy' => 'articles#destroy'"
|
116
121
|
route "get '/articles/my' => 'articles/my'"
|
117
122
|
route "get '/logout' => 'sessions#destroy', :as => 'logout'"
|
@@ -55,6 +55,7 @@ module JindaGeneralConcern
|
|
55
55
|
end
|
56
56
|
|
57
57
|
# process images from second level, e.g,, fields_for
|
58
|
+
# save uploaded file info to Doc
|
58
59
|
def get_image1(key, key1, params)
|
59
60
|
doc = Jinda::Doc.create(
|
60
61
|
:name=> "#{key}_#{key1}",
|
@@ -63,16 +64,24 @@ module JindaGeneralConcern
|
|
63
64
|
:filename=> params.original_filename,
|
64
65
|
:content_type => params.content_type || 'application/zip',
|
65
66
|
:data_text=> '',
|
67
|
+
:dscan=> '',
|
68
|
+
:description=>'',
|
69
|
+
:keywords=>'',
|
70
|
+
:category=>'',
|
66
71
|
:ma_display=>true, :ma_secured => @xmain.service.ma_secured )
|
67
72
|
if defined?(IMAGE_LOCATION)
|
68
73
|
filename = "#{IMAGE_LOCATION}/f#{Param.gen(:asset_id)}"
|
69
74
|
File.open(filename,"wb") { |f| f.write(params.read) }
|
70
75
|
eval "@xvars[@runseq.code][key][key1] = '#{url_for(:action=>'document', :id=>doc.id, :only_path => true)}' "
|
71
|
-
doc.update_attributes :url => filename,
|
76
|
+
doc.update_attributes :url => filename,
|
77
|
+
:basename => File.basename(filename),
|
78
|
+
:cloudinary => false,
|
79
|
+
:dscan => @xvars[@runseq.code][key][key1],
|
80
|
+
:user_id => @xvars["user_id"]
|
72
81
|
else
|
73
82
|
result = Cloudinary::Uploader.upload(params)
|
74
83
|
eval %Q{ @xvars[@runseq.code][key][key1] = '#{result["url"]}' }
|
75
|
-
doc.update_attributes :url => result["url"], :basename => File.basename(result["url"]), :cloudinary => true
|
84
|
+
doc.update_attributes :url => result["url"], :basename => File.basename(result["url"]), :cloudinary => true, :dscan => @xvars[@runseq.code][key][key1]
|
76
85
|
end
|
77
86
|
end
|
78
87
|
|
@@ -81,13 +90,27 @@ module JindaGeneralConcern
|
|
81
90
|
end
|
82
91
|
|
83
92
|
# generate documentation for application
|
93
|
+
# search data from Doc
|
94
|
+
def document
|
95
|
+
doc = Jinda::Doc.find params[:id]
|
96
|
+
if doc.cloudinary
|
97
|
+
require 'net/http'
|
98
|
+
require "uri"
|
99
|
+
uri = URI.parse(doc.url)
|
100
|
+
data = Net::HTTP.get_response(uri)
|
101
|
+
send_data(data.body, :filename=>doc.filename, :type=>doc.content_type, :disposition=>"inline")
|
102
|
+
else
|
103
|
+
data= read_binary(doc.url)
|
104
|
+
send_data(data, :filename=>doc.filename, :type=>doc.content_type, :disposition=>"inline")
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
84
108
|
def doc
|
85
109
|
require 'rdoc'
|
86
110
|
@app= get_app
|
87
111
|
@intro = File.read('README.md')
|
88
112
|
@print= "<div align='right'><img src='/assets/printer.png'/> <a href='/jinda/doc_print' target='_blank'/>Print</a></div>"
|
89
113
|
doc= render_to_string 'doc.md', :layout => false
|
90
|
-
|
91
114
|
html= Maruku.new(doc).to_html
|
92
115
|
File.open('public/doc.html','w') {|f| f.puts html }
|
93
116
|
respond_to do |format|
|
@@ -127,7 +150,7 @@ module JindaGeneralConcern
|
|
127
150
|
|
128
151
|
def search
|
129
152
|
@q = params[:q] || params[:ma_search][:q] || ""
|
130
|
-
@title = "
|
153
|
+
@title = "Search Result #{@q}"
|
131
154
|
@backbtn= true
|
132
155
|
@cache= true
|
133
156
|
if @q.blank?
|
@@ -68,16 +68,19 @@ module JindaRunConcern
|
|
68
68
|
end_action(next_runseq)
|
69
69
|
end
|
70
70
|
|
71
|
+
# call controller to do the freemind task using Star symbol eg: Update
|
72
|
+
# not for run_form
|
71
73
|
def run_do
|
72
74
|
init_vars(params[:id])
|
73
75
|
@runseq.start ||= Time.now
|
74
76
|
@runseq.status= 'R' # running
|
75
77
|
$runseq_id= @runseq.id
|
76
78
|
$user_id= current_ma_user.try(:id)
|
79
|
+
# $xmain, $runseq, $user, $xvars, $ip from local
|
77
80
|
set_global
|
78
81
|
controller = Kernel.const_get(@xvars['custom_controller']).new
|
79
|
-
# call controller to do the freemind task using Star symbol eg: Update
|
80
82
|
result = controller.send(@runseq.code)
|
83
|
+
# save local var to database
|
81
84
|
init_vars_by_runseq($runseq_id)
|
82
85
|
@xvars = $xvars
|
83
86
|
@xvars[@runseq.code.to_sym]= result.to_s
|
@@ -97,6 +100,100 @@ module JindaRunConcern
|
|
97
100
|
refresh_to "/", :alert => "Sorry opeation error at #{@xmain.id} #{@xvars['error']}"
|
98
101
|
end
|
99
102
|
|
103
|
+
def run_list
|
104
|
+
init_vars(params[:id])
|
105
|
+
service= @xmain.service
|
106
|
+
# disp= get_option("display")
|
107
|
+
# disp = Nil or :"??????"
|
108
|
+
# get option from last node: rule, role, display
|
109
|
+
disp= get_option("display")
|
110
|
+
# change from Nil to false and string to true
|
111
|
+
ma_display = (disp && !affirm(disp)) ? false : true
|
112
|
+
# Todo check if file is available
|
113
|
+
# if service and file exist
|
114
|
+
# ma_display from disp of 3rd level node as rule, role, display
|
115
|
+
if service && !@runseq.code.blank?
|
116
|
+
f= "app/views/#{service.module.code}/#{service.code}/#{@runseq.code}.html.erb"
|
117
|
+
@ui= File.read(f)
|
118
|
+
if Jinda::Doc.where(:runseq_id=>@runseq.id).exists?
|
119
|
+
@doc= Jinda::Doc.where(:runseq_id=>@runseq.id).first
|
120
|
+
@doc.update_attributes :data_text=> render_to_string(:inline=>@ui, :layout=>"utf8"),
|
121
|
+
:xmain=>@xmain, :runseq=>@runseq, :user=>current_ma_user,
|
122
|
+
:ip=> get_ip, :service=>service, :ma_display=>ma_display,
|
123
|
+
:ma_secured => @xmain.service.ma_secured,
|
124
|
+
:filename => "#{@runseq.code}.html.erb"
|
125
|
+
else
|
126
|
+
@doc= Jinda::Doc.create :name=> @runseq.name,
|
127
|
+
:content_type=>"output", :data_text=> render_to_string(:inline=>@ui, :layout=>"utf8"),
|
128
|
+
:xmain=>@xmain, :runseq=>@runseq, :user=>current_ma_user,
|
129
|
+
:ip=> get_ip, :service=>service, :ma_display=>ma_display,
|
130
|
+
:ma_secured => @xmain.service.ma_secured,
|
131
|
+
:filename => "#{@runseq.code}.html.erb"
|
132
|
+
end
|
133
|
+
# @message = defined?(MSG_NEXT) ? MSG_NEXT : "Next >"
|
134
|
+
@message = defined?(MSG_NEXT) ? MSG_NEXT : "Next >>"
|
135
|
+
@message = "Finish" if @runseq.end
|
136
|
+
ma_log("Todo defined?(NSG_NEXT : Next >>)")
|
137
|
+
eval "@xvars[@runseq.code] = url_for(:controller=>'jinda', :action=>'document', :id=>@doc.id)"
|
138
|
+
else
|
139
|
+
flash[:notice]= "Error: Can not find the view file for this controller"
|
140
|
+
ma_log "Error: Can not find the view file for this controller"
|
141
|
+
redirect_to_root
|
142
|
+
end
|
143
|
+
# Check if ma_display available
|
144
|
+
# ma_display= get_option("display")
|
145
|
+
# if not ma_display then no display both controller-view and content then end back to root
|
146
|
+
unless ma_display
|
147
|
+
end_action
|
148
|
+
end
|
149
|
+
# controller display from @ui
|
150
|
+
end
|
151
|
+
|
152
|
+
def run_folder
|
153
|
+
init_vars(params[:id])
|
154
|
+
service= @xmain.service
|
155
|
+
# disp= get_option("display")
|
156
|
+
# disp = Nil or :"??????"
|
157
|
+
disp= get_option("display")
|
158
|
+
ma_display = (disp && !affirm(disp)) ? false : true
|
159
|
+
# Todo check if file is available
|
160
|
+
# if service and file exist
|
161
|
+
if service && !@runseq.code.blank?
|
162
|
+
f= "app/views/#{service.module.code}/#{service.code}/#{@runseq.code}.html.erb"
|
163
|
+
@ui= File.read(f)
|
164
|
+
if Jinda::Doc.where(:runseq_id=>@runseq.id).exists?
|
165
|
+
@doc= Jinda::Doc.where(:runseq_id=>@runseq.id).first
|
166
|
+
@doc.update_attributes :data_text=> render_to_string(:inline=>@ui, :layout=>"utf8"),
|
167
|
+
:xmain=>@xmain, :runseq=>@runseq, :user=>current_ma_user,
|
168
|
+
:ip=> get_ip, :service=>service, :ma_display=>ma_display,
|
169
|
+
:ma_secured => @xmain.service.ma_secured,
|
170
|
+
:filename => "#{@runseq.code}.html.erb"
|
171
|
+
else
|
172
|
+
@doc= Jinda::Doc.create :name=> @runseq.name,
|
173
|
+
:content_type=>"output", :data_text=> render_to_string(:inline=>@ui, :layout=>"utf8"),
|
174
|
+
:xmain=>@xmain, :runseq=>@runseq, :user=>current_ma_user,
|
175
|
+
:ip=> get_ip, :service=>service, :ma_display=>ma_display,
|
176
|
+
:ma_secured => @xmain.service.ma_secured,
|
177
|
+
:filename => "#{@runseq.code}.html.erb"
|
178
|
+
end
|
179
|
+
# @message = defined?(MSG_NEXT) ? MSG_NEXT : "Next >"
|
180
|
+
@message = defined?(MSG_NEXT) ? MSG_NEXT : "Next >>"
|
181
|
+
@message = "Finish" if @runseq.end
|
182
|
+
ma_log("Todo defined?(NSG_NEXT : Next >>)")
|
183
|
+
eval "@xvars[@runseq.code] = url_for(:controller=>'jinda', :action=>'document', :id=>@doc.id)"
|
184
|
+
else
|
185
|
+
flash[:notice]= "Error: Can not find the view file for this controller"
|
186
|
+
ma_log "Error: Can not find the view file for this controller"
|
187
|
+
redirect_to_root
|
188
|
+
end
|
189
|
+
# Check if ma_display available
|
190
|
+
# ma_display= get_option("display")
|
191
|
+
unless ma_display
|
192
|
+
end_action
|
193
|
+
end
|
194
|
+
# controller display from @ui
|
195
|
+
end
|
196
|
+
|
100
197
|
def run_output
|
101
198
|
init_vars(params[:id])
|
102
199
|
service= @xmain.service
|
@@ -135,11 +232,11 @@ module JindaRunConcern
|
|
135
232
|
redirect_to_root
|
136
233
|
end
|
137
234
|
# Check if ma_display available
|
138
|
-
# ma_display= get_option("
|
235
|
+
# ma_display= get_option("display")
|
139
236
|
unless ma_display
|
140
237
|
end_action
|
141
238
|
end
|
142
|
-
# display from @ui
|
239
|
+
# controller display from @ui
|
143
240
|
end
|
144
241
|
|
145
242
|
def run_mail
|
@@ -168,8 +265,11 @@ module JindaRunConcern
|
|
168
265
|
end_action
|
169
266
|
end
|
170
267
|
|
268
|
+
# Store params to @xvars[@runseq]
|
269
|
+
# Perform task from the form input eg: attach file
|
270
|
+
# replace end_action (for form)
|
271
|
+
# Store params attach file to @xvars to use in get_image
|
171
272
|
def end_form
|
172
|
-
# Check error using xmain_id to redirect_to_root and return
|
173
273
|
if params[:xmain_id]
|
174
274
|
init_vars(params[:xmain_id])
|
175
275
|
else
|
@@ -183,13 +283,17 @@ module JindaRunConcern
|
|
183
283
|
get_image(k, params[k])
|
184
284
|
# check if params of array in form eg: edit_article
|
185
285
|
elsif params[k].is_a?(ActionController::Parameters)
|
286
|
+
eval "@xvars[@runseq.code][k] = {} unless @xvars[@runseq.code][k]"
|
186
287
|
params[k].each { |k1,v1|
|
187
288
|
# eval "@xvars[@runseq.code][k1] = params.require(k1).permit(k1)"
|
188
|
-
eval "@xvars[@runseq.code][k1] = v1"
|
289
|
+
eval "@xvars[@runseq.code][k][k1] = v1"
|
189
290
|
next unless v1.respond_to?(:original_filename)
|
291
|
+
doc = {}
|
190
292
|
get_image1(k, k1, params[k][k1])
|
191
293
|
}
|
192
294
|
else
|
295
|
+
# No file attached
|
296
|
+
#
|
193
297
|
# https://stackoverflow.com/questions/34949505/rails-5-unable-to- retrieve-hash-values-from-parameter # bug in to_unsalfe_h rails 5.1.6 https://github.com/getsentry/raven-ruby/issues/799
|
194
298
|
# Solution:
|
195
299
|
# https://stackoverflow.com/questions/34949505/rails-5-unable-to-retrieve-hash-values-from-parameter
|
@@ -200,10 +304,21 @@ module JindaRunConcern
|
|
200
304
|
eval "@xvars[@runseq.code][k] = v"
|
201
305
|
end
|
202
306
|
}
|
203
|
-
|
307
|
+
end_action
|
308
|
+
rescue => e
|
309
|
+
@xmain.status='E'
|
310
|
+
@xvars['error']= e.to_s+e.backtrace.to_s
|
311
|
+
@xmain.xvars= $xvars
|
312
|
+
@xmain.save
|
313
|
+
@runseq.status= 'F' #finish
|
314
|
+
@runseq.stop= Time.now
|
315
|
+
@runseq.save
|
316
|
+
ma_log "Error:end_form "
|
317
|
+
refresh_to "/", :alert => "Sorry opeation error at #{@xmain.id} #{@xvars['error']}"
|
204
318
|
end
|
205
319
|
|
206
320
|
def end_action(next_runseq = nil)
|
321
|
+
# not for form
|
207
322
|
# @runseq.status='F' unless @runseq_not_f
|
208
323
|
@xmain.xvars= @xvars
|
209
324
|
@xmain.status= 'R' # running
|
@@ -0,0 +1,55 @@
|
|
1
|
+
class DocsController < ApplicationController
|
2
|
+
before_action :load_doc, only: [:destroy]
|
3
|
+
before_action :load_doc_form, only: [:doc_update, :edit, :my]
|
4
|
+
|
5
|
+
def index
|
6
|
+
@documents = Jinda::Doc.desc(:created_at).page(params[:page]).per(10)
|
7
|
+
end
|
8
|
+
|
9
|
+
def edit
|
10
|
+
end
|
11
|
+
|
12
|
+
def my
|
13
|
+
@page_title = 'My Document'
|
14
|
+
end
|
15
|
+
|
16
|
+
def doc_update
|
17
|
+
|
18
|
+
if Jinda::Doc.where(:runseq_id => $xvars["doc_form"]["runseq_id"]).exists?
|
19
|
+
@doc = Jinda::Doc.where(:runseq_id => $xvars["doc_form"]["runseq_id"]).first
|
20
|
+
@doc.update(description: $xvars["doc_form"]["description"],
|
21
|
+
category: $xvars["doc_form"]["jinda_doc"]["category"],
|
22
|
+
keywords: $xvars["doc_form"]["keywords"],
|
23
|
+
user_id: $xvars["user_id"]
|
24
|
+
)
|
25
|
+
else
|
26
|
+
# create here
|
27
|
+
# Todo
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def destroy
|
32
|
+
# duplicated from jinda_controller
|
33
|
+
# Expected to use in jinda_controller
|
34
|
+
current_ma_user = User.where(:auth_token => cookies[:auth_token]).first if cookies[:auth_token]
|
35
|
+
|
36
|
+
if Rails.env.test? #Temp solution until fix test of current_ma_user
|
37
|
+
current_ma_user = $xvars["current_ma_user"]
|
38
|
+
#current_ma_user = @doc.user
|
39
|
+
end
|
40
|
+
|
41
|
+
if current_ma_user.role.upcase.split(',').include?("A") || current_ma_user == @doc.user
|
42
|
+
@doc.destroy
|
43
|
+
end
|
44
|
+
redirect_to :action=>'my'
|
45
|
+
end
|
46
|
+
|
47
|
+
private
|
48
|
+
|
49
|
+
def load_doc_form
|
50
|
+
@docs = Jinda::Doc.all.desc(:created_at).page(params[:page]).per(10)
|
51
|
+
end
|
52
|
+
def load_doc
|
53
|
+
@doc = Jinda::Doc.find(params[:doc_id])
|
54
|
+
end
|
55
|
+
end
|
@@ -13,7 +13,7 @@ class JindaController < ApplicationController
|
|
13
13
|
xmain = create_xmain(@service)
|
14
14
|
result = create_runseq(xmain)
|
15
15
|
unless result
|
16
|
-
message = "cannot find action for xmain #{xmain.id}"
|
16
|
+
message = "Node missing action icon: cannot find action for xmain #{xmain.id}, the node required action(icon) in freemind eg: form, list, method"
|
17
17
|
ma_log(message)
|
18
18
|
flash[:notice]= message
|
19
19
|
redirect_to "pending" and return
|
@@ -21,9 +21,12 @@ class JindaController < ApplicationController
|
|
21
21
|
xmain.update_attribute(:xvars, @xvars)
|
22
22
|
xmain.runseqs.last.update_attribute(:end,true)
|
23
23
|
#Above line cause error update_attribute in heroku shown in logs and it was proposed to fixed in github:'kul1/g241502'
|
24
|
+
# Main action run with :id
|
24
25
|
redirect_to :action=>'run', :id=>xmain.id
|
25
26
|
else
|
26
27
|
refresh_to "/", :alert => "Error: cannot process"
|
28
|
+
error_run_xmain = "Error_run_xmain"
|
29
|
+
ma_log(error_run_xmain)
|
27
30
|
end
|
28
31
|
end
|
29
32
|
|
@@ -32,6 +35,24 @@ class JindaController < ApplicationController
|
|
32
35
|
# action from @r.action == do, form, if, output
|
33
36
|
# Then will call def run_do, run_form, run_if, run_output
|
34
37
|
########################################################################]
|
38
|
+
#
|
39
|
+
# run
|
40
|
+
# init_vars
|
41
|
+
# To get all var from global and runseq, action
|
42
|
+
# (@runseq.action)
|
43
|
+
#
|
44
|
+
# run_do, run_form, run_if, run_output
|
45
|
+
# run_do => controller => action eg: update, create, document
|
46
|
+
# run_form =>
|
47
|
+
# run_form.haml => - next step => def end_form
|
48
|
+
# - next_step = end_form
|
49
|
+
# run_if =>
|
50
|
+
# run_output =>
|
51
|
+
#
|
52
|
+
# end_action
|
53
|
+
# => save local var to database :current_runseq
|
54
|
+
# :current_runseq => next_runseq
|
55
|
+
#
|
35
56
|
def run
|
36
57
|
init_vars(params[:id])
|
37
58
|
if authorize?
|
@@ -41,5 +62,4 @@ class JindaController < ApplicationController
|
|
41
62
|
redirect_to_root
|
42
63
|
end
|
43
64
|
end
|
44
|
-
|
45
65
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<map version="1.0.1">
|
2
2
|
<!-- To view this file, download free mind mapping software FreeMind from http://freemind.sourceforge.net -->
|
3
3
|
<node CREATED="1273819432637" ID="ID_1098419600" MODIFIED="1334737006485" TEXT="Jinda">
|
4
|
-
<node CREATED="1273819462973" ID="ID_282419531" MODIFIED="
|
4
|
+
<node CREATED="1273819462973" ID="ID_282419531" MODIFIED="1589756758387" POSITION="right" TEXT="services">
|
5
5
|
<node CREATED="1275756501221" FOLDED="true" ID="ID_1720745721" MODIFIED="1583097151076" TEXT="users:User">
|
6
6
|
<node CREATED="1278491598711" ID="ID_1662699954" MODIFIED="1494393920347" TEXT="role:m"/>
|
7
7
|
<node CREATED="1279700865182" ID="ID_1266797279" MODIFIED="1357798847781" TEXT="link:info: /users"/>
|
@@ -25,7 +25,7 @@
|
|
25
25
|
</node>
|
26
26
|
</node>
|
27
27
|
</node>
|
28
|
-
<node CREATED="1275752678377"
|
28
|
+
<node CREATED="1275752678377" ID="ID_1348489452" MODIFIED="1588883079396" TEXT="admins:Admin">
|
29
29
|
<node CREATED="1275752688167" ID="ID_229996461" MODIFIED="1275752690948" TEXT="role:a"/>
|
30
30
|
<node CREATED="1282722836614" ID="ID_1213363124" MODIFIED="1330477902602" TEXT="edit_role:edit user role">
|
31
31
|
<node CREATED="1282722862918" ID="ID_1190117882" MODIFIED="1330477922159" TEXT="select_user:select user">
|
@@ -44,15 +44,54 @@
|
|
44
44
|
<node CREATED="1275790679363" ID="ID_829325467" MODIFIED="1511159696044" TEXT="link: logs: /jinda/logs"/>
|
45
45
|
<node CREATED="1507573166973" ID="ID_351025910" MODIFIED="1511159700908" TEXT="link: docs: /jinda/doc"/>
|
46
46
|
</node>
|
47
|
-
<node CREATED="1273706796854"
|
47
|
+
<node CREATED="1273706796854" ID="ID_1003882979" MODIFIED="1588964401951" TEXT="devs: Developer">
|
48
48
|
<node CREATED="1275373154914" ID="ID_340725299" MODIFIED="1275373158632" TEXT="role:d"/>
|
49
49
|
<node CREATED="1275788317299" ID="ID_716276608" MODIFIED="1511159716471" TEXT="link: error_logs: /jinda/error_logs"/>
|
50
|
+
<node CREATED="1275788317299" ID="ID_1570419198" MODIFIED="1587858894833" TEXT="link: notice_logs: /jinda/notice_logs"/>
|
51
|
+
</node>
|
52
|
+
<node CREATED="1589756777499" ID="ID_853155456" MODIFIED="1589772589662" TEXT="docs: Document">
|
53
|
+
<node CREATED="1589757073388" ID="ID_1938238774" MODIFIED="1589772640862" TEXT="link: My Document: /docs/my">
|
54
|
+
<node CREATED="1589757125861" ID="ID_521286668" MODIFIED="1589757136547" TEXT="role:m"/>
|
55
|
+
</node>
|
56
|
+
<node CREATED="1589756879955" ID="ID_899042293" MODIFIED="1589910229085" TEXT="doc_new: New Document">
|
57
|
+
<node CREATED="1589756946117" ID="ID_1840278804" MODIFIED="1589910235469" TEXT="doc_form: Doc Form">
|
58
|
+
<icon BUILTIN="attach"/>
|
59
|
+
<node CREATED="1589757054618" ID="ID_642998203" MODIFIED="1589757059003" TEXT="role: m"/>
|
60
|
+
</node>
|
61
|
+
<node CREATED="1589757264764" ID="ID_1352102524" MODIFIED="1589772413612" TEXT="doc_update: Doc update">
|
62
|
+
<icon BUILTIN="bookmark"/>
|
63
|
+
</node>
|
64
|
+
</node>
|
65
|
+
<node CREATED="1493419562726" ID="ID_339628868" MODIFIED="1590424956484" TEXT="doc_edit: Edit Document">
|
66
|
+
<icon BUILTIN="button_cancel"/>
|
67
|
+
<node CREATED="1493419577933" ID="ID_801950372" MODIFIED="1590180699851" TEXT="doc_select: Select Document">
|
68
|
+
<icon BUILTIN="attach"/>
|
69
|
+
<node CREATED="1493479602815" ID="ID_761787946" MODIFIED="1493479606921" TEXT="role:m"/>
|
70
|
+
</node>
|
71
|
+
<node CREATED="1493419612720" ID="ID_1190499756" MODIFIED="1590180735204" TEXT="doc_edit: Edit Document">
|
72
|
+
<icon BUILTIN="attach"/>
|
73
|
+
<node CREATED="1493479557266" ID="ID_1216426484" MODIFIED="1493479561055" TEXT="role:m"/>
|
74
|
+
</node>
|
75
|
+
<node CREATED="1581400438157" ID="ID_447781815" MODIFIED="1590180242343" TEXT="doc_update: Doc_update">
|
76
|
+
<icon BUILTIN="bookmark"/>
|
77
|
+
</node>
|
78
|
+
</node>
|
79
|
+
<node CREATED="1495246388313" ID="ID_278169779" MODIFIED="1590180135106" TEXT="doc_xedit: Doc_hidden_menu">
|
80
|
+
<icon BUILTIN="button_cancel"/>
|
81
|
+
<node CREATED="1493419612720" ID="ID_541432768" MODIFIED="1590180160498" TEXT="doc_edit: Edit">
|
82
|
+
<icon BUILTIN="attach"/>
|
83
|
+
<node CREATED="1493479557266" ID="ID_1339913531" MODIFIED="1493479561055" TEXT="role:m"/>
|
84
|
+
</node>
|
85
|
+
<node CREATED="1581400438157" ID="ID_802199910" MODIFIED="1590180242343" TEXT="doc_update: Doc_update">
|
86
|
+
<icon BUILTIN="bookmark"/>
|
87
|
+
</node>
|
88
|
+
</node>
|
50
89
|
</node>
|
51
90
|
<node CREATED="1493393619430" ID="ID_554831343" MODIFIED="1584996526651" TEXT="notes: Notes">
|
52
|
-
<node CREATED="1493489768542" ID="ID_737469676" MODIFIED="
|
91
|
+
<node CREATED="1493489768542" ID="ID_737469676" MODIFIED="1589772615102" TEXT="link:My Notes: /notes/my">
|
53
92
|
<node CREATED="1493490295677" ID="ID_514416082" MODIFIED="1493490302239" TEXT="role:m"/>
|
54
93
|
</node>
|
55
|
-
<node CREATED="1493419257021" ID="ID_553734932" MODIFIED="
|
94
|
+
<node CREATED="1493419257021" FOLDED="true" ID="ID_553734932" MODIFIED="1589772585873" TEXT="new: New Note">
|
56
95
|
<node CREATED="1493419299004" ID="ID_723334321" MODIFIED="1581351169990" TEXT="new_note: New ">
|
57
96
|
<icon BUILTIN="attach"/>
|
58
97
|
<node CREATED="1493479075294" ID="ID_1009521360" MODIFIED="1493479079687" TEXT="role:m"/>
|
@@ -96,7 +135,7 @@
|
|
96
135
|
<icon BUILTIN="bookmark"/>
|
97
136
|
</node>
|
98
137
|
</node>
|
99
|
-
<node CREATED="1495246388313" ID="ID_807216843" MODIFIED="
|
138
|
+
<node CREATED="1495246388313" FOLDED="true" ID="ID_807216843" MODIFIED="1590180066630" TEXT="xedit: Future use">
|
100
139
|
<icon BUILTIN="button_cancel"/>
|
101
140
|
<node CREATED="1493419612720" ID="ID_6864095" MODIFIED="1584999031935" TEXT="edit_note: Edit">
|
102
141
|
<icon BUILTIN="attach"/>
|
@@ -107,12 +146,16 @@
|
|
107
146
|
</node>
|
108
147
|
</node>
|
109
148
|
</node>
|
110
|
-
<node CREATED="1493393619430" ID="ID_328863650" MODIFIED="
|
149
|
+
<node CREATED="1493393619430" ID="ID_328863650" MODIFIED="1589327646872" TEXT="articles: Article">
|
111
150
|
<node CREATED="1493419096527" ID="ID_1521905276" MODIFIED="1493478060121" TEXT="link: All Articles: /articles"/>
|
112
|
-
<node CREATED="1493489768542" ID="ID_1376361427" MODIFIED="
|
151
|
+
<node CREATED="1493489768542" FOLDED="true" ID="ID_1376361427" MODIFIED="1589757167952" TEXT="link: My article: /articles/my">
|
113
152
|
<node CREATED="1493490295677" ID="ID_628476988" MODIFIED="1493490302239" TEXT="role:m"/>
|
114
153
|
</node>
|
115
|
-
<node CREATED="1493419257021" ID="ID_1355420049" MODIFIED="
|
154
|
+
<node CREATED="1493419257021" ID="ID_1355420049" MODIFIED="1588619429446" TEXT="new_article: New Article">
|
155
|
+
<node CREATED="1588958814863" ID="ID_576640224" MODIFIED="1589053904119" TEXT="display: DisplayFile">
|
156
|
+
<icon BUILTIN="idea"/>
|
157
|
+
<node CREATED="1588959451085" ID="ID_779920893" MODIFIED="1588959473698" TEXT="display: Option"/>
|
158
|
+
</node>
|
116
159
|
<node CREATED="1493419299004" ID="ID_1468250197" MODIFIED="1493419428686" TEXT="form_article: New Article">
|
117
160
|
<icon BUILTIN="attach"/>
|
118
161
|
<node CREATED="1493479075294" ID="ID_1145618514" MODIFIED="1493479079687" TEXT="role:m"/>
|
@@ -121,7 +164,7 @@
|
|
121
164
|
<icon BUILTIN="bookmark"/>
|
122
165
|
</node>
|
123
166
|
</node>
|
124
|
-
<node CREATED="1493419562726" ID="ID_922854639" MODIFIED="
|
167
|
+
<node CREATED="1493419562726" ID="ID_922854639" MODIFIED="1590180584955" TEXT="edit_article: Edit Article">
|
125
168
|
<node CREATED="1493419577933" ID="ID_938626803" MODIFIED="1538329139586" TEXT="select_article: Select Article">
|
126
169
|
<icon BUILTIN="attach"/>
|
127
170
|
<node CREATED="1493479602815" ID="ID_753056881" MODIFIED="1493479606921" TEXT="role:m"/>
|
@@ -144,6 +187,36 @@
|
|
144
187
|
<icon BUILTIN="bookmark"/>
|
145
188
|
</node>
|
146
189
|
</node>
|
190
|
+
<node CREATED="1587909407412" ID="ID_1468305343" MODIFIED="1588910402612" TEXT="doc_list: Doc List">
|
191
|
+
<node CREATED="1588958814863" ID="ID_560142027" MODIFIED="1589049756609" TEXT="display: DisplayFile">
|
192
|
+
<icon BUILTIN="list"/>
|
193
|
+
<node CREATED="1588959451085" ID="ID_1584950345" MODIFIED="1588959473698" TEXT="display: Option"/>
|
194
|
+
<node CREATED="1589053886230" ID="ID_737872984" MODIFIED="1589053890706" TEXT="role: m"/>
|
195
|
+
</node>
|
196
|
+
</node>
|
197
|
+
<node CREATED="1587909407412" ID="ID_1146843472" MODIFIED="1588909113502" TEXT="doc_folder: Doc Folder">
|
198
|
+
<node CREATED="1588875666991" ID="ID_549324429" MODIFIED="1588907940839" TEXT="folder: Article Folder 1">
|
199
|
+
<arrowlink DESTINATION="ID_549324429" ENDARROW="Default" ENDINCLINATION="0;0;" ID="Arrow_ID_1094355522" STARTARROW="None" STARTINCLINATION="0;0;"/>
|
200
|
+
<linktarget COLOR="#b0b0b0" DESTINATION="ID_549324429" ENDARROW="Default" ENDINCLINATION="0;0;" ID="Arrow_ID_1094355522" SOURCE="ID_549324429" STARTARROW="None" STARTINCLINATION="0;0;"/>
|
201
|
+
<icon BUILTIN="folder"/>
|
202
|
+
</node>
|
203
|
+
<node CREATED="1588875666991" ID="ID_650279375" MODIFIED="1588907966960" TEXT="folder_article: Article Folder2"/>
|
204
|
+
</node>
|
205
|
+
<node CREATED="1495246388313" ID="ID_1073115355" MODIFIED="1589635771727" TEXT="test_article: Test Article">
|
206
|
+
<node CREATED="1589635773545" ID="ID_809041299" MODIFIED="1589655664057" TEXT="document1: display">
|
207
|
+
<icon BUILTIN="bookmark"/>
|
208
|
+
</node>
|
209
|
+
<node CREATED="1495246432533" ID="ID_1329009190" MODIFIED="1589635849441" TEXT="test article: Test Article">
|
210
|
+
<icon BUILTIN="attach"/>
|
211
|
+
<node CREATED="1495246517185" ID="ID_724933955" MODIFIED="1495246522964" TEXT="role:m"/>
|
212
|
+
</node>
|
213
|
+
<node CREATED="1495246466176" ID="ID_790539896" MODIFIED="1589755604652" TEXT="update_test: Update Test Article">
|
214
|
+
<icon BUILTIN="bookmark"/>
|
215
|
+
</node>
|
216
|
+
<node CREATED="1589635773545" ID="ID_1912048591" MODIFIED="1589740973954" TEXT="document2: display">
|
217
|
+
<icon BUILTIN="bookmark"/>
|
218
|
+
</node>
|
219
|
+
</node>
|
147
220
|
</node>
|
148
221
|
<node CREATED="1493664700564" FOLDED="true" ID="ID_704959130" MODIFIED="1583091848193" TEXT="comments: Comment">
|
149
222
|
<node CREATED="1493665155709" ID="ID_1973520751" MODIFIED="1493665186791" TEXT="new_comment: New Comment">
|
@@ -194,10 +267,6 @@
|
|
194
267
|
</node>
|
195
268
|
</node>
|
196
269
|
<node CREATED="1493419562726" ID="ID_963001770" MODIFIED="1581180788218" TEXT="edit: Edit">
|
197
|
-
<node CREATED="1493419577933" ID="ID_1640736660" MODIFIED="1581350888992" TEXT="select_note: Select">
|
198
|
-
<icon BUILTIN="attach"/>
|
199
|
-
<node CREATED="1493479602815" ID="ID_1623444138" MODIFIED="1493479606921" TEXT="role:m"/>
|
200
|
-
</node>
|
201
270
|
<node CREATED="1493419612720" ID="ID_1362613316" MODIFIED="1581350996674" TEXT="edit_note: Edit">
|
202
271
|
<icon BUILTIN="attach"/>
|
203
272
|
<node CREATED="1493479557266" ID="ID_1838104057" MODIFIED="1493479561055" TEXT="role:m"/>
|