OSDN Git Service

rename model name
authoryasushiito <yas@pen-chan.jp>
Fri, 31 Oct 2014 07:19:15 +0000 (16:19 +0900)
committeryasushiito <yas@pen-chan.jp>
Fri, 31 Oct 2014 07:19:15 +0000 (16:19 +0900)
108 files changed:
app/assets/javascripts/manifest/controller.js.coffee
app/assets/javascripts/manifest/controller/action/base.js.coffee
app/assets/javascripts/manifest/manifest.js.coffee
app/assets/javascripts/manifest/model/association/has_many.js.coffee
app/assets/javascripts/pettanr.js.coffee
app/assets/javascripts/system.js.coffee
app/assets/javascripts/work/controllers.js.coffee.erb
app/assets/javascripts/work/inflectors.js.coffee.erb [new file with mode: 0644]
app/assets/javascripts/work/items.js.coffee.erb
app/assets/javascripts/work/list_groups.js.coffee.erb
app/assets/javascripts/work/models.js.coffee.erb
app/assets/javascripts/work/profilers.js.coffee.erb
app/controllers/application_controller.rb
app/controllers/artists_controller.rb
app/controllers/authors_controller.rb
app/controllers/balloons_controller.rb
app/controllers/comic_stories_controller.rb
app/controllers/comics_controller.rb
app/controllers/folders_controller.rb
app/controllers/ground_colors_controller.rb
app/controllers/ground_pictures_controller.rb
app/controllers/license_groups_controller.rb
app/controllers/licenses_controller.rb
app/controllers/original_pictures_controller.rb
app/controllers/panel_pictures_controller.rb
app/controllers/panels_controller.rb
app/controllers/pictures_controller.rb
app/controllers/resource_pictures_controller.rb
app/controllers/scroll_panels_controller.rb
app/controllers/scrolls_controller.rb
app/controllers/sheet_panels_controller.rb
app/controllers/sheets_controller.rb
app/controllers/speech_balloon_templates_controller.rb
app/controllers/speech_balloons_controller.rb
app/controllers/speeches_controller.rb
app/controllers/stories_controller.rb
app/controllers/story_sheets_controller.rb
app/controllers/system_pictures_controller.rb
app/controllers/writing_formats_controller.rb
app/models/writing_format.rb
app/views/stories/play.html.erb
app/views/system/_filer.html.erb [deleted file]
app/views/system/_jfiler.html.erb [deleted file]
app/views/system/filer.html.erb [deleted file]
app/views/templates/r/filer/icon/_default.html.erb
app/views/templates/r/form/helper/_tail_angle_helper.html.erb
app/views/templates/r/form/tag/_select.html.erb
lib/local_manifest/filer/caption/default/link/link.rb
lib/local_manifest/filer/symbol/default/link/link.rb
lib/local_manifest/form/field.rb
lib/local_manifest/form/field/label/label.rb
lib/local_manifest/list_group.rb
lib/local_manifest/list_group/list/base.rb
lib/local_manifest/list_group/list/filter.rb
lib/local_manifest/list_group/list/order.rb [deleted file]
lib/local_manifest/list_group/list/order/auto.rb [deleted file]
lib/local_manifest/list_group/list/order/base.rb [deleted file]
lib/local_manifest/list_group/list/order/method.rb [deleted file]
lib/local_manifest/list_group/list/play.rb
lib/local_manifest/profiler/association/belongs_to.rb
lib/local_manifest/profiler/association/has_many.rb
lib/local_manifest/profiler/association/has_one.rb
lib/local_manifest/profiler/list.rb
lib/locmare/booster.rb
lib/locmare/filer/body/file_body/file_item/caption/default/link/link.rb
lib/locmare/filer/body/file_body/file_item/icon/icon.rb
lib/locmare/filer/body/file_body/file_item/symbol/default/link/link.rb
lib/locmare/form.rb
lib/locmare/form/extend_field.rb
lib/locmare/form/field/label/label.rb
lib/locmare/form/field/tag/base.rb
lib/locmare/form/field/tag/select.rb
lib/locmare/list_group.rb
lib/locmare/list_group/list/base.rb
lib/locmare/list_group/list/filter.rb
lib/locmare/list_group/list/foreign_filter.rb
lib/locmare/list_group/list/private.rb
lib/locmare/list_group/list/public.rb
lib/locmare/list_group/list/system_resource.rb
lib/locmare/list_group/list/through_filter.rb
lib/locmare/profiler/association/belongs_to.rb
lib/locmare/profiler/association/has_many.rb
lib/locmare/profiler/association/has_one.rb
lib/locmare/profiler/column/extend.rb
lib/manifest/controller.rb
lib/manifest/controller/action/base.rb
lib/manifest/controller/action/count.rb
lib/manifest/controller/action/list.rb
lib/manifest/item/base.rb
lib/manifest/item/element.rb
lib/manifest/item/leaf.rb
lib/manifest/manifest.rb
lib/manifest/model.rb
lib/manifest/model/association.rb
lib/manifest/model/association/belongs_to.rb
lib/manifest/model/association/has_many.rb
lib/manifest/model/association/has_one.rb
lib/manifest/model/attribute.rb
lib/manifest/model/attribute/source/base.rb
lib/manifest/model/attribute/source/model.rb
lib/manifest/model/list.rb [deleted file]
lib/manifest/system_resource.rb
lib/peta/content.rb
lib/peta/element.rb
lib/peta/item.rb
lib/peta/leaf.rb
public/local_manifest.json
public/manifest.json

index 3b5b84e..3ed91a1 100644 (file)
@@ -4,7 +4,6 @@ class Manifest.Controller extends ManifestBase.Base
     super()\r
     @json\r
     @json.actions ||= {}\r
-    @json.item_name ||= @name\r
     \r
   init: () ->\r
     super()\r
index 8dc8be2..60096dd 100644 (file)
@@ -2,7 +2,6 @@ class Manifest.ControllerModule.ActionModule.Base extends ManifestBase.TypeNameA
   \r
   set_default: () ->\r
     super()\r
-    @args.item_name ||= @parent.item_name  # not parent.name. follow singularized name\r
     @args.param_id ||= 'prefix'\r
     \r
   init: () ->\r
index 77c1aba..c442bc6 100644 (file)
@@ -22,6 +22,9 @@ class Manifest
   @pluralize: (name) ->\r
     name.pluralize\r
   \r
+  @singularize: (name) ->\r
+    @inflectors[name]\r
+  \r
   @manifest: () ->\r
     @mani\r
   \r
index a5a9f8b..acd065f 100644 (file)
@@ -2,7 +2,6 @@ class Manifest.ModelModule.AssociationModule.HasMany extends ManifestBase.NameVa
   \r
   set_default: () ->\r
     super()\r
-    @values['model_name'] ||= Manifest.manifest().controllers[@name].item_name\r
     @values['foreign_key'] ||= @parent.model_name + '_id'\r
     \r
   init: () ->\r
@@ -14,8 +13,11 @@ class Manifest.ModelModule.AssociationModule.HasMany extends ManifestBase.NameVa
   is_through: () ->\r
     !@through\r
   \r
+  model_name: () ->\r
+    @model_name || Manifest.manifest().singularize(@name)\r
+  \r
   model: () ->\r
-    Manifest.item_name_to_model @model_name\r
+    Manifest.item_name_to_model(@model_name())\r
   \r
   association_name: () ->\r
     @parent.association_name\r
index 65a2d07..046f8da 100644 (file)
@@ -123,7 +123,7 @@ class Pettanr
       @set_model()\r
       @my_list_model = Manifest.manifest().models[@my_action.item_name]\r
       @my_list_model_class = @my_list_model.classify()\r
-      @list = Locmare.ListGroup.list(@my_action.item_name, @my_action.list_name)\r
+      @list = Locmare.ListGroup.list(@my_action.item_name, @my_action.name)\r
     \r
     set_show: () ->\r
       @set_model()\r
index 6c1396a..bcccf83 100644 (file)
@@ -1,5 +1,6 @@
 $ ->\r
   manifest =  {\r
+    inflectors: window.inflectors,\r
     items: window.items,\r
     controllers: window.controllers,\r
     models: window.models,\r
index 7754d28..862fc56 100644 (file)
@@ -1,7 +1,6 @@
 #マニフェスト\r
 @controllers = {\r
   folders: {\r
-    item_name: 'folder',\r
     actions: {\r
       root: {\r
         type: 'show',\r
@@ -9,7 +8,6 @@
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public',\r
           param_id: 'none',\r
         },\r
       },\r
@@ -22,7 +20,7 @@
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public',\r
+          action_name: 'index',\r
         },\r
       },\r
       new: {\r
     },\r
   },\r
   scrolls: {\r
-    item_name: 'scroll',\r
     actions: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public',\r
           param_id: 'none',\r
         },\r
       },\r
       play: {\r
         type: 'list',\r
         args: {\r
-          item_name: 'scroll_panel',\r
-          list_name: 'by_scroll',\r
+          alias: 'scroll_panels.by_scroll',\r
           order: 't',\r
-          direction: 'asc'\r
+          direction: 1\r
         },\r
       },\r
       show: {\r
@@ -73,7 +68,7 @@
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public',\r
+          action_name: 'index',\r
         },\r
       },\r
       count_by_author: {\r
     },\r
   },\r
   scroll_panels: {\r
-    item_name: 'scroll_panel',\r
     actions: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public',\r
           param_id: 'none',\r
         },\r
       },\r
           param_id: 'suffix',\r
         },\r
       },\r
-      play: {\r
-        type: 'list',\r
-        args: {\r
-        },\r
-      },\r
       show: {\r
         type: 'show',\r
       },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public',\r
+          action_name: 'index',\r
         },\r
       },\r
       count_by_panel: {\r
       count_by_author: {\r
         type: 'count',\r
       },\r
-      count_play: {\r
-        type: 'count',\r
-      },\r
       new: {\r
         type: 'new',\r
       },\r
     },\r
   },\r
   comics: {\r
-    item_name: 'comic',\r
     actions: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public',\r
           param_id: 'none',\r
         },\r
       },\r
       play: {\r
         type: 'list',\r
         args: {\r
-          item_name: 'comic_story',\r
-          list_name: 'play',\r
+          alias: 'comic_stories.by_comic',\r
+          order: 't',\r
+          direction: 1\r
         },\r
       },\r
       show: {\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public',\r
+          action_name: 'index',\r
         },\r
       },\r
       count_by_story: {\r
     },\r
   },\r
   comic_stories: {\r
-    item_name: 'comic_story',\r
     actions: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public',\r
           param_id: 'none',\r
         },\r
       },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public',\r
+          action_name: 'index',\r
         },\r
       },\r
       count_by_comic: {\r
     },\r
   },\r
   stories: {\r
-    item_name: 'story',\r
     actions: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public',\r
           param_id: 'none',\r
         },\r
       },\r
       play: {\r
         type: 'list',\r
         args: {\r
-          item_name: 'story_sheet',\r
-          list_name: 'play',\r
+          alias: 'story_sheets.by_story',\r
+          order: 't',\r
+          direction: 1\r
         },\r
       },\r
       show: {\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public',\r
+          action_name: 'index',\r
         },\r
       },\r
       count_by_comic: {\r
     },\r
   },\r
   story_sheets: {\r
-    item_name: 'story_sheet',\r
     actions: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public',\r
           param_id: 'none',\r
         },\r
       },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public',\r
+          action_name: 'index',\r
         },\r
       },\r
       count_by_story: {\r
     },\r
   },\r
   sheets: {\r
-    item_name: 'sheet',\r
     actions: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public',\r
           param_id: 'none',\r
         },\r
       },\r
       play: {\r
         type: 'list',\r
         args: {\r
-          item_name: 'sheet_panel',\r
-          list_name: 'play',\r
+          alias: 'sheet_panels.by_sheet',\r
+          order: 't',\r
+          direction: 1\r
         },\r
       },\r
       show: {\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public',\r
+          action_name: 'index',\r
         },\r
       },\r
       count_by_story: {\r
     },\r
   },\r
   sheet_panels: {\r
-    item_name: 'sheet_panel',\r
     actions: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public',\r
           param_id: 'none',\r
         },\r
       },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public',\r
+          action_name: 'index',\r
         },\r
       },\r
       count_by_sheet: {\r
     },\r
   },\r
   panels: {\r
-    item_name: 'panel',\r
     actions: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public',\r
           param_id: 'none',\r
         },\r
       },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public',\r
+          action_name: 'index',\r
         },\r
       },\r
       count_by_scroll: {\r
     },\r
   },\r
   panel_pictures: {\r
-    item_name: 'panel_picture',\r
     actions: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public',\r
           param_id: 'none',\r
         },\r
       },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public',\r
+          action_name: 'index',\r
         },\r
       },\r
       count_by_panel: {\r
     },\r
   },\r
   speech_balloons: {\r
-    item_name: 'speech_balloon',\r
     actions: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public',\r
           param_id: 'none',\r
         },\r
       },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public',\r
+          action_name: 'index',\r
         },\r
       },\r
       count_by_panel: {\r
     },\r
   },\r
   speeches: {\r
-    item_name: 'speech',\r
     actions: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public',\r
           param_id: 'none',\r
         },\r
       },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public',\r
+          action_name: 'index',\r
         },\r
       },\r
       count_by_author: {\r
     },\r
   },\r
   balloons: {\r
-    item_name: 'balloon',\r
     actions: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public',\r
           param_id: 'none',\r
         },\r
       },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public',\r
+          action_name: 'index',\r
         },\r
       },\r
       count_by_author: {\r
     },\r
   },\r
   ground_pictures: {\r
-    item_name: 'ground_picture',\r
     actions: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public',\r
           param_id: 'none',\r
         },\r
       },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public',\r
+          action_name: 'index',\r
         },\r
       },\r
       count_by_panel: {\r
     },\r
   },\r
   ground_colors: {\r
-    item_name: 'ground_color',\r
     actions: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public',\r
           param_id: 'none',\r
         },\r
       },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public',\r
+          action_name: 'index',\r
         },\r
       },\r
       count_by_panel: {\r
     },\r
   },\r
   original_pictures: {\r
-    item_name: 'original_picture',\r
     actions: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'private',\r
           param_id: 'none',\r
         },\r
       },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'private',\r
+          action_name: 'index',\r
         },\r
       },\r
       new: {\r
     },\r
   },\r
   pictures: {\r
-    item_name: 'picture',\r
     actions: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public',\r
           param_id: 'none',\r
         },\r
       },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public',\r
+          action_name: 'index',\r
         },\r
       },\r
       count_by_artist: {\r
     },\r
   },\r
   resource_pictures: {\r
-    item_name: 'resource_picture',\r
     actions: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public',\r
           param_id: 'none',\r
         },\r
       },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public',\r
+          action_name: 'index',\r
         },\r
       },\r
       count_by_license_group: {\r
     },\r
   },\r
   speech_balloon_templates: {\r
-    item_name: 'speech_balloon_template',\r
     actions: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public',\r
           param_id: 'none',\r
         },\r
       },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public',\r
+          action_name: 'index',\r
         },\r
       },\r
       count_by_panel: {\r
     },\r
   },\r
   writing_formats: {\r
-    item_name: 'writing_format',\r
     actions: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public',\r
           param_id: 'none',\r
         },\r
       },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public',\r
+          action_name: 'index',\r
         },\r
       },\r
       count_by_system_picture: {\r
     },\r
   },\r
   license_groups: {\r
-    item_name: 'license_group',\r
     actions: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public',\r
           param_id: 'none',\r
         },\r
       },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public',\r
+          action_name: 'index',\r
         },\r
       },\r
       new: {\r
     },\r
   },\r
   licenses: {\r
-    item_name: 'license',\r
     actions: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public',\r
           param_id: 'none',\r
         },\r
       },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public',\r
+          action_name: 'index',\r
         },\r
       },\r
       count_by_license_group: {\r
     },\r
   },\r
   authors: {\r
-    item_name: 'author',\r
     actions: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public',\r
           param_id: 'none',\r
         },\r
       },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public',\r
+          action_name: 'index',\r
         },\r
       },\r
       new: {\r
     },\r
   },\r
   artists: {\r
-    item_name: 'artist',\r
     actions: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public',\r
           param_id: 'none',\r
         },\r
       },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public',\r
+          action_name: 'index',\r
         },\r
       },\r
       new: {\r
     },\r
   },\r
   system_pictures: {\r
-    item_name: 'system_picture',\r
     actions: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public',\r
           param_id: 'none',\r
         },\r
       },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public',\r
+          action_name: 'index',\r
         },\r
       },\r
     },\r
         type: 'list',\r
         args: {\r
           item_name: 'scroll',\r
-          list_name: 'private',\r
           param_id: 'none',\r
           counter_name: 'scrolls_count',\r
         },\r
         type: 'list',\r
         args: {\r
           item_name: 'scroll_panel',\r
-          list_name: 'private',\r
           param_id: 'none',\r
           counter_name: 'scroll_panels_count',\r
         },\r
         type: 'list',\r
         args: {\r
           item_name: 'comic',\r
-          list_name: 'private',\r
           param_id: 'none',\r
           counter_name: 'comics_count',\r
         },\r
         type: 'list',\r
         args: {\r
           item_name: 'comic_story',\r
-          list_name: 'private',\r
           param_id: 'none',\r
           counter_name: 'comic_stories_count',\r
         },\r
         type: 'list',\r
         args: {\r
           item_name: 'story',\r
-          list_name: 'private',\r
           param_id: 'none',\r
           counter_name: 'stories_count',\r
         },\r
         type: 'list',\r
         args: {\r
           item_name: 'story_sheet',\r
-          list_name: 'private',\r
           param_id: 'none',\r
           counter_name: 'story_sheets_count',\r
         },\r
         type: 'list',\r
         args: {\r
           item_name: 'sheet',\r
-          list_name: 'private',\r
           param_id: 'none',\r
           counter_name: 'sheets_count',\r
         },\r
         type: 'list',\r
         args: {\r
           item_name: 'sheet_panel',\r
-          list_name: 'private',\r
           param_id: 'none',\r
           counter_name: 'sheet_panels_count',\r
         },\r
         type: 'list',\r
         args: {\r
           item_name: 'panel',\r
-          list_name: 'private',\r
           param_id: 'none',\r
           counter_name: 'panels_count',\r
         },\r
         type: 'list',\r
         args: {\r
           item_name: 'panel_picture',\r
-          list_name: 'private',\r
           param_id: 'none',\r
           counter_name: 'panel_pictures_count',\r
         },\r
         type: 'list',\r
         args: {\r
           item_name: 'speech_balloon',\r
-          list_name: 'private',\r
           param_id: 'none',\r
           counter_name: 'speech_balloons_count',\r
         },\r
         type: 'list',\r
         args: {\r
           item_name: 'speech',\r
-          list_name: 'private',\r
           param_id: 'none',\r
           counter_name: 'speeches_count',\r
         },\r
         type: 'list',\r
         args: {\r
           item_name: 'balloon',\r
-          list_name: 'private',\r
           param_id: 'none',\r
           counter_name: 'balloons_count',\r
         },\r
         type: 'list',\r
         args: {\r
           item_name: 'ground_picture',\r
-          list_name: 'private',\r
           param_id: 'none',\r
           counter_name: 'ground_pictures_count',\r
         },\r
         type: 'list',\r
         args: {\r
           item_name: 'ground_color',\r
-          list_name: 'private',\r
           param_id: 'none',\r
           counter_name: 'ground_colors_count',\r
         },\r
         type: 'list',\r
         args: {\r
           item_name: 'original_picture',\r
-          list_name: 'private',\r
           param_id: 'none',\r
           counter_name: 'count',\r
         },\r
         type: 'list',\r
         args: {\r
           item_name: 'resource_picture',\r
-          list_name: 'private',\r
           param_id: 'none',\r
           counter_name: 'resource_pictures_count',\r
         },\r
         type: 'count',\r
         args: {\r
           item_name: 'scroll',\r
-          list_name: 'private',\r
           param_id: 'none',\r
         },\r
       },\r
         type: 'count',\r
         args: {\r
           item_name: 'scroll_panel',\r
-          list_name: 'private',\r
           param_id: 'none',\r
         },\r
       },\r
         type: 'count',\r
         args: {\r
           item_name: 'comic',\r
-          list_name: 'private',\r
           param_id: 'none',\r
         },\r
       },\r
         type: 'count',\r
         args: {\r
           item_name: 'comic_story',\r
-          list_name: 'private',\r
           param_id: 'none',\r
         },\r
       },\r
diff --git a/app/assets/javascripts/work/inflectors.js.coffee.erb b/app/assets/javascripts/work/inflectors.js.coffee.erb
new file mode 100644 (file)
index 0000000..9157610
--- /dev/null
@@ -0,0 +1,32 @@
+#マニフェスト\r
+@inflectors = {\r
+  folder: 'folders',\r
+  scroll: 'scrolls',\r
+  scroll_panel: 'scroll_panels',\r
+  comic: 'comics',\r
+  comic_story: 'comic_stories',\r
+  story: 'stories',\r
+  story_sheet: 'story_sheets',\r
+  sheet: 'sheets',\r
+  sheet_panel: 'sheet_panels',\r
+  panel: 'panels',\r
+  panel_picture: 'panel_pictures',\r
+  speech_balloon: 'speech_balloons',\r
+  speech: 'speeches',\r
+  balloon: 'balloons',\r
+  ground_picture: 'ground_pictures',\r
+  ground_color: 'ground_colors',\r
+  original_picture: 'original_pictures',\r
+  picture: 'pictures',\r
+  resource_picture: 'resource_pictures',\r
+  original_picture_license_group: 'original_picture_license_groups'\r
+  original_picture_license: 'original_picture_licenses'\r
+  speech_balloon_template: 'speech_balloon_templates',\r
+  writing_format: 'writing_formats',\r
+  license_group: 'license_groups',\r
+  license: 'licenses',\r
+  author: 'authors',\r
+  artist: 'artists',\r
+  system_picture: 'system_pictures',\r
+  home: 'home',\r
+}\r
index 34ccc52..d6e911b 100644 (file)
@@ -10,8 +10,8 @@
   scroll_panel: {\r
     type: 'leaf',\r
     args: {\r
-      parent_model_name: 'scroll',\r
-      destination_model_name: 'panel',\r
+      parent_item_name: 'scroll',\r
+      destination_item_name: 'panel',\r
     },\r
   },\r
   comic: {\r
@@ -22,8 +22,8 @@
   comic_story: {\r
     type: 'leaf',\r
     args: {\r
-      parent_model_name: 'comic',\r
-      destination_model_name: 'story',\r
+      parent_item_name: 'comic',\r
+      destination_item_name: 'story',\r
     },\r
   },\r
   story: {\r
@@ -34,8 +34,8 @@
   story_sheet: {\r
     type: 'leaf',\r
     args: {\r
-      parent_model_name: 'story',\r
-      destination_model_name: 'sheet',\r
+      parent_item_name: 'story',\r
+      destination_item_name: 'sheet',\r
     },\r
   },\r
   sheet: {\r
@@ -46,7 +46,7 @@
   sheet_panel: {\r
     type: 'element',\r
     args: {\r
-      parent_model_name: 'sheet',\r
+      parent_item_name: 'sheet',\r
     },\r
   },\r
   panel: {\r
   panel_picture: {\r
     type: 'element',\r
     args: {\r
-      parent_model_name: 'panel',\r
+      parent_item_name: 'panel',\r
     },\r
   },\r
   speech_balloon: {\r
     type: 'element',\r
     args: {\r
-      parent_model_name: 'panel',\r
+      parent_item_name: 'panel',\r
       boost: {\r
         speech_balloon_template: {\r
           extend_model_class_name: 'SpeechBalloon',\r
@@ -75,7 +75,7 @@
   balloon: {\r
     type: 'element',\r
     args: {\r
-      parent_model_name: 'speech_balloon',\r
+      parent_item_name: 'speech_balloon',\r
       boost: {\r
         speech_balloon_template: {\r
           extend_model_class_name: 'Balloon',\r
@@ -87,7 +87,7 @@
   speech: {\r
     type: 'element',\r
     args: {\r
-      parent_model_name: 'speech_balloon',\r
+      parent_item_name: 'speech_balloon',\r
       boost: {\r
         writing_format: {\r
           level: 'read',\r
   ground_picture: {\r
     type: 'element',\r
     args: {\r
-      parent_model_name: 'panel',\r
+      parent_item_name: 'panel',\r
     },\r
   },\r
   ground_color: {\r
     type: 'element',\r
     args: {\r
-      parent_model_name: 'panel',\r
+      parent_item_name: 'panel',\r
     },\r
   },\r
   original_picture: {\r
   license: {\r
     type: 'system_resource',\r
     args: {\r
-      parent_model_name: 'license_group',\r
+      parent_item_name: 'license_group',\r
       boost: {\r
         license_group: {\r
           extend_model_class_name: 'License',\r
index 8684661..b72e865 100644 (file)
@@ -1,20 +1,17 @@
 #マニフェスト\r
 @list_groups = {\r
-  folder: {\r
+  folders: {\r
     lists: {\r
-      public: {\r
+      index: {\r
         type: 'public',\r
       },\r
     },\r
   },\r
-  scroll: {\r
+  scrolls: {\r
     lists: {\r
-      public: {\r
+      index: {\r
         type: 'public',\r
       },\r
-      private: {\r
-        type: 'private',\r
-      },\r
       by_author: {\r
         type: 'filter',\r
       },\r
           through: 'scroll_panels',\r
         },\r
       },\r
+      play: {\r
+        type: 'play',\r
+      },\r
     },\r
   },\r
-  scroll_panel: {\r
+  scroll_panels: {\r
     lists: {\r
-      public: {\r
+      index: {\r
         type: 'public',\r
       },\r
-      private: {\r
-        type: 'private',\r
-      },\r
-      play: {\r
-        type: 'play',\r
-        args: {\r
-          filter_item_name: 'scroll',\r
-          filter_model_name: 'scroll_panel',\r
-          filter_key: 'scroll_id',\r
-          order: {\r
-            type: 'method',\r
-          }\r
-        },\r
-      },\r
       by_scroll: {\r
         type: 'filter',\r
       },\r
       },\r
     },\r
   },\r
-  comic: {\r
+  comics: {\r
     lists: {\r
-      public: {\r
+      index: {\r
         type: 'public',\r
       },\r
-      private: {\r
-        type: 'private',\r
-      },\r
       by_author: {\r
         type: 'filter',\r
       },\r
           through: 'comic_stories',\r
         },\r
       },\r
+      play: {\r
+        type: 'play',\r
+      },\r
     },\r
   },\r
-  comic_story: {\r
+  comic_stories: {\r
     lists: {\r
-      public: {\r
+      index: {\r
         type: 'public',\r
       },\r
-      private: {\r
-        type: 'private',\r
-      },\r
-      play: {\r
-        type: 'play',\r
-        args: {\r
-          filter_item_name: 'comic',\r
-          filter_model_name: 'comic_story',\r
-          filter_key: 'comic_id',\r
-          order: {\r
-            type: 'method',\r
-          }\r
-        },\r
-      },\r
       by_comic: {\r
         type: 'filter',\r
       },\r
       },\r
     },\r
   },\r
-  story: {\r
+  stories: {\r
     lists: {\r
-      public: {\r
+      index: {\r
         type: 'public',\r
       },\r
-      private: {\r
-        type: 'private',\r
-      },\r
       by_comic: {\r
         type: 'through_filter',\r
         args: {\r
       by_author: {\r
         type: 'filter',\r
       },\r
+      play: {\r
+        type: 'play',\r
+      },\r
     },\r
   },\r
-  story_sheet: {\r
+  story_sheets: {\r
     lists: {\r
-      public: {\r
+      index: {\r
         type: 'public',\r
       },\r
-      private: {\r
-        type: 'private',\r
-      },\r
-      play: {\r
-        type: 'play',\r
-        args: {\r
-          filter_item_name: 'story',\r
-          filter_model_name: 'story_sheet',\r
-          filter_key: 'story_id',\r
-          order: {\r
-            type: 'method',\r
-          }\r
-        },\r
-      },\r
       by_story: {\r
         type: 'filter',\r
       },\r
       },\r
     },\r
   },\r
-  sheet: {\r
+  sheets: {\r
     lists: {\r
-      public: {\r
+      index: {\r
         type: 'public',\r
       },\r
-      private: {\r
-        type: 'private',\r
-      },\r
       by_story: {\r
         type: 'through_filter',\r
         args: {\r
       by_author: {\r
         type: 'filter',\r
       },\r
+      play: {\r
+        type: 'play',\r
+      },\r
     },\r
   },\r
-  sheet_panel: {\r
+  sheet_panels: {\r
     lists: {\r
-      public: {\r
+      index: {\r
         type: 'public',\r
       },\r
-      private: {\r
-        type: 'private',\r
-      },\r
-      play: {\r
-        type: 'play',\r
-        args: {\r
-          filter_item_name: 'sheet',\r
-          filter_model_name: 'sheet_panel',\r
-          filter_key: 'sheet_id',\r
-        },\r
-      },\r
       by_sheet: {\r
         type: 'filter',\r
       },\r
       },\r
     },\r
   },\r
-  panel: {\r
+  panels: {\r
     lists: {\r
-      public: {\r
+      index: {\r
         type: 'public',\r
       },\r
-      private: {\r
-        type: 'private',\r
-      },\r
       by_scroll: {\r
         type: 'through_filter',\r
         args: {\r
       },\r
     },\r
   },\r
-  panel_picture: {\r
+  panel_pictures: {\r
     lists: {\r
-      public: {\r
+      index: {\r
         type: 'public',\r
       },\r
-      private: {\r
-        type: 'private',\r
-      },\r
       by_panel: {\r
         type: 'filter',\r
       },\r
       },\r
     },\r
   },\r
-  speech_balloon: {\r
+  speech_balloons: {\r
     lists: {\r
-      public: {\r
+      index: {\r
         type: 'public',\r
       },\r
-      private: {\r
-        type: 'private',\r
-      },\r
       by_panel: {\r
         type: 'filter',\r
       },\r
       },\r
     },\r
   },\r
-  speech: {\r
+  speeches: {\r
     lists: {\r
-      public: {\r
+      index: {\r
         type: 'public',\r
       },\r
-      private: {\r
-        type: 'private',\r
-      },\r
       by_panel: {\r
         type: 'filter',\r
       },\r
       },\r
     },\r
   },\r
-  balloon: {\r
+  balloons: {\r
     lists: {\r
-      public: {\r
+      index: {\r
         type: 'public',\r
       },\r
-      private: {\r
-        type: 'private',\r
-      },\r
       by_speech_balloon: {\r
         type: 'filter',\r
       },\r
       },\r
     },\r
   },\r
-  ground_picture: {\r
+  ground_pictures: {\r
     lists: {\r
-      public: {\r
+      index: {\r
         type: 'public',\r
       },\r
-      private: {\r
-        type: 'private',\r
-      },\r
       by_panel: {\r
         type: 'filter',\r
       },\r
       },\r
     },\r
   },\r
-  ground_color: {\r
+  ground_colors: {\r
     lists: {\r
-      public: {\r
+      index: {\r
         type: 'public',\r
       },\r
-      private: {\r
-        type: 'private',\r
-      },\r
       by_panel: {\r
         type: 'filter',\r
       },\r
       },\r
     },\r
   },\r
-  original_picture: {\r
+  original_pictures: {\r
     lists: {\r
-      private: {\r
+      index: {\r
         type: 'private',\r
       },\r
     },\r
   },\r
-  picture: {\r
+  pictures: {\r
     lists: {\r
-      public: {\r
+      index: {\r
         type: 'public',\r
       },\r
       by_artist: {\r
       },\r
     },\r
   },\r
-  resource_picture: {\r
+  resource_pictures: {\r
     lists: {\r
-      public: {\r
+      index: {\r
         type: 'public',\r
       },\r
-      private: {\r
-        type: 'private',\r
-      },\r
       by_original_picture: {\r
         type: 'filter',\r
       },\r
       },\r
     },\r
   },\r
-  speech_balloon_template: {\r
+  speech_balloon_templates: {\r
     lists: {\r
-      public: {\r
+      index: {\r
         type: 'public',\r
       },\r
       by_panel: {\r
       },\r
     },\r
   },\r
-  writing_format: {\r
+  writing_formats: {\r
     lists: {\r
-      public: {\r
+      index: {\r
         type: 'public',\r
       },\r
       select_items: {\r
       },\r
     },\r
   },\r
-  license_group: {\r
+  license_groups: {\r
     lists: {\r
-      public: {\r
+      index: {\r
         type: 'public',\r
       },\r
       by_resource_picture: {\r
       },\r
     },\r
   },\r
-  license: {\r
+  licenses: {\r
     lists: {\r
-      public: {\r
+      index: {\r
         type: 'public',\r
       },\r
       by_license_group: {\r
       },\r
     },\r
   },\r
-  author: {\r
+  authors: {\r
     lists: {\r
-      public: {\r
+      index: {\r
         type: 'public',\r
       },\r
     },\r
   },\r
-  artist: {\r
+  artists: {\r
     lists: {\r
-      public: {\r
+      index: {\r
         type: 'public',\r
       },\r
     },\r
   },\r
-  system_picture: {\r
+  system_pictures: {\r
     lists: {\r
-      public: {\r
+      index: {\r
         type: 'public',\r
       },\r
     },\r
   },\r
+  home: {\r
+    lists: {\r
+      scrolls: {\r
+        type: 'private',\r
+      },\r
+      scroll_panels: {\r
+        type: 'private',\r
+      },\r
+      comics: {\r
+        type: 'private',\r
+      },\r
+      comic_stories: {\r
+        type: 'private',\r
+      },\r
+      stories: {\r
+        type: 'private',\r
+      },\r
+      story_sheets: {\r
+        type: 'private',\r
+      },\r
+      sheets: {\r
+        type: 'private',\r
+      },\r
+      sheet_panels: {\r
+        type: 'private',\r
+      },\r
+      panels: {\r
+        type: 'private',\r
+      },\r
+      panel_pictures: {\r
+        type: 'private',\r
+      },\r
+      speech_balloons: {\r
+        type: 'private',\r
+      },\r
+      speeches: {\r
+        type: 'private',\r
+      },\r
+      balloons: {\r
+        type: 'private',\r
+      },\r
+      ground_pictures: {\r
+        type: 'private',\r
+      },\r
+      ground_colors: {\r
+        type: 'private',\r
+      },\r
+      original_pictures: {\r
+        type: 'private',\r
+      },\r
+      resource_pictures: {\r
+        type: 'private',\r
+      },\r
+    },\r
+  },\r
 }\r
index 03a4112..4fc7776 100644 (file)
@@ -1,7 +1,6 @@
 #マニフェスト\r
 @models = {\r
   folder: {\r
-    table_name: 'folders',\r
     associations: {\r
       belongs_to: {\r
       },\r
@@ -66,7 +65,6 @@
     },\r
   },\r
   scroll: {\r
-    table_name: 'scrolls',\r
     associations: {\r
       belongs_to: {\r
         author: {\r
     },\r
   },\r
   scroll_panel: {\r
-    table_name: 'scroll_panels',\r
     associations: {\r
       belongs_to: {\r
         panel: {\r
     },\r
   },\r
   comic: {\r
-    table_name: 'comics',\r
     associations: {\r
       belongs_to: {\r
         author: {\r
     },\r
   },\r
   comic_story: {\r
-    table_name: 'comic_stories',\r
     associations: {\r
       belongs_to: {\r
         comic: {\r
     },\r
   },\r
   story: {\r
-    table_name: 'stories',\r
     associations: {\r
       belongs_to: {\r
         author: {\r
     },\r
   },\r
   story_sheet: {\r
-    table_name: 'story_sheets',\r
     associations: {\r
       belongs_to: {\r
         story: {\r
     },\r
   },\r
   sheet: {\r
-    table_name: 'sheets',\r
     associations: {\r
       belongs_to: {\r
         author: {\r
     },\r
   },\r
   sheet_panel: {\r
-    table_name: 'sheet_panels',\r
     associations: {\r
       belongs_to: {\r
         sheet: {\r
     },\r
   },\r
   panel: {\r
-    table_name: 'panels',\r
     associations: {\r
       belongs_to: {\r
         author: {\r
     },\r
   },\r
   panel_picture: {\r
-    table_name: 'panel_pictures',\r
     associations: {\r
       belongs_to: {\r
         panel: {\r
     },\r
   },\r
   speech_balloon: {\r
-    table_name: 'speech_balloons',\r
     associations: {\r
       belongs_to: {\r
         panel: {\r
     },\r
   }, \r
   balloon: {\r
-    table_name: 'balloons',\r
     associations: {\r
       belongs_to: {\r
         speech_balloon: {\r
     },\r
   },\r
   speech: {\r
-    table_name: 'speeches',\r
     associations: {\r
       belongs_to: {\r
         speech_balloon: {\r
     },\r
   },\r
   ground_picture: {\r
-    table_name: 'ground_pictures',\r
     associations: {\r
       belongs_to: {\r
         panel: {\r
     },\r
   },\r
   ground_color: {\r
-    table_name: 'ground_colors',\r
     associations: {\r
       belongs_to: {\r
         panel: {\r
     },\r
   },\r
   original_picture: {\r
-    table_name: 'original_pictures',\r
     associations: {\r
       belongs_to: {\r
         artist: {\r
     },\r
   },\r
   picture: {\r
-    table_name: 'pictures',\r
     associations: {\r
       belongs_to: {\r
         license: {\r
     }\r
   },\r
   resource_picture: {\r
-    table_name: 'resource_pictures',\r
     associations: {\r
       belongs_to: {\r
         original_picture: {\r
     },\r
   },\r
   original_picture_license_group: {\r
-    table_name: 'original_picture_license_groups',\r
     associations: {\r
       belongs_to: {\r
         original_picture: {\r
     },\r
   },\r
   original_picture_license: {\r
-    table_name: 'original_picture_licenses',\r
     associations: {\r
       belongs_to: {\r
         original_picture: {\r
         source: {\r
           type: 'filter',\r
           args: {\r
-            resource_list_name: 'by_license_group',\r
+            resource_action_name: 'by_license_group',\r
             filter_column_name: 'license_group_id',\r
           },\r
         },\r
     },\r
   },\r
   speech_balloon_template: {\r
-    table_name: 'speech_balloon_templates',\r
     associations: {\r
       belongs_to: {\r
         system_picture: {\r
     },\r
   },\r
   writing_format: {\r
-    table_name: 'writing_formats',\r
     associations: {\r
       belongs_to: {\r
         system_picture: {\r
     },\r
   },\r
   license_group: {\r
-    table_name: 'license_groups',\r
     associations: {\r
       belongs_to: {\r
       },\r
     },\r
   },\r
   license: {\r
-    table_name: 'licenses',\r
     associations: {\r
       belongs_to: {\r
         license_group: {\r
     },\r
   },\r
   author: {\r
-    table_name: 'authors',\r
     associations: {\r
       belongs_to: {\r
       },\r
     },\r
   },\r
   artist: {\r
-    table_name: 'artists',\r
     associations: {\r
       belongs_to: {\r
       },\r
     },\r
   },\r
   system_picture: {\r
-    table_name: 'system_pictures',\r
     associations: {\r
       belongs_to: {\r
       },\r
index 45746b6..3e7de53 100644 (file)
         'speech_balloon_template',\r
       ],\r
       has_one: [\r
-        'balloon.by_speech_balloon',\r
-        'speech.by_speech_balloon',\r
+        'balloons.by_speech_balloon',\r
+        'speeches.by_speech_balloon',\r
       ],\r
     }, \r
   },\r
         'artist',\r
       ],\r
       has_one: [\r
-        'resource_picture.by_original_picture',\r
       ],\r
     }, \r
   },\r
index bbdd2e8..a169dc1 100644 (file)
@@ -114,14 +114,12 @@ class ApplicationController < ActionController::Base
     set_model
     @my_list_model = Manifest.manifest.models[@my_action.item_name]
     @my_list_model_class = @my_list_model.classify
-    @list = Locmare::ListGroup.list @my_action.item_name, @my_action.list_name
+    @list = Locmare::ListGroup.list @my_controller.name, @my_action.name, @operators, params
   end
   
   def filer_list
     set_list
-    list_result = @list.open(@operators, 
-      {:id => params[:id], :page => params[:page], :page_size => params[:page_size]}
-    )
+    list_result = @list.open(@operators)
     @items = list_result.items 
     respond_to do |format|
       format.html {
@@ -144,17 +142,16 @@ class ApplicationController < ActionController::Base
   def set_play
     set_list
     @binder_controller = Manifest.manifest.controllers[params[:controller].to_s]
-    @binder_model = Manifest.manifest.models[@binder_controller.item_name]
+    @binder_action = @my_controller.actions[params[:action].to_s]
+    @binder_model = Manifest.manifest.models[@binder_action.item_name]
     @binder_model_class = @binder_model.classify
     @item = @binder_model_class.show(params[:id], @operators)
   end
   
   def play_list
-    @options = {:id => params[:id], :my_play => @item.own?(@operators), 
-      :offset => params[:offset], :count => params[:count], 
-      :page => params[:page], :page_size => params[:page_size]
-    }
-    list_result = @list.open(@operators, @options)
+    @options = params
+    @options[:my_play] = @item.own?(@operators)
+    list_result = @list.open(@operators)
     @items = list_result.items 
     @count = list_result.count
     @pager = list_result.paginate
@@ -396,7 +393,7 @@ class ApplicationController < ActionController::Base
   
   def list_count
     set_list
-    j = {:count => @list.count(@operators, {:id => params[:id]})}
+    j = {:count => @list.count(@operators)}
     respond_to do |format|
       format.json { render json: j.to_json }
     end
@@ -421,9 +418,9 @@ class ApplicationController < ActionController::Base
     }
   end
   
-  def assist_items item_name, list_name
-    list = Locmare::ListGroup.list item_name, list_name
-    list_result = list.open(@operators, {:id => @item.id, :page => 1, :page_size => 5})
+  def assist_items controller_name, list_name
+    list = Locmare::ListGroup.list controller_name, list_name, @operators, {:id => @item.id, :page => 1, :page_size => 5}
+    list_result = list.open(@operators)
     list_result.items
   end
   
index 917f7dc..82145f1 100644 (file)
@@ -7,10 +7,6 @@ class ArtistsController < ApplicationController
     before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
     before_filter :authenticate_artist, :only => [:edit, :update, :destroy]
   end
-
-  def self.model
-    Artist
-  end
   
   def index
     filer_list
index f45feb6..2a3e90d 100644 (file)
@@ -8,10 +8,6 @@ class AuthorsController < ApplicationController
     before_filter :authenticate_author, :only => [:edit, :update]
   end
 
-  def self.model
-    Author
-  end
-  
   def index
     filer_list
   end
index 12da158..c633cc7 100644 (file)
@@ -10,10 +10,6 @@ class BalloonsController < ApplicationController
     before_filter :authenticate_author, :only => [:new, :edit, :create, :update, :destroy]
   end
   
-  def self.model
-    Balloon
-  end
-  
   def index
     filer_list
   end
index e79195d..cbb596d 100644 (file)
@@ -9,10 +9,6 @@ class ComicStoriesController < ApplicationController
     before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
     before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
   end
-
-  def self.model
-    ComicStory
-  end
   
   def index
     filer_list
index 3ef277e..975288b 100644 (file)
@@ -9,10 +9,6 @@ class ComicsController < ApplicationController
     before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
     before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
   end
-
-  def self.model
-    Comic
-  end
   
   def index
     filer_list
@@ -28,10 +24,11 @@ class ComicsController < ApplicationController
   
   def show_html_format format
     format.html {
-      play_list = Locmare::ListGroup.list 'comic_story', 'play'
-      @play_count = play_list.count(@operators, 
+      play_list = Locmare::ListGroup.list(
+        'comic_stories', 'by_comic', @operators, 
         {:id => @item.id, :my_play => @item.own?(@operators)}
       )
+      @play_count = play_list.count(@operators)
     }
   end
   
@@ -47,18 +44,19 @@ class ComicsController < ApplicationController
   end
   
   def play
-    @item = self.class.model.show(params[:id], @operators)
     set_play
-    @items = @list.items(@operators, 
-      {:id => params[:id], :my_play => @item.own?(@operators)},
-      0, -1 # no limit
+    @list = Locmare::ListGroup.list(
+      @my_controller.name, 
+      @my_action.name, @operators, 
+      {:id => @item.id, :offset => 0, :limit => -1}# no limit
     )
-    @count = @items.count
+    @items = @list.items(@operators)
+    @count = @list.count @operators
     # no pager
     respond_to do |format|
       format.html {
         if @item.own? @operators
-          @new_story_items = assist_items('story', 'private')
+          @new_story_items = assist_items('home', 'stories')
         end
       }
       format.json { render json: @items.to_json }
index e05e3db..dbe8bf5 100644 (file)
@@ -6,10 +6,6 @@ class FoldersController < ApplicationController
     before_filter :authenticate_admin, :only => [:new, :create, :edit, :update, :destroy]
   end
   
-  def self.model
-    Folder
-  end
-  
   def root
     set_model
     @item = Folder.root
@@ -38,7 +34,7 @@ class FoldersController < ApplicationController
   
   def children_html_format format
     format.html {
-      @filer = Locmare::Filer.new self.class.model.item_name, @item.children, nil, :none, @operators
+      @filer = Locmare::Filer.new Folder.item_name, @item.children, nil, :none, @operators
       render :action => :show
     }
   end
index 168bda3..78c03b4 100644 (file)
@@ -9,10 +9,6 @@ class GroundColorsController < ApplicationController
     before_filter :authenticate_user, :only => []
     before_filter :authenticate_author, :only => []
   end
-
-  def self.model
-    GroundColor
-  end
   
   def index
     filer_list
index 7d5fb1c..05d3d5e 100644 (file)
@@ -10,10 +10,6 @@ class GroundPicturesController < ApplicationController
     before_filter :authenticate_author, :only => []
   end
   
-  def self.model
-    GroundPicture
-  end
-  
   def index
     filer_list
   end
index b6a2353..b0f64dd 100644 (file)
@@ -1,10 +1,6 @@
 class LicenseGroupsController < ApplicationController
   before_filter :authenticate_admin, :only => [:new, :create, :edit, :update, :destroy]
   
-  def self.model
-    LicenseGroup
-  end
-  
   def index
     filer_list
   end
index dc31794..f47a145 100644 (file)
@@ -3,10 +3,6 @@ class LicensesController < ApplicationController
     :by_license_group, :by_system_picture, :count_by_license_group, :count_by_system_picture
   ]
   before_filter :authenticate_admin, :only => [:new, :create, :edit, :update, :destroy]
-
-  def self.model
-    License
-  end
   
   def index
     filer_list
index 135492c..92a5ab8 100644 (file)
@@ -4,10 +4,6 @@ class OriginalPicturesController < ApplicationController
   before_filter :authenticate_user, :only => [:index, :new, :edit, :create, :update, :destroy]
   before_filter :authenticate_artist, :only => [:index, :new, :edit, :create, :update, :destroy]
   
-  def self.model
-    OriginalPicture
-  end
-  
   def index
     filer_list
   end
index 09d1f54..5c666e0 100644 (file)
@@ -10,10 +10,6 @@ class PanelPicturesController < ApplicationController
     before_filter :authenticate_author, :only => []
   end
   
-  def self.model
-    PanelPicture
-  end
-  
   def index
     filer_list
   end
index 8d4b05e..2589851 100644 (file)
@@ -10,15 +10,10 @@ class PanelsController < ApplicationController
     before_filter :authenticate_author, :only => [:new, :edit, :create, :update, :destroy, :catch]
   end
   
-  def self.model
-    Panel
-  end
   private
   def panel_list
     set_list
-    list_result = @list.open(@operators, 
-      {:id => params[:id], :page => params[:page], :page_size => params[:page_size]}
-    )
+    list_result = @list.open(@operators)
     @items = list_result.items 
     @pager = list_result.paginate
     respond_to do |format|
@@ -56,8 +51,8 @@ class PanelsController < ApplicationController
   def show_html_format format
     format.html {
       if @operators.author
-        @new_scroll_items = assist_items('scroll', 'private')
-        @fresh_scroll_items = assist_items('scroll_panel', 'private').map {|sp| sp.scroll}
+        @new_scroll_items = assist_items('home', 'scrolls')
+        @fresh_scroll_items = assist_items('home', 'scroll_panels').map {|sp| sp.scroll}
       end
     }
   end
@@ -155,7 +150,7 @@ class PanelsController < ApplicationController
   
   def update
     @item = Panel.edit(params[:id], @operators)
-    @item.boost
+    @item.boosts 'post'
     jsn = nil
     if params[:json]
       jsn = JSON.parse(params[:json])
index 0847917..497aba6 100644 (file)
@@ -9,10 +9,6 @@ class PicturesController < ApplicationController
   end
   before_filter :authenticate_admin, :only => [:index, :by_artist, :count, :count_by_artist]
   
-  def self.model
-    Picture
-  end
-  
   def index
     filer_list
   end
index a0847fe..bae6ac7 100644 (file)
@@ -9,10 +9,6 @@ class ResourcePicturesController < ApplicationController
     before_filter :authenticate_user, :only => [:new, :create, :update, :destroy]
     before_filter :authenticate_artist, :only => [:new, :create, :update, :destroy]
   end
-
-  def self.model
-    ResourcePicture
-  end
   
   def index
     filer_list
index dc94d9b..21d4d14 100644 (file)
@@ -9,10 +9,6 @@ class ScrollPanelsController < ApplicationController
     before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
     before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
   end
-
-  def self.model
-    ScrollPanel
-  end
   
   def index
     filer_list
index 6e459b7..3c88b60 100644 (file)
@@ -10,10 +10,6 @@ class ScrollsController < ApplicationController
     before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
   end
   
-  def self.model
-    Scroll
-  end
-  
   def index
     filer_list
   end
@@ -28,10 +24,11 @@ class ScrollsController < ApplicationController
   
   def show_html_format format
     format.html {
-      play_list = Locmare::ListGroup.list 'scroll_panel', 'play'
-      @play_count = play_list.count(@operators, 
+      play_list = Locmare::ListGroup.list(
+        'scroll_panels', 'by_scroll', @operators, 
         {:id => @item.id, :my_play => @item.own?(@operators)}
       )
+      @play_count = play_list.count(@operators)
     }
   end
   
@@ -50,8 +47,8 @@ class ScrollsController < ApplicationController
     respond_to do |format|
       format.html {
         if @item.own? @operators
-          @fresh_panel_items = assist_items('panel', 'public')
-          @new_panel_items = assist_items('panel', 'private')
+          @fresh_panel_items = assist_items('panels', 'index')
+          @new_panel_items = assist_items('home', 'panels')
         end
       }
       format.json { render json: @items.to_json }
index c2f1c78..703f409 100644 (file)
@@ -9,10 +9,6 @@ class SheetPanelsController < ApplicationController
     before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
     before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
   end
-
-  def self.model
-    SheetPanel
-  end
   
   def index
     filer_list
index ec3dfc9..8564d06 100644 (file)
@@ -9,10 +9,6 @@ class SheetsController < ApplicationController
     before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
     before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
   end
-
-  def self.model
-    Sheet
-  end
   
   def index
     filer_list
@@ -33,10 +29,10 @@ class SheetsController < ApplicationController
   def show_html_format format
     format.html {
       if @operators.author
-        @new_panel_items = assist_items('panel', 'private')
+        @new_panel_items = assist_items('home', 'panels')
         
-        @new_story_items = assist_items('story', 'private')
-        @fresh_story_items = assist_items('story_sheet', 'private').map {|ss| ss.story}
+        @new_story_items = assist_items('home', 'stories')
+        @fresh_story_items = assist_items('home', 'story_sheets').map {|ss| ss.story}
       end
     }
   end
@@ -53,9 +49,7 @@ class SheetsController < ApplicationController
   def play
     @item = self.class.model.show(params[:id], @operators)
     set_play
-    list_result = @list.open(@operators, 
-      {:id => params[:id]}
-    )
+    list_result = @list.open(@operators, params[:id])
     @items = list_result.items 
     respond_to do |format|
       format.html {
index 96f337d..0b2d024 100644 (file)
@@ -8,10 +8,6 @@ class SpeechBalloonTemplatesController < ApplicationController
     before_filter :authenticate_user, :only => []
   end
   before_filter :authenticate_admin, :only => [:new, :create, :edit, :update, :destroy]
-
-  def self.model
-    SpeechBalloonTemplate
-  end
   
   def index
     filer_list
index 688d8cd..1d1a523 100644 (file)
@@ -10,10 +10,6 @@ class SpeechBalloonsController < ApplicationController
     before_filter :authenticate_author, :only => []
   end
   
-  def self.model
-    SpeechBalloon
-  end
-  
   def index
     filer_list
   end
index 658f270..a0b74a0 100644 (file)
@@ -10,10 +10,6 @@ class SpeechesController < ApplicationController
     before_filter :authenticate_author, :only => [:new, :edit, :create, :update, :destroy]
   end
   before_filter :authenticate_admin!, :only => []
-
-  def self.model
-    Speech
-  end
   
   def index
     filer_list
index 976ec15..6e473f1 100644 (file)
@@ -9,10 +9,6 @@ class StoriesController < ApplicationController
     before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
     before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
   end
-
-  def self.model
-    Story
-  end
   
   def index
     filer_list
@@ -32,10 +28,11 @@ class StoriesController < ApplicationController
   
   def show_html_format format
     format.html {
-      play_list = Locmare::ListGroup.list 'story_sheet', 'play'
-      @play_count = play_list.count(@operators, 
+      play_list = Locmare::ListGroup.list(
+        'story_sheets', 'by_story', @operators, 
         {:id => @item.id, :my_play => @item.own?(@operators)}
       )
+      @play_count = play_list.count(@operators)
     }
   end
   
@@ -53,17 +50,18 @@ class StoriesController < ApplicationController
     params[:count] = nil
     params[:page] ||= 1
     params[:page_size] = 1
-    @item = self.class.model.show(params[:id], @operators)
     set_play
-    play_list
-    @sort_items = @list.items(@operators
-      {:id => params[:id], :my_play => @item.own?(@operators)},
-      0, -1 # no limit
+    @list = Locmare::ListGroup.list(
+      @my_controller.name
+      @my_action.name, @operators, 
+      {:id => @item.id, :offset => 0, :limit => -1}# no limit
     )
+    @items = @list.items(@operators)
+    @count = @list.count @operators
     respond_to do |format|
       format.html {
         if @item.own? @operators
-          @new_sheet_items = assist_items('sheet', 'private')
+          @new_sheet_items = assist_items('home', 'sheets')
         end
       }
       format.json { render json: @items.to_json }
index b3b076e..c1b74e0 100644 (file)
@@ -9,10 +9,6 @@ class StorySheetsController < ApplicationController
     before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
     before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
   end
-
-  def self.model
-    StorySheet
-  end
   
   def index
     filer_list
index ffb75de..a0175e1 100644 (file)
@@ -9,10 +9,6 @@ class SystemPicturesController < ApplicationController
   end
   before_filter :authenticate_admin!, :only => []
   
-  def self.model
-    SystemPicture
-  end
-  
   def index
     filer_list
   end
index 078566b..a6efeb6 100644 (file)
@@ -7,10 +7,6 @@ class WritingFormatsController < ApplicationController
   end
   before_filter :authenticate_admin, :only => [:new, :create, :edit, :update, :destroy]
   
-  def self.model
-    WritingFormat
-  end
-  
   def index
     filer_list
   end
index a0bbb0b..7060fb2 100644 (file)
@@ -30,10 +30,14 @@ def self.list
   self.enable_list
 end
 
-  def self.enable_list
-    WritingFormat.find(:all).delete_if {|wf|
-      wf.enable? == false
-    }
+  def self.enable_list include_available = false
+    r = WritingFormat.find(:all)
+    unless include_available
+      r.delete_if {|wf|
+        wf.enable? == false
+      }
+    end
+    r
   end
   
   def self.show_opt
index 5aedbfd..7f2af7d 100644 (file)
@@ -28,7 +28,7 @@
   <h3 id="editor"><%= t('editor') -%></h3>
   <p id="notice"><%= notice %></p>
   
-  <% @sort_items.each do |story_sheet| %>
+  <% @items.each do |story_sheet| %>
     <% if story_sheet.sheet -%>
       <div>
         <% @items.each do |ss| %>
diff --git a/app/views/system/_filer.html.erb b/app/views/system/_filer.html.erb
deleted file mode 100644 (file)
index d55070d..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-<div>
-  <%= filer.model.model_name.human %>
-</div>
-<ul class="filer">
-  <li id="" class="filer-head filer-head-<%= filer.model_name -%>">
-    <div id="" class="filer-head-symbol">
-      symbol
-    </div>
-    <% if filer.caption.visible? %>
-      <div id="" class="filer-head-caption">
-        caption
-      </div>
-    <% end %>
-    <% if filer.summary.visible? %>
-      <div id="" class="filer-head-summary">
-        summary
-      </div>
-    <% end %>
-    <div id="" class="filer-head-icon">
-      icon
-    </div>
-    <div id="" class="filer-head-date">
-      date
-    </div>
-    <% if filer.edit.visible? %>
-      <div id="" class="filer-head-edit">
-        edit
-      </div>
-    <% end %>
-  </li>
-  <% filer.file_items.each do |file_item| %>
-    <li id="" class="filer-item filer-item-<%= filer.model_name -%>">
-      <div id="" class="filer-item-symbol">
-        <%= file_item.symbol self %>
-      </div>
-      <% if filer.caption.visible? %>
-        <div id="" class="filer-item-caption">
-          <%= file_item.caption self %>
-        </div>
-      <% end %>
-      <% if filer.summary.visible? %>
-        <div id="" class="filer-item-summary">
-          <%= file_item.summary self %>
-        </div>
-      <% end %>
-      <div id="" class="filer-item-icon">
-        <%= file_item.icon self %>
-      </div>
-      <div id="" class="filer-item-date">
-        <%= file_item.date self %>
-      </div>
-      <% if filer.edit.visible? %>
-        <div id="" class="filer-item-edit">
-          <%= file_item.edit self %>
-        </div>
-      <% end %>
-    </li>
-  <% end %>
-</ul>
-<div class="row_break">
-</div>
-<% if filer.paginate %>
-  <%= paginate(filer.paginate) %>
-<% end %>
diff --git a/app/views/system/_jfiler.html.erb b/app/views/system/_jfiler.html.erb
deleted file mode 100644 (file)
index d424432..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-<script type="text/template" id="jfiler_template">
-<div>
-  <&= filer.header &>
-</div>
-<ul class="filer">
-  <li id="" class="filer-head filer-head-<&= filer.model_name() &>">
-    <div id="" class="filer-head-symbol">
-      symbol
-    </div>
-    <& if (filer.caption.visible()) { &>
-      <div id="" class="filer-head-caption">
-        caption
-      </div>
-    <& } &>
-    <& if (filer.summary.visible()) { &>
-      <div id="" class="filer-head-summary">
-        summary
-      </div>
-    <& } &>
-    <div id="" class="filer-head-icon">
-      icon
-    </div>
-    <div id="" class="filer-head-date">
-      date
-    </div>
-    <& if (filer.edit.visible()) { &>
-      <div id="" class="filer-head-edit">
-        edit
-      </div>
-    <& } &>
-  </li>
-  <& _.each(filer.file_items, function(file_item) { &>
-    <li id="" class="filer-item filer-item-<&= filer.model_name() &>">
-      <div id="" class="filer-item-symbol">
-        <&= file_item.symbol() &>
-      </div>
-      <& if (filer.caption.visible()) { &>
-        <div id="" class="filer-item-caption">
-          <&= file_item.caption() &>
-        </div>
-      <& } &>
-      <& if (filer.summary.visible()) { &>
-        <div id="" class="filer-item-summary">
-          <&= file_item.summary() &>
-        </div>
-      <& } &>
-      <div id="" class="filer-item-icon">
-        <&= file_item.icon() &>
-      </div>
-      <div id="" class="filer-item-date">
-        <&= file_item.date() &>
-      </div>
-      <& if (filer.edit.visible()) { &>
-        <div id="" class="filer-item-edit">
-          <&= file_item.edit() &>
-        </div>
-      <& } &>
-    </li>
-  <& }); &>
-</ul>
-<div class="row_break">
-</div>
-<& if (filer.paginate()) { &>
-  <&= filer.paginate &>
-<& } &>
-</script>
diff --git a/app/views/system/filer.html.erb b/app/views/system/filer.html.erb
deleted file mode 100644 (file)
index 44d2ecb..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<%= render 'system/filer', {:filer => filer} %>
index 899a1fe..51a7126 100644 (file)
@@ -1 +1 @@
-<%= link_to tag(:img, :src => item_column.icon_file_name, :width => item_column.icon_size, :height => item_column.icon_size), polymorphic_path(item_column.item, :format => :prof) %>
+<%= link_to tag(:img, :src => item_column.icon_file_name, :width => item_column.icon_size, :height => item_column.icon_size), item_column.url %>
index 7f54721..9c41be6 100644 (file)
@@ -1,4 +1,4 @@
-<span class="r-wrap" style="display: none;" <%= raw helper.field.element.tag_attr -%>>
+<span class="r-wrap" style="display: none;" <%= raw helper.field.item.tag_attr -%>>
   <button class="r-down" value="0"><</button>
   <button class="r-up" value="0">></button>
   <button class="r-reset" value="0">reset</button>
index fcec3a3..9ff0603 100644 (file)
@@ -1,4 +1,4 @@
 <%= select_tag tag.form_field_name, 
-  options_for_select(tag.source_by_model? ? tag.items : t_select_items(tag.items), :selected => tag.value.to_s), 
+  options_for_select(tag.source_by_filter? ? tag.items : t_select_items(tag.items), :selected => tag.value.to_s), 
   tag.options 
 %>
index b7d7196..c048efc 100644 (file)
@@ -32,11 +32,6 @@ module LocalManifest
               @action_name = @args['action_name']
             end
             
-            def action_path
-              a = @action_name == 'show' ? '' : @action_name + '/'
-              '/' + self.filer.item_class.path_name + '/' + a
-            end
-            
           end
           
           class NoneLink < BaseLink
index bb25f56..ed5b906 100644 (file)
@@ -32,11 +32,6 @@ module LocalManifest
               @action_name = @args['action_name']
             end
             
-            def action_path
-              a = @action_name == 'show' ? '' : @action_name + '/'
-              '/' + self.filer.item_class.path_name + '/' + a
-            end
-            
           end
           
           class NoneLink < BaseLink
index 83c59d3..bd9efa9 100644 (file)
@@ -37,7 +37,7 @@ module LocalManifest
         @name
       end
       
-      def model_name
+      def item_name
         form_name
       end
       
@@ -47,27 +47,5 @@ module LocalManifest
       
     end
     
-    class ElementField < Field
-    end
-    
-    class PartField < Field
-      attr :part_name
-      
-      def set_default
-        super
-        @values['part_name'] ||= @values['model_name']
-      end
-      
-      def init
-        super
-        @part_name = @values['part_name']
-      end
-      
-      def form_field_name
-        @model_name + '[' + @model_name + '_attributes][' + @column_name + ']'
-      end
-      
-    end
-    
   end
 end
index b260f73..61ec558 100644 (file)
@@ -23,7 +23,7 @@ module LocalManifest
             @parent.name
           end
           
-          def model_name
+          def item_name
             self.form_name
           end
           
index 22fd1ee..93f1f07 100644 (file)
@@ -5,20 +5,22 @@ module LocalManifest
   class ListGroup < ManifestBase::Base
     include ListGroupModule
     
-    attr :item_name, :lists
+    attr :lists
     
     def set_default
       super
-      @json['item_name'] ||= @name
       @json['lists'] ||= {}
     end
     
     def init
       super
-      @item_name = @json['item_name']
       @lists = ManifestBase.load_type_name_args self, @json, 'lists', ListFactory
     end
     
+    def controller_name
+      @name
+    end
+    
   end
   
 end
index 4fc88f7..d0a0c41 100644 (file)
@@ -1,52 +1,47 @@
 ManifestBase.require_modules "local_manifest/list_group/list/", 
-  %w|where includes order|
+  %w|where includes|
 
 module LocalManifest
   module ListGroupModule
     module ListModule
       class Base < ManifestBase::TypeNameArgs
-        attr :model_manifest, :model_list_manifest, :model, 
-          :where, :includes, :order
+        attr :where, :includes
         
         def set_default
           super
           @args['where'] ||= {}
           @args['includes'] ||= {}
-          @args['order'] ||= {}
         end
         
         def init
           super
           @where = ManifestBase.load_type_args self, @args, 'where', WhereFactory
           @includes = ManifestBase.load_type_args self, @args, 'includes', IncludeFactory
-          @order = ManifestBase.load_type_args self, @args, 'order', OrderFactory
-          
-          @model_manifest = ::Manifest.manifest.models[self.item_name]
-          @model_list_manifest = @model_manifest.list
-          @model = ::Manifest.item_name_to_model self.item_name
         end
         
-        def has_id?
-          @type =~ /filter/
+        def model_manifest
+          ::Manifest.manifest.models[self.item_name]
         end
         
-        # url format 
-        # true: /path/id/action 
-        # nil: /path/action/id
-        def pre_id?
-          if @name =~ /^by_/
-            false
-          else
-            true
-          end
+        def model
+          ::Manifest.item_name_to_model self.item_name
+        end
+        
+        def item_name
+          self.action_manifest.item_name
+        end
+        
+        def action_manifest
+          c = ::Manifest.manifest.controllers[self.controller_name]
+          c.actions[self.action_name]
         end
         
         def action_name
-          ''
+          @name
         end
         
-        def item_name
-          @parent.item_name
+        def controller_name
+          @parent.controller_name
         end
         
         def list_group
index fdfe55f..8b219ec 100644 (file)
@@ -16,10 +16,6 @@ module LocalManifest
           @filter_key = @args['filter_key']
         end
         
-        def action_name
-          @name
-        end
-        
       end
     end
   end
diff --git a/lib/local_manifest/list_group/list/order.rb b/lib/local_manifest/list_group/list/order.rb
deleted file mode 100644 (file)
index b006bdb..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-ManifestBase.require_modules "local_manifest/list_group/list/order/", 
-  %w|base method auto|
-
-module LocalManifest
-  module ListGroupModule
-    module ListModule
-      class OrderFactory < ManifestBase::Factory
-        include OrderModule
-        
-        def self.types
-          {
-            'method' => OrderMethod, 'auto' => OrderAuto
-          }
-        end
-        
-        def self.default_type
-          'auto'
-        end
-        
-      end
-    end
-  end
-end
diff --git a/lib/local_manifest/list_group/list/order/auto.rb b/lib/local_manifest/list_group/list/order/auto.rb
deleted file mode 100644 (file)
index 6edd54b..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-module LocalManifest
-  module ListGroupModule
-    module ListModule
-      module OrderModule
-        class OrderAuto < Base
-          def set_default
-            super
-          end
-          
-          def init
-            super
-          end
-          
-          def order
-            'list_order'
-          end
-          
-        end
-      end
-    end
-  end
-end
diff --git a/lib/local_manifest/list_group/list/order/base.rb b/lib/local_manifest/list_group/list/order/base.rb
deleted file mode 100644 (file)
index fa1a60a..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-module LocalManifest
-  module ListGroupModule
-    module ListModule
-      module OrderModule
-        class Base < ManifestBase::TypeArgs
-          
-          def set_default
-            super
-          end
-          
-          def init
-            super
-          end
-          
-          def item_name
-            @parent.item_name
-          end
-          
-          def list_name
-            @parent.name
-          end
-          
-          def model
-            @parent.model
-          end
-          
-        end
-        
-      end
-    end
-  end
-end
diff --git a/lib/local_manifest/list_group/list/order/method.rb b/lib/local_manifest/list_group/list/order/method.rb
deleted file mode 100644 (file)
index 1dba6b4..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-module LocalManifest
-  module ListGroupModule
-    module ListModule
-      module OrderModule
-        class OrderMethod < Base
-          attr :method_name
-          
-          def set_default
-            super
-            @args['method_name'] ||= @parent.name + '_list_order'
-          end
-          
-          def init
-            super
-            @method_name = @args['method_name']
-          end
-          
-          def order
-            @method_name
-          end
-          
-        end
-        
-      end
-    end
-  end
-end
index 4f6e102..bdc688b 100644 (file)
@@ -16,78 +16,6 @@ module LocalManifest
           @filter_key = @args['filter_key']
         end
         
-        def action_name
-          @name
-        end
-        
-=begin
-        def set_default
-          return
-          @default_page_size = @conf['default_page_size'] || 25
-          @max_page_size = @conf['max_page_size'] || 100
-          @params_offset = params_offset
-          @params_count = params_count
-          @list_list_conf = @manifest.list(@item_name).lists[list_name] || {}
-          @model_name = @list_list_conf['model']
-          @filter_key = @list_list_conf['filter_key']
-          @model = @model_name.classify.constantize
-          @table_name = @model.table_name
-          if @model.content?
-            @owner_model = @model.owner_model
-            @owner_table_name = @owner_model.table_name if @owner_model
-          end
-        end
-        
-        def offset cnt, prm = nil
-          offset = prm.to_i
-          offset = cnt - 1 if offset >= cnt
-          offset = cnt - offset.abs if offset < 0
-          offset = 0 if offset < 0
-          offset
-        end
-        
-        def limit prm
-          prm ||= @default_page_size
-          count = prm.to_i
-          count = @max_page_size if count > @max_page_size
-          count = @default_page_size if count < 1
-          count
-        end
-        
-        def items filter_item
-          c  = @count || self.count(filter_item)
-          o  = self.offset c, @offset
-          l  = self.limit @count
-          @model.where(self.where(filter_item)).includes(self.includes).order(self.order).offset(o).limit(l)
-        end
-        
-        def prev_offset filter_item
-          c  = @count || self.count(filter_item)
-          o  = self.offset c, @offset
-          l  = self.limit @count
-          if o > 0
-            if o - l < 0
-              0
-            else
-              o - l
-            end
-          else
-            nil
-          end
-        end
-        
-        def next_offset filter_item
-          c  = @count || self.count(filter_item)
-          o  = self.offset c, @offset
-          l  = self.limit @count
-          if o + l > c
-            nil
-          else
-            o + l
-          end
-        end
-=end
-        
       end
     end
   end
index 0e520dd..8567824 100644 (file)
@@ -2,7 +2,7 @@ module LocalManifest
   module ProfilerModule
     module AssociationModule
       class BelongsTo < ManifestBase::Names
-        attr :model_name
+        attr :item_name
         
         def set_default
           super
@@ -10,11 +10,11 @@ module LocalManifest
         
         def init
           super
-          @model_name = @name
+          @item_name = @name
         end
         
         def model
-          ::Manifest::item_name_to_model @model_name
+          ::Manifest::item_name_to_model @item_name
         end
         
         def association_name
index 2a23989..ed971a4 100644 (file)
@@ -2,7 +2,7 @@ module LocalManifest
   module ProfilerModule
     module AssociationModule
       class HasMany < ManifestBase::Names
-        attr :model_name, :list_name, :table_name
+        attr :controller_name, :item_name, :action_name
         
         def set_default
           super
@@ -11,26 +11,22 @@ module LocalManifest
         def init
           super
           if list_manifest = self.profiler.lists[@name]
-            @model_name = list_manifest.model_name
-            @list_name = list_manifest.list_name
+            @controller_name = list_manifest.controller_name
+            @action_name = list_manifest.action_name
           else
             n = @name.split '.'
             if n.size > 1
-              @table_name = n[0]
-              @model_name = @table_name.singularize
-              @list_name = n[1]
+              @controller_name = n[0]
+              @action_name = n[1]
             else
               ManifestBase::alert_undefined_message 'list', self.module_message
             end
           end
         end
         
-        def list
-          Locmare::ListGroup.list @model_name, @list_name
-        end
-        
         def model
-          ::Manifest::item_name_to_model @model_name
+          item_name = Manifest.manifest.controllers[@controller_name].actions[@action_name].item_name
+          ::Manifest::item_name_to_model item_name
         end
         
         def association_name
index f0bdf82..a9039bb 100644 (file)
@@ -2,7 +2,7 @@ module LocalManifest
   module ProfilerModule
     module AssociationModule
       class HasOne < ManifestBase::Names
-        attr :model_name, :list_name, :list
+        attr :controller_name, :item_name, :action_name
         
         def set_default
           super
@@ -11,25 +11,22 @@ module LocalManifest
         def init
           super
           if list_manifest = self.profiler.lists[@name]
-            @model_name = @parent.model_name
-            @list_name = @parent.list_name
+            @controller_name = list_manifest.controller_name
+            @action_name = list_manifest.action_name
           else
             n = @name.split '.'
             if n.size > 1
-              @model_name = n[0]
-              @list_name = n[1]
+              @controller_name = n[0]
+              @action_name = n[1]
             else
               ManifestBase::alert_undefined_message 'list', self.module_message
             end
           end
         end
         
-        def list
-          Locmare::ListGroup.list @model_name, @list_name
-        end
-        
         def model
-          ::Manifest::item_name_to_model @model_name
+          item_name = Manifest.manifest.controllers[@controller_name].actions[@action_name].item_name
+          ::Manifest::item_name_to_model item_name
         end
         
         def association_name
index 5b9c0a5..a97e0a1 100644 (file)
@@ -1,16 +1,16 @@
 module LocalManifest
   module ProfilerModule
     class List < ManifestBase::NameValues
-      attr :model_name, :list_name
+      attr :controller_name, :action_name
       
       def set_default
-        ManifestBase::alert_undefined_message "model_name", self.module_message unless @json['model_name']
-        ManifestBase::alert_undefined_message "list_name", self.module_message unless @json['list_name']
+        ManifestBase::alert_undefined_message "controller_name", self.module_message unless @json['controller_name']
+        ManifestBase::alert_undefined_message "action_name", self.module_message unless @json['action_name']
       end
       
       def init
-        @model_name = @json['model_name']
-        @list_name = @json['list_name']
+        @controller_name = @json['controller_name']
+        @action_name = @json['action_name']
       end
       
       def profiler_name
index 6dda2ab..8fef236 100644 (file)
@@ -23,7 +23,7 @@ module Locmare
       Manifest.manifest.system_resources.templates[@manifest.template_name]
     end
     
-    def model_name
+    def item_name
       self.template_path_name + '_' + @manifest.item_name_for_extend_model
     end
     
index 54dfcb4..0e75bb1 100644 (file)
@@ -23,7 +23,9 @@ module Locmare
                 class ActionLink < BaseLink
                   
                   def url
-                    @link_manifest.action_path + @item.id.to_s
+                    controller_manifest = @item.class.my_controller
+                    action_manifest = controller_manifest.actions[@link_manifest.action_name]
+                    action_manifest.url({'id' => @item.id.to_s})
                   end
                   
                 end
index e1efb8e..eceb344 100644 (file)
@@ -69,6 +69,12 @@ module Locmare
                 Manifest.manifest.magic_numbers['thumbnail_width']
               end
               
+              def url
+                controller_manifest = @item.class.my_controller
+                action_manifest = controller_manifest.actions['show']
+                action_manifest.url({'id' => @item.id.to_s, 'format' => 'prof'})
+              end
+              
             end
             
             class None < Base
index dba6389..58bc49d 100644 (file)
@@ -23,7 +23,9 @@ module Locmare
                 class ActionLink < BaseLink
                   
                   def url
-                    @link_manifest.action_path + @item.id.to_s
+                    controller_manifest = @item.class.my_controller
+                    action_manifest = controller_manifest.actions[@link_manifest.action_name]
+                    action_manifest.url({'id' => @item.id.to_s})
                   end
                 end
                 
index 041854a..c663f01 100644 (file)
@@ -80,7 +80,7 @@ module Locmare
           nil
         end
         if boost_name and extend_model # field is extend setting AND template has a extend model
-          extend_form_name = @item.boosters[boost_name].model_name
+          extend_form_name = @item.boosters[boost_name].item_name
           extend_item = @item.boosters[boost_name].extend_item
           @fields[field_name] = ExtendForm.new self, extend_form_name, extend_item, @mounted, @operators, field_name
         else
index 990b2eb..ecb9ea2 100644 (file)
@@ -14,7 +14,7 @@ module Locmare
         @field_manifest.helpers.each {|helper_name, helper_manifest|
           @helpers[helper_name] = HelperFactory.factory self, helper_manifest
         }
-        @options = {'data-model' => @field_manifest.model_name}
+        @options = {'data-model' => @field_manifest.item_name}
       end
       
       def mounted
index 3d10dd7..9265701 100644 (file)
@@ -30,8 +30,8 @@ module Locmare
             self.form.item
           end
           
-          def model_name
-            @label_manifest.model_name
+          def item_name
+            @label_manifest.item_name
           end
           
           def column_name
@@ -74,7 +74,7 @@ module Locmare
           end
           
           def label_name
-            'activerecord.attributes.' + self.model_name + '.' +  self.column_name
+            'activerecord.attributes.' + self.item_name + '.' +  self.column_name
           end
           
         end
index a83f839..c3797a4 100644 (file)
@@ -42,14 +42,6 @@ module Locmare
             self.form.item
           end
           
-          def model_name
-            @tag_manifest.model_name
-          end
-          
-          def column_name
-            @tag_manifest.column_name
-          end
-          
           def template_dir
             self.form.template_dir + 'tag/'
           end
index f3a629e..dfc0b1c 100644 (file)
@@ -8,7 +8,7 @@ module Locmare
           end
           
           def model_manifest
-            ::Manifest.manifest.models[@field.field_manifest.model_name]
+            ::Manifest.manifest.models[@field.field_manifest.item_name]
           end
           
           def model_attribute_manifest
@@ -20,13 +20,19 @@ module Locmare
           end
           
           def items
-            if self.source_by_model?
-              resource_model_name = self.model_attribute_manifest.source.resource_model_name
-              resource_list_name = self.model_attribute_manifest.source.resource_list_name
+            if self.source_by_filter?
+              resource_item_name = self.model_attribute_manifest.source.resource_item_name
+              resource_action_name = self.model_attribute_manifest.source.resource_action_name
               filter_column_name = self.model_attribute_manifest.source.filter_column_name
               filter_id = self.form.item.attributes[filter_column_name]
-              list = Locmare::ListGroup.list resource_model_name, resource_list_name
-              list.items(nil, {:id => filter_id}, 
+              resource_controller_name = ::Manifest.manifest.models[resource_item_name].classify.tables
+              list = Locmare::ListGroup.list(
+                resource_controller_name, 
+                resource_action_name, 
+                self.form.operators, 
+                {:id => filter_id}
+              )
+              list.items(nil, 
                 0, -1 # no limit
               ).map {|i| [i.caption, i.id] }
             else
@@ -34,7 +40,7 @@ module Locmare
             end
           end
           
-          def source_by_model?
+          def source_by_filter?
             case self.model_attribute_manifest.source.type
             when 'filter'
               true
index e208938..eae27aa 100644 (file)
@@ -18,10 +18,19 @@ module Locmare
       }
     end
     
-    def self.list item_name, list_name
-      list_group_manifest = LocalManifest.manifest.list_groups[item_name]
-      list_manifest = list_group_manifest.lists[list_name]
-      self.types[list_manifest.type].new item_name, list_name
+    def self.list controller_name, action_name, operators, options = {}
+      controller_manifest = Manifest.manifest.controllers[controller_name]
+      action_manifest = controller_manifest.actions[action_name]
+      if action_manifest.alias
+        options['order'] ||= action_manifest.order
+        options['direction'] ||= action_manifest.direction
+        alias_action = action_manifest.alias_action
+        ::Locmare::ListGroup.list alias_action.path_name, alias_action.name, operators, options
+      else
+        list_group_manifest = LocalManifest.manifest.list_groups[controller_name]
+        list_manifest = list_group_manifest.lists[action_name]
+        self.types[list_manifest.type].new controller_name, action_name, operators, options
+      end
     end
     
   end
index bde05f1..222ed9b 100644 (file)
@@ -4,82 +4,142 @@ module Locmare
       class ListResult
         attr :list, :items, :count, :paginate
         
-        def initialize list, items, count, paginate, operators, options
+        def initialize list, items, count, paginate, operators
           @list = list
           @items = items
           @count = count  # total count
           @paginate = paginate
           @operators = operators
-          @options = options
         end
         
         def path
-          if list_manifest.has_id?
-            filter_item_id = @options[:id]
-            if list_manifest.pre_id?
-              '/' + list_manifest.model.path_name + '/' + filter_item_id.to_s + '/' + list_manifest.action_name
-            else
-              '/' + list_manifest.model.path_name + '/' + list_manifest.action_name + '/' + filter_item_id.to_s
-            end
-          else
-            '/' + list_manifest.model.path_name + '/' + list_manifest.action_name
-          end
-        end
-        
-        def list_manifest
-          @list.list_manifest
+          @list.action_manifest.url @list.options
         end
         
       end
       
-      attr :item_name, :list_name, 
-        :model_manifest, :model_list_manifest, :list_manifest, :model, 
-        :default_page_size, :max_page_size
-      def initialize item_name, list_name
-        @item_name = item_name
+      attr :list_group_name, :list_name, :options, :item_name, 
+        :controller_manifest, :action_manifest, :list_manifest, :model,
+        :count
+      def initialize list_group_name, list_name, operators, options = {}
+        @list_group_name = list_group_name
         @list_name = list_name
-        self.init
-      end
-      
-      def init
-        @list_group_manifest = LocalManifest.manifest.list_groups[@item_name]
+        @operators = operators
+        @options = options
+        
+        @list_group_manifest = LocalManifest.manifest.list_groups[@list_group_name]
         @list_manifest = @list_group_manifest.lists[@list_name]
         @where = @list_manifest.where
         @includes = @list_manifest.includes
-        @order = @list_manifest.order
-        @model_manifest = ::Manifest.manifest.models[@item_name]
-        @model_list_manifest = @model_manifest.list
+        
+        @controller_name = @list_group_name
+        @action_name = @list_name
+        @controller_manifest = ::Manifest.manifest.controllers[@controller_name]
+        @action_manifest = @controller_manifest.actions[@action_name]
+        @item_name = @action_manifest.item_name
         @model = ::Manifest.item_name_to_model @item_name
         @table_name = @model.table_name
+        self.init
+      end
+      
+      def init
+        self.set_count
+        self.set_offset
+        self.set_limit
       end
       
       def model_name
         @model.model_name
       end
       
-      def model_manifest
-        @model.model_manifest
+      def set_offset
+        if prm = @options['offset'] || @options[:offset]
+          @offset = prm.to_i
+          @offset = @count - 1 if @offset >= @count
+          @offset = @count - @offset.abs if @offset < 0
+          @offset = 0 if @offset < 0
+          offset
+        else
+          @offset = (self.fixed_page - 1) * self.fixed_page_size
+        end
+        @offset
+      end
+      
+      def limit?
+        self.max_page_size > 0
+      end
+      
+      def unlimit?
+        !limit?
       end
       
-      def page_number prm = nil
-        page = prm.to_i
+      def fixed_page
+        page = self.opt_page.to_i
         page = 1 if page < 1
         page
       end
       
-      def page_size prm
-        page_size = prm.to_i
-        page_size = self.max_page_size if page_size > self.max_page_size
-        page_size = self.default_page_size if page_size < 1
+      def fixed_page_size
+        page_size = self.opt_page_size || self.default_page_size
+        page_size = self.max_page_size if self.limit? and page_size > self.max_page_size
         page_size
       end
       
+      def set_limit
+        prm = self.opt_page_size || self.opt_count
+        @limit = prm.to_i
+        if self.max_page_size > 0
+          @limit = self.max_page_size if @limit > self.max_page_size
+        else  # unlimited api
+          @limit = @count if @limit > @count
+        end
+        @limit = self.default_page_size if @limit < 1
+        @limit
+      end
+      
+      def opt_page
+        @options['page'] || @options[:page]
+      end
+      
+      def opt_page_size
+        @options['page_size'] || @options[:page_size]
+      end
+      
+      def opt_count
+        @options['count'] || @options[:count]
+      end
+      
       def default_page_size
-        @model_list_manifest.default_page_size
+        @action_manifest.default_page_size
       end
       
       def max_page_size
-        @model_list_manifest.max_page_size
+        @action_manifest.max_page_size
+      end
+      
+      def order
+        order = @options['order'] || @options[:order] || @action_manifest.order
+        order = 'updated_at' unless ::Manifest.manifest.models[@item_name].attributes[order]
+        @table_name + '.' + order
+      end
+      
+      def direction
+        direction = @options['direction'] || @options[:direction] || @action_manifest.direction
+        if direction < 0
+          'desc'
+        elsif direction > 0
+          'asc'
+        else
+          ''
+        end
+      end
+      
+      def filter_id
+        @options['id'] || @options[:id]
+      end
+      
+      def order_by
+        self.order + ' ' + self.direction
       end
       
       def base_where_condition
@@ -97,21 +157,27 @@ module Locmare
         @includes.includes
       end
       
-      def order
-        @model.__send__ @order.order
-      end
-      
-      def items operators, options, offset, page_size
-        @model.where(self.where_condition).includes(self.include_hash).order(self.order).offset(offset).limit(page_size)
+      def items
+        @model.where(
+          self.where_condition
+        ).includes(
+          self.include_hash
+        ).order(
+          self.order_by
+        ).offset(@offset).limit(@limit)
       end
       
-      def count operators, options
-        @model.where(self.where_condition).includes(self.include_hash).count
+      def set_count
+        @count = @model.where(
+          self.where_condition
+        ).includes(
+          self.include_hash
+        ).count
       end
       
-      def paginate count, page, page_size
+      def paginate count
         c = count ? count.to_i : 0
-        Kaminari.paginate_array(Array.new(c, nil)).page(page).per(page_size)
+        Kaminari.paginate_array(Array.new(c, nil)).page(self.fixed_page).per(self.fixed_page_size)
       end
       
       def boost_manifests
@@ -129,15 +195,15 @@ module Locmare
         end
       end
       
-      def open operators, options
-        page = self.page_number(options[:page]) 
-        page_size = self.page_size options[:page_size]
-        offset = (page -1) * page_size
-        items = self.items operators, options, offset, page_size
-        count = self.count operators, options
-        pg = self.paginate count, page, page_size
+      def open operators
+        items = self.items
+        pg = if limit?
+          self.paginate @count
+        else
+          nil
+        end
         self.boost items
-        ListResult.new self, items, count, pg, operators, options
+        ListResult.new self, items, @count, pg, @operators
       end
       
     end
index 4f98930..1e8d69c 100644 (file)
@@ -4,17 +4,17 @@ module Locmare
       attr :filter_key, :filter_item_name
       
       def init
-        super
         @filter_key = @list_manifest.filter_key
         @filter_item_name = @list_manifest.filter_item_name
         @filter_model = ::Manifest.manifest.models[@filter_item_name].classify
         @filter_table_name = @filter_model.table_name
+        super
       end
       
-      def where_condition filter_item_id
+      def where_condition
         w = self.base_where_condition
         w += ' and ' unless w.blank?
-        [w + @table_name + '.' + @filter_key + ' = ?', filter_item_id] 
+        [w + @table_name + '.' + @filter_key + ' = ?', self.filter_id] 
       end
       
       def include_hash
@@ -23,29 +23,37 @@ module Locmare
         w
       end
       
-      def visible? item_id, operators
+      def visible?
         r = nil
         begin
-          r = @filter_model.show(item_id, operators)
+          r = @filter_model.show(self.filter_id, @operators)
         rescue ActiveRecord::RecordNotFound, ActiveRecord::Forbidden
           r = false
         end
         r
       end
       
-      def items operators, options, offset, page_size
-        filter_item_id = options[:id]
-        if self.visible? filter_item_id, operators
-          @model.where(self.where_condition(filter_item_id)).includes(self.include_hash).order(self.order).offset(offset).limit(page_size)
+      def items
+        if self.visible?
+          @model.where(
+            self.where_condition
+          ).includes(
+            self.include_hash
+          ).order(
+            self.order_by
+          ).offset(@offset).limit(@limit)
         else
           []
         end
       end
       
-      def count operators, options
-        filter_item_id = options[:id]
-        if self.visible? filter_item_id, operators
-          @model.where(self.where_condition(filter_item_id)).includes(self.include_hash).count
+      def count
+        if self.visible?
+          @model.where(
+            self.where_condition
+          ).includes(
+            self.include_hash
+          ).count
         else
           0
         end
index ece86ac..5fe666a 100644 (file)
@@ -3,14 +3,14 @@ module Locmare
     class ForeignFilterList < FilterList
       
       def init
-        super
         @filter_table_name = ::Manifest.manifest.models[@filter_item_name].classify.table_name
+        super
       end
       
-      def where_condition filter_item_id
+      def where_condition
         w = self.base_where_condition
         w += ' and ' unless w.blank?
-        [w + @filter_table_name + '.id' + ' = ?', filter_item_id] 
+        [w + @filter_table_name + '.id' + ' = ?', self.filter_id] 
       end
       
       def include_hash
index 1394a17..3b05203 100644 (file)
@@ -6,7 +6,7 @@ module Locmare
         super
       end
       
-      def where_condition operators
+      def where_condition
         owner_model = if @model.element?
           @model.root_model
         else
@@ -14,20 +14,29 @@ module Locmare
         end
         case owner_model.owner_type
         when :author
-          operator = operators.author
+          operator = @operators.author
         when :artist
-          operator = operators.artist
+          operator = @operators.artist
         end
         [owner_model.table_name + '.' + owner_model.owner_type.to_s + '_id = ?', operator.id]
       end
       
-      def items operators, options, offset, page_size
-        @model.where(self.where_condition(operators)).includes(self.include_hash).order(self.order).offset(offset).limit(page_size)
+      def items
+        @model.where(
+          self.where_condition
+        ).includes(
+          self.include_hash
+        ).order(
+          self.order_by
+        ).offset(@offset).limit(@limit)
       end
       
-      def count operators, options
-        filter_item_id = options[:id]
-        @model.where(self.where_condition(operators)).includes(self.include_hash).count
+      def count
+        @model.where(
+          self.where_condition
+        ).includes(
+          self.include_hash
+        ).count
       end
       
     end
index 9259827..11f55c0 100644 (file)
@@ -6,10 +6,6 @@ module Locmare
         super
       end
       
-      def order
-        @model.list_order
-      end
-      
     end
     
   end
index 9cc0343..5f88884 100644 (file)
@@ -6,7 +6,7 @@ module Locmare
         super
       end
       
-      def items operators, options, offset, page_size
+      def items
         # enable_list does not work when configured auto load in development.rb
         # auto loader undefing MODEL at reload manifest file
         @model.enable_list
index d0317d4..16d0fc2 100644 (file)
@@ -4,18 +4,18 @@ module Locmare
       attr :through
       
       def init
-        super
         @through = @list_manifest.through
+        super
       end
       
       def include_hash
         {@through => {@filter_item_name => {}} }
       end
       
-      def where_condition filter_item_id
+      def where_condition
         w = self.base_where_condition
         w += ' and ' unless w.blank?
-        [w + @filter_table_name + '.id' + ' = ?', filter_item_id] 
+        [w + @filter_table_name + '.id' + ' = ?', self.filter_id] 
       end
       
     end
index f7d680e..a40cf36 100644 (file)
@@ -35,7 +35,7 @@ module Locmare
         end
         
         def model_belongs_to_manifest
-          self.model_manifest.associations.belongs_to[@belongs_to_manifest.model_name]
+          self.model_manifest.associations.belongs_to[@belongs_to_manifest.item_name]
         end
         
         def profiler
index 030d06d..62cfbce 100644 (file)
@@ -17,7 +17,13 @@ module Locmare
         end
         
         def filer
-          list_result = @has_many_manifest.list.open(self.profiler.operators, {:id => self.item.id, :page => 1, :page_size => 3})
+          list = ::Locmare::ListGroup.list(
+            @has_many_manifest.controller_name, 
+            @has_many_manifest.action_name, 
+            self.profiler.operators, 
+            {:id => self.item.id, :page => 1, :page_size => 3}
+          )
+          list_result = list.open(self.profiler.operators)
           items = list_result.items
           ::Locmare::Filer.new self.has_many_model.item_name, items, list_result, :more, self.profiler.operators
         end
index 326c1ec..5fb4b99 100644 (file)
@@ -17,7 +17,12 @@ module Locmare
         end
         
         def filer
-          list_result = @has_one_manifest.list.open(self.profiler.operators, {:id => self.item.id})
+          list = ::Locmare::ListGroup.list(
+            @has_one_manifest.controller_name, 
+            @has_one_manifest.action_name, 
+            {:id => self.item.id}
+          )
+          list_result = list.open(self.profiler.operators)
           items = list_result.items 
           ::Locmare::Filer.new self.has_one_model.item_name, items, nil, :none, self.profiler.operators
         end
index c86927f..1c6b155 100644 (file)
@@ -24,7 +24,7 @@ module Locmare
         end
         
         def extend_settings
-          self.template_model_profiler.extend_settings[self.booster.model_name]
+          self.template_model_profiler.extend_settings[self.booster.item_name]
         end
         
         def template_model_profiler
index 678d6d6..a2d55b0 100644 (file)
@@ -4,17 +4,15 @@ ManifestBase.require_modules "manifest/controller/",
 module Manifest
   class Controller < ManifestBase::Base
     include ControllerModule
-    attr :item_name, :actions
+    attr :actions
     
     def set_default
       super
-      @json['item_name'] ||= ::Manifest.singularize(@name)
       @json['actions'] ||= {}
     end
     
     def init
       super
-      @item_name = @json['item_name']
       @actions = ManifestBase.load_type_name_args self, @json, 'actions', ActionFactory
     end
     
index a832b22..539a245 100644 (file)
@@ -2,16 +2,69 @@ module Manifest
   module ControllerModule
     module ActionModule
       class Base < ManifestBase::TypeNameArgs
-        attr :item_name
+        attr :param_id, :item_name
         
         def set_default
           super
-          @args['item_name'] ||= self.parent.item_name  # not parent.name. follow singularized name
+          @args['item_name'] ||= ::Manifest.manifest.singularize(@parent.name)
+          @args['param_id'] ||= 'prefix'
         end
         
         def init
           super
           @item_name = @args['item_name']
+          @param_id = @args['param_id']
+        end
+        
+        def path_name
+          ::Manifest.manifest.pluralize(@item_name)
+        end
+        
+        def encode_query params
+          q = []
+          q.push('page=' + params['page'].to_s) if params['page']
+          q.push('page_size=' + params['page_size'].to_s) if params['page_size']
+          if q.length > 0
+            '?' + q.join('&')
+          else
+            ''
+          end
+        end
+        
+        def encode_url params = {}
+          controller_name = '/' + self.path_name
+          c = controller_name
+          a = if @name == 'index' or @name == 'show' or @name == 'destroy'
+            ''
+          else
+            '/' + @name
+          end
+          pf = params['format'] || params[:format]
+          # f = if params['format']   # json request? so bad. html request as get rest api
+          f = if pf == 'prof'
+            '.' + params['format'].to_s
+          else
+            ''
+          end
+          pid = params['id'] || params[:id]
+          i = if pid
+            '/' + params['id'].to_s
+          else
+            ''
+          end
+          q = self.encode_query(params)
+          case @param_id
+          when 'prefix'
+            c + i + a + f + q
+          when 'suffix'
+            c + a + i + f + q
+          else
+            c + a + f + q
+          end
+        end
+        
+        def url params
+          self.encode_url(params)
         end
         
       end
index dd7a0f2..a5968e4 100644 (file)
@@ -2,16 +2,16 @@ module Manifest
   module ControllerModule
     module ActionModule
       class ActionCount < Base
-        attr :list_name
+        attr :action_name
         
         def set_default
           super
-          @args['list_name'] ||= @name.gsub(/^count_/, '')
+          @args['action_name'] ||= @name.gsub(/^count_/, '')
         end
         
         def init
           super
-          @list_name = @args['list_name']
+          @action_name = @args['action_name']
         end
         
       end
index 4ce8f67..0475a49 100644 (file)
@@ -2,16 +2,42 @@ module Manifest
   module ControllerModule
     module ActionModule
       class ActionList < Base
-        attr :list_name
+        attr :alias, :order, :direction, :default_page_size, :max_page_size
         
         def set_default
           super
-          @args['list_name'] ||= @name
+          @args['direction'] ||= -1
+          @args['default_page_size'] ||= 25
+          @args['max_page_size'] ||= 100
         end
         
         def init
           super
-          @list_name = @args['list_name']
+          @alias = @args['alias']
+          @order = @args['order'] || 'updated_at'
+          @direction = @args['direction'].to_i
+          @default_page_size = @args['default_page_size']
+          @max_page_size = @args['max_page_size']
+          @counter_name = if @args['counter_name']
+            @args['counter_name']
+          else
+            if @name == 'index'
+              'count'
+            else
+              'count_' + @name
+            end
+          end
+        end
+        
+        def alias_action
+          s = @alias.split('.')
+          c = ::Manifest.manifest.controllers[s[0]]
+          c.actions[s[1]]
+        end
+        
+        def counter_url params
+          action_manifest = @parent.actions[@counter_name]
+          self.encode_url(params)
         end
         
       end
index d92cfd6..4ace4e2 100644 (file)
@@ -5,7 +5,7 @@ module Manifest
   module ItemModule
     class BasePeta < ManifestBase::TypeNameArgs
       
-      attr :boost ,:parent_model_name
+      attr :boost ,:parent_item_name
       
       def set_default
         super
@@ -14,12 +14,12 @@ module Manifest
       
       def init
         super
-        @parent_model_name = nil  # init at leaf, element
+        @parent_item_name = nil  # init at leaf, element
         @boost = ManifestBase.load_name_values self, @args, 'boost', Boost
       end
       
       def element?
-        @parent_model_name != nil
+        @parent_item_name != nil
       end
       
       def find_boost_name column_name
index 9a4ed72..f532db5 100644 (file)
@@ -1,16 +1,16 @@
 module Manifest
   module ItemModule
     class ElementPeta < BasePeta
-      attr :parent_model_name
+      attr :parent_item_name
       
       def set_default
         super
-        ManifestBase.alert_undefined_message 'parent_model_name', self.module_message unless @args['parent_model_name']
+        ManifestBase.alert_undefined_message 'parent_item_name', self.module_message unless @args['parent_item_name']
       end
       
       def init
         super
-        @parent_model_name = @args['parent_model_name']
+        @parent_item_name = @args['parent_item_name']
       end
       
     end
index c78e9cb..0e4723f 100644 (file)
@@ -1,17 +1,17 @@
 module Manifest
   module ItemModule
     class LeafPeta < BasePeta
-      attr :parent_model_name, :destination_model_name
+      attr :parent_item_name, :destination_item_name
       
       def set_default
         super
-        ManifestBase.alert_undefined_message 'parent_model_name', self.module_message unless @args['parent_model_name']
+        ManifestBase.alert_undefined_message 'parent_item_name', self.module_message unless @args['parent_item_name']
       end
       
       def init
         super
-        @parent_model_name = @args['parent_model_name']
-        @destination_model_name = @args['destination_model_name']
+        @parent_item_name = @args['parent_item_name']
+        @destination_item_name = @args['destination_item_name']
       end
       
     end
index 1108921..1fc9df7 100644 (file)
@@ -2,7 +2,8 @@ module Manifest
   class Manifest
     cattr_accessor :manifest
     attr :system_resources, :magic_numbers,
-      :items, :controllers, :models, :module_names
+      :items, :controllers, :models, :module_names, 
+      :inflectors, :singulars, :plurals
     # call me before load routes.rb
     # routes.rb needs engine_resources manifest in system_resources
     # ex. it's adding license_groups routes
@@ -16,6 +17,13 @@ module Manifest
     def init
       # managers can't initialize before load  application.rb
       return unless defined? ::Pettanr
+      @inflectors = @global_json['inflectors']
+      @item_names = {}
+      @table_names = {}
+      @inflectors.each do |item_name, table_name|
+        @item_names[item_name] = table_name  # monkey copy
+        @table_names[table_name] = item_name
+      end
       @items = ManifestBase.load_type_name_args(self, @global_json, 'items', ItemFactory)
       @controllers = Controller.load(self, @global_json, 'controllers')
       @models = Model.load(self, @global_json, 'models')
@@ -33,6 +41,16 @@ module Manifest
       end
     end
     
+    # table_name to item_name
+    def singularize table_name
+      @table_names[table_name]
+    end
+    
+    # item_name to table_name
+    def pluralize item_name
+      @item_names[item_name]
+    end
+    
   end
   
   module ModuleMethods
@@ -48,14 +66,6 @@ module Manifest
       item_name.classify.constantize
     end
     
-    def singularize name
-      name.singularize
-    end
-    
-    def pluralize name
-      name.pluralize
-    end
-    
   end
 
   extend ModuleMethods
index 90059f7..2606b62 100644 (file)
@@ -1,17 +1,17 @@
 ManifestBase.require_modules "manifest/model/", 
-  %w|attribute association list|
+  %w|attribute association|
 
 module Manifest
   class Model < ManifestBase::Base
     include ModelModule
     
-    attr :attributes, :associations, :list
+    attr :attributes, :associations, :table_name
     
     def set_default
       super
+      @json['table_name'] ||= ::Manifest.manifest.pluralize(@name)
       @json['attributes'] ||= {}
       @json['associations'] ||= {}
-      @json['list'] ||= {}
       @json['attributes']['id'] = {
         'type' => 'number',
         'primary_key' => 1,
@@ -29,12 +29,12 @@ module Manifest
     
     def init
       super
+      @table_name = @json['table_name']
       @attributes = ManifestBase.load_name_values self, @json, 'attributes', Attribute
       @associations = ManifestBase.load_value self, @json, 'associations', Association
-      @list = ManifestBase.load_value self, @json, 'list', List
     end
     
-    def model_name
+    def item_name
       @name
     end
     
@@ -42,10 +42,6 @@ module Manifest
       ::Manifest.item_name_to_model @name
     end
     
-    def table_name
-      self.classify.table_name
-    end
-    
     def valid_encode_columns
       r = []
       @attributes.each {|attribute_name, attribute|
@@ -61,7 +57,7 @@ module Manifest
       false
     end
     
-    def content_model
+    def content_model?
       return true if self.owner_type
       false
     end
@@ -70,7 +66,7 @@ module Manifest
       r = []
       ::Manifest.manifest.items.each {|peta_name, peta_manifest|
         next unless peta_manifest.element?
-        next unless peta_manifest.parent_model_name == @name
+        next unless peta_manifest.parent_item_name == @name
         r << ::Manifest.manifest.models[peta_name]
       }
       r
index a24cec2..36b6ae0 100644 (file)
@@ -22,17 +22,18 @@ module Manifest
         @has_one = ManifestBase.load_name_values self, @values, 'has_one', HasOne
       end
       
-      def model_name
-        @parent.name
+      def item_name
+        @parent.item_name
       end
       
       def each_parent_model
         @belongs_to.each do |name, belongs_to_manifest|
-          next unless @parent.classify.element?
-          if @parent.classify.my_peta.type == 'element'
+          pm = @parent.classify
+          next unless pm.element?
+          if pm.my_peta.type == 'element'
             next unless belongs_to_manifest.model.my_peta.type == 'root'
           end
-          if @parent.classify.my_peta.type == 'leaf'
+          if pm.my_peta.type == 'leaf'
             next unless belongs_to_manifest.model.my_peta.type == 'binder'
           end
           yield belongs_to_manifest.model
index bd96075..354cccd 100644 (file)
@@ -2,22 +2,22 @@ module Manifest
   module ModelModule
     module AssociationModule
       class BelongsTo < ManifestBase::NameValues
-        attr :id_column, :model_name
+        attr :id_column, :item_name
         
         def set_default
           super
-          @values['model_name'] ||= @name
+          @values['item_name'] ||= @name
           @values['id_column'] ||= @name + '_id' 
         end
         
         def init
           super
-          @model_name = @values['model_name']
+          @item_name = @values['item_name']
           @id_column = @values['id_column']
         end
         
         def model
-          ::Manifest.item_name_to_model @model_name
+          ::Manifest.item_name_to_model @item_name
         end
         
       end
index 8a9c7cd..3a3555a 100644 (file)
@@ -2,17 +2,17 @@ module Manifest
   module ModelModule
     module AssociationModule
       class HasMany < ManifestBase::NameValues
-        attr :model_name, :foreign_key, :through
+        attr :foreign_key, :through, :item_name
         
         def set_default
           super
-          @values['model_name'] ||= ::Manifest.singularize @name
-          @values['foreign_key'] ||= @parent.model_name + '_id'
+          @values['item_name'] ||= ::Manifest.manifest.singularize(@name)
+          @values['foreign_key'] ||= @parent.item_name + '_id'
         end
         
         def init
           super
-          @model_name = @values['model_name']
+          @item_name = @values['item_name']
           @foreign_key = @values['foreign_key']
           @through = @values['through']
         end
@@ -22,7 +22,7 @@ module Manifest
         end
         
         def model
-          ::Manifest.item_name_to_model @model_name
+          ::Manifest.item_name_to_model @item_name
         end
         
       end
index a85d39c..e85b019 100644 (file)
@@ -2,17 +2,17 @@ module Manifest
   module ModelModule
     module AssociationModule
       class HasOne < ManifestBase::NameValues
-        attr :model_name, :foreign_key
+        attr :item_name, :foreign_key
         
         def set_default
           super
-          @values['model_name'] ||= @name
-          @values['foreign_key'] ||= @parent.model_name + '_id'
+          @values['item_name'] ||= @name
+          @values['foreign_key'] ||= @parent.item_name + '_id'
         end
         
         def init
           super
-          @model_name = @values['model_name']
+          @item_name = @values['item_name']
           @foreign_key = @values['foreign_key']
         end
         
@@ -21,7 +21,7 @@ module Manifest
         end
         
         def model
-          ::Manifest.item_name_to_model @model_name
+          ::Manifest.item_name_to_model @item_name
         end
         
       end
index eaceb58..e9df9b0 100644 (file)
@@ -25,8 +25,8 @@ module Manifest
         end
       end
       
-      def model_name
-        @parent.name
+      def item_name
+        @parent.item_name
       end
       
     end
index a57bbdb..ce94a50 100644 (file)
@@ -12,8 +12,8 @@ module Manifest
             super
           end
           
-          def model_name
-            @parent.model_name
+          def item_name
+            @parent.item_name
           end
           
         end
index 36eb6aa..ea70de2 100644 (file)
@@ -3,21 +3,21 @@ module Manifest
     module AttributeModule
       module SourceModule
         class ModelSource < Base
-          attr :resource_model_name, :resource_list_name, 
+          attr :resource_item_name, :resource_action_name, 
             :select_item_name, :caption_name
           
           def set_default
             super
-            @args['resource_model_name'] ||= (@parent.name.gsub('_id', ''))
-            @args['resource_list_name'] ||= 'select_items'
-            @args['select_item_name'] ||= self.model_name + '_' + @parent.name.gsub('_id', '') + '_items'
+            @args['resource_item_name'] ||= (@parent.name.gsub('_id', ''))
+            @args['resource_action_name'] ||= 'index'
+            @args['select_item_name'] ||= self.item_name + '_' + @parent.name.gsub('_id', '') + '_items'
             @args['caption_name'] ||= 'caption'
           end
           
           def init
             super
-            @resource_model_name = @args['resource_model_name']
-            @resource_list_name = @args['resource_list_name']
+            @resource_item_name = @args['resource_item_name']
+            @resource_action_name = @args['resource_action_name']
             @select_item_name = @args['select_item_name']
             @caption_name = @args['caption_name']
           end
diff --git a/lib/manifest/model/list.rb b/lib/manifest/model/list.rb
deleted file mode 100644 (file)
index b41d921..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-module Manifest
-  module ModelModule
-    class List < ManifestBase::Values
-      attr :default_page_size, :max_page_size
-      
-      def set_default
-        super
-        @values['default_page_size'] ||= 25
-        @values['max_page_size'] ||= 100
-      end
-      
-      def init
-        super
-        @default_page_size = @values['default_page_size']
-        @max_page_size = @values['max_page_size']
-      end
-      
-    end
-    
-  end
-end
index 8d5eea2..3bde0d3 100644 (file)
@@ -35,16 +35,22 @@ module Manifest
           source_manifest = attribute_manifest.source
           next unless source_manifest
           next unless source_manifest.type == 'model'
-          resource_model_name = source_manifest.resource_model_name
-          resource_list_name = source_manifest.resource_list_name
+          resource_item_name = source_manifest.resource_item_name
+          resource_action_name = source_manifest.resource_action_name
           caption = source_manifest.caption_name
+          resource_controller_name = ::Manifest.manifest.pluralize(resource_item_name)
           begin
-            list = Locmare::ListGroup.list resource_model_name, resource_list_name
-            r = list.open nil, {}
+            list = Locmare::ListGroup.list(
+              resource_controller_name, 
+              resource_action_name, 
+              nil, 
+              {}
+            )
+            r = list.open nil
             @select_items[source_manifest.select_item_name] = 
               r.items.map {|item| [item.attributes[caption], item.id]}
           rescue
-            puts 'skip store select_items:' + resource_model_name + '.' + resource_list_name
+            puts 'skip store select_items:' + resource_item_name + '.' + resource_action_name
           end
         }
       }
index 5ded097..5ff3f9b 100644 (file)
@@ -8,7 +8,7 @@ module Peta
       super
       return nil if self._skip_load?
       # Class Methods
-      ct = self.my_manifest.content_model
+      ct = self.my_manifest.content_model?
       define_singleton_method("content?") do 
         ct
       end
index 35be5f6..cf0bd70 100644 (file)
@@ -8,11 +8,11 @@ module Peta
       super
       return nil if self._skip_load?
       # Class Methods
-      pm = Manifest.manifest.models[self.my_peta.parent_model_name].classify
+      pm = Manifest.manifest.models[self.my_peta.parent_item_name].classify
       define_singleton_method("parent_model") do 
         pm
       end
-      pfk = self.my_peta.parent_model_name + '_id'
+      pfk = self.my_peta.parent_item_name + '_id'
       define_singleton_method("parent_key") do 
         pfk
       end
@@ -38,11 +38,11 @@ module Peta
     # Instance Methods
     
     def root
-      pm = self.__send__ self.class.parent_model.item_name
-      if pm.class.element?
-        pm.root
+      pi = self.__send__ self.class.parent_model.item_name
+      if pi.class.element?
+        pi.root
       else
-        pm
+        pi
       end
     end
     
index db22a10..0dadd32 100644 (file)
@@ -37,7 +37,6 @@ module Peta
     
     # ClassMethods
     # class_name
-    # table_name
     
     before_validation :valid_encode
     
@@ -61,13 +60,20 @@ module Peta
     end
     
     def self.plural
-      self.singular.pluralize
+      table_name = Manifest.manifest.pluralize self.item_name
+      table_name.camelize
     end
     
     def self.item_name
       self.singular.underscore
     end
     
+    # self.model_name
+    # => "PanelPicture"
+    
+    # self.table_name
+    # => "panel_picture"
+    
     def self.item?
       true
     end
@@ -89,7 +95,7 @@ module Peta
     end
     
     def self.path_name with_engine = false
-      self.plural.underscore
+      self.table_name
     end
     
     def self.pickup_item_name
@@ -112,10 +118,6 @@ module Peta
       ''
     end
     
-    def self.list_order
-      self.table_name + '.updated_at desc'
-    end
-    
     def self.list_opt
       {}
     end
@@ -279,6 +281,10 @@ module Peta
       r
     end
     
+    def tag_attr column = nil, opt = {}
+      self.tag_attributes(column, opt).to_attr
+    end
+    
     def field_tag_attributes column_name, opt = {}
       self.tag_attributes(column_name, opt).merge(
         {'data-column_name' => column_name}
index 51ea19c..6d987c6 100644 (file)
@@ -8,20 +8,20 @@ module Peta
       super
       return nil if self._skip_load?
       # Class Methods
-      pm = Manifest.manifest.models[self.my_peta.parent_model_name].classify
+      pm = Manifest.manifest.models[self.my_peta.parent_item_name].classify
       define_singleton_method("parent_model") do 
         pm
       end
-      destm = Manifest.manifest.models[self.my_peta.destination_model_name].classify
+      destm = Manifest.manifest.models[self.my_peta.destination_item_name].classify
       define_singleton_method("destination_model") do 
         destm
       end
-      pfk = self.my_peta.parent_model_name + '_id'
+      pfk = self.my_peta.parent_item_name + '_id'
       define_singleton_method("binder_key") do 
         pfk
       end
-      dest_key = if self.my_peta.destination_model_name
-        self.my_peta.destination_model_name + '_id'
+      dest_key = if self.my_peta.destination_item_name
+        self.my_peta.destination_item_name + '_id'
       else
         nil
       end
index 790af74..0b410e4 100644 (file)
@@ -1,20 +1,17 @@
 {\r
   "list_groups": {\r
-    "folder": {\r
+    "folders": {\r
       "lists": {\r
-        "public": {\r
+        "index": {\r
           "type": "public"\r
         }\r
       }\r
     },\r
-    "scroll": {\r
+    "scrolls": {\r
       "lists": {\r
-        "public": {\r
+        "index": {\r
           "type": "public"\r
         },\r
-        "private": {\r
-          "type": "private"\r
-        },\r
         "by_author": {\r
           "type": "filter"\r
         },\r
           "args": {\r
             "through": "scroll_panels"\r
           }\r
+        },\r
+        "play": {\r
+          "type": "play"\r
         }\r
       }\r
     },\r
-    "scroll_panel": {\r
+    "scroll_panels": {\r
       "lists": {\r
-        "public": {\r
+        "index": {\r
           "type": "public"\r
         },\r
-        "private": {\r
-          "type": "private"\r
-        },\r
-        "play": {\r
-          "type": "play",\r
-          "args": {\r
-            "filter_item_name": "scroll",\r
-            "filter_model_name": "scroll_panel",\r
-            "filter_key": "scroll_id",\r
-            "order": {\r
-              "type": "method"\r
-            }\r
-          }\r
-        },\r
         "by_scroll": {\r
           "type": "filter"\r
         },\r
         }\r
       }\r
     },\r
-    "comic": {\r
+    "comics": {\r
       "lists": {\r
-        "public": {\r
+        "index": {\r
           "type": "public"\r
         },\r
-        "private": {\r
-          "type": "private"\r
-        },\r
         "by_author": {\r
           "type": "filter"\r
         },\r
           "args": {\r
             "through": "comic_stories"\r
           }\r
+        },\r
+        "play": {\r
+          "type": "play"\r
         }\r
       }\r
     },\r
-    "comic_story": {\r
+    "comic_stories": {\r
       "lists": {\r
-        "public": {\r
+        "index": {\r
           "type": "public"\r
         },\r
-        "private": {\r
-          "type": "private"\r
-        },\r
-        "play": {\r
-          "type": "play",\r
-          "args": {\r
-            "filter_item_name": "comic",\r
-            "filter_model_name": "comic_story",\r
-            "filter_key": "comic_id",\r
-            "order": {\r
-              "type": "method"\r
-            }\r
-          }\r
-        },\r
         "by_comic": {\r
           "type": "filter"\r
         },\r
         }\r
       }\r
     },\r
-    "story": {\r
+    "stories": {\r
       "lists": {\r
-        "public": {\r
+        "index": {\r
           "type": "public"\r
         },\r
-        "private": {\r
-          "type": "private"\r
-        },\r
         "by_comic": {\r
           "type": "through_filter",\r
           "args": {\r
         },\r
         "by_author": {\r
           "type": "filter"\r
+        },\r
+        "play": {\r
+          "type": "play"\r
         }\r
       }\r
     },\r
-    "story_sheet": {\r
+    "story_sheets": {\r
       "lists": {\r
-        "public": {\r
+        "index": {\r
           "type": "public"\r
         },\r
-        "private": {\r
-          "type": "private"\r
-        },\r
-        "play": {\r
-          "type": "play",\r
-          "args": {\r
-            "filter_item_name": "story",\r
-            "filter_model_name": "story_sheet",\r
-            "filter_key": "story_id",\r
-            "order": {\r
-              "type": "method"\r
-            }\r
-          }\r
-        },\r
         "by_story": {\r
           "type": "filter"\r
         },\r
         }\r
       }\r
     },\r
-    "sheet": {\r
+    "sheets": {\r
       "lists": {\r
-        "public": {\r
+        "index": {\r
           "type": "public"\r
         },\r
-        "private": {\r
-          "type": "private"\r
-        },\r
         "by_story": {\r
           "type": "through_filter",\r
           "args": {\r
         },\r
         "by_author": {\r
           "type": "filter"\r
+        },\r
+        "play": {\r
+          "type": "play"\r
         }\r
       }\r
     },\r
-    "sheet_panel": {\r
+    "sheet_panels": {\r
       "lists": {\r
-        "public": {\r
+        "index": {\r
           "type": "public"\r
         },\r
-        "private": {\r
-          "type": "private"\r
-        },\r
-        "play": {\r
-          "type": "play",\r
-          "args": {\r
-            "filter_item_name": "sheet",\r
-            "filter_model_name": "sheet_panel",\r
-            "filter_key": "sheet_id"\r
-          }\r
-        },\r
         "by_sheet": {\r
           "type": "filter"\r
         },\r
         }\r
       }\r
     },\r
-    "panel": {\r
+    "panels": {\r
       "lists": {\r
-        "public": {\r
+        "index": {\r
           "type": "public"\r
         },\r
-        "private": {\r
-          "type": "private"\r
-        },\r
         "by_scroll": {\r
           "type": "through_filter",\r
           "args": {\r
         }\r
       }\r
     },\r
-    "panel_picture": {\r
+    "panel_pictures": {\r
       "lists": {\r
-        "public": {\r
+        "index": {\r
           "type": "public"\r
         },\r
-        "private": {\r
-          "type": "private"\r
-        },\r
         "by_panel": {\r
           "type": "filter"\r
         },\r
         }\r
       }\r
     },\r
-    "speech_balloon": {\r
+    "speech_balloons": {\r
       "lists": {\r
-        "public": {\r
+        "index": {\r
           "type": "public"\r
         },\r
-        "private": {\r
-          "type": "private"\r
-        },\r
         "by_panel": {\r
           "type": "filter"\r
         },\r
         }\r
       }\r
     },\r
-    "speech": {\r
+    "speeches": {\r
       "lists": {\r
-        "public": {\r
+        "index": {\r
           "type": "public"\r
         },\r
-        "private": {\r
-          "type": "private"\r
-        },\r
         "by_panel": {\r
           "type": "filter"\r
         },\r
         }\r
       }\r
     },\r
-    "balloon": {\r
+    "balloons": {\r
       "lists": {\r
-        "public": {\r
+        "index": {\r
           "type": "public"\r
         },\r
-        "private": {\r
-          "type": "private"\r
-        },\r
         "by_speech_balloon": {\r
           "type": "filter"\r
         },\r
         }\r
       }\r
     },\r
-    "ground_picture": {\r
+    "ground_pictures": {\r
       "lists": {\r
-        "public": {\r
+        "index": {\r
           "type": "public"\r
         },\r
-        "private": {\r
-          "type": "private"\r
-        },\r
         "by_panel": {\r
           "type": "filter"\r
         },\r
         }\r
       }\r
     },\r
-    "ground_color": {\r
+    "ground_colors": {\r
       "lists": {\r
-        "public": {\r
+        "index": {\r
           "type": "public"\r
         },\r
-        "private": {\r
-          "type": "private"\r
-        },\r
         "by_panel": {\r
           "type": "filter"\r
         },\r
         }\r
       }\r
     },\r
-    "original_picture": {\r
+    "original_pictures": {\r
       "lists": {\r
-        "private": {\r
+        "index": {\r
           "type": "private"\r
         }\r
       }\r
     },\r
-    "picture": {\r
+    "pictures": {\r
       "lists": {\r
-        "public": {\r
+        "index": {\r
           "type": "public"\r
         },\r
         "by_artist": {\r
         }\r
       }\r
     },\r
-    "resource_picture": {\r
+    "resource_pictures": {\r
       "lists": {\r
-        "public": {\r
+        "index": {\r
           "type": "public"\r
         },\r
-        "private": {\r
-          "type": "private"\r
-        },\r
         "by_original_picture": {\r
           "type": "filter"\r
         },\r
         }\r
       }\r
     },\r
-    "speech_balloon_template": {\r
+    "speech_balloon_templates": {\r
       "lists": {\r
-        "public": {\r
+        "index": {\r
           "type": "public"\r
         },\r
         "by_panel": {\r
         }\r
       }\r
     },\r
-    "writing_format": {\r
+    "writing_formats": {\r
       "lists": {\r
-        "public": {\r
+        "index": {\r
           "type": "public"\r
         },\r
         "select_items": {\r
         }\r
       }\r
     },\r
-    "license_group": {\r
+    "license_groups": {\r
       "lists": {\r
-        "public": {\r
+        "index": {\r
           "type": "public"\r
         },\r
         "by_resource_picture": {\r
         }\r
       }\r
     },\r
-    "license": {\r
+    "licenses": {\r
       "lists": {\r
-        "public": {\r
+        "index": {\r
           "type": "public"\r
         },\r
         "by_license_group": {\r
         }\r
       }\r
     },\r
-    "author": {\r
+    "authors": {\r
       "lists": {\r
-        "public": {\r
+        "index": {\r
           "type": "public"\r
         }\r
       }\r
     },\r
-    "artist": {\r
+    "artists": {\r
       "lists": {\r
-        "public": {\r
+        "index": {\r
           "type": "public"\r
         }\r
       }\r
     },\r
-    "system_picture": {\r
+    "system_pictures": {\r
       "lists": {\r
-        "public": {\r
+        "index": {\r
           "type": "public"\r
         }\r
       }\r
+    },\r
+    "home": {\r
+      "lists": {\r
+        "scrolls": {\r
+          "type": "private"\r
+        },\r
+        "scroll_panels": {\r
+          "type": "private"\r
+        },\r
+        "comics": {\r
+          "type": "private"\r
+        },\r
+        "comic_stories": {\r
+          "type": "private"\r
+        },\r
+        "stories": {\r
+          "type": "private"\r
+        },\r
+        "story_sheets": {\r
+          "type": "private"\r
+        },\r
+        "sheets": {\r
+          "type": "private"\r
+        },\r
+        "sheet_panels": {\r
+          "type": "private"\r
+        },\r
+        "panels": {\r
+          "type": "private"\r
+        },\r
+        "panel_pictures": {\r
+          "type": "private"\r
+        },\r
+        "speech_balloons": {\r
+          "type": "private"\r
+        },\r
+        "speeches": {\r
+          "type": "private"\r
+        },\r
+        "balloons": {\r
+          "type": "private"\r
+        },\r
+        "ground_pictures": {\r
+          "type": "private"\r
+        },\r
+        "ground_colors": {\r
+          "type": "private"\r
+        },\r
+        "original_pictures": {\r
+          "type": "private"\r
+        },\r
+        "resource_pictures": {\r
+          "type": "private"\r
+        }\r
+      }\r
     }\r
   },\r
   "profilers": {\r
           "speech_balloon_template"\r
         ],\r
         "has_one": [\r
-          "balloon.by_speech_balloon",\r
-          "speech.by_speech_balloon"\r
+          "balloons.by_speech_balloon",\r
+          "speeches.by_speech_balloon"\r
         ]\r
       }\r
     },\r
         "belongs_to": [\r
           "artist"\r
         ],\r
-        "has_one": [\r
-          "resource_picture.by_original_picture"\r
-        ]\r
+        "has_one": []\r
       }\r
     },\r
     "picture": {\r
index 2aeb845..5541e1a 100644 (file)
@@ -1,4 +1,35 @@
 {\r
+  "inflectors": {\r
+    "folder": "folders",\r
+    "scroll": "scrolls",\r
+    "scroll_panel": "scroll_panels",\r
+    "comic": "comics",\r
+    "comic_story": "comic_stories",\r
+    "story": "stories",\r
+    "story_sheet": "story_sheets",\r
+    "sheet": "sheets",\r
+    "sheet_panel": "sheet_panels",\r
+    "panel": "panels",\r
+    "panel_picture": "panel_pictures",\r
+    "speech_balloon": "speech_balloons",\r
+    "speech": "speeches",\r
+    "balloon": "balloons",\r
+    "ground_picture": "ground_pictures",\r
+    "ground_color": "ground_colors",\r
+    "original_picture": "original_pictures",\r
+    "picture": "pictures",\r
+    "resource_picture": "resource_pictures",\r
+    "original_picture_license_group": "original_picture_license_groups",\r
+    "original_picture_license": "original_picture_licenses",\r
+    "speech_balloon_template": "speech_balloon_templates",\r
+    "writing_format": "writing_formats",\r
+    "license_group": "license_groups",\r
+    "license": "licenses",\r
+    "author": "authors",\r
+    "artist": "artists",\r
+    "system_picture": "system_pictures",\r
+    "home": "home"\r
+  },\r
   "items": {\r
     "folder": {},\r
     "scroll": {\r
@@ -8,8 +39,8 @@
     "scroll_panel": {\r
       "type": "leaf",\r
       "args": {\r
-        "parent_model_name": "scroll",\r
-        "destination_model_name": "panel"\r
+        "parent_item_name": "scroll",\r
+        "destination_item_name": "panel"\r
       }\r
     },\r
     "comic": {\r
@@ -19,8 +50,8 @@
     "comic_story": {\r
       "type": "leaf",\r
       "args": {\r
-        "parent_model_name": "comic",\r
-        "destination_model_name": "story"\r
+        "parent_item_name": "comic",\r
+        "destination_item_name": "story"\r
       }\r
     },\r
     "story": {\r
@@ -30,8 +61,8 @@
     "story_sheet": {\r
       "type": "leaf",\r
       "args": {\r
-        "parent_model_name": "story",\r
-        "destination_model_name": "sheet"\r
+        "parent_item_name": "story",\r
+        "destination_item_name": "sheet"\r
       }\r
     },\r
     "sheet": {\r
@@ -41,7 +72,7 @@
     "sheet_panel": {\r
       "type": "element",\r
       "args": {\r
-        "parent_model_name": "sheet"\r
+        "parent_item_name": "sheet"\r
       }\r
     },\r
     "panel": {\r
     "panel_picture": {\r
       "type": "element",\r
       "args": {\r
-        "parent_model_name": "panel"\r
+        "parent_item_name": "panel"\r
       }\r
     },\r
     "speech_balloon": {\r
       "type": "element",\r
       "args": {\r
-        "parent_model_name": "panel",\r
+        "parent_item_name": "panel",\r
         "boost": {\r
           "speech_balloon_template": {\r
             "extend_model_class_name": "SpeechBalloon",\r
     "balloon": {\r
       "type": "element",\r
       "args": {\r
-        "parent_model_name": "speech_balloon",\r
+        "parent_item_name": "speech_balloon",\r
         "boost": {\r
           "speech_balloon_template": {\r
             "extend_model_class_name": "Balloon",\r
     "speech": {\r
       "type": "element",\r
       "args": {\r
-        "parent_model_name": "speech_balloon",\r
+        "parent_item_name": "speech_balloon",\r
         "boost": {\r
           "writing_format": {\r
             "level": "read",\r
     "ground_picture": {\r
       "type": "element",\r
       "args": {\r
-        "parent_model_name": "panel"\r
+        "parent_item_name": "panel"\r
       }\r
     },\r
     "ground_color": {\r
       "type": "element",\r
       "args": {\r
-        "parent_model_name": "panel"\r
+        "parent_item_name": "panel"\r
       }\r
     },\r
     "original_picture": {\r
     "license": {\r
       "type": "system_resource",\r
       "args": {\r
-        "parent_model_name": "license_group",\r
+        "parent_item_name": "license_group",\r
         "boost": {\r
           "license_group": {\r
             "extend_model_class_name": "License",\r
   },\r
   "controllers": {\r
     "folders": {\r
-      "item_name": "folder",\r
       "actions": {\r
         "root": {\r
           "type": "show"\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public",\r
             "param_id": "none"\r
           }\r
         },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public"\r
+            "action_name": "index"\r
           }\r
         },\r
         "new": {\r
       }\r
     },\r
     "scrolls": {\r
-      "item_name": "scroll",\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public",\r
             "param_id": "none"\r
           }\r
         },\r
         "play": {\r
           "type": "list",\r
           "args": {\r
-            "item_name": "scroll_panel",\r
-            "list_name": "play"\r
+            "alias": "scroll_panels.by_scroll",\r
+            "order": "t",\r
+            "direction": 1\r
           }\r
         },\r
         "show": {\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public"\r
+            "action_name": "index"\r
           }\r
         },\r
         "count_by_author": {\r
         "count_by_panel": {\r
           "type": "count"\r
         },\r
-        "count_play": {\r
-          "type": "count"\r
-        },\r
         "new": {\r
           "type": "new"\r
         },\r
       }\r
     },\r
     "scroll_panels": {\r
-      "item_name": "scroll_panel",\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public",\r
             "param_id": "none"\r
           }\r
         },\r
             "param_id": "suffix"\r
           }\r
         },\r
-        "play": {\r
-          "type": "list",\r
-          "args": {\r
-          }\r
-        },\r
         "show": {\r
           "type": "show"\r
         },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public"\r
+            "action_name": "index"\r
           }\r
         },\r
         "count_by_panel": {\r
         "count_by_author": {\r
           "type": "count"\r
         },\r
-        "count_play": {\r
-          "type": "count"\r
-        },\r
         "new": {\r
           "type": "new"\r
         },\r
       }\r
     },\r
     "comics": {\r
-      "item_name": "comic",\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public",\r
             "param_id": "none"\r
           }\r
         },\r
         "play": {\r
           "type": "list",\r
           "args": {\r
-            "item_name": "comic_story",\r
-            "list_name": "play"\r
+            "alias": "comic_stories.by_comic",\r
+            "order": "t",\r
+            "direction": 1\r
           }\r
         },\r
         "show": {\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public"\r
+            "action_name": "index"\r
           }\r
         },\r
         "count_by_story": {\r
       }\r
     },\r
     "comic_stories": {\r
-      "item_name": "comic_story",\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public",\r
             "param_id": "none"\r
           }\r
         },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public"\r
+            "action_name": "index"\r
           }\r
         },\r
         "count_by_comic": {\r
       }\r
     },\r
     "stories": {\r
-      "item_name": "story",\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public",\r
             "param_id": "none"\r
           }\r
         },\r
         "play": {\r
           "type": "list",\r
           "args": {\r
-            "item_name": "story_sheet",\r
-            "list_name": "play"\r
+            "alias": "story_sheets.by_story",\r
+            "order": "t",\r
+            "direction": 1\r
           }\r
         },\r
         "show": {\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public"\r
+            "action_name": "index"\r
           }\r
         },\r
         "count_by_comic": {\r
       }\r
     },\r
     "story_sheets": {\r
-      "item_name": "story_sheet",\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public",\r
             "param_id": "none"\r
           }\r
         },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public"\r
+            "action_name": "index"\r
           }\r
         },\r
         "count_by_story": {\r
       }\r
     },\r
     "sheets": {\r
-      "item_name": "sheet",\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public",\r
             "param_id": "none"\r
           }\r
         },\r
         "play": {\r
           "type": "list",\r
           "args": {\r
-            "item_name": "sheet_panel",\r
-            "list_name": "play"\r
+            "alias": "sheet_panels.by_sheet",\r
+            "order": "t",\r
+            "direction": 1\r
           }\r
         },\r
         "show": {\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public"\r
+            "action_name": "index"\r
           }\r
         },\r
         "count_by_story": {\r
       }\r
     },\r
     "sheet_panels": {\r
-      "item_name": "sheet_panel",\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public",\r
             "param_id": "none"\r
           }\r
         },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public"\r
+            "action_name": "index"\r
           }\r
         },\r
         "count_by_sheet": {\r
       }\r
     },\r
     "panels": {\r
-      "item_name": "panel",\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public",\r
             "param_id": "none"\r
           }\r
         },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public"\r
+            "action_name": "index"\r
           }\r
         },\r
         "count_by_scroll": {\r
       }\r
     },\r
     "panel_pictures": {\r
-      "item_name": "panel_picture",\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public",\r
             "param_id": "none"\r
           }\r
         },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public"\r
+            "action_name": "index"\r
           }\r
         },\r
         "count_by_panel": {\r
       }\r
     },\r
     "speech_balloons": {\r
-      "item_name": "speech_balloon",\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public",\r
             "param_id": "none"\r
           }\r
         },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public"\r
+            "action_name": "index"\r
           }\r
         },\r
         "count_by_panel": {\r
       }\r
     },\r
     "speeches": {\r
-      "item_name": "speech",\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public",\r
             "param_id": "none"\r
           }\r
         },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public"\r
+            "action_name": "index"\r
           }\r
         },\r
         "count_by_author": {\r
       }\r
     },\r
     "balloons": {\r
-      "item_name": "balloon",\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public",\r
             "param_id": "none"\r
           }\r
         },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public"\r
+            "action_name": "index"\r
           }\r
         },\r
         "count_by_author": {\r
       }\r
     },\r
     "ground_pictures": {\r
-      "item_name": "ground_picture",\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public",\r
             "param_id": "none"\r
           }\r
         },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public"\r
+            "action_name": "index"\r
           }\r
         },\r
         "count_by_panel": {\r
       }\r
     },\r
     "ground_colors": {\r
-      "item_name": "ground_color",\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public",\r
             "param_id": "none"\r
           }\r
         },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public"\r
+            "action_name": "index"\r
           }\r
         },\r
         "count_by_panel": {\r
       }\r
     },\r
     "original_pictures": {\r
-      "item_name": "original_picture",\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "private",\r
             "param_id": "none"\r
           }\r
         },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "private"\r
+            "action_name": "index"\r
           }\r
         },\r
         "new": {\r
       }\r
     },\r
     "pictures": {\r
-      "item_name": "picture",\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public",\r
             "param_id": "none"\r
           }\r
         },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public"\r
+            "action_name": "index"\r
           }\r
         },\r
         "count_by_artist": {\r
       }\r
     },\r
     "resource_pictures": {\r
-      "item_name": "resource_picture",\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public",\r
             "param_id": "none"\r
           }\r
         },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public"\r
+            "action_name": "index"\r
           }\r
         },\r
         "count_by_license_group": {\r
       }\r
     },\r
     "speech_balloon_templates": {\r
-      "item_name": "speech_balloon_template",\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public",\r
             "param_id": "none"\r
           }\r
         },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public"\r
+            "action_name": "index"\r
           }\r
         },\r
         "count_by_panel": {\r
       }\r
     },\r
     "writing_formats": {\r
-      "item_name": "writing_format",\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public",\r
             "param_id": "none"\r
           }\r
         },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public"\r
+            "action_name": "index"\r
           }\r
         },\r
         "count_by_system_picture": {\r
       }\r
     },\r
     "license_groups": {\r
-      "item_name": "license_group",\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public",\r
             "param_id": "none"\r
           }\r
         },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public"\r
+            "action_name": "index"\r
           }\r
         },\r
         "new": {\r
       }\r
     },\r
     "licenses": {\r
-      "item_name": "license",\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public",\r
             "param_id": "none"\r
           }\r
         },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public"\r
+            "action_name": "index"\r
           }\r
         },\r
         "count_by_license_group": {\r
       }\r
     },\r
     "authors": {\r
-      "item_name": "author",\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public",\r
             "param_id": "none"\r
           }\r
         },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public"\r
+            "action_name": "index"\r
           }\r
         },\r
         "new": {\r
       }\r
     },\r
     "artists": {\r
-      "item_name": "artist",\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public",\r
             "param_id": "none"\r
           }\r
         },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public"\r
+            "action_name": "index"\r
           }\r
         },\r
         "new": {\r
       }\r
     },\r
     "system_pictures": {\r
-      "item_name": "system_picture",\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public",\r
             "param_id": "none"\r
           }\r
         },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public"\r
+            "action_name": "index"\r
           }\r
         }\r
       }\r
           "type": "list",\r
           "args": {\r
             "item_name": "scroll",\r
-            "list_name": "private",\r
             "param_id": "none",\r
             "counter_name": "scrolls_count"\r
           }\r
           "type": "list",\r
           "args": {\r
             "item_name": "scroll_panel",\r
-            "list_name": "private",\r
             "param_id": "none",\r
             "counter_name": "scroll_panels_count"\r
           }\r
           "type": "list",\r
           "args": {\r
             "item_name": "comic",\r
-            "list_name": "private",\r
             "param_id": "none",\r
             "counter_name": "comics_count"\r
           }\r
           "type": "list",\r
           "args": {\r
             "item_name": "comic_story",\r
-            "list_name": "private",\r
             "param_id": "none",\r
             "counter_name": "comic_stories_count"\r
           }\r
           "type": "list",\r
           "args": {\r
             "item_name": "story",\r
-            "list_name": "private",\r
             "param_id": "none",\r
             "counter_name": "stories_count"\r
           }\r
           "type": "list",\r
           "args": {\r
             "item_name": "story_sheet",\r
-            "list_name": "private",\r
             "param_id": "none",\r
             "counter_name": "story_sheets_count"\r
           }\r
           "type": "list",\r
           "args": {\r
             "item_name": "sheet",\r
-            "list_name": "private",\r
             "param_id": "none",\r
             "counter_name": "sheets_count"\r
           }\r
           "type": "list",\r
           "args": {\r
             "item_name": "sheet_panel",\r
-            "list_name": "private",\r
             "param_id": "none",\r
             "counter_name": "sheet_panels_count"\r
           }\r
           "type": "list",\r
           "args": {\r
             "item_name": "panel",\r
-            "list_name": "private",\r
             "param_id": "none",\r
             "counter_name": "panels_count"\r
           }\r
           "type": "list",\r
           "args": {\r
             "item_name": "panel_picture",\r
-            "list_name": "private",\r
             "param_id": "none",\r
             "counter_name": "panel_pictures_count"\r
           }\r
           "type": "list",\r
           "args": {\r
             "item_name": "speech_balloon",\r
-            "list_name": "private",\r
             "param_id": "none",\r
             "counter_name": "speech_balloons_count"\r
           }\r
           "type": "list",\r
           "args": {\r
             "item_name": "speech",\r
-            "list_name": "private",\r
             "param_id": "none",\r
             "counter_name": "speeches_count"\r
           }\r
           "type": "list",\r
           "args": {\r
             "item_name": "balloon",\r
-            "list_name": "private",\r
             "param_id": "none",\r
             "counter_name": "balloons_count"\r
           }\r
           "type": "list",\r
           "args": {\r
             "item_name": "ground_picture",\r
-            "list_name": "private",\r
             "param_id": "none",\r
             "counter_name": "ground_pictures_count"\r
           }\r
           "type": "list",\r
           "args": {\r
             "item_name": "ground_color",\r
-            "list_name": "private",\r
             "param_id": "none",\r
             "counter_name": "ground_colors_count"\r
           }\r
           "type": "list",\r
           "args": {\r
             "item_name": "original_picture",\r
-            "list_name": "private",\r
             "param_id": "none",\r
             "counter_name": "count"\r
           }\r
           "type": "list",\r
           "args": {\r
             "item_name": "resource_picture",\r
-            "list_name": "private",\r
             "param_id": "none",\r
             "counter_name": "resource_pictures_count"\r
           }\r
           "type": "count",\r
           "args": {\r
             "item_name": "scroll",\r
-            "list_name": "private",\r
             "param_id": "none"\r
           }\r
         },\r
           "type": "count",\r
           "args": {\r
             "item_name": "scroll_panel",\r
-            "list_name": "private",\r
             "param_id": "none"\r
           }\r
         },\r
           "type": "count",\r
           "args": {\r
             "item_name": "comic",\r
-            "list_name": "private",\r
             "param_id": "none"\r
           }\r
         },\r
           "type": "count",\r
           "args": {\r
             "item_name": "comic_story",\r
-            "list_name": "private",\r
             "param_id": "none"\r
           }\r
         },\r
   },\r
   "models": {\r
     "folder": {\r
-      "table_name": "folders",\r
       "associations": {\r
         "belongs_to": {},\r
         "has_many": {}\r
       }\r
     },\r
     "scroll": {\r
-      "table_name": "scrolls",\r
       "associations": {\r
         "belongs_to": {\r
           "author": {}\r
       }\r
     },\r
     "scroll_panel": {\r
-      "table_name": "scroll_panels",\r
       "associations": {\r
         "belongs_to": {\r
           "panel": {},\r
       }\r
     },\r
     "comic": {\r
-      "table_name": "comics",\r
       "associations": {\r
         "belongs_to": {\r
           "author": {}\r
       }\r
     },\r
     "comic_story": {\r
-      "table_name": "comic_stories",\r
       "associations": {\r
         "belongs_to": {\r
           "comic": {},\r
       }\r
     },\r
     "story": {\r
-      "table_name": "stories",\r
       "associations": {\r
         "belongs_to": {\r
           "author": {}\r
       }\r
     },\r
     "story_sheet": {\r
-      "table_name": "story_sheets",\r
       "associations": {\r
         "belongs_to": {\r
           "story": {},\r
       }\r
     },\r
     "sheet": {\r
-      "table_name": "sheets",\r
       "associations": {\r
         "belongs_to": {\r
           "author": {}\r
       }\r
     },\r
     "sheet_panel": {\r
-      "table_name": "sheet_panels",\r
       "associations": {\r
         "belongs_to": {\r
           "sheet": {},\r
       }\r
     },\r
     "panel": {\r
-      "table_name": "panels",\r
       "associations": {\r
         "belongs_to": {\r
           "author": {}\r
       }\r
     },\r
     "panel_picture": {\r
-      "table_name": "panel_pictures",\r
       "associations": {\r
         "belongs_to": {\r
           "panel": {}\r
       }\r
     },\r
     "speech_balloon": {\r
-      "table_name": "speech_balloons",\r
       "associations": {\r
         "belongs_to": {\r
           "panel": {},\r
       }\r
     },\r
     "balloon": {\r
-      "table_name": "balloons",\r
       "associations": {\r
         "belongs_to": {\r
           "speech_balloon": {},\r
       }\r
     },\r
     "speech": {\r
-      "table_name": "speeches",\r
       "associations": {\r
         "belongs_to": {\r
           "speech_balloon": {},\r
       }\r
     },\r
     "ground_picture": {\r
-      "table_name": "ground_pictures",\r
       "associations": {\r
         "belongs_to": {\r
           "panel": {}\r
       }\r
     },\r
     "ground_color": {\r
-      "table_name": "ground_colors",\r
       "associations": {\r
         "belongs_to": {\r
           "panel": {}\r
       }\r
     },\r
     "original_picture": {\r
-      "table_name": "original_pictures",\r
       "associations": {\r
         "belongs_to": {\r
           "artist": {}\r
       }\r
     },\r
     "picture": {\r
-      "table_name": "pictures",\r
       "associations": {\r
         "belongs_to": {\r
           "license": {},\r
       }\r
     },\r
     "resource_picture": {\r
-      "table_name": "resource_pictures",\r
       "associations": {\r
         "belongs_to": {\r
           "original_picture": {},\r
       }\r
     },\r
     "original_picture_license_group": {\r
-      "table_name": "original_picture_license_groups",\r
       "associations": {\r
         "belongs_to": {\r
           "original_picture": {},\r
       }\r
     },\r
     "original_picture_license": {\r
-      "table_name": "original_picture_licenses",\r
       "associations": {\r
         "belongs_to": {\r
           "original_picture": {},\r
           "source": {\r
             "type": "filter",\r
             "args": {\r
-              "resource_list_name": "by_license_group",\r
+              "resource_action_name": "by_license_group",\r
               "filter_column_name": "license_group_id"\r
             }\r
           },\r
       }\r
     },\r
     "speech_balloon_template": {\r
-      "table_name": "speech_balloon_templates",\r
       "associations": {\r
         "belongs_to": {\r
           "system_picture": {}\r
       }\r
     },\r
     "writing_format": {\r
-      "table_name": "writing_formats",\r
       "associations": {\r
         "belongs_to": {\r
           "system_picture": {}\r
       }\r
     },\r
     "license_group": {\r
-      "table_name": "license_groups",\r
       "associations": {\r
         "belongs_to": {},\r
         "has_many": {\r
       }\r
     },\r
     "license": {\r
-      "table_name": "licenses",\r
       "associations": {\r
         "belongs_to": {\r
           "license_group": {},\r
       }\r
     },\r
     "author": {\r
-      "table_name": "authors",\r
       "associations": {\r
         "belongs_to": {},\r
         "has_many": {\r
       }\r
     },\r
     "artist": {\r
-      "table_name": "artists",\r
       "associations": {\r
         "belongs_to": {},\r
         "has_many": {\r
       }\r
     },\r
     "system_picture": {\r
-      "table_name": "system_pictures",\r
       "associations": {\r
         "belongs_to": {},\r
         "has_many": {\r