5 def self.set_default my_manifest
6 my_manifest.each {|item_name, controller_manifest|
7 controller_manifest|['model_name'] ||= item_name
8 controller_manifest|['actions'] ||= {}
9 controller_manifest|['actions'].each {|action_name, action_manifest|
10 action_manifest['options'] ||= {}
11 action_manifest['options'].each {option_name, option_manifest|
12 raise "undefined list_name for controllers > #{item_name} > actions > #{action_name} > options\n" unless option_manifest['list_name']
20 def initialize my_item_name, action_name, conf
22 @my_item_name = conf['item_name'] if conf['item_name']
23 @action_name = action_name
27 def list params, operators
28 list_name = @controller_manifest.list_name action_name
29 @list = @manifest.list_managers[@my_item_name].open(list_name, params[:page], params[:page_size], operators)
32 def ready params, operators
33 @items = @action.items
42 @filer = @action.filer
43 render :template => 'system/filer', :locals => {
49 def cook params, operators
50 @action.ready params, operators
58 def initialize my_item_name, action_name, conf
59 @my_item_name = conf['item_name'] if conf['item_name']
60 @action_name = action_name
65 @item = Comic.show(params[:id], @operators)
81 attr :controller_manifest, :item_name, :manifest, :controller_conf,
83 @@types = {'list' => ActionList, 'show' => ActionShow}
84 def initialize controller_manifest
85 @controller_manifest = controller_manifest
86 @item_name = @controller_manifest.item_name
87 @manifest = @controller_manifest.manifest
88 @controller_conf = @controller_manifest.conf
90 @my_item_name = @controller_conf['item_name'] || @item_name
91 @controller_manifest.actions.each {|action_name, conf|
93 @actions[action_name] = @@types[type].new @my_item_name, action_name, conf