OSDN Git Service

fix orm
authoryasushiito <yas@pen-chan.jp>
Wed, 26 Feb 2014 08:08:20 +0000 (17:08 +0900)
committeryasushiito <yas@pen-chan.jp>
Wed, 26 Feb 2014 08:08:20 +0000 (17:08 +0900)
88 files changed:
app/assets/javascripts/manifest/work/controllers.js.coffee.erb
app/assets/javascripts/manifest/work/lists.js.coffee.erb
app/assets/javascripts/manifest/work/models.js.coffee.erb
app/assets/javascripts/manifest/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/comics_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/views/system/prof.prof.erb
app/views/templates/r/filer/_filer.html.erb [new file with mode: 0644]
app/views/templates/r/filer/filer.html.erb
app/views/templates/r/profiler/_associations.html.erb [new file with mode: 0644]
app/views/templates/r/profiler/_column.html.erb [new file with mode: 0644]
app/views/templates/r/profiler/_columns.html.erb [new file with mode: 0644]
app/views/templates/r/profiler/_header.html.erb [new file with mode: 0644]
app/views/templates/r/profiler/_profiler.html.erb [new file with mode: 0644]
app/views/templates/r/profiler/column_note/_default.html.erb [new file with mode: 0644]
app/views/templates/r/profiler/column_note/_none.html.erb [new file with mode: 0644]
app/views/templates/r/profiler/column_value/_date.html.erb [new file with mode: 0644]
app/views/templates/r/profiler/column_value/_default.html.erb [new file with mode: 0644]
app/views/templates/r/profiler/profiler.html.erb [new file with mode: 0644]
lib/manifest/list.rb
lib/manifest/list/base.rb
lib/manifest/list/filter.rb
lib/manifest/list/foreign_filter.rb [moved from lib/manifest/list/element_filter.rb with 54% similarity]
lib/manifest/list/includes.rb [new file with mode: 0644]
lib/manifest/list/includes/auto.rb [new file with mode: 0644]
lib/manifest/list/includes/base.rb [new file with mode: 0644]
lib/manifest/list/includes/method.rb [new file with mode: 0644]
lib/manifest/list/includes/none.rb [new file with mode: 0644]
lib/manifest/list/private.rb
lib/manifest/list/public.rb
lib/manifest/list/through_filter.rb
lib/manifest/list/where.rb [new file with mode: 0644]
lib/manifest/list/where/auto.rb [new file with mode: 0644]
lib/manifest/list/where/base.rb [new file with mode: 0644]
lib/manifest/list/where/method.rb [new file with mode: 0644]
lib/manifest/local/view.rb
lib/manifest/local/view/profiler.rb [new file with mode: 0644]
lib/manifest/local/view/profiler/association.rb [new file with mode: 0644]
lib/manifest/local/view/profiler/association/belongs_to.rb [new file with mode: 0644]
lib/manifest/local/view/profiler/association/has_many.rb [new file with mode: 0644]
lib/manifest/local/view/profiler/association/has_one.rb [new file with mode: 0644]
lib/manifest/local/view/profiler/column.rb [new file with mode: 0644]
lib/manifest/local/view/profiler/header.rb [new file with mode: 0644]
lib/manifest/local/view/profiler/profiler.rb [deleted file]
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/list.rb
lib/manifest/model/list/filter.rb
lib/manifest/model/list/foreign_filter.rb [moved from lib/manifest/model/list/element_filter.rb with 93% similarity]
lib/manifest/model/list/has_many.rb [deleted file]
lib/manifest/model/list/has_many_through.rb [deleted file]
lib/manifest/model/list/through_filter.rb
lib/manifest/profiler.rb
lib/manifest/profiler/association.rb
lib/manifest/profiler/association/belongs_to.rb
lib/manifest/profiler/association/has_many.rb
lib/manifest/profiler/association/has_one.rb
lib/manifest/profiler/list.rb
lib/peta/content.rb
public/manifest.json

index 5a7db07..d2854d0 100644 (file)
@@ -5,7 +5,7 @@
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public_list',\r
+          list_name: 'public',\r
         },\r
       },\r
       by_author: {\r
       },\r
       show: {\r
         type: 'show',\r
-        name: 'show',\r
       },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public_list',\r
+          list_name: 'public',\r
         },\r
       },\r
       count_by_author: {\r
@@ -49,7 +48,7 @@
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public_list',\r
+          list_name: 'public',\r
           \r
         },\r
       },\r
       by_scroll: {\r
         type: 'list',\r
       },\r
+      show: {\r
+        type: 'show',\r
+      },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public_list',\r
+          list_name: 'public',\r
         },\r
       },\r
       count_by_panel: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public_list',\r
+          list_name: 'public',\r
           \r
         },\r
       },\r
       by_author: {\r
         type: 'list',\r
       },\r
+      show: {\r
+        type: 'show',\r
+      },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public_list',\r
+          list_name: 'public',\r
         },\r
       },\r
       count_by_author: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public_list',\r
+          list_name: 'public',\r
           \r
         },\r
       },\r
           list_name: 'play',\r
         },\r
       },\r
+      show: {\r
+        type: 'show',\r
+      },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public_list',\r
+          list_name: 'public',\r
         },\r
       },\r
       by_comic: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public_list',\r
+          list_name: 'public',\r
           \r
         },\r
       },\r
       by_sheet: {\r
         type: 'list',\r
       },\r
+      show: {\r
+        type: 'show',\r
+      },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public_list',\r
+          list_name: 'public',\r
         },\r
       },\r
       count_by_story: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public_list',\r
+          list_name: 'public',\r
           \r
         },\r
       },\r
           list_name: 'play',\r
         },\r
       },\r
+      show: {\r
+        type: 'show',\r
+      },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public_list',\r
+          list_name: 'public',\r
         },\r
       },\r
       count_by_story: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public_list',\r
+          list_name: 'public',\r
           \r
         },\r
       },\r
       by_panel: {\r
         type: 'list',\r
       },\r
+      show: {\r
+        type: 'show',\r
+      },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public_list',\r
+          list_name: 'public',\r
         },\r
       },\r
       count_by_sheet: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public_list',\r
+          list_name: 'public',\r
           \r
         },\r
       },\r
       by_speech_balloon_template: {\r
         type: 'list',\r
       },\r
+      show: {\r
+        type: 'show',\r
+      },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public_list',\r
+          list_name: 'public',\r
         },\r
       },\r
       count_by_scroll: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public_list',\r
+          list_name: 'public',\r
           \r
         },\r
       },\r
       by_author: {\r
         type: 'list',\r
       },\r
+      show: {\r
+        type: 'show',\r
+      },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public_list',\r
+          list_name: 'public',\r
         },\r
       },\r
       count_by_panel: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public_list',\r
+          list_name: 'public',\r
           \r
         },\r
       },\r
       by_author: {\r
         type: 'list',\r
       },\r
+      show: {\r
+        type: 'show',\r
+      },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public_list',\r
+          list_name: 'public',\r
         },\r
       },\r
       count_by_panel: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public_list',\r
+          list_name: 'public',\r
           \r
         },\r
       },\r
       by_writing_format: {\r
         type: 'list',\r
       },\r
+      show: {\r
+        type: 'show',\r
+      },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public_list',\r
+          list_name: 'public',\r
         },\r
       },\r
       count_by_writing_format: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public_list',\r
+          list_name: 'public',\r
           \r
         },\r
       },\r
       #    list_name: 'by_system_picture',\r
       #  },\r
       #},\r
+      show: {\r
+        type: 'show',\r
+      },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public_list',\r
+          list_name: 'public',\r
         },\r
       },\r
     },\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public_list',\r
+          list_name: 'public',\r
           \r
         },\r
       },\r
       by_author: {\r
         type: 'list',\r
       },\r
+      show: {\r
+        type: 'show',\r
+      },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public_list',\r
+          list_name: 'public',\r
         },\r
       },\r
       count_by_panel: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public_list',\r
+          list_name: 'public',\r
           \r
         },\r
       },\r
       by_author: {\r
         type: 'list',\r
       },\r
+      show: {\r
+        type: 'show',\r
+      },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public_list',\r
+          list_name: 'public',\r
         },\r
       },\r
       count_by_panel: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'private_list',\r
-          \r
+          list_name: 'private',\r
         },\r
       },\r
+      show: {\r
+        type: 'show',\r
+      },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public_list',\r
+          list_name: 'public',\r
         },\r
       },\r
     },\r
   },\r
   pictures: {\r
+    actions: {\r
+      show: {\r
+        type: 'show',\r
+      },\r
+    },\r
   },\r
   resource_pictures: {\r
     actions: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public_list',\r
+          list_name: 'public',\r
           \r
         },\r
       },\r
       by_artist: {\r
         type: 'list',\r
       },\r
+      show: {\r
+        type: 'show',\r
+      },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public_list',\r
+          list_name: 'public',\r
         },\r
       },\r
       count_by_license: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public_list',\r
+          list_name: 'public',\r
           \r
         },\r
       },\r
+      show: {\r
+        type: 'show',\r
+      },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public_list',\r
+          list_name: 'public',\r
         },\r
       },\r
     },\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public_list',\r
+          list_name: 'public',\r
           \r
         },\r
       },\r
       by_system_picture: {\r
         type: 'list',\r
       },\r
+      show: {\r
+        type: 'show',\r
+      },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public_list',\r
+          list_name: 'public',\r
         },\r
       },\r
       count_by_system_picture: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public_list',\r
+          list_name: 'public',\r
           \r
         },\r
       },\r
+      show: {\r
+        type: 'show',\r
+      },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public_list',\r
+          list_name: 'public',\r
         },\r
       },\r
     },\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public_list',\r
+          list_name: 'public',\r
           \r
         },\r
       },\r
       by_system_picture: {\r
         type: 'list',\r
       },\r
+      show: {\r
+        type: 'show',\r
+      },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public_list',\r
+          list_name: 'public',\r
         },\r
       },\r
       count_by_license_group: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public_list',\r
+          list_name: 'public',\r
           \r
         },\r
       },\r
           list_name: 'ground_colors',\r
         },\r
       },\r
+      show: {\r
+        type: 'show',\r
+      },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public_list',\r
+          list_name: 'public',\r
         },\r
       },\r
       new: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public_list',\r
+          list_name: 'public',\r
           \r
         },\r
       },\r
           list_name: 'resource_pictures',\r
         },\r
       },\r
+      show: {\r
+        type: 'show',\r
+      },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public_list',\r
+          list_name: 'public',\r
         },\r
       },\r
       new: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public_list',\r
+          list_name: 'public',\r
           \r
         },\r
       },\r
+      show: {\r
+        type: 'show',\r
+      },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public_list',\r
+          list_name: 'public',\r
         },\r
       },\r
     },\r
         type: 'list',\r
         args: {\r
           item_name: 'scroll',\r
-          list_name: 'private_list',\r
+          list_name: 'private',\r
           \r
         },\r
       },\r
         type: 'list',\r
         args: {\r
           item_name: 'scroll_panel',\r
-          list_name: 'private_list',\r
+          list_name: 'private',\r
           \r
         },\r
       },\r
         type: 'list',\r
         args: {\r
           item_name: 'comic',\r
-          list_name: 'private_list',\r
+          list_name: 'private',\r
           \r
         },\r
       },\r
         type: 'list',\r
         args: {\r
           item_name: 'story',\r
-          list_name: 'private_list',\r
+          list_name: 'private',\r
           \r
         },\r
       },\r
         type: 'list',\r
         args: {\r
           item_name: 'story_sheet',\r
-          list_name: 'private_list',\r
+          list_name: 'private',\r
           \r
         },\r
       },\r
         type: 'list',\r
         args: {\r
           item_name: 'sheet',\r
-          list_name: 'private_list',\r
+          list_name: 'private',\r
           \r
         },\r
       },\r
         type: 'list',\r
         args: {\r
           item_name: 'sheet_panel',\r
-          list_name: 'private_list',\r
+          list_name: 'private',\r
           \r
         },\r
       },\r
         type: 'list',\r
         args: {\r
           item_name: 'panel',\r
-          list_name: 'private_list',\r
+          list_name: 'private',\r
           \r
         },\r
       },\r
         type: 'list',\r
         args: {\r
           item_name: 'panel_picture',\r
-          list_name: 'private_list',\r
+          list_name: 'private',\r
           \r
         },\r
       },\r
         type: 'list',\r
         args: {\r
           item_name: 'speech_balloon',\r
-          list_name: 'private_list',\r
+          list_name: 'private',\r
           \r
         },\r
       },\r
         type: 'list',\r
         args: {\r
           item_name: 'speech',\r
-          list_name: 'private_list',\r
+          list_name: 'private',\r
           \r
         },\r
       },\r
         type: 'list',\r
         args: {\r
           item_name: 'balloon',\r
-          list_name: 'private_list',\r
+          list_name: 'private',\r
           \r
         },\r
       },\r
         type: 'list',\r
         args: {\r
           item_name: 'ground_picture',\r
-          list_name: 'private_list',\r
+          list_name: 'private',\r
           \r
         },\r
       },\r
         type: 'list',\r
         args: {\r
           item_name: 'ground_color',\r
-          list_name: 'private_list',\r
+          list_name: 'private',\r
           \r
         },\r
       },\r
         type: 'list',\r
         args: {\r
           item_name: 'original_picture',\r
-          list_name: 'private_list',\r
+          list_name: 'private',\r
           \r
         },\r
       },\r
         type: 'list',\r
         args: {\r
           item_name: 'resource_picture',\r
-          list_name: 'private_list',\r
+          list_name: 'private',\r
           \r
         },\r
       },\r
index 815d8bc..d3add6f 100644 (file)
@@ -1,9 +1,9 @@
 #マニフェスト\r
 @lists = {\r
   scroll: {\r
-    public_list: {\r
+    public: {\r
     },\r
-    private_list: {\r
+    private: {\r
     },\r
     by_author: {\r
     },\r
@@ -13,9 +13,9 @@
     },\r
   },\r
   scroll_panel: {\r
-    public_list: {\r
+    public: {\r
     },\r
-    private_list: {\r
+    private: {\r
     },\r
     by_scroll: {\r
     },\r
     },\r
   },\r
   comic: {\r
-    public_list: {\r
+    public: {\r
     },\r
-    private_list: {\r
+    private: {\r
     },\r
     by_author: {\r
     },\r
   },\r
   story: {\r
-    public_list: {\r
+    public: {\r
     },\r
-    private_list: {\r
+    private: {\r
     },\r
     by_comic: {\r
     },\r
     by_sheet: {\r
     },\r
     by_author: {\r
-      type: 'element_filter',\r
-      args: {\r
-        from: 'author',\r
-        filter_key: 'author_id',\r
-      },\r
     },\r
     play: {\r
-      type: 'play',\r
-      args: {\r
-        model: 'story_sheet',\r
-        filter_key: 'story_id',\r
-      },\r
     },\r
   },\r
   story_sheet: {\r
-    public_list: {\r
+    public: {\r
     },\r
-    private_list: {\r
+    private: {\r
     },\r
     by_story: {\r
     },\r
@@ -65,9 +55,9 @@
     },\r
   },\r
   sheet: {\r
-    public_list: {\r
+    public: {\r
     },\r
-    private_list: {\r
+    private: {\r
     },\r
     by_story: {\r
     },\r
     by_author: {\r
     },\r
     play: {\r
-      type: 'play',\r
-      args: {\r
-        model: 'sheet_panel',\r
-        filter_key: 'sheet_id',\r
-      },\r
     },\r
   },\r
   sheet_panel: {\r
-    public_list: {\r
+    public: {\r
     },\r
-    private_list: {\r
+    private: {\r
     },\r
     by_sheet: {\r
     },\r
@@ -94,9 +79,9 @@
     },\r
   },\r
   panel: {\r
-    public_list: {\r
+    public: {\r
     },\r
-    private_list: {\r
+    private: {\r
     },\r
     by_scroll: {\r
     },\r
     by_author: {\r
     },\r
     by_speech_balloon_template: {\r
-      type: 'through_filter',\r
-      args: {\r
-        from: 'speech_balloon_template',\r
-        through: 'speech_balloons',\r
-        filter_key: 'speech_balloon_template_id',\r
-      },\r
     },\r
   },\r
   panel_picture: {\r
-    public_list: {\r
+    public: {\r
     },\r
-    private_list: {\r
+    private: {\r
     },\r
     by_panel: {\r
     },\r
     by_author: {\r
-      where: 'by_author_where',\r
-      includes: 'by_author_includes',\r
     },\r
   },\r
   speech_balloon: {\r
-    public_list: {\r
+    public: {\r
     },\r
-    private_list: {\r
+    private: {\r
     },\r
     by_panel: {\r
     },\r
     by_speech_balloon_template: {\r
-      type: 'filter',\r
-      args: {\r
-        from: 'speech_balloon_template',\r
-        filter_key: 'speech_balloon_template_id',\r
-      },\r
     },\r
     by_author: {\r
     },\r
   },\r
   speech: {\r
-    public_list: {\r
+    public: {\r
     },\r
     by_speech_balloon: {\r
-      type: 'filter',\r
-      args: {\r
-        from: 'speech_balloon',\r
-        includes: {speech_balloon: {panel: {}}},\r
-        filter_key: 'speech_balloon_id',\r
-      },\r
     },\r
     by_writing_format: {\r
-      type: 'filter',\r
-      args: {\r
-        from: 'writing_format',\r
-        filter_key: 'writing_format_id',\r
-      },\r
     },\r
   },\r
   balloon: {\r
-    public_list: {\r
+    public: {\r
     },\r
     by_speech_balloon: {\r
-      type: 'filter',\r
-      args: {\r
-        from: 'speech_balloon',\r
-        includes: {speech_balloon: {panel: {}}},\r
-        filter_key: 'speech_balloon_id',\r
-      },\r
     },\r
     #by_system_picture: {\r
-    #  type: 'filter',\r
-    #  from: 'system_picture',\r
-    #  filter_key: 'system_picture_id',\r
     #},\r
   },\r
   ground_picture: {\r
-    public_list: {\r
+    public: {\r
     },\r
-    private_list: {\r
+    private: {\r
     },\r
     by_panel: {\r
-      type: 'filter',\r
-      args: {\r
-        from: 'panel',\r
-        filter_key: 'panel_id',\r
-      },\r
     },\r
     by_author: {\r
-      type: 'element_filter',\r
-      args: {\r
-        from: 'author',\r
-        filter_key: 'author_id',\r
-      },\r
     },\r
   },\r
   ground_color: {\r
-    public_list: {\r
+    public: {\r
     },\r
-    private_list: {\r
+    private: {\r
     },\r
     by_panel: {\r
-      type: 'filter',\r
-      args: {\r
-        from: 'panel',\r
-        filter_key: 'panel_id',\r
-      },\r
     },\r
     by_author: {\r
-      type: 'element_filter',\r
-      args: {\r
-        from: 'author',\r
-        filter_key: 'author_id',\r
-      },\r
     },\r
   },\r
   original_picture: {\r
-    private_list: {\r
+    private: {\r
     },\r
   },\r
   picture: {\r
   },\r
   resource_picture: {\r
-    public_list: {\r
+    public: {\r
     },\r
-    private_list: {\r
+    private: {\r
     },\r
     by_license: {\r
-      type: 'filter',\r
-      args: {\r
-        from: 'license',\r
-        filter_key: 'license_id',\r
-      },\r
     },\r
     by_artist: {\r
     },\r
   },\r
   speech_balloon_template: {\r
-    public_list: {\r
+    public: {\r
     },\r
     select_items: {\r
-      type: 'system_resource',\r
     },\r
   },\r
   writing_format: {\r
-    public_list: {\r
+    public: {\r
     },\r
     select_items: {\r
-      type: 'system_resource',\r
     },\r
     by_system_picture: {\r
     },\r
   },\r
   license_group: {\r
-    public_list: {\r
+    public: {\r
     },\r
     select_items: {\r
-      type: 'system_resource',\r
     },\r
   },\r
   license: {\r
-    public_list: {\r
+    public: {\r
     },\r
     by_license_group: {\r
     },\r
     },\r
   },\r
   author: {\r
-    public_list: {\r
+    public: {\r
     },\r
   },\r
   artist: {\r
-    public_list: {\r
+    public: {\r
     },\r
   },\r
   system_picture: {\r
-    public_list: {\r
+    public: {\r
     },\r
   },\r
 }\r
index a198d4f..47b4ba8 100644 (file)
@@ -1,23 +1,16 @@
 #マニフェスト\r
 @models = {\r
   scroll: {\r
-    class_name: 'Scroll',\r
-    table_name: 'scrolls',\r
     associations: {\r
       belongs_to: {\r
         author: {\r
-          id_column: 'author_id'\r
         }, \r
       },\r
       has_many: {\r
         scroll_panels: {\r
-          foreign_key: 'scroll_id',\r
-          model_name: 'scroll_panel',\r
         }, \r
         panels: {\r
           through: 'scroll_panel',\r
-          foreign_key: 'scroll_id',\r
-          model_name: 'panel',\r
         }, \r
       },\r
     },\r
       }\r
     },\r
     lists: {\r
-      public_list: {\r
+      public: {\r
         type: 'public',\r
       },\r
-      private_list: {\r
+      private: {\r
         type: 'private',\r
       },\r
       by_author: {\r
         type: 'filter',\r
         args: {\r
-          filter_item_name: 'author',\r
-          filter_key: 'author_id',\r
         },\r
       },\r
       by_panel: {\r
         type: 'through_filter',\r
         args: {\r
-          filter_item_name: 'panel',\r
           through: 'scroll_panels',\r
-          filter_key: 'panel_id',\r
         },\r
       },\r
       play: {\r
     },\r
   },\r
   scroll_panel: {\r
-    class_name: 'ScrollPanel',\r
-    table_name: 'scroll_panels',\r
     associations: {\r
       belongs_to: {\r
         panel: {\r
-          id_column: 'panel_id'\r
         }, \r
         scroll: {\r
-          id_column: 'scroll_id'\r
         }, \r
       },\r
       has_many: {\r
         type: 'datetime',\r
       }\r
     },\r
+    tree: {\r
+      owner: 'scroll',\r
+    },\r
     lists: {\r
-      public_list: {\r
+      public: {\r
         type: 'public',\r
       },\r
-      private_list: {\r
+      private: {\r
         type: 'private',\r
       },\r
       by_scroll: {\r
     },\r
   },\r
   comic: {\r
-    class_name: 'Comic',\r
-    table_name: 'comics',\r
     associations: {\r
       belongs_to: {\r
         author: {\r
-          id_column: 'author_id'\r
         }, \r
       },\r
       has_many: {\r
         stories: {\r
-          foreign_key: 'comic_id',\r
-          model_name: 'story',\r
         }, \r
       },\r
-      has_many_through: {\r
-      },\r
     },\r
     attributes: {\r
       id: {\r
       }\r
     },\r
     lists: {\r
-      public_list: {\r
+      public: {\r
         type: 'public',\r
       },\r
-      private_list: {\r
+      private: {\r
         type: 'private',\r
       },\r
       by_author: {\r
     },\r
   },\r
   story: {\r
-    class_name: 'Story',\r
-    table_name: 'stories',\r
     associations: {\r
       belongs_to: {\r
         comic: {\r
-          id_column: 'comic_id'\r
         }, \r
       },\r
       has_many: {\r
         story_sheets: {\r
-          foreign_key: 'story_id',\r
-          model_name: 'story_sheet',\r
         }, \r
         sheets: {\r
           through: 'story_sheets',\r
-          foreign_key: 'story_id',\r
-          model_name: 'sheet',\r
         }, \r
       },\r
     },\r
         type: 'datetime',\r
       }\r
     },\r
+    tree: {\r
+      owner: 'comic',\r
+    },\r
     lists: {\r
-      public_list: {\r
+      public: {\r
         type: 'public',\r
       },\r
-      private_list: {\r
+      private: {\r
         type: 'private',\r
       },\r
       by_comic: {\r
       },\r
       by_sheet: {\r
         type: 'through_filter',\r
+        args: {\r
+          through: 'story_sheets',\r
+        },\r
       },\r
       by_author: {\r
-        type: 'element_filter',\r
+        type: 'foreign_filter',\r
       },\r
       play: {\r
         type: 'play',\r
     },\r
   },\r
   story_sheet: {\r
-    class_name: 'StorySheet',\r
-    table_name: 'story_sheets',\r
     associations: {\r
       belongs_to: {\r
         story: {\r
-          id_column: 'story_id'\r
         }, \r
         sheet: {\r
-          id_column: 'sheet_id'\r
         }, \r
       },\r
       has_many: {\r
         type: 'datetime',\r
       }\r
     },\r
+    tree: {\r
+      owner: 'story',\r
+    },\r
     lists: {\r
-      public_list: {\r
+      public: {\r
         type: 'public',\r
       },\r
-      private_list: {\r
+      private: {\r
         type: 'private',\r
       },\r
       by_story: {\r
     },\r
   },\r
   sheet: {\r
-    class_name: 'Sheet',\r
-    table_name: 'sheets',\r
     associations: {\r
       belongs_to: {\r
         author: {\r
-          id_column: 'author_id'\r
         }, \r
       },\r
       has_many: {\r
         story_sheets: {\r
-          foreign_key: 'story_id',\r
-          model_name: 'story_sheet',\r
         }, \r
         stories: {\r
           through: 'story_sheets',\r
-          foreign_key: 'sheet_id',\r
-          model_name: 'story',\r
         }, \r
         sheet_panels: {\r
-          foreign_key: 'sheet_id',\r
-          model_name: 'sheet_panel',\r
         }, \r
         panels: {\r
           through: 'sheet_panels',\r
-          foreign_key: 'sheet_id',\r
-          model_name: 'panel',\r
         }, \r
       },\r
     },\r
       }\r
     },\r
     lists: {\r
-      public_list: {\r
+      public: {\r
         type: 'public',\r
       },\r
-      private_list: {\r
+      private: {\r
         type: 'private',\r
       },\r
       by_story: {\r
         type: 'through_filter',\r
+        args: {\r
+          through: 'story_sheets',\r
+        },\r
       },\r
       by_panel: {\r
         type: 'through_filter',\r
+        args: {\r
+          through: 'sheet_panels',\r
+        },\r
       },\r
       by_author: {\r
         type: 'filter',\r
     },\r
   },\r
   sheet_panel: {\r
-    class_name: 'SheetPanel',\r
-    table_name: 'sheet_panels',\r
     associations: {\r
       belongs_to: {\r
         sheet: {\r
-          id_column: 'sheet_id'\r
         }, \r
         panel: {\r
-          id_column: 'panel_id'\r
         }, \r
       },\r
       has_many: {\r
         type: 'datetime',\r
       }\r
     },\r
+    tree: {\r
+      owner: 'sheet',\r
+    },\r
     lists: {\r
-      public_list: {\r
+      public: {\r
         type: 'public',\r
       },\r
-      private_list: {\r
+      private: {\r
         type: 'private',\r
       },\r
       by_sheet: {\r
     },\r
   },\r
   panel: {\r
-    class_name: 'Panel',\r
-    table_name: 'panels',\r
     associations: {\r
       belongs_to: {\r
         author: {\r
-          id_column: 'author_id'\r
         }, \r
       },\r
       has_many: {\r
         scroll_panels: {\r
-          foreign_key: 'panel_id',\r
-          model_name: 'scroll_panel',\r
         }, \r
         scrolls: {\r
           through: 'scroll_panels',\r
-          foreign_key: 'panel_id',\r
-          model_name: 'scroll',\r
         }, \r
         sheet_panels: {\r
-          foreign_key: 'panel_id',\r
-          model_name: 'sheet_panel',\r
         }, \r
         sheets: {\r
           through: 'sheet_panels',\r
-          foreign_key: 'panel_id',\r
-          model_name: 'sheet',\r
         }, \r
         panel_pictures: {\r
-          foreign_key: 'panel_id',\r
-          model_name: 'panel_picture',\r
         }, \r
         speech_balloons: {\r
-          foreign_key: 'panel_id',\r
-          model_name: 'speech_balloon',\r
         }, \r
         ground_pictures: {\r
-          foreign_key: 'panel_id',\r
-          model_name: 'ground_picture',\r
         }, \r
         ground_colors: {\r
-          foreign_key: 'panel_id',\r
-          model_name: 'ground_color',\r
         }, \r
       },\r
     },\r
       }\r
     },\r
     lists: {\r
-      public_list: {\r
+      public: {\r
         type: 'public',\r
       },\r
-      private_list: {\r
+      private: {\r
         type: 'private',\r
       },\r
       by_scroll: {\r
         type: 'through_filter',\r
+        args: {\r
+          through: 'scroll_panels',\r
+        },\r
       },\r
       by_sheet: {\r
         type: 'through_filter',\r
+        args: {\r
+          through: 'sheet_panels',\r
+        },\r
       },\r
       by_author: {\r
         type: 'filter',\r
     },\r
   },\r
   panel_picture: {\r
-    class_name: 'PanelPicture',\r
-    table_name: 'panel_pictures',\r
     associations: {\r
       belongs_to: {\r
         panel: {\r
-          id_column: 'panel_id'\r
         }, \r
       },\r
       has_many: {\r
         type: 'datetime',\r
       }\r
     },\r
+    tree: {\r
+      owner: 'panel',\r
+      panel: 'panel',\r
+    },\r
     lists: {\r
-      public_list: {\r
+      public: {\r
         type: 'public',\r
       },\r
-      private_list: {\r
+      private: {\r
         type: 'private',\r
       },\r
       by_panel: {\r
         type: 'filter',\r
+        args: {\r
+          where_name: 'public_list_where',\r
+        },\r
       },\r
       by_author: {\r
-        type: 'element_filter',\r
+        type: 'foreign_filter',\r
+        args: {\r
+          tree_name: 'owner',\r
+        },\r
       },\r
     },\r
   },\r
   speech_balloon: {\r
-    class_name: 'SpeechBalloon',\r
-    table_name: 'speech_balloons',\r
     extend: 'classname', \r
     associations: {\r
       belongs_to: {\r
         panel: {\r
-          id_column: 'panel_id'\r
         }, \r
       },\r
       has_many: {\r
       },\r
       has_one: {\r
         balloon: {\r
-          foreign_key: 'speech_balloon_id',\r
-          model_name: 'balloon',\r
         }, \r
         speech: {\r
-          foreign_key: 'speech_balloon_id',\r
-          model_name: 'speech',\r
         }, \r
       },\r
     },\r
         type: 'datetime',\r
       }\r
     },\r
+    tree: {\r
+      owner: 'panel',\r
+      panel: 'panel',\r
+    },\r
     lists: {\r
-      public_list: {\r
+      public: {\r
         type: 'public',\r
       },\r
-      private_list: {\r
+      private: {\r
         type: 'private',\r
       },\r
       by_panel: {\r
         type: 'filter',\r
       },\r
       by_author: {\r
-        type: 'element_filter',\r
+        type: 'foreign_filter',\r
       },\r
     },\r
   }, \r
   balloon: {\r
-    class_name: 'Balloon',\r
-    table_name: 'balloons',\r
     associations: {\r
       belongs_to: {\r
         speech_balloon: {\r
-          id_column: 'speech_balloon_id'\r
         }, \r
         system_picture: {\r
-          id_column: 'system_picture_id'\r
         }, \r
       },\r
       has_many: {\r
         type: 'datetime',\r
       }\r
     },\r
+    tree: {\r
+      owner: 'speech_balloon',\r
+      panel: 'speech_balloon',\r
+    },\r
     lists: {\r
-      public_list: {\r
+      public: {\r
         type: 'public',\r
       },\r
-      private_list: {\r
+      private: {\r
         type: 'private',\r
       },\r
       by_panel: {\r
         type: 'filter',\r
       },\r
       by_author: {\r
-        type: 'element_filter',\r
+        type: 'foreign_filter',\r
       },\r
     },\r
   },\r
   speech: {\r
-    class_name: 'Speech',\r
-    table_name: 'speeches',\r
     associations: {\r
       belongs_to: {\r
         speech_balloon: {\r
-          id_column: 'speech_balloon_id'\r
         }, \r
         writing_format: {\r
-          id_column: 'writing_format_id'\r
         }, \r
       },\r
       has_many: {\r
         type: 'datetime',\r
       }\r
     },\r
+    tree: {\r
+      owner: 'speech_balloon',\r
+      panel: 'speech_balloon',\r
+    },\r
     lists: {\r
-      public_list: {\r
+      public: {\r
         type: 'public',\r
       },\r
       by_speech_balloon: {\r
     },\r
   },\r
   ground_picture: {\r
-    class_name: 'GroundPicture',\r
-    table_name: 'ground_pictures',\r
     associations: {\r
       belongs_to: {\r
         panel: {\r
-          id_column: 'panel_id'\r
         }, \r
       },\r
       has_many: {\r
         type: 'datetime',\r
       }\r
     },\r
+    tree: {\r
+      owner: 'panel',\r
+      panel: 'panel',\r
+    },\r
     lists: {\r
-      public_list: {\r
+      public: {\r
         type: 'public',\r
       },\r
-      private_list: {\r
+      private: {\r
         type: 'private',\r
       },\r
       by_panel: {\r
         type: 'filter',\r
       },\r
       by_author: {\r
-        type: 'element_filter',\r
+        type: 'foreign_filter',\r
       },\r
     },\r
   },\r
   ground_color: {\r
-    class_name: 'GroundColor',\r
-    table_name: 'ground_colors',\r
     associations: {\r
       belongs_to: {\r
         panel: {\r
-          id_column: 'panel_id'\r
         }, \r
       },\r
       has_many: {\r
         type: 'datetime',\r
       }\r
     },\r
+    tree: {\r
+      owner: 'panel',\r
+      panel: 'panel',\r
+    },\r
     lists: {\r
-      public_list: {\r
+      public: {\r
         type: 'public',\r
       },\r
-      private_list: {\r
+      private: {\r
         type: 'private',\r
       },\r
       by_panel: {\r
         type: 'filter',\r
       },\r
       by_author: {\r
-        type: 'element_filter',\r
+        type: 'foreign_filter',\r
       },\r
     },\r
   },\r
   original_picture: {\r
-    class_name: 'OriginalPicture',\r
-    table_name: 'original_pictures',\r
     associations: {\r
       belongs_to: {\r
         artist: {\r
-          id_column: 'artist_id'\r
         }, \r
       },\r
       has_many: {\r
         pictures: {\r
-          foreign_key: 'original_picture_id',\r
-          model_name: 'picture',\r
         }, \r
       },\r
       has_one: {\r
         resource_picture: {\r
-          foreign_key: 'original_picture_id',\r
-          model_name: 'resource_picture',\r
         }, \r
       },\r
     },\r
       }\r
     },\r
     lists: {\r
-      private_list: {\r
+      private: {\r
         type: 'private',\r
       },\r
     },\r
   },\r
   picture: {\r
-    class_name: 'Picture',\r
-    table_name: 'pictures',\r
     associations: {\r
       belongs_to: {\r
         license: {\r
-          id_column: 'license_id'\r
         }, \r
         artist: {\r
-          id_column: 'artist_id'\r
         }, \r
       },\r
       has_many: {\r
     }\r
   },\r
   resource_picture: {\r
-    class_name: 'ResourcePicture',\r
-    table_name: 'resource_pictures',\r
     associations: {\r
       belongs_to: {\r
         original_picture: {\r
-          id_column: 'original_picture_id'\r
         }, \r
         license: {\r
-          id_column: 'license_id'\r
         }, \r
         artist: {\r
-          id_column: 'artist_id'\r
         }, \r
       },\r
       has_many: {\r
       }\r
     },\r
     lists: {\r
-      public_list: {\r
+      public: {\r
         type: 'public',\r
       },\r
-      private_list: {\r
+      private: {\r
         type: 'private',\r
       },\r
       by_license: {\r
     },\r
   },\r
   speech_balloon_template: {\r
-    class_name: 'SpeechBalloonTemplate',\r
-    table_name: 'speech_balloon_templates',\r
     associations: {\r
       belongs_to: {\r
         system_picture: {\r
-          id_column: 'system_picture_id'\r
         }, \r
       },\r
       has_many: {\r
         speech_balloons: {\r
-          foreign_key: 'speech_balloon_template_id',\r
-          model_name: 'speech_balloon',\r
         }, \r
         panels: {\r
           through: 'speech_balloons',\r
-          foreign_key: 'speech_balloon_template_id',\r
-          model_name: 'panel',\r
         }, \r
       },\r
       has_one: {\r
       }\r
     },\r
     lists: {\r
-      public_list: {\r
+      public: {\r
         type: 'public',\r
       },\r
       select_items: {\r
     },\r
   },\r
   writing_format: {\r
-    class_name: 'WritingFormat',\r
-    table_name: 'writing_formats',\r
     associations: {\r
       belongs_to: {\r
         system_picture: {\r
-          id_column: 'system_picture_id'\r
         }, \r
       },\r
       has_many: {\r
         speeches: {\r
-          foreign_key: 'writing_format_id',\r
-          model_name: 'speech',\r
         }, \r
       },\r
       has_one: {\r
       }\r
     },\r
     lists: {\r
-      public_list: {\r
+      public: {\r
         type: 'public',\r
       },\r
       select_items: {\r
     },\r
   },\r
   license_group: {\r
-    class_name: 'LicenseGroup',\r
-    table_name: 'license_groups',\r
     associations: {\r
       belongs_to: {\r
       },\r
       has_many: {\r
         licenses: {\r
-          foreign_key: 'license_group_id',\r
-          model_name: 'license',\r
         }, \r
       },\r
       has_one: {\r
       }\r
     },\r
     lists: {\r
-      public_list: {\r
+      public: {\r
         type: 'public',\r
       },\r
       select_items: {\r
     },\r
   },\r
   license: {\r
-    class_name: 'License',\r
-    table_name: 'licenses',\r
     associations: {\r
       belongs_to: {\r
         license_group: {\r
-          id_column: 'license_group_id'\r
         }, \r
         system_picture: {\r
-          id_column: 'system_picture_id'\r
         }, \r
       },\r
       has_many: {\r
         resource_pictures: {\r
-          foreign_key: 'license_id',\r
-          model_name: 'resource_picture',\r
         }, \r
       },\r
       has_one: {\r
       }\r
     },\r
     lists: {\r
-      public_list: {\r
+      public: {\r
         type: 'public',\r
       },\r
       by_license_group: {\r
     },\r
   },\r
   author: {\r
-    class_name: 'Author',\r
-    table_name: 'authors',\r
     associations: {\r
       belongs_to: {\r
       },\r
       has_many: {\r
         scrolls: {\r
-          foreign_key: 'author_id',\r
-          model_name: 'scroll',\r
         }, \r
         comics: {\r
-          foreign_key: 'author_id',\r
-          model_name: 'comic',\r
         }, \r
         stories: {\r
-          foreign_key: 'author_id',\r
-          model_name: 'story',\r
         }, \r
         sheets: {\r
-          foreign_key: 'author_id',\r
-          model_name: 'sheet',\r
         }, \r
         panels: {\r
-          foreign_key: 'author_id',\r
-          model_name: 'panel',\r
         }, \r
       },\r
       has_one: {\r
       }\r
     },\r
     lists: {\r
-      public_list: {\r
+      public: {\r
         type: 'public',\r
       },\r
     },\r
   },\r
   artist: {\r
-    class_name: 'Artist',\r
-    table_name: 'artists',\r
     associations: {\r
       belongs_to: {\r
       },\r
       has_many: {\r
         resource_pictures: {\r
-          foreign_key: 'artist_id',\r
-          model_name: 'resource_picture',\r
         }, \r
       },\r
       has_one: {\r
       }\r
     },\r
     lists: {\r
-      public_list: {\r
+      public: {\r
         type: 'public',\r
       },\r
     },\r
   },\r
   system_picture: {\r
-    class_name: 'SystemPicture',\r
-    table_name: 'system_pictures',\r
     associations: {\r
       belongs_to: {\r
       },\r
       has_many: {\r
         balloons: {\r
-          foreign_key: 'system_picture_id',\r
-          model_name: 'balloon',\r
         }, \r
-        balloon_templates: {\r
-          foreign_key: 'system_picture_id',\r
-          model_name: 'balloon_template',\r
+        speech_balloon_templates: {\r
         }, \r
         licenses: {\r
-          foreign_key: 'system_picture_id',\r
-          model_name: 'license',\r
         }, \r
       },\r
       has_one: {\r
       }\r
     },\r
     lists: {\r
-      public_list: {\r
+      public: {\r
         type: 'public',\r
       },\r
     },\r
index e21f097..0402e94 100644 (file)
@@ -11,7 +11,7 @@
         list_name: 'by_scroll',\r
       }, \r
     }, \r
-    columns: [\r
+    column_names: [\r
       'id', \r
       'title', \r
       'description', \r
       #  model_name: 'balloon',\r
       #  list_name: 'by_system_picture',\r
       #}, \r
-      'speech_balloon_templates.by_system_picture': {\r
-        model_name: 'speech_balloon_template',\r
-        list_name: 'by_system_picture',\r
-      }, \r
+      #'speech_balloon_templates.by_system_picture': {\r
+      #  model_name: 'speech_balloon_template',\r
+      #  list_name: 'by_system_picture',\r
+      #}, \r
       'licenses.by_system_picture': {\r
         model_name: 'license',\r
         list_name: 'by_system_picture',\r
       ],\r
       has_many: [\r
         #'balloons.by_system_picture', \r
-        'speech_balloon_templates.by_system_picture', \r
+        #'speech_balloon_templates.by_system_picture', \r
         'licenses.by_system_picture', \r
       ],\r
       has_one: [\r
index 4c64f53..679c1a1 100644 (file)
@@ -133,12 +133,31 @@ class ApplicationController < ActionController::Base
           :filer => @filer
         }
       }
-      format.json { render json: @items.to_json(self.class.model.list_json_opt) }
+      format.json { render json: @items.to_json(@my_model_class.list_json_opt) }
       format.atom 
       format.rss
     end
   end
   
+  def set_show
+    set_model
+    @item = @my_model_class.show(params[:id], @operators)
+  end
+  
+ def show_prof_format format
+    format.prof {
+      self.formats = [:html]
+      @profiler = Manifest::View::Profiler.new @my_model.model_name, @item, @operators
+      render @profiler.template_name, :locals => {
+        :profiler => @profiler
+      }
+    }
+  end
+  
+  def show_json_format format
+    format.json { render json: @item.to_json(@my_model_class.show_json_opt) }
+  end
+  
   def set_new
     set_model
     @item = @my_model_class.new
@@ -200,12 +219,13 @@ class ApplicationController < ActionController::Base
   end
   
   def assist_items item_name, list_name
-    list_manager = Pettanr::Application::manifest.list_managers[item_name]
-    list = list_manager.open list_name, 1, 5, @operators
-    list.items
+    list = Manifest.manifest.lists[item_name][list_name]
+    list_result = list.open(@operators, {:id => @item.id, :page => 1, :page_size => 5})
+    list_result.items
   end
   
   def assist_filer item_name, items
+    @filer = Manifest::View::Filer.new @list.item_name, list_result.items, list_result.paginate, @operators
     filer_manager = Pettanr::Application::manifest.filer_managers[item_name]
     filer_manager.open(item_name, items, @operators, nil)
   end
index c46f864..f840f78 100644 (file)
@@ -16,15 +16,18 @@ class ArtistsController < ApplicationController
     filer_list
   end
   
-  def show
-    @item = Artist.show(params[:id], @operators)
+  def show_html_format format
+    format.html {
+      @artist = @item
+    }
+  end
   
+  def show
+    set_show
     respond_to do |format|
-      format.html {
-        @artist = @item
-      }
-      format_prof format
-      format.json { render :json => @item.to_json(Artist.show_json_opt) }
+      show_html_format format
+      show_prof_format format
+      show_json_format format
     end
   end
   
index 5fd246e..5cc0314 100644 (file)
@@ -16,15 +16,18 @@ class AuthorsController < ApplicationController
     filer_list
   end
   
+  def show_html_format format
+    format.html {
+      @author = @item
+    }
+  end
+  
   def show
-    @item = Author.show(params[:id], @operators)
-
+    set_show
     respond_to do |format|
-      format.html {
-        @author = @item
-      }
-      format_prof format
-      format.json { render :json => @item.to_json(Author.show_json_opt) }
+      show_html_format format
+      show_prof_format format
+      show_json_format format
     end
   end
   
index e784738..3237c7a 100644 (file)
@@ -23,14 +23,18 @@ class BalloonsController < ApplicationController
     filer_list
   end
   
+  def show_html_format format
+    format.html {
+      @balloon = @item
+    }
+  end
+  
   def show
-    @item = Balloon.show(params[:id], @operators)
+    set_show
     respond_to do |format|
-      format.html {
-        @balloon = @item
-      }
-      format_prof format
-      format.json { render json: @item.to_json(Balloon.show_json_opt) }
+      show_html_format format
+      show_prof_format format
+      show_json_format format
     end
   end
   
index 6580993..5a5312b 100644 (file)
@@ -20,13 +20,17 @@ class ComicsController < ApplicationController
     filer_list
   end
 
+  def show_html_format format
+    format.html {
+    }
+  end
+  
   def show
-    @item = Comic.show(params[:id], @operators)
+    set_show
     respond_to do |format|
-      format.html {
-      }
-      format_prof format
-      format.json { render json: @item.to_json(Comic.show_json_opt) }
+      show_html_format format
+      show_prof_format format
+      show_json_format format
       format.atom 
       format.rss 
     end
index 8e0a1fa..32e3d64 100644 (file)
@@ -26,14 +26,18 @@ class GroundColorsController < ApplicationController
     filer_list
   end
   
+  def show_html_format format
+    format.html {
+      @ground_color = @item
+    }
+  end
+  
   def show
-    @item = GroundColor.show(params[:id], @operators)
+    set_show
     respond_to do |format|
-      format.html {
-        @ground_color = @item
-      }
-      format_prof format
-      format.json { render json: @item.to_json(GroundColor.show_json_opt) }
+      show_html_format format
+      show_prof_format format
+      show_json_format format
     end
   end
   
index 515b0c0..a4616e6 100644 (file)
@@ -26,14 +26,18 @@ class GroundPicturesController < ApplicationController
     filer_list
   end
   
+  def show_html_format format
+    format.html {
+      @ground_picture = @item
+    }
+  end
+  
   def show
-    @item = GroundPicture.show(params[:id], @operators)
+    set_show
     respond_to do |format|
-      format.html {
-        @ground_picture = @item
-      }
-      format_prof format
-      format.json { render json: @item.to_json(GroundPicture.show_json_opt) }
+      show_html_format format
+      show_prof_format format
+      show_json_format format
     end
   end
   
index 1f0c0f8..5c2aedf 100644 (file)
@@ -9,14 +9,18 @@ class LicenseGroupsController < ApplicationController
     filer_list
   end
   
+  def show_html_format format
+    format.html {
+      @license_group = @item
+    }
+  end
+  
   def show
-    @item = LicenseGroup.show(params[:id], @operators)
+    set_show
     respond_to do |format|
-      format.html {
-        @license_group = @item
-      }
-      format_prof format
-      format.json { render json: @item.to_json(LicenseGroup.show_json_opt) }
+      show_html_format format
+      show_prof_format format
+      show_json_format format
     end
   end
   
index d5376de..4051865 100644 (file)
@@ -19,14 +19,18 @@ class LicensesController < ApplicationController
     filer_list
   end
   
+  def show_html_format format
+    format.html {
+      @license = @item
+    }
+  end
+  
   def show
-    @item = License.show(params[:id], @operators)
+    set_show
     respond_to do |format|
-      format.html {
-        @license = @item
-      }
-      format_prof format
-      format.json { render json: @item.to_json(License.show_json_opt) }
+      show_html_format format
+      show_prof_format format
+      show_json_format format
     end
   end
 
index 7bf19cc..0c5801b 100644 (file)
@@ -12,22 +12,25 @@ class OriginalPicturesController < ApplicationController
     filer_list
   end
 
+  def show_html_format format
+    format.html {
+      @original_picture = @item
+      #ライセンス付与のために原画ライセンスグループ作成準備
+      @original_picture_license_group  = OriginalPictureLicenseGroup.new :original_picture_id => @item.id
+      render
+    }
+  end
+  
   def show
-    @item = OriginalPicture.show(params[:id], @operators)
-    
+    set_show
     respond_to do |format|
       opt = {:type => @item.mime_type, :disposition=>"inline"}
-      format.png { send_data(@item.restore, opt ) }
-      format.gif { send_data(@item.restore, opt ) }
-      format.jpeg { send_data(@item.restore, opt ) }
-      format.html {
-        @original_picture = @item
-        #ライセンス付与のために原画ライセンスグループ作成準備
-        @original_picture_license_group  = OriginalPictureLicenseGroup.new :original_picture_id => @item.id
-        render
-      }
-      format_prof format
-      format.json { render json: @item.to_json(OriginalPicture.show_json_opt)}
+      format.png { send_data(@item.restore(params[:subdir]), opt ) }
+      format.gif { send_data(@item.restore(params[:subdir]), opt ) }
+      format.jpeg { send_data(@item.restore(params[:subdir]), opt ) }
+      show_html_format format
+      show_prof_format format
+      show_json_format format
     end
   end
 
index 180bed5..728215c 100644 (file)
@@ -26,15 +26,18 @@ class PanelPicturesController < ApplicationController
     filer_list
   end
   
+  def show_html_format format
+    format.html {
+      @panel_picture = @item
+    }
+  end
+  
   def show
-    @item = PanelPicture.show(params[:id], @operators)
-
+    set_show
     respond_to do |format|
-      format.html {
-        @panel_picture = @item
-      }
-      format_prof format
-      format.json { render :json => @item.to_json(PanelPicture.show_json_opt) }
+      show_html_format format
+      show_prof_format format
+      show_json_format format
     end
   end
 
index 82bc084..8017e75 100644 (file)
@@ -30,26 +30,29 @@ class PanelsController < ApplicationController
     filer_list
   end
   
+  def show_html_format format
+    format.html {
+      @panel = @item
+      if @operators.author
+        @new_scroll_items = assist_items('scroll', 'private_list')
+        #@new_scroll_filer = assist_filer 'scroll', @new_scroll_items
+        @fresh_scroll_items = assist_items('scroll_panel', 'private_list').map {|sp| sp.scroll}
+        #@fresh_scroll_filer = assist_filer 'scroll', @fresh_scroll_items
+        
+        @new_sheet_items = assist_items('sheet', 'private_list')
+        #@new_sheet_filer = assist_filer 'sheet', @new_sheet_items
+        @fresh_sheet_items = assist_items('sheet_panel', 'private_list').map {|sp| sp.sheet}
+        #@fresh_sheet_filer = assist_filer 'sheet', @fresh_sheet_items
+      end
+    }
+  end
+  
   def show
-    @item = Panel.show(params[:id], @operators)
-
+    set_show
     respond_to do |format|
-      format.html {
-        @panel = @item
-        if @operators.author
-          @new_scroll_items = assist_items('scroll', 'private_list')
-     #     @new_scroll_filer = assist_filer 'scroll', @new_scroll_items
-          @fresh_scroll_items = assist_items('scroll_panel', 'private_list').map {|sp| sp.scroll}
-     #     @fresh_scroll_filer = assist_filer 'scroll', @fresh_scroll_items
-          
-          @new_sheet_items = assist_items('sheet', 'private_list')
-    #      @new_sheet_filer = assist_filer 'sheet', @new_sheet_items
-          @fresh_sheet_items = assist_items('sheet_panel', 'private_list').map {|sp| sp.sheet}
-     #     @fresh_sheet_filer = assist_filer 'sheet', @fresh_sheet_items
-        end
-      }
-      format_prof format
-      format.json { render json: @item.panel_elements_as_json }
+      show_html_format format
+      show_prof_format format
+      show_json_format format
     end
   end
 
index 81b5ad4..9e1bae8 100644 (file)
@@ -8,19 +8,22 @@ class PicturesController < ApplicationController
     before_filter :authenticate_author, :only => []
   end
   
+  def show_html_format format
+    format.html {
+      @picture = @item
+    }
+  end
+  
   def show
-    @item = Picture.show(params[:id], @operators)
-
+    set_show
     respond_to do |format|
       opt = {:type => @item.mime_type, :disposition=>"inline"}
       format.png { send_data(@item.restore(params[:subdir]), opt ) }
       format.gif { send_data(@item.restore(params[:subdir]), opt ) }
       format.jpeg { send_data(@item.restore(params[:subdir]), opt ) }
-      format.html {
-        @picture = @item
-      }
-      format_prof format
-      format.json { render :json => @item.to_json}
+      show_html_format format
+      show_prof_format format
+      show_json_format format
     end
   end
   
index da074af..5049b5e 100644 (file)
@@ -26,19 +26,22 @@ class ResourcePicturesController < ApplicationController
     filer_list
   end
   
+  def show_html_format format
+    format.html {
+      @resource_picture = @item
+    }
+  end
+  
   def show
-    @item = ResourcePicture.show(params[:id], @operators)
-
+    set_show
     respond_to do |format|
       opt = {:type => @item.mime_type, :disposition=>"inline"}
       format.png { send_data(@item.restore(params[:subdir]), opt ) }
       format.gif { send_data(@item.restore(params[:subdir]), opt ) }
       format.jpeg { send_data(@item.restore(params[:subdir]), opt ) }
-      format.html {
-        @resource_picture = @item
-      }
-      format_prof format
-      format.json { render :json => @item.to_json(ResourcePicture.show_json_opt)}
+      show_html_format format
+      show_prof_format format
+      show_json_format format
     end
   end
   
index f6a93e8..df8c011 100644 (file)
@@ -27,10 +27,9 @@ class ScrollPanelsController < ApplicationController
   end
   
   def show
-    @item = ScrollPanel.show(params[:id], @operators)
-
+    set_show
     respond_to do |format|
-      format_prof format
+      show_prof_format format
       format.json { render json: @item.scroll_panel_as_json(@operators.author) }
     end
   end
index 4c1a6af..b9f52d5 100644 (file)
@@ -24,20 +24,22 @@ class ScrollsController < ApplicationController
     filer_list
   end
   
+  def show_html_format format
+    format.html {
+      @scroll = @item
+      if @operators.author
+        @new_panel_items = assist_items('panel', 'private_list')
+        #@new_panel_filer = assist_filer 'panel', @new_panel_items
+      end
+    }
+  end
+  
   def show
-    @item = Scroll.show(params[:id], @operators)
-
+    set_show
     respond_to do |format|
-      format.html {
-        if @operators.author
-          @new_panel_items = assist_items('panel', 'private_list')
-          @new_panel_filer = assist_filer 'panel', @new_panel_items
-        end
-      }
-      format.json { render json: @item.to_json(Scroll.show_json_opt) }
-      format_prof format
-      format.atom 
-      format.rss 
+      show_html_format format
+      show_prof_format format
+      show_json_format format
     end
   end
 
index 9782fc6..66e876b 100644 (file)
@@ -27,10 +27,9 @@ class SheetPanelsController < ApplicationController
   end
   
   def show
-    @item = SheetPanel.show(params[:id], @operators)
-
+    set_show
     respond_to do |format|
-      format_prof format
+      show_prof_format format
       format.json { render json: @item.sheet_panel_as_json(@operators.author) }
     end
   end
index a43c009..d36dfb7 100644 (file)
@@ -30,25 +30,26 @@ class SheetsController < ApplicationController
     filer_list
   end
   
+  def show_html_format format
+    format.html {
+      if @operators.author
+        @new_panel_items = assist_items('panel', 'private_list')
+        #new_panel_filer = assist_filer 'panel', @new_panel_items
+        
+        @new_story_items = assist_items('story', 'private_list')
+        #new_story_filer = assist_filer 'story', @new_story_items
+        @fresh_story_items = assist_items('story_sheet', 'private_list').map {|ss| ss.story}
+        #@fresh_story_filer = assist_filer 'story', @fresh_story_items
+      end
+    }
+  end
+  
   def show
-    @item = Sheet.show(params[:id], @operators)
-
+    set_show
     respond_to do |format|
-      format.html {
-        if @operators.author
-          @new_panel_items = assist_items('panel', 'private_list')
-          @new_panel_filer = assist_filer 'panel', @new_panel_items
-          
-          @new_story_items = assist_items('story', 'private_list')
-          @new_story_filer = assist_filer 'story', @new_story_items
-          @fresh_story_items = assist_items('story_sheet', 'private_list').map {|ss| ss.story}
-          @fresh_story_filer = assist_filer 'story', @fresh_story_items
-        end
-      }
-      format_prof format
-      format.json { render json: @item.to_json(Sheet.show_json_opt) }
-      format.atom 
-      format.rss 
+      show_html_format format
+      show_prof_format format
+      show_json_format format
     end
   end
 
index 1e3b1c9..61be851 100644 (file)
@@ -21,17 +21,18 @@ class SpeechBalloonTemplatesController < ApplicationController
     filer_list
   end
   
+  def show_html_format format
+    format.html {
+      @speech_balloon_template = @item
+    }
+  end
+  
   def show
-    @item = SpeechBalloonTemplate.show(params[:id], @operators)
-
+    set_show
     respond_to do |format|
-      format.html {
-        @speech_balloon_template = @item
-      }
-      format_prof format
-      format.json {
-        render :json => @item.to_json(SpeechBalloonTemplate.show_json_opt)
-      }
+      show_html_format format
+      show_prof_format format
+      show_json_format format
     end
   end
   
index 0203309..be0bdf7 100644 (file)
@@ -26,14 +26,18 @@ class SpeechBalloonsController < ApplicationController
     filer_list
   end
   
+  def show_html_format format
+    format.html {
+      @speech_balloon = @item
+    }
+  end
+  
   def show
-    @item = SpeechBalloon.show(params[:id], @operators)
+    set_show
     respond_to do |format|
-      format.html {
-        @speech_balloon = @item
-      }
-      format_prof format
-      format.json { render json: @item.to_json(SpeechBalloon.show_json_opt) }
+      show_html_format format
+      show_prof_format format
+      show_json_format format
     end
   end
   
index 19e3fc0..432c696 100644 (file)
@@ -27,14 +27,18 @@ class SpeechesController < ApplicationController
     filer_list
   end
   
+  def show_html_format format
+    format.html {
+      @speech = @item
+    }
+  end
+  
   def show
-    @item = Speech.show(params[:id], @operators)
+    set_show
     respond_to do |format|
-      format.html {
-        @speech = @item
-      }
-      format_prof format
-      format.json { render json: @item.to_json(Speech.show_json_opt) }
+      show_html_format format
+      show_prof_format format
+      show_json_format format
     end
   end
   
index 89676e1..1058c62 100644 (file)
@@ -30,18 +30,21 @@ class StoriesController < ApplicationController
     filer_list
   end
   
+  def show_html_format format
+    format.html {
+      if @operators.author
+        @new_sheet_items = assist_items('sheet', 'private_list')
+        #@new_sheet_filer = assist_filer 'sheet', @new_sheet_items
+      end
+    }
+  end
+  
   def show
-    @item = Story.show(params[:id], @operators)
-
+    set_show
     respond_to do |format|
-      format.html { 
-        if @operators.author
-          @new_sheet_items = assist_items('sheet', 'private_list')
-          @new_sheet_filer = assist_filer 'sheet', @new_sheet_items
-        end
-      }
-      format_prof format
-      format.json { render json: @item.to_json(Story.show_json_opt) }
+      show_html_format format
+      show_prof_format format
+      show_json_format format
     end
   end
   
index 496943f..9b56617 100644 (file)
@@ -27,11 +27,10 @@ class StorySheetsController < ApplicationController
   end
   
   def show
-    @item = StorySheet.show(params[:id], @operators)
-
+    set_show
     respond_to do |format|
-      format_prof format
-      format.json { render json: @item.to_json(StorySheet.show_json_opt) }
+      show_prof_format format
+      show_json_format format
     end
   end
   
index b151632..5b9f7e6 100644 (file)
@@ -17,19 +17,22 @@ class SystemPicturesController < ApplicationController
     filer_list
   end
   
+  def show_html_format format
+    format.html {
+      @system_picture = @item
+    }
+  end
+  
   def show
-    @item = SystemPicture.show(params[:id], @operators)
-    
+    set_show
     respond_to do |format|
       opt = {:type => @item.mime_type, :disposition=>"inline"}
       format.png { send_data(@item.restore, opt ) }
       format.gif { send_data(@item.restore, opt ) }
       format.jpeg { send_data(@item.restore, opt ) }
-      format.html {
-        @system_picture = @item
-      }
-      format_prof format
-      format.json { render json: @item.to_json(SystemPicture.show_json_opt)}
+      show_html_format format
+      show_prof_format format
+      show_json_format format
     end
   end
   
index ab7f606..520cf61 100644 (file)
@@ -15,15 +15,18 @@ class WritingFormatsController < ApplicationController
     filer_list
   end
 
+  def show_html_format format
+    format.html {
+      @writing_format = @item
+    }
+  end
+  
   def show
-    @item = WritingFormat.show(params[:id], @operators)
-
+    set_show
     respond_to do |format|
-      format.html {
-        @writing_format = @item
-      }
-      format_prof format
-      format.json { render :json => @item.to_json(WritingFormat.show_json_opt) }
+      show_html_format format
+      show_prof_format format
+      show_json_format format
     end
   end
 
index 2289587..6ef43e3 100644 (file)
@@ -1,30 +1,5 @@
-<%= render 'system/filer.html', :filer => profiler.header_filer %>\r
-<% profiler.each_column do |column| %>\r
-  <div>\r
-    <%= column.label self %>\r
-    <%= column.disp_value self %>\r
-    <%= column.note self %>\r
-  </div>\r
-<% end %>\r
-<div>\r
-  <%= 'associations' %>\r
+<div class="profiler">\r
+  <%= render profiler.header_template_name, :profiler => profiler %>\r
+  <%= render profiler.columns_template_name, :profiler => profiler %>\r
+  <%= render profiler.associations_template_name, :profiler => profiler %>\r
 </div>\r
-<div>\r
-  <%= 'belongs_to' %>\r
-</div>\r
-<% profiler.each_belongs_to do |parent_filer| %>\r
-  <%= render 'system/filer.html', :filer => parent_filer %>\r
-<% end %>\r
-<div>\r
-  <%= 'has_many' %>\r
-</div>\r
-<% profiler.each_has_many do |has_many_filer, more_url| %>\r
-  <%= render 'system/filer.html', :filer => has_many_filer %>\r
-  <%= link_to h('more'), more_url %>\r
-<% end %>\r
-<div>\r
-  <%= 'has_one' %>\r
-</div>\r
-<% profiler.each_has_one do |has_one_filer| %>\r
-  <%= render 'system/filer.html', :filer => has_one_filer %>\r
-<% end %>\r
diff --git a/app/views/templates/r/filer/_filer.html.erb b/app/views/templates/r/filer/_filer.html.erb
new file mode 100644 (file)
index 0000000..5ff03c5
--- /dev/null
@@ -0,0 +1,5 @@
+<div class="filer">
+  <%= render filer.header.template_name, :header => filer.header %>
+  <%= render filer.body.template_name, :body => filer.body %>
+  <%= render filer.footer.template_name, :footer => filer.footer %>
+</div>
index 5ff03c5..a2dc13a 100644 (file)
@@ -1,5 +1 @@
-<div class="filer">
-  <%= render filer.header.template_name, :header => filer.header %>
-  <%= render filer.body.template_name, :body => filer.body %>
-  <%= render filer.footer.template_name, :footer => filer.footer %>
-</div>
+<%= render filer.template_name, :filer => filer %>
diff --git a/app/views/templates/r/profiler/_associations.html.erb b/app/views/templates/r/profiler/_associations.html.erb
new file mode 100644 (file)
index 0000000..806f054
--- /dev/null
@@ -0,0 +1,23 @@
+<div class="associations">
+  <div>
+    <%= 'associations' %>
+  </div>
+  <div>
+    <%= 'belongs_to' %>
+  </div>
+  <% associations.each_belongs_to_filer do |filer| %>
+    <%= render filer.template_name, :filer => filer %>
+  <% end %>
+  <div>
+    <%= 'has_many' %>
+  </div>
+  <% associations.each_has_many_filer do |filer| %>
+    <%= render filer.template_name, :filer => filer %>
+  <% end %>
+  <div>
+    <%= 'has_one' %>
+  </div>
+  <% associations.each_has_one_filer do |filer| %>
+    <%= render filer.template_name, :filer => filer %>
+  <% end %>
+</div>
diff --git a/app/views/templates/r/profiler/_column.html.erb b/app/views/templates/r/profiler/_column.html.erb
new file mode 100644 (file)
index 0000000..b1b93c4
--- /dev/null
@@ -0,0 +1,5 @@
+<div class="column">
+  <%= column.label %>
+  <%= render column.value_template_name, :column => column %>
+  <%= render column.note_template_name, :column => column %>
+</div>
diff --git a/app/views/templates/r/profiler/_columns.html.erb b/app/views/templates/r/profiler/_columns.html.erb
new file mode 100644 (file)
index 0000000..6df659a
--- /dev/null
@@ -0,0 +1,5 @@
+<div class="columns">
+  <% profiler.columns.each do |column| %>
+    <%= render column.template_name, :column => column %>
+  <% end %>
+</div>
diff --git a/app/views/templates/r/profiler/_header.html.erb b/app/views/templates/r/profiler/_header.html.erb
new file mode 100644 (file)
index 0000000..c4a1fa0
--- /dev/null
@@ -0,0 +1,3 @@
+<div class="header">
+  <%= render header.filer.template_name, :filer => header.filer %>
+</div>
diff --git a/app/views/templates/r/profiler/_profiler.html.erb b/app/views/templates/r/profiler/_profiler.html.erb
new file mode 100644 (file)
index 0000000..131c486
--- /dev/null
@@ -0,0 +1,5 @@
+<div class="profiler">
+  <%= render profiler.header_template_name, :header => profiler.header %>
+  <%= render profiler.columns_template_name, :profiler => profiler %>
+  <%= render profiler.associations_template_name, :associations => profiler.associations %>
+</div>
diff --git a/app/views/templates/r/profiler/column_note/_default.html.erb b/app/views/templates/r/profiler/column_note/_default.html.erb
new file mode 100644 (file)
index 0000000..fbefb96
--- /dev/null
@@ -0,0 +1 @@
+(<%= t_selected_item(column.select_item_name, column.value) %>)
diff --git a/app/views/templates/r/profiler/column_note/_none.html.erb b/app/views/templates/r/profiler/column_note/_none.html.erb
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/app/views/templates/r/profiler/column_value/_date.html.erb b/app/views/templates/r/profiler/column_value/_date.html.erb
new file mode 100644 (file)
index 0000000..8968a26
--- /dev/null
@@ -0,0 +1 @@
+<%= l column.value %>
diff --git a/app/views/templates/r/profiler/column_value/_default.html.erb b/app/views/templates/r/profiler/column_value/_default.html.erb
new file mode 100644 (file)
index 0000000..ce22060
--- /dev/null
@@ -0,0 +1 @@
+<%= column.value %>
diff --git a/app/views/templates/r/profiler/profiler.html.erb b/app/views/templates/r/profiler/profiler.html.erb
new file mode 100644 (file)
index 0000000..4418e65
--- /dev/null
@@ -0,0 +1 @@
+<%= render profiler.template_name, :profiler => profiler %>
index 1d48022..4fdd3f0 100644 (file)
@@ -4,15 +4,14 @@ require_dependency "manifest/list/private"
 require_dependency "manifest/list/system_resource"
 require_dependency "manifest/list/filter"
 require_dependency "manifest/list/through_filter"
-require_dependency "manifest/list/element_filter"
+require_dependency "manifest/list/foreign_filter"
 require_dependency "manifest/list/play"
 module Manifest
   module ListModule
     class ListFactory
       @@types = {
         'public' => ListModule::PublicList, 'private' => PrivateList, 'system_resource' => SystemResourceList,
-        'filter' => FilterList, 
-        'through_filter' => ThroughFilterList, 'element_filter' => ElementFilterList, 
+        'filter' => FilterList, 'through_filter' => ThroughFilterList, 'foreign_filter' => ForeignFilterList, 
         'play' => PlayList
       }
       def self.factory manifest, item_name, my_manifests
index 58e7a7e..a771846 100644 (file)
@@ -1,3 +1,5 @@
+require_dependency "manifest/list/where"
+require_dependency "manifest/list/includes"
 module Manifest
   module ListModule
     class Base
@@ -11,7 +13,8 @@ module Manifest
       end
       
       attr :manifest, :item_name, :list_name, :list_manifest, 
-        :default_page_size, :max_page_size
+        :model, :model_manifest, :model_list_manifest, 
+        :where, :includes
       def initialize manifest, item_name, list_name, list_manifest
         @manifest = manifest
         @item_name = item_name
@@ -24,20 +27,23 @@ module Manifest
       def set_default
         @model_manifest = @manifest.models[@item_name]
         @model_list_manifest = @model_manifest.lists[@list_name]
-        @list_manifest['default_page_size'] ||= @model_list_manifest.default_page_size
-        @list_manifest['max_page_size'] ||= @model_list_manifest.max_page_size
+        @list_manifest['where'] ||= {}
+        @list_manifest['includes'] ||= {}
       end
       
       def init
-        @default_page_size = @list_manifest['default_page_size']
-        @max_page_size = @list_manifest['max_page_size']
-        
         @model = ::Manifest.item_name_to_model @item_name
         @table_name = @model.table_name
-        if @model.content?
-          @owner_model = @model.owner_model
-          @owner_table_name = @owner_model.table_name if @owner_model
-        end
+        @where = WhereFactory.factory self, @list_manifest['where']
+        @includes = IncludeFactory.factory self, @list_manifest['includes']
+      end
+      
+      def default_page_size
+        @model_list_manifest.default_page_size
+      end
+      
+      def max_page_size
+        @model_list_manifest.max_page_size
       end
       
       def page_number prm = nil
@@ -48,25 +54,24 @@ module Manifest
       
       def page_size prm
         page_size = prm.to_i
-        page_size = @max_page_size if page_size > @max_page_size
-        page_size = @default_page_size if page_size < 1
+        page_size = self.max_page_size if page_size > self.max_page_size
+        page_size = self.default_page_size if page_size < 1
         page_size
       end
       
-      def where
-        @model.list_where
+      def base_where_condition
+        method_name = @where.conditions do |name|
+          name
+        end
+        @model.__send__ method_name
       end
       
-      def includes
-        if @owner_model
-          if @owner_model.owner_model
-            {@owner_model.item_name => {@owner_model.owner_model.item_name => {}}}
-          else
-            {@owner_model.item_name => {}}
-          end
-        else
-          {}
-        end
+      def where_condition
+        base_where_condition
+      end
+      
+      def include_hash
+        @includes.includes
       end
       
       def order
@@ -74,15 +79,15 @@ module Manifest
       end
       
       def items operators, options, offset, page_size
-        @model.where(self.where).includes(self.includes).order(self.order).offset(offset).limit(page_size)
+        @model.where(self.where_condition).includes(self.include_hash).order(self.order).offset(offset).limit(page_size)
       end
       
       def count operators, options
-        @model.where(self.where).includes(self.includes)
+        @model.where(self.where_condition).includes(self.include_hash).count
       end
       
-      def paginate items, offset, page_size
-        c = items ? items.count : 0
+      def paginate count, offset, page_size
+        c = count ? count.to_i : 0
         Kaminari.paginate_array(Array.new(c, nil)).page(offset).per(page_size)
       end
       
@@ -91,8 +96,9 @@ module Manifest
         page_size = self.page_size options[:page_size]
         offset = (page -1) * page_size
         items = self.items operators, options, offset, page_size
-        paginate = self.paginate items, offset, page_size
-        ListResult.new items, paginate
+        count = self.count operators, options
+        pg = self.paginate count, offset, page_size
+        ListResult.new items, pg
       end
       
     end
index 2a06ffb..b5a0d56 100644 (file)
@@ -8,29 +8,29 @@ module Manifest
       
       def init
         super
+        @filter_item_name = @model_list_manifest.filter_item_name
         @filter_key = @model_list_manifest.filter_key
       end
       
-      def where filter_item_id
-        w = @model.list_where
+      def where_condition filter_item_id
+        w = self.base_where_condition
         w += ' and ' unless w.blank?
         [w + @table_name + '.' + @filter_key + ' = ?', filter_item_id] 
       end
       
-      def includes
-        return @includes if @includes
-        w = @owner_model ? {@owner_model.item_name => {}} : {}
-        w.merge({@from => {} }) 
+      def include_hash
+        w = super
+        w.merge({@filter_item_name => {} }) unless w[@filter_item_name]
       end
       
-      def items options, offset, page_size
+      def items operators, options, offset, page_size
         filter_item_id = options[:id]
-        @model.where(self.where(filter_item_)).includes(self.includes).order(self.order).offset(offset).limit(page_size)
+        @model.where(self.where_condition(filter_item_id)).includes(self.include_hash).order(self.order).offset(offset).limit(page_size)
       end
       
       def count operators, options
         filter_item_id = options[:id]
-        @model.where(self.where(filter_item_id)).includes(self.includes).count
+        @model.where(self.where_condition(filter_item_id)).includes(self.include_hash).count
       end
       
       def self._add_action item_name, action_name, list_name, list_conf
similarity index 54%
rename from lib/manifest/list/element_filter.rb
rename to lib/manifest/list/foreign_filter.rb
index b846268..899edb1 100644 (file)
@@ -1,6 +1,6 @@
 module Manifest
   module ListModule
-    class ElementFilterList < FilterList
+    class ForeignFilterList <  FilterList
       
       def set_default
         super
@@ -8,16 +8,13 @@ module Manifest
       
       def init
         super
+        @filter_table_name = ::Manifest.manifest.models[@filter_item_name].classify.table_name
       end
       
-      def includes
-        {@owner_model.item_name => {}}
-      end
-      
-      def where filter_item
-        w = @model.list_where
+      def where_condition filter_item_id
+        w = super()
         w += ' and ' unless w.blank?
-        [w + @owner_table_name + '.' + @filter_key + ' = ?', filter_item.id] 
+        [w + @filter_table_name + '.id' + ' = ?', filter_item_id] 
       end
       
       def self.add_action item_name, action_name, list_name, list_conf
diff --git a/lib/manifest/list/includes.rb b/lib/manifest/list/includes.rb
new file mode 100644 (file)
index 0000000..7873585
--- /dev/null
@@ -0,0 +1,24 @@
+require_dependency "manifest/list/includes/base"
+require_dependency "manifest/list/includes/method"
+require_dependency "manifest/list/includes/auto"
+require_dependency "manifest/list/includes/none"
+module Manifest
+  module ListModule
+    class IncludeFactory
+      include IncludeModule
+      @@types = {
+        'method' => IncludeMethod, 'auto' => IncludeAuto, 'none' => IncludeNone
+      }
+      
+      def self.factory list, my_manifest
+        my_manifest['type'] ||=  'auto'
+        type = my_manifest['type']
+        raise "undefined type for lists > #{list.item_name} > #{list.list_name} > includes\n" unless type
+        my_class = @@types[type]
+        raise "undefined class for lists > #{list.item_name} > #{list.list_name} > includes > #{type}\n" unless my_class
+        my_class.new(list, my_manifest)
+      end
+      
+    end
+  end
+end
diff --git a/lib/manifest/list/includes/auto.rb b/lib/manifest/list/includes/auto.rb
new file mode 100644 (file)
index 0000000..73d5eaa
--- /dev/null
@@ -0,0 +1,48 @@
+module Manifest
+  module ListModule
+    module IncludeModule
+      class IncludeAuto < Base
+        attr :tree_name
+        def set_default
+          super
+          @includes_manifest['args']['tree_name'] ||= 'owner'
+        end
+        
+        def init
+          super
+          @tree_name = @args['tree_name']
+          @parent_model_manifest = @list.model_manifest.tree_model_manifest(@tree_name)
+          if @parent_model_manifest
+            @parent_model_name = @parent_model_manifest.classify.item_name
+            @root_model_manifest = @parent_model_manifest.tree_model_manifest(@tree_name)
+            if @root_model_manifest
+              @root_model_name = @root_model_manifest.classify.item_name
+            end
+          end
+        end
+        
+        def includes
+          if @parent_model_name
+            if @root_model_name
+              {@parent_model_name => {@root_model_name => {}}}
+            else
+              {@parent_model_name => {}}
+            end
+          else
+            {}
+          end
+        end
+        
+        def foreign_model_name
+          if @root_model_name
+            @root_model_name
+          else
+            @parent_model_name
+          end
+        end
+        
+      end
+      
+    end
+  end
+end
diff --git a/lib/manifest/list/includes/base.rb b/lib/manifest/list/includes/base.rb
new file mode 100644 (file)
index 0000000..742f7f1
--- /dev/null
@@ -0,0 +1,38 @@
+module Manifest
+  module ListModule
+    module IncludeModule
+      class Base
+        attr :list, :includes_manifest, :type
+        def initialize list, includes_manifest
+          @list = list
+          @includes_manifest = includes_manifest
+          self.set_default
+          self.init
+        end
+        
+        def set_default
+          @includes_manifest['args'] ||= {}
+        end
+        
+        def init
+          @type = @includes_manifest['type']
+          @args = @includes_manifest['args']
+        end
+        
+        def item_name
+          @list.item_name
+        end
+        
+        def list_name
+          @list.list_name
+        end
+        
+        def model
+          @list.model
+        end
+        
+      end
+      
+    end
+  end
+end
diff --git a/lib/manifest/list/includes/method.rb b/lib/manifest/list/includes/method.rb
new file mode 100644 (file)
index 0000000..7b99fcb
--- /dev/null
@@ -0,0 +1,24 @@
+module Manifest
+  module ListModule
+    module IncludeModule
+      class IncludeMethod < Base
+        attr :method_name
+        def set_default
+          super
+          @includes_manifest['args']['method_name'] ||= self.list_name + '_list_includes'
+        end
+        
+        def init
+          super
+          @method_name = @args['method_name']
+        end
+        
+        def includes
+          self.model.__send__ @method_name
+        end
+        
+      end
+      
+    end
+  end
+end
diff --git a/lib/manifest/list/includes/none.rb b/lib/manifest/list/includes/none.rb
new file mode 100644 (file)
index 0000000..0dae0b2
--- /dev/null
@@ -0,0 +1,22 @@
+module Manifest
+  module ListModule
+    module IncludeModule
+      class IncludeNone < Base
+        attr :tree_name
+        def set_default
+          super
+        end
+        
+        def init
+          super
+        end
+        
+        def includes
+          {}
+        end
+        
+      end
+      
+    end
+  end
+end
index 5014234..81a123b 100644 (file)
@@ -1,7 +1,7 @@
 module Manifest
   module ListModule
     class PrivateList < Base
-      def where operators
+      def where_condition operators
         case @model.owner_type
         when :author
           operator = operators.author
@@ -17,11 +17,18 @@ module Manifest
         else
           @table_name
         end
-        [t + '.' + @model.owner_type.to_s + '_id = ?', operator.id]
+        @where.conditions do |name|
+          [t + '.' + @model.owner_type.to_s + '_id = ?', operator.id]
+        end
       end
     
       def items operators, options, offset, page_size
-        @model.where(self.where(operators)).includes(self.includes).order(self.order).offset(offset).limit(page_size)
+        @model.where(self.where_condition(operators)).includes(self.include_hash).order(self.order).offset(offset).limit(page_size)
+      end
+      
+      def count operators, options
+        filter_item_id = options[:id]
+        @model.where(self.where_condition(operators)).includes(self.include_hash).count
       end
       
     end
index d5fb47f..6a19c43 100644 (file)
@@ -10,22 +10,6 @@ module Manifest
         super
       end
       
-      def where
-        @model.list_where
-      end
-      
-      def includes
-        if @owner_model
-          if @owner_model.owner_model
-            {@owner_model.item_name => {@owner_model.owner_model.item_name => {}}}
-          else
-            {@owner_model.item_name => {}}
-          end
-        else
-          {}
-        end
-      end
-      
       def order
         @model.list_order
       end
index d8b35dd..8e84937 100644 (file)
@@ -9,18 +9,18 @@ module Manifest
       
       def init
         super
-        return
-        @through = @list_list_conf['through']
+        @through = @model_list_manifest.through
+        @filter_table_name = ::Manifest.manifest.models[@filter_item_name].classify.table_name
       end
       
-      def includes
-        {@through => {@from => {}} }
+      def include_hash
+        {@through => {@filter_item_name => {}} }
       end
       
-      def where filter_item
-        w = @model.list_where
+      def where_condition filter_item_id
+        w = self.base_where_condition
         w += ' and ' unless w.blank?
-        [w + @through + '.' + @filter_key + ' = ?', filter_item.id] 
+        [w + @filter_table_name + '.id' + ' = ?', filter_item_id] 
       end
       
     end
diff --git a/lib/manifest/list/where.rb b/lib/manifest/list/where.rb
new file mode 100644 (file)
index 0000000..6a67f63
--- /dev/null
@@ -0,0 +1,23 @@
+require_dependency "manifest/list/where/base"
+require_dependency "manifest/list/where/method"
+require_dependency "manifest/list/where/auto"
+module Manifest
+  module ListModule
+    class WhereFactory
+      include WhereModule
+      @@types = {
+        'method' => WhereMethod, 'auto' => WhereAuto
+      }
+      
+      def self.factory list, my_manifest
+        my_manifest['type'] ||=  'auto'
+        type = my_manifest['type']
+        raise "undefined type for lists > #{list.item_name} > #{list.list_name} > where\n" unless type
+        my_class = @@types[type]
+        raise "undefined class for lists > #{list.item_name} > #{list.list_name} > where > #{type}\n" unless my_class
+        my_class.new(list, my_manifest)
+      end
+      
+    end
+  end
+end
diff --git a/lib/manifest/list/where/auto.rb b/lib/manifest/list/where/auto.rb
new file mode 100644 (file)
index 0000000..ca8c14d
--- /dev/null
@@ -0,0 +1,32 @@
+module Manifest
+  module ListModule
+    module WhereModule
+      class WhereAuto < Base
+        attr :method_name
+        def set_default
+          super
+          @where_manifest['args']['method_name'] ||= self.base_name
+        end
+        
+        def init
+          super
+          @method_name = @args['method_name']
+        end
+        
+        def base_name
+          if self.model.content?
+            'public_list_where'
+          else
+            'list_where'
+          end
+        end
+        
+        def conditions
+          yield @method_name
+        end
+        
+      end
+      
+    end
+  end
+end
diff --git a/lib/manifest/list/where/base.rb b/lib/manifest/list/where/base.rb
new file mode 100644 (file)
index 0000000..41ba04f
--- /dev/null
@@ -0,0 +1,38 @@
+module Manifest
+  module ListModule
+    module WhereModule
+      class Base
+        attr :list, :where_manifest, :type
+        def initialize list, where_manifest
+          @list = list
+          @where_manifest = where_manifest
+          self.set_default
+          self.init
+        end
+        
+        def set_default
+          @where_manifest['args'] ||= {}
+        end
+        
+        def init
+          @type = @where_manifest['type']
+          @args = @where_manifest['args']
+        end
+        
+        def item_name
+          @list.item_name
+        end
+        
+        def list_name
+          @list.list_name
+        end
+        
+        def model
+          @list.model
+        end
+        
+      end
+      
+    end
+  end
+end
diff --git a/lib/manifest/list/where/method.rb b/lib/manifest/list/where/method.rb
new file mode 100644 (file)
index 0000000..723edde
--- /dev/null
@@ -0,0 +1,24 @@
+module Manifest
+  module ListModule
+    module WhereModule
+      class WhereMethod < Base
+        attr :method_name
+        def set_default
+          super
+          @where_manifest['args']['method_name'] ||= self.list_name + '_list_where'
+        end
+        
+        def init
+          super
+          @method_name = @args['method_name']
+        end
+        
+        def conditions
+          yield @method_name
+        end
+        
+      end
+      
+    end
+  end
+end
index fbf11b5..5671b23 100644 (file)
@@ -1,5 +1,6 @@
 require_dependency "manifest/local/view/filer"
 require_dependency "manifest/local/view/form"
+require_dependency "manifest/local/view/profiler"
 module Manifest
   module View
   end
diff --git a/lib/manifest/local/view/profiler.rb b/lib/manifest/local/view/profiler.rb
new file mode 100644 (file)
index 0000000..ffb9efd
--- /dev/null
@@ -0,0 +1,65 @@
+require_dependency "manifest/local/view/profiler/header"
+require_dependency "manifest/local/view/profiler/column"
+require_dependency "manifest/local/view/profiler/association"
+module Manifest
+  module View
+    class Profiler
+      include ProfilerModule
+      attr :profiler_manifest, :item_name, :item, :operators, :template_dir, 
+        :header, :columns, :associations
+      def initialize item_name, item, operators
+        @item_name = item_name
+        @item = item
+        @operators = operators
+        @profiler_manifest = Manifest.manifest.profilers[@item_name]
+        @template_dir = 'templates/r/profiler/'
+        @header = Header.new self
+        @columns = @profiler_manifest.column_names.map {|column_name|
+          Column.new self, column_name
+        }
+        @associations = Association.new self, @profiler_manifest.associations
+      end
+      
+      def model
+        ::Manifest::item_name_to_model @item_name
+      end
+      
+      def template_file_name
+        "profiler"
+      end
+      
+      def template_name
+        self.template_dir + self.template_file_name
+      end
+      
+      def header_template_file_name
+        "header"
+      end
+      
+      def header_template_name
+        self.template_dir + self.header_template_file_name
+      end
+      
+      def columns_template_file_name
+        "columns"
+      end
+      
+      def columns_template_name
+        self.template_dir + self.columns_template_file_name
+      end
+      
+      def associations_template_file_name
+        "associations"
+      end
+      
+      def associations_template_name
+        self.template_dir + self.associations_template_file_name
+      end
+      
+      def image_dir
+        '/images/'
+      end
+      
+    end
+  end
+end
diff --git a/lib/manifest/local/view/profiler/association.rb b/lib/manifest/local/view/profiler/association.rb
new file mode 100644 (file)
index 0000000..35cde9c
--- /dev/null
@@ -0,0 +1,70 @@
+require_dependency "manifest/local/view/profiler/association/belongs_to"
+require_dependency "manifest/local/view/profiler/association/has_many"
+require_dependency "manifest/local/view/profiler/association/has_one"
+module Manifest
+  module View
+    module ProfilerModule
+      class Association
+        include AssociationModule
+        attr :profiler, :association_manifest,
+          :belongs_to, :has_many, :has_one
+        def initialize profiler, association_manifest
+          @profiler = profiler
+          @association_manifest = association_manifest
+          @belongs_to = @association_manifest.belongs_to.map {|belongs_to_manifest|
+            BelongsTo.new self, belongs_to_manifest
+          }
+          @has_many = @association_manifest.has_many.map {|list_name|
+            HasMany.new self, list_name
+          }
+          @has_one = @association_manifest.has_one.map {|list_name|
+            HasOne.new self, list_name
+          }
+        end
+        
+        def item
+          @profiler.item
+        end
+        
+        def model_manifest
+          ::Manifest.manifest.models[@profiler.item_name]
+        end
+        
+        def model_attribute_manifest
+          model_manifest.attributes[@column_name]
+        end
+        
+        def template_dir 
+          @profiler.template_dir
+        end
+        
+        def template_file_name
+          "associations"
+        end
+        
+        def template_name
+          self.template_dir + self.template_file_name
+        end
+        
+        def each_belongs_to_filer
+          @belongs_to.each {|b|
+            yield b.filer
+          }
+        end
+        
+        def each_has_many_filer
+          @has_many.each {|h|
+            yield h.filer
+          }
+        end
+        
+        def each_has_one_filer
+          @has_one.each {|h|
+            yield h.filer
+          }
+        end
+        
+      end
+    end
+  end
+end
diff --git a/lib/manifest/local/view/profiler/association/belongs_to.rb b/lib/manifest/local/view/profiler/association/belongs_to.rb
new file mode 100644 (file)
index 0000000..8955be0
--- /dev/null
@@ -0,0 +1,52 @@
+module Manifest
+  module View
+    module ProfilerModule
+      module AssociationModule
+        class BelongsTo
+          attr :association, :belongs_to_manifest
+          def initialize association, belongs_to_manifest
+            @association = association
+            @belongs_to_manifest = belongs_to_manifest
+          end
+          
+          def item
+            self.profiler.item
+          end
+          
+          def parent_model
+            @belongs_to_manifest.model
+          end
+          
+          def parent_id
+            self.item.attributes[self.model_belongs_to_manifest.id_column]
+          end
+          
+          def filer
+            filer = nil
+            begin
+              r = self.parent_model.show(self.parent_id, self.profiler.operators)
+             if r
+                filer = ::Manifest::View::Filer.new self.parent_model.item_name, [r], nil, self.profiler.operators
+              end
+           rescue ActiveRecord::RecordNotFound, ActiveRecord::Forbidden
+            end
+            filer
+          end
+          
+          def model_manifest
+            ::Manifest.manifest.models[self.profiler.item_name]
+          end
+          
+          def model_belongs_to_manifest
+            self.model_manifest.associations.belongs_to[@belongs_to_manifest.model_name]
+          end
+          
+          def profiler
+            @association.profiler
+          end
+          
+        end
+      end
+    end
+  end
+end
diff --git a/lib/manifest/local/view/profiler/association/has_many.rb b/lib/manifest/local/view/profiler/association/has_many.rb
new file mode 100644 (file)
index 0000000..6a9711a
--- /dev/null
@@ -0,0 +1,35 @@
+module Manifest
+  module View
+    module ProfilerModule
+      module AssociationModule
+        class HasMany
+          attr :association, :has_many_manifest
+          def initialize association, has_many_manifest
+            @association = association
+            @has_many_manifest = has_many_manifest
+          end
+          
+          def item
+            self.profiler.item
+          end
+          
+          def has_many_model
+            @has_many_manifest.model
+          end
+          
+          def filer
+            l = @has_many_manifest.list
+            list_result = @has_many_manifest.list.open(self.profiler.operators, {:id => self.item.id, :page => 1, :page_size => 3})
+            items = list_result.items 
+            ::Manifest::View::Filer.new self.has_many_model.item_name, items, nil, self.profiler.operators
+          end
+          
+          def profiler
+            @association.profiler
+          end
+          
+        end
+      end
+    end
+  end
+end
diff --git a/lib/manifest/local/view/profiler/association/has_one.rb b/lib/manifest/local/view/profiler/association/has_one.rb
new file mode 100644 (file)
index 0000000..6b732cd
--- /dev/null
@@ -0,0 +1,64 @@
+module Manifest
+  module View
+    module ProfilerModule
+      module AssociationModule
+        class HasOne
+          attr :association, :column_name
+          def initialize association, belongs_to_name
+            @association = association
+            @belongs_to_name = belongs_to_name
+          end
+          
+          def profiler
+            @association.profiler
+          end
+          
+          def item
+            self.profiler.item
+          end
+          
+          def parent_model
+            self.model_belongs_to_manifest.model
+          end
+          
+          def parent_id
+            self.item.attributes[self.model_belongs_to_manifest.id_column]
+          end
+          
+          def filer
+            filer = nil
+            begin
+              r = self.parent_model.show(self.parent_id, self.profiler.operators)
+             if r
+                filer = Manifest::View::Filer.new self.item.item_name, [r], nil, self.profiler.operators
+              end
+           rescue ActiveRecord::RecordNotFound, ActiveRecord::Forbidden
+            end
+            filer
+          end
+          
+          def model_manifest
+            ::Manifest.manifest.models[@profiler.item_name]
+          end
+          
+          def model_belongs_to_manifest
+            self.model_manifest.belongs_to[@belongs_to_name]
+          end
+          
+          def template_dir 
+            @profiler.template_dir
+          end
+          
+          def template_file_name
+            "ssociations"
+          end
+          
+          def template_name
+            self.template_dir + self.template_file_name
+          end
+          
+        end
+      end
+    end
+  end
+end
diff --git a/lib/manifest/local/view/profiler/column.rb b/lib/manifest/local/view/profiler/column.rb
new file mode 100644 (file)
index 0000000..9a7dc0a
--- /dev/null
@@ -0,0 +1,118 @@
+module Manifest
+  module View
+    module ProfilerModule
+      class Column
+        attr :profiler, :column_name
+        def initialize profiler, column_name
+          @profiler = profiler
+          @column_name = column_name
+        end
+        
+        def label
+          self.item.class.human_attribute_name(@column_name)
+        end
+        
+        def value
+          self.item.attributes[@column_name]
+        end
+        
+        def note
+        end
+        
+        def date?
+          case model_attribute_manifest.type
+          when 'datetime'
+            if self.value
+              true
+            else
+              false
+            end
+          else
+            false
+          end
+        end
+        
+        def note?
+          if self.model_attribute_source_manifest
+            case self.model_attribute_source_manifest.type
+            when 'magic_number'
+              true
+            when 'model'
+              false
+            else
+              false
+            end
+          else
+            false
+          end
+        end
+        
+        def select_item_name
+          self.model_attribute_source_manifest.select_item_name
+        end
+        
+        def item
+          @profiler.item
+        end
+        
+        def model_manifest
+          ::Manifest.manifest.models[@profiler.item_name]
+        end
+        
+        def model_attribute_manifest
+          self.model_manifest.attributes[@column_name]
+        end
+        
+        def model_attribute_source_manifest
+          self.model_attribute_manifest.source
+        end
+        
+        def template_dir 
+          @profiler.template_dir
+        end
+        
+        def template_file_name
+          "column"
+        end
+        
+        def template_name
+          self.template_dir + self.template_file_name
+        end
+        
+        def value_template_dir 
+          @profiler.template_dir + "column_value/"
+        end
+        
+        def value_template_file_name
+          if self.date?
+            'date'
+          else
+            'default'
+          end
+        end
+        
+        def value_template_name
+          self.value_template_dir + self.value_template_file_name
+        end
+        
+        def note_template_dir 
+          @profiler.template_dir + "column_note/"
+        end
+        
+        def note_template_file_name
+          if self.note?
+            'default'
+          else
+            'none'
+          end
+        end
+        
+        def note_template_name
+          self.note_template_dir + self.note_template_file_name
+        end
+        
+      end
+    end
+  end
+end
+  
diff --git a/lib/manifest/local/view/profiler/header.rb b/lib/manifest/local/view/profiler/header.rb
new file mode 100644 (file)
index 0000000..80a1d15
--- /dev/null
@@ -0,0 +1,19 @@
+module Manifest
+  module View
+    module ProfilerModule
+      class Header
+        attr :profiler
+        def initialize profiler
+          @profiler = profiler
+        end
+        
+        def filer
+          ::Manifest::View::Filer.new @profiler.item_name, [@profiler.item], nil, @profiler.operators
+        end
+        
+      end
+      
+    end
+  end
+end
+
diff --git a/lib/manifest/local/view/profiler/profiler.rb b/lib/manifest/local/view/profiler/profiler.rb
deleted file mode 100644 (file)
index 1caab9f..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-  class ProfilerView
-    attr :filer_manifest, :item_name, :manifest, :filer_conf, 
-      :symbol, :caption, :summary, :icon, :date, :edit
-    def initialize filer_manifest, items, operators, paginate
-      @filer_manifest = filer_manifest
-      @items = items
-      @file_items = @items.map {|item| 
-        FileItem.new self, @filer_manifest
-      }
-    end
-    
-    def render view
-    end
-    
-      def model_name
-        @item_name
-      end
-      
-      def model
-        model_name.classify.constantize
-      end
-      
-  end
-  
-  class ProfilerManager
-    class Profiler
-      def initialize item_name, item, operators, conf, manifest
-        @item_name = item_name
-        @item = item
-        @operators = operators
-        @conf = conf
-        @manifest = manifest
-        
-        @lists = @manifest.profiler(@item_name).lists
-        @belongs_to_conf = @manifest.profiler(@item_name).belongs_to
-        @has_many_conf = @manifest.profiler(@item_name).has_many
-        @has_one_conf = @manifest.profiler(@item_name).has_one
-      end
-      
-      def modelize str
-        str.classify.constantize
-      end
-      
-      def header_filer
-        @manifest.filer_managers[@item_name].open @item_name, [@item], @operators, nil
-      end
-      
-      def each_column
-        @conf['columns'].each do |column_name|
-          column = Column.new @item_name, column_name, @item, @operators, @manifest
-          yield column
-        end
-      end
-      
-      def parent_item parent_model, model_belongs_to_conf
-        r = nil
-        id_column = model_belongs_to_conf['id_column']
-        begin
-          r = parent_model.show(@item.attributes[id_column], @operators)
-        rescue ActiveRecord::RecordNotFound, ActiveRecord::Forbidden
-        end
-        r
-      end
-      
-      def each_belongs_to
-        @belongs_to_conf.each do |association_model_name|
-          model_belongs_to_conf = @manifest.model(@item_name).belongs_to[association_model_name]
-          parent_model = self.modelize association_model_name
-          parent = self.parent_item parent_model, model_belongs_to_conf
-          if parent
-            parent_filer = @manifest.filer_managers[parent_model.item_name].open parent_model.item_name, [parent], @operators, nil
-            yield parent_filer
-          end
-        end
-      end
-      
-      def each_has_many
-        @has_many_conf.each do |profiler_list_name|
-          raise "undefined lists for #{profiler_list_name} in #{@lists}\n" unless @lists[profiler_list_name]
-          model_name = @lists[profiler_list_name]['model_name']
-          list_name = @lists[profiler_list_name]['list_name']
-          raise "undefined has_many list for #{model_name}::#{list_name}\nconf:#{@controller_conf}\n" unless @manifest.list_managers[model_name]
-          list = @manifest.list_managers[model_name].open(list_name, 1, 3, @operators)
-          items = list.items @item
-#p [model_name, list_name, @item, list.class, list.includes, list.where(@item )]
-          has_many_filer = @manifest.filer_managers[model_name].open model_name, items, @operators, nil
-          model = model_name.classify.constantize
-          more_url = "/#{model.table_name}/#{list_name}/#{@item.id}"
-          yield has_many_filer, more_url
-        end
-      end
-      
-      def each_has_one 
-        @has_one_conf.each do |profiler_list_name|
-          raise "undefined lists for #{profiler_list_name} in #{@lists}\n" unless @lists[profiler_list_name]
-          model_name = @lists[profiler_list_name]['model_name']
-          list_name = @lists[profiler_list_name]['list_name']
-          raise "undefined has_one list for #{model_name}::#{list_name}\nconf:#{@controller_conf}\n" unless @manifest.list_managers[model_name]
-          list = @manifest.list_managers[model_name].open(list_name, 1, 1, @operators)
-          items = list.items @item
-          has_one_filer = @manifest.filer_managers[model_name].open model_name, items, @operators, nil
-          yield has_one_filer
-        end
-      end
-      
-    end
-    
-    def initialize profiler_manifest
-      @profiler_manifest = profiler_manifest
-      @item_name = @profiler_manifest.item_name
-      @manifest = profiler_manifest.manifest
-      @profiler_conf = @profiler_manifest.conf
-    end
-    
-  end
-  
index a871faa..a2da8f8 100644 (file)
@@ -18,11 +18,11 @@ module Manifest
       @controllers = Controller.manager(self, @manifest['controllers'])
       @models = Model.manager(self, @manifest['models'])
       @locals = @manifest['locals']
+      @lists = List.manager(self, @locals['lists'])
       @filers = Filer.manager(self, @locals['filers'])
       @profilers = Profiler.manager(self, @locals['profilers'])
       @forms = Form.base_manager(self, @locals['forms'])
       @forms.merge(Form.extend_manager(self, @locals['forms']))
-      @lists = List.manager(self, @locals['lists'])
       @system_resources.init
       add_action
     end
index c2eb4c5..6c76ea4 100644 (file)
@@ -14,7 +14,7 @@ module Manifest
     end
     
     attr :model_name, :model_manifest, 
-      :attributes, :associations, :lists
+      :attributes, :associations, :tree, :lists
     def initialize manifest, model_name, model_manifest
       @manifest = manifest
       @model_name = model_name
@@ -26,6 +26,7 @@ module Manifest
     def set_default
       @model_manifest['attributes'] ||= {}
       @model_manifest['associations'] ||= {}
+      @model_manifest['tree'] ||= {}
       @model_manifest['lists'] ||= {}
     end
     
@@ -34,10 +35,8 @@ module Manifest
       @model_manifest['attributes'].each {|attribute_name, attribute_manifest|
         @attributes[attribute_name] = ModelModule::Attribute.new(self, attribute_name, attribute_manifest)
       }
-      @associations = {}
-      @model_manifest['associations'].each {|association_name, association_manifest|
-        @associations[association_name] = ModelModule::Association.new(self, association_name, association_manifest)
-      }
+      @associations = ModelModule::Association.new(self, @model_manifest['associations'])
+      @tree = @model_manifest['tree']
       @lists = {}
       @model_manifest['lists'].each {|list_name, list_manifest|
         @lists[list_name] = ModelModule::ListFactory.factory(self, list_name, list_manifest)
@@ -48,6 +47,20 @@ module Manifest
       ::Manifest.item_name_to_model @model_name
     end
     
+    def tree_model_manifest tree_name
+      if tree_name
+        if @tree[tree_name]
+          r = ::Manifest.manifest.models[@tree[tree_name]]
+          raise "undefined tree_model for models > #{@model_name} > tree > #{tree_name}\n" unless r
+          r
+        else
+          nil
+        end
+      else
+        nil
+      end
+    end
+    
   end
 end
 
index 6a806b1..f21d082 100644 (file)
@@ -4,11 +4,11 @@ require_dependency "manifest/model/association/has_one"
 module Manifest
   module ModelModule
     class Association
-      attr :model, :association_name, :association_manifest, 
+      include AssociationModule
+      attr :model, :association_manifest, 
         :belongs_to, :has_many, :has_one
-      def initialize model, association_name, association_manifest
+      def initialize model, association_manifest
         @model = model
-        @association_name = association_name
         @association_manifest = association_manifest
         self.set_default
         self.init
index e01eae1..20f50e8 100644 (file)
@@ -22,6 +22,10 @@ module Manifest
           @id_column = @belongs_to_manifest['id_column']
         end
         
+        def model
+          ::Manifest.item_name_to_model @model_name
+        end
+        
         def association_name
           @association.association_name
         end
index 1fddab9..063fdcf 100644 (file)
@@ -14,15 +14,19 @@ module Manifest
         
         def set_default
           @has_many_manifest['model_name'] ||= @has_many_name.singularize
+          @has_many_manifest['foreign_key'] ||= @association.model_name + '_id'
         end
         
         def init
           @model_name = @has_many_manifest['model_name']
-          raise "undefined foreign_key for models > #{@association.model.model_name} > associations > has_many > #{@has_many_name}\n" unless @has_many_manifest['foreign_key']
           @foreign_key = @has_many_manifest['foreign_key']
           @through = @has_many_manifest['through']
         end
         
+        def model
+          ::Manifest.item_name_to_model @model_name
+        end
+        
         def association_name
           @association.association_name
         end
index 6f4e874..7cf723d 100644 (file)
@@ -14,14 +14,18 @@ module Manifest
         
         def set_default
           @has_one_manifest['model_name'] ||= @has_one_name
+          @has_one_manifest['foreign_key'] ||= @association.model_name + '_id'
         end
         
         def init
           @model_name = @has_one_manifest['model_name']
-          raise "undefined foreign_key for models > #{@association.model.model_name} > associations > has_one > #{@has_one_name}\n" unless @has_one_manifest['foreign_key']
           @foreign_key = @has_one_manifest['foreign_key']
         end
         
+        def model
+          ::Manifest.item_name_to_model @model_name
+        end
+        
         def association_name
           @association.association_name
         end
index 22f9d70..0d9ab3e 100644 (file)
@@ -4,7 +4,7 @@ module Manifest
     class Attribute
       include AttributeModule
       attr :model, :attribute_name, :attribute_manifest, 
-        :primary_key, :rules, :source
+        :type, :primary_key, :rules, :source
       def initialize model, attribute_name, attribute_manifest
         @model = model
         @attribute_name = attribute_name
@@ -20,6 +20,7 @@ module Manifest
       end
       
       def init
+        @type = @attribute_manifest['type']
         @primary_key = @attribute_manifest['primary_key']
         @rules = @attribute_manifest['rules']
         if @attribute_manifest['source']
index e7c1803..d32a6b3 100644 (file)
@@ -2,11 +2,9 @@ require_dependency "manifest/model/list/base"
 require_dependency "manifest/model/list/public"
 require_dependency "manifest/model/list/private"
 require_dependency "manifest/model/list/system_resource"
-require_dependency "manifest/model/list/has_many"
-require_dependency "manifest/model/list/has_many_through"
 require_dependency "manifest/model/list/filter"
 require_dependency "manifest/model/list/through_filter"
-require_dependency "manifest/model/list/element_filter"
+require_dependency "manifest/model/list/foreign_filter"
 require_dependency "manifest/model/list/play"
 module Manifest
   module ModelModule
@@ -14,8 +12,7 @@ module Manifest
       include ListModule
       @@types = {
         'public' => PublicList, 'private' => PrivateList, 'system_resource' => SystemResourceList,
-        'has_many' => HasManyList, 'has_many_through' => HasManyThroughList, 'filter' => FilterList, 
-        'through_filter' => ThroughFilterList, 'element_filter' => ElementFilterList, 
+        'filter' => FilterList, 'through_filter' => ThroughFilterList, 'foreign_filter' => ForeignFilterList, 
         'play' => PlayList
       }
       
index e79ca01..a72a54a 100644 (file)
@@ -2,7 +2,7 @@ module Manifest
   module ModelModule
     module ListModule
       class FilterList < Base
-        attr :filter_key
+        attr :filter_key, :filter_item_name
         
         def set_default
           super
@@ -12,6 +12,7 @@ module Manifest
         
         def init
           super
+          @filter_item_name = @args['filter_item_name']
           @filter_key = @args['filter_key']
         end
         
similarity index 93%
rename from lib/manifest/model/list/element_filter.rb
rename to lib/manifest/model/list/foreign_filter.rb
index 2dea906..77eff0c 100644 (file)
@@ -1,7 +1,7 @@
 module Manifest
   module ModelModule
     module ListModule
-      class ElementFilterList < FilterList
+      class ForeignFilterList < FilterList
         
         def set_default
           super
diff --git a/lib/manifest/model/list/has_many.rb b/lib/manifest/model/list/has_many.rb
deleted file mode 100644 (file)
index 869c978..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-module Manifest
-  module ModelModule
-    module ListModule
-      class HasManyList < Base
-        def initialize list, list_name, list_manifest
-          super
-        end
-        
-        def set_default
-          super
-          return
-          option_manifest['association_name'] ||= 100
-        end
-        
-        def init
-          super
-          return
-          @list_list_conf = @manifest.list(@item_name).lists[list_name] || {}
-          @association_name = @list_list_conf['association_name']
-          @has_many_conf = @manifest.model(@item_name).associations['has_many'] || {}
-          @association_conf = @has_many_conf[@association_name] || {}
-          @association_model_name = @association_conf['model']
-          @association_model = @association_model_name.classify.constantize
-          @foreign_key = @association_conf['foreign_key']
-         if @association_model.content?
-            @owner_model = @association_model.owner_model
-            @owner_table_name = @owner_model.table_name if @owner_model
-          end
-        end
-        
-        def where parent_item
-          w = @association_model.list_where
-          w += ' and ' unless w.blank?
-          [w + @association_model.table_name + '.' + @foreign_key + ' = ?', parent_item.id] 
-        end
-        
-        def includes
-    #   @with_model_name ? {@with_model_name.classify.constantize.table_name => {}} : {}
-          w = @owner_model ? {@owner_model.item_name => {}} : {}
-          w.merge({}) 
-        end
-        
-        def items parent_item
-           @association_model.where(self.where(parent_item)).includes(self.includes).order(self.order).offset(@offset).limit(@page_size)
-        end
-        
-        def paginate parent_item
-          Kaminari.paginate_array(Array.new(@association_model.where(self.where(parent_item)).includes(self.includes).count, nil)).page(@offset).per(@page_size)
-        end
-        
-        def self._add_action item_name, action_name, list_name, list_conf
-          model = item_name.classify.constantize
-          controller_name = model.plural + 'Controller'
-          controller = controller_name.constantize
-          association_name = list_conf['association_name']
-          has_many_conf = Pettanr::Application::manifest.model(item_name).associations['has_many'] || {}
-          association_conf = has_many_conf[association_name] || {}
-          association_model_name = association_conf['model']
-          return if controller.method_defined?(action_name)
-          controller.define_method(action_name) do 
-            has_many_list item_name, list_name, association_model_name, params
-          end
-        end
-      end
-      
-    end
-  end
-end
diff --git a/lib/manifest/model/list/has_many_through.rb b/lib/manifest/model/list/has_many_through.rb
deleted file mode 100644 (file)
index 21c12df..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-module Manifest
-  module ModelModule
-    module ListModule
-      class HasManyThroughList < Base
-        attr :list, :list_name, :list_manifest, 
-          :belongs_to, :has_many, :has_one
-        
-        def set_default
-          super
-        end
-        
-        def init
-          super
-          return
-          @list_list_conf = @manifest.list(@item_name).lists[list_name] || {}
-          @association_name = @list_list_conf['association_name']
-          @has_many_conf = @manifest.model(@item_name).associations['has_many'] || {}
-          @association_conf = @has_many_conf[@association_name] || {}
-          @association_through_model_name = @association_conf['through']
-          @association_through_model = @association_through_model_name.classify.constantize
-          @association_model_name = @association_conf['model']
-          @association_model = @association_model_name.classify.constantize
-          @foreign_key = @association_conf['foreign_key']
-         if @association_model.content?
-            @owner_model = @association_model.owner_model
-            @owner_table_name = @owner_model.table_name if @owner_model
-          end
-        end
-        
-        def where root_item
-          w = @association_model.list_where
-          w += ' and ' unless w.blank?
-          [w + @association_through_model.table_name + '.' + @foreign_key + ' = ?', root_item.id] 
-        end
-        
-        def includes
-          {@association_through_model.table_name => {@item_name => {}}}
-        end
-        
-        def items root_item
-           @association_model.where(self.where(root_item)).includes(self.includes).order(self.order).offset(@offset).limit(@page_size)
-        end
-        
-        def paginate root_item
-          Kaminari.paginate_array(Array.new(@association_model.where(self.where(root_item)).includes(self.includes).count, nil)).page(@offset).per(@page_size)
-        end
-        
-        def self.add_action item_name, action_name, list_name, list_conf
-          return
-        end
-      end
-      
-    end
-  end
-end
index 9149e37..185bed6 100644 (file)
@@ -2,7 +2,7 @@ module Manifest
   module ModelModule
     module ListModule
       class ThroughFilterList < FilterList
-        attr :list, :list_name, :list_manifest
+        attr :through
         
         def set_default
           super
@@ -10,18 +10,7 @@ module Manifest
         
         def init
           super
-          return
-          @through = @list_list_conf['through']
-        end
-        
-        def includes
-          {@through => {@from => {}} }
-        end
-        
-        def where filter_item
-          w = @model.list_where
-          w += ' and ' unless w.blank?
-          [w + @through + '.' + @filter_key + ' = ?', filter_item.id] 
+          @through = @args['through']
         end
         
       end
index 1eb54ff..e5555cb 100644 (file)
@@ -13,7 +13,7 @@ module Manifest
     end
     
     attr :profiler_manifest, :item_name, :manifest, 
-      :columns, :lists, :associations
+      :column_names, :lists, :associations
     def initialize manifest, item_name, profiler_manifest
       @manifest = manifest
       @item_name = item_name
@@ -23,13 +23,13 @@ module Manifest
     end
     
     def set_default
-      @profiler_manifest['columns'] ||= []
+      @profiler_manifest['column_names'] ||= []
       @profiler_manifest['lists'] ||= {}
       @profiler_manifest['associations'] ||= {}
     end
     
     def init
-      @columns = @profiler_manifest['columns']
+      @column_names = @profiler_manifest['column_names']
       @lists = {}
       @profiler_manifest['lists'].each {|list_name, list_manifest|
         @lists[list_name] = ProfilerModule::List.new(self, list_name, list_manifest)
@@ -37,8 +37,8 @@ module Manifest
       @associations = ProfilerModule::Association.new(self, @profiler_manifest['associations'])
     end
     
-    def open item, operators
-      ProfilerView.new @item_name, item, operators, @profiler_conf, @manifest
+    def each_column
+      @column_names
     end
     
   end
index c07fc20..3dc1cf0 100644 (file)
@@ -39,7 +39,7 @@ module Manifest
         @profiler.model_name
       end
       
-      def model_manifest
+      def profiler_manifest
         @profiler.profiler_manifest
       end
       
index bc052a6..a76c3a5 100644 (file)
@@ -16,6 +16,10 @@ module Manifest
         def init
         end
         
+        def model
+          ::Manifest::item_name_to_model @model_name
+        end
+        
         def association_name
           @association.association_name
         end
index 200cf6c..bc9553b 100644 (file)
@@ -2,10 +2,11 @@ module Manifest
   module ProfilerModule
     module AssociationModule
       class HasMany
-        attr :association, :list_name
-        def initialize association, list_name
+        attr :association, :profiler_list_name, 
+          :model_name, :list_name, :list
+        def initialize association, profiler_list_name
           @association = association
-          @list_name = list_name
+          @profiler_list_name = profiler_list_name
           self.set_default
           self.init
         end
@@ -14,12 +15,40 @@ module Manifest
         end
         
         def init
+          if list_manifest = self.profiler.lists[@profiler_list_name]
+            @model_name = list_manifest.model_name
+            @list_name = list_manifest.list_name
+          else
+            n = @profiler_list_name.split '.'
+            if n.size > 1
+              @model_name = n[0]
+              @list_name = n[1]
+            else
+              raise "undefined list for profilers > #{self.profiler.item_name} > lists > #{@my_name}\n" unless @list_manifest['model_name']
+            end
+          end
+          @my_list = ::Manifest.manifest.lists[@model_name]
+          raise "undefined my_list for profilers > #{self.profiler.item_name} > lists > #{@my_name} ... #{@model_name}\n" unless @my_list
+          @list = @my_list[@list_name]
+          raise "undefined list for profilers > #{self.profiler.item_name} > lists > #{@my_name} ... #{@list_name}\n" unless @list
+        end
+        
+        def model
+          ::Manifest::item_name_to_model @model_name
         end
         
         def association_name
           @association.association_name
         end
         
+        def profiler
+          @association.profiler
+        end
+        
+        def profiler_manifest
+          @association.profiler_manifest
+        end
+        
       end
       
     end
index d35011e..5e65622 100644 (file)
@@ -16,6 +16,10 @@ module Manifest
         def init
         end
         
+        def model
+          ::Manifest::item_name_to_model @model_name
+        end
+        
         def association_name
           @association.association_name
         end
index b566af0..f9adef7 100644 (file)
@@ -13,8 +13,8 @@ module Manifest
       end
       
       def set_default
-        list_manifest['model_name'] ||= {}
-        list_manifest['list_name'] ||= {}
+        raise "undefined model_name for profilers > #{self.profiler_name} > lists > #{@my_name}\n" unless @list_manifest['model_name']
+        raise "undefined list_name for profilers > #{self.profiler_name} > lists > #{@my_name}\n" unless @list_manifest['list_name']
       end
       
       def init
@@ -26,7 +26,7 @@ module Manifest
         @profiler.item_name
       end
       
-      def filer_manifest
+      def profiler_manifest
         @profiler.profiler_manifest
       end
       
index 6b59afc..8458c51 100644 (file)
@@ -30,6 +30,10 @@ module Peta
       self.owner_type.to_s + '_id'
     end
     
+    def self.public_list_where
+      ''
+    end
+    
     def self.edit content_id, operators
       content = self.find content_id, self.show_opt
       raise ActiveRecord::Forbidden unless content.own?(operators)
index 7bae1a0..58a76fc 100644 (file)
@@ -5,7 +5,7 @@
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public_list"\r
+            "list_name": "public"\r
           }\r
         },\r
         "by_author": {\r
           }\r
         },\r
         "show": {\r
-          "type": "show",\r
-          "name": "show"\r
+          "type": "show"\r
         },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public_list"\r
+            "list_name": "public"\r
           }\r
         },\r
         "count_by_author": {\r
@@ -49,7 +48,7 @@
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public_list"\r
+            "list_name": "public"\r
           }\r
         },\r
         "by_panel": {\r
         "by_scroll": {\r
           "type": "list"\r
         },\r
+        "show": {\r
+          "type": "show"\r
+        },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public_list"\r
+            "list_name": "public"\r
           }\r
         },\r
         "count_by_panel": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public_list"\r
+            "list_name": "public"\r
           }\r
         },\r
         "by_author": {\r
           "type": "list"\r
         },\r
+        "show": {\r
+          "type": "show"\r
+        },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public_list"\r
+            "list_name": "public"\r
           }\r
         },\r
         "count_by_author": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public_list"\r
+            "list_name": "public"\r
           }\r
         },\r
         "by_comic": {\r
             "list_name": "play"\r
           }\r
         },\r
+        "show": {\r
+          "type": "show"\r
+        },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public_list"\r
+            "list_name": "public"\r
           }\r
         },\r
         "count_by_author": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public_list"\r
+            "list_name": "public"\r
           }\r
         },\r
         "by_story": {\r
         "by_sheet": {\r
           "type": "list"\r
         },\r
+        "show": {\r
+          "type": "show"\r
+        },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public_list"\r
+            "list_name": "public"\r
           }\r
         },\r
         "count_by_story": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public_list"\r
+            "list_name": "public"\r
           }\r
         },\r
         "by_story": {\r
             "list_name": "play"\r
           }\r
         },\r
+        "show": {\r
+          "type": "show"\r
+        },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public_list"\r
+            "list_name": "public"\r
           }\r
         },\r
         "count_by_story": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public_list"\r
+            "list_name": "public"\r
           }\r
         },\r
         "by_sheet": {\r
         "by_panel": {\r
           "type": "list"\r
         },\r
+        "show": {\r
+          "type": "show"\r
+        },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public_list"\r
+            "list_name": "public"\r
           }\r
         },\r
         "count_by_sheet": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public_list"\r
+            "list_name": "public"\r
           }\r
         },\r
         "by_scroll": {\r
         "by_speech_balloon_template": {\r
           "type": "list"\r
         },\r
+        "show": {\r
+          "type": "show"\r
+        },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public_list"\r
+            "list_name": "public"\r
           }\r
         },\r
         "count_by_scroll": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public_list"\r
+            "list_name": "public"\r
           }\r
         },\r
         "by_panel": {\r
         "by_author": {\r
           "type": "list"\r
         },\r
+        "show": {\r
+          "type": "show"\r
+        },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public_list"\r
+            "list_name": "public"\r
           }\r
         },\r
         "count_by_panel": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public_list"\r
+            "list_name": "public"\r
           }\r
         },\r
         "by_panel": {\r
         "by_author": {\r
           "type": "list"\r
         },\r
+        "show": {\r
+          "type": "show"\r
+        },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public_list"\r
+            "list_name": "public"\r
           }\r
         },\r
         "count_by_panel": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public_list"\r
+            "list_name": "public"\r
           }\r
         },\r
         "by_writing_format": {\r
           "type": "list"\r
         },\r
+        "show": {\r
+          "type": "show"\r
+        },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public_list"\r
+            "list_name": "public"\r
           }\r
         },\r
         "count_by_writing_format": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public_list"\r
+            "list_name": "public"\r
           }\r
         },\r
+        "show": {\r
+          "type": "show"\r
+        },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public_list"\r
+            "list_name": "public"\r
           }\r
         }\r
       }\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public_list"\r
+            "list_name": "public"\r
           }\r
         },\r
         "by_panel": {\r
         "by_author": {\r
           "type": "list"\r
         },\r
+        "show": {\r
+          "type": "show"\r
+        },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public_list"\r
+            "list_name": "public"\r
           }\r
         },\r
         "count_by_panel": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public_list"\r
+            "list_name": "public"\r
           }\r
         },\r
         "by_panel": {\r
         "by_author": {\r
           "type": "list"\r
         },\r
+        "show": {\r
+          "type": "show"\r
+        },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public_list"\r
+            "list_name": "public"\r
           }\r
         },\r
         "count_by_panel": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "private_list"\r
+            "list_name": "private"\r
           }\r
         },\r
+        "show": {\r
+          "type": "show"\r
+        },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public_list"\r
+            "list_name": "public"\r
           }\r
         }\r
       }\r
     },\r
-    "pictures": {},\r
+    "pictures": {\r
+      "actions": {\r
+        "show": {\r
+          "type": "show"\r
+        }\r
+      }\r
+    },\r
     "resource_pictures": {\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public_list"\r
+            "list_name": "public"\r
           }\r
         },\r
         "by_license": {\r
         "by_artist": {\r
           "type": "list"\r
         },\r
+        "show": {\r
+          "type": "show"\r
+        },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public_list"\r
+            "list_name": "public"\r
           }\r
         },\r
         "count_by_license": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public_list"\r
+            "list_name": "public"\r
           }\r
         },\r
+        "show": {\r
+          "type": "show"\r
+        },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public_list"\r
+            "list_name": "public"\r
           }\r
         }\r
       }\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public_list"\r
+            "list_name": "public"\r
           }\r
         },\r
         "by_system_picture": {\r
           "type": "list"\r
         },\r
+        "show": {\r
+          "type": "show"\r
+        },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public_list"\r
+            "list_name": "public"\r
           }\r
         },\r
         "count_by_system_picture": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public_list"\r
+            "list_name": "public"\r
           }\r
         },\r
+        "show": {\r
+          "type": "show"\r
+        },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public_list"\r
+            "list_name": "public"\r
           }\r
         }\r
       }\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public_list"\r
+            "list_name": "public"\r
           }\r
         },\r
         "by_license_group": {\r
         "by_system_picture": {\r
           "type": "list"\r
         },\r
+        "show": {\r
+          "type": "show"\r
+        },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public_list"\r
+            "list_name": "public"\r
           }\r
         },\r
         "count_by_license_group": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public_list"\r
+            "list_name": "public"\r
           }\r
         },\r
         "scrolls": {\r
             "list_name": "ground_colors"\r
           }\r
         },\r
+        "show": {\r
+          "type": "show"\r
+        },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public_list"\r
+            "list_name": "public"\r
           }\r
         },\r
         "new": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public_list"\r
+            "list_name": "public"\r
           }\r
         },\r
         "resource_pictures": {\r
             "list_name": "resource_pictures"\r
           }\r
         },\r
+        "show": {\r
+          "type": "show"\r
+        },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public_list"\r
+            "list_name": "public"\r
           }\r
         },\r
         "new": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public_list"\r
+            "list_name": "public"\r
           }\r
         },\r
+        "show": {\r
+          "type": "show"\r
+        },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public_list"\r
+            "list_name": "public"\r
           }\r
         }\r
       }\r
           "type": "list",\r
           "args": {\r
             "item_name": "scroll",\r
-            "list_name": "private_list"\r
+            "list_name": "private"\r
           }\r
         },\r
         "scroll_panels": {\r
           "type": "list",\r
           "args": {\r
             "item_name": "scroll_panel",\r
-            "list_name": "private_list"\r
+            "list_name": "private"\r
           }\r
         },\r
         "comics": {\r
           "type": "list",\r
           "args": {\r
             "item_name": "comic",\r
-            "list_name": "private_list"\r
+            "list_name": "private"\r
           }\r
         },\r
         "stories": {\r
           "type": "list",\r
           "args": {\r
             "item_name": "story",\r
-            "list_name": "private_list"\r
+            "list_name": "private"\r
           }\r
         },\r
         "story_sheets": {\r
           "type": "list",\r
           "args": {\r
             "item_name": "story_sheet",\r
-            "list_name": "private_list"\r
+            "list_name": "private"\r
           }\r
         },\r
         "sheets": {\r
           "type": "list",\r
           "args": {\r
             "item_name": "sheet",\r
-            "list_name": "private_list"\r
+            "list_name": "private"\r
           }\r
         },\r
         "sheet_panels": {\r
           "type": "list",\r
           "args": {\r
             "item_name": "sheet_panel",\r
-            "list_name": "private_list"\r
+            "list_name": "private"\r
           }\r
         },\r
         "panels": {\r
           "type": "list",\r
           "args": {\r
             "item_name": "panel",\r
-            "list_name": "private_list"\r
+            "list_name": "private"\r
           }\r
         },\r
         "panel_pictures": {\r
           "type": "list",\r
           "args": {\r
             "item_name": "panel_picture",\r
-            "list_name": "private_list"\r
+            "list_name": "private"\r
           }\r
         },\r
         "speech_balloons": {\r
           "type": "list",\r
           "args": {\r
             "item_name": "speech_balloon",\r
-            "list_name": "private_list"\r
+            "list_name": "private"\r
           }\r
         },\r
         "speeches": {\r
           "type": "list",\r
           "args": {\r
             "item_name": "speech",\r
-            "list_name": "private_list"\r
+            "list_name": "private"\r
           }\r
         },\r
         "balloons": {\r
           "type": "list",\r
           "args": {\r
             "item_name": "balloon",\r
-            "list_name": "private_list"\r
+            "list_name": "private"\r
           }\r
         },\r
         "ground_pictures": {\r
           "type": "list",\r
           "args": {\r
             "item_name": "ground_picture",\r
-            "list_name": "private_list"\r
+            "list_name": "private"\r
           }\r
         },\r
         "ground_colors": {\r
           "type": "list",\r
           "args": {\r
             "item_name": "ground_color",\r
-            "list_name": "private_list"\r
+            "list_name": "private"\r
           }\r
         },\r
         "original_pictures": {\r
           "type": "list",\r
           "args": {\r
             "item_name": "original_picture",\r
-            "list_name": "private_list"\r
+            "list_name": "private"\r
           }\r
         },\r
         "resource_pictures": {\r
           "type": "list",\r
           "args": {\r
             "item_name": "resource_picture",\r
-            "list_name": "private_list"\r
+            "list_name": "private"\r
           }\r
         }\r
       }\r
   },\r
   "models": {\r
     "scroll": {\r
-      "class_name": "Scroll",\r
-      "table_name": "scrolls",\r
       "associations": {\r
         "belongs_to": {\r
-          "author": {\r
-            "id_column": "author_id"\r
-          }\r
+          "author": {}\r
         },\r
         "has_many": {\r
-          "scroll_panels": {\r
-            "foreign_key": "scroll_id",\r
-            "model_name": "scroll_panel"\r
-          },\r
+          "scroll_panels": {},\r
           "panels": {\r
-            "through": "scroll_panel",\r
-            "foreign_key": "scroll_id",\r
-            "model_name": "panel"\r
+            "through": "scroll_panel"\r
           }\r
         }\r
       },\r
         }\r
       },\r
       "lists": {\r
-        "public_list": {\r
+        "public": {\r
           "type": "public"\r
         },\r
-        "private_list": {\r
+        "private": {\r
           "type": "private"\r
         },\r
         "by_author": {\r
           "type": "filter",\r
-          "args": {\r
-            "filter_item_name": "author",\r
-            "filter_key": "author_id"\r
-          }\r
+          "args": {}\r
         },\r
         "by_panel": {\r
           "type": "through_filter",\r
           "args": {\r
-            "filter_item_name": "panel",\r
-            "through": "scroll_panels",\r
-            "filter_key": "panel_id"\r
+            "through": "scroll_panels"\r
           }\r
         },\r
         "play": {\r
       }\r
     },\r
     "scroll_panel": {\r
-      "class_name": "ScrollPanel",\r
-      "table_name": "scroll_panels",\r
       "associations": {\r
         "belongs_to": {\r
-          "panel": {\r
-            "id_column": "panel_id"\r
-          },\r
-          "scroll": {\r
-            "id_column": "scroll_id"\r
-          }\r
+          "panel": {},\r
+          "scroll": {}\r
         },\r
         "has_many": {}\r
       },\r
           "type": "datetime"\r
         }\r
       },\r
+      "tree": {\r
+        "owner": "scroll"\r
+      },\r
       "lists": {\r
-        "public_list": {\r
+        "public": {\r
           "type": "public"\r
         },\r
-        "private_list": {\r
+        "private": {\r
           "type": "private"\r
         },\r
         "by_scroll": {\r
       }\r
     },\r
     "comic": {\r
-      "class_name": "Comic",\r
-      "table_name": "comics",\r
       "associations": {\r
         "belongs_to": {\r
-          "author": {\r
-            "id_column": "author_id"\r
-          }\r
+          "author": {}\r
         },\r
         "has_many": {\r
-          "stories": {\r
-            "foreign_key": "comic_id",\r
-            "model_name": "story"\r
-          }\r
-        },\r
-        "has_many_through": {}\r
+          "stories": {}\r
+        }\r
       },\r
       "attributes": {\r
         "id": {\r
         }\r
       },\r
       "lists": {\r
-        "public_list": {\r
+        "public": {\r
           "type": "public"\r
         },\r
-        "private_list": {\r
+        "private": {\r
           "type": "private"\r
         },\r
         "by_author": {\r
       }\r
     },\r
     "story": {\r
-      "class_name": "Story",\r
-      "table_name": "stories",\r
       "associations": {\r
         "belongs_to": {\r
-          "comic": {\r
-            "id_column": "comic_id"\r
-          }\r
+          "comic": {}\r
         },\r
         "has_many": {\r
-          "story_sheets": {\r
-            "foreign_key": "story_id",\r
-            "model_name": "story_sheet"\r
-          },\r
+          "story_sheets": {},\r
           "sheets": {\r
-            "through": "story_sheets",\r
-            "foreign_key": "story_id",\r
-            "model_name": "sheet"\r
+            "through": "story_sheets"\r
           }\r
         }\r
       },\r
           "type": "datetime"\r
         }\r
       },\r
+      "tree": {\r
+        "owner": "comic"\r
+      },\r
       "lists": {\r
-        "public_list": {\r
+        "public": {\r
           "type": "public"\r
         },\r
-        "private_list": {\r
+        "private": {\r
           "type": "private"\r
         },\r
         "by_comic": {\r
           "type": "filter"\r
         },\r
         "by_sheet": {\r
-          "type": "through_filter"\r
+          "type": "through_filter",\r
+          "args": {\r
+            "through": "story_sheets"\r
+          }\r
         },\r
         "by_author": {\r
-          "type": "element_filter"\r
+          "type": "foreign_filter"\r
         },\r
         "play": {\r
           "type": "play"\r
       }\r
     },\r
     "story_sheet": {\r
-      "class_name": "StorySheet",\r
-      "table_name": "story_sheets",\r
       "associations": {\r
         "belongs_to": {\r
-          "story": {\r
-            "id_column": "story_id"\r
-          },\r
-          "sheet": {\r
-            "id_column": "sheet_id"\r
-          }\r
+          "story": {},\r
+          "sheet": {}\r
         },\r
         "has_many": {}\r
       },\r
           "type": "datetime"\r
         }\r
       },\r
+      "tree": {\r
+        "owner": "story"\r
+      },\r
       "lists": {\r
-        "public_list": {\r
+        "public": {\r
           "type": "public"\r
         },\r
-        "private_list": {\r
+        "private": {\r
           "type": "private"\r
         },\r
         "by_story": {\r
       }\r
     },\r
     "sheet": {\r
-      "class_name": "Sheet",\r
-      "table_name": "sheets",\r
       "associations": {\r
         "belongs_to": {\r
-          "author": {\r
-            "id_column": "author_id"\r
-          }\r
+          "author": {}\r
         },\r
         "has_many": {\r
-          "story_sheets": {\r
-            "foreign_key": "story_id",\r
-            "model_name": "story_sheet"\r
-          },\r
+          "story_sheets": {},\r
           "stories": {\r
-            "through": "story_sheets",\r
-            "foreign_key": "sheet_id",\r
-            "model_name": "story"\r
-          },\r
-          "sheet_panels": {\r
-            "foreign_key": "sheet_id",\r
-            "model_name": "sheet_panel"\r
+            "through": "story_sheets"\r
           },\r
+          "sheet_panels": {},\r
           "panels": {\r
-            "through": "sheet_panels",\r
-            "foreign_key": "sheet_id",\r
-            "model_name": "panel"\r
+            "through": "sheet_panels"\r
           }\r
         }\r
       },\r
         }\r
       },\r
       "lists": {\r
-        "public_list": {\r
+        "public": {\r
           "type": "public"\r
         },\r
-        "private_list": {\r
+        "private": {\r
           "type": "private"\r
         },\r
         "by_story": {\r
-          "type": "through_filter"\r
+          "type": "through_filter",\r
+          "args": {\r
+            "through": "story_sheets"\r
+          }\r
         },\r
         "by_panel": {\r
-          "type": "through_filter"\r
+          "type": "through_filter",\r
+          "args": {\r
+            "through": "sheet_panels"\r
+          }\r
         },\r
         "by_author": {\r
           "type": "filter"\r
       }\r
     },\r
     "sheet_panel": {\r
-      "class_name": "SheetPanel",\r
-      "table_name": "sheet_panels",\r
       "associations": {\r
         "belongs_to": {\r
-          "sheet": {\r
-            "id_column": "sheet_id"\r
-          },\r
-          "panel": {\r
-            "id_column": "panel_id"\r
-          }\r
+          "sheet": {},\r
+          "panel": {}\r
         },\r
         "has_many": {}\r
       },\r
           "type": "datetime"\r
         }\r
       },\r
+      "tree": {\r
+        "owner": "sheet"\r
+      },\r
       "lists": {\r
-        "public_list": {\r
+        "public": {\r
           "type": "public"\r
         },\r
-        "private_list": {\r
+        "private": {\r
           "type": "private"\r
         },\r
         "by_sheet": {\r
       }\r
     },\r
     "panel": {\r
-      "class_name": "Panel",\r
-      "table_name": "panels",\r
       "associations": {\r
         "belongs_to": {\r
-          "author": {\r
-            "id_column": "author_id"\r
-          }\r
+          "author": {}\r
         },\r
         "has_many": {\r
-          "scroll_panels": {\r
-            "foreign_key": "panel_id",\r
-            "model_name": "scroll_panel"\r
-          },\r
+          "scroll_panels": {},\r
           "scrolls": {\r
-            "through": "scroll_panels",\r
-            "foreign_key": "panel_id",\r
-            "model_name": "scroll"\r
-          },\r
-          "sheet_panels": {\r
-            "foreign_key": "panel_id",\r
-            "model_name": "sheet_panel"\r
+            "through": "scroll_panels"\r
           },\r
+          "sheet_panels": {},\r
           "sheets": {\r
-            "through": "sheet_panels",\r
-            "foreign_key": "panel_id",\r
-            "model_name": "sheet"\r
-          },\r
-          "panel_pictures": {\r
-            "foreign_key": "panel_id",\r
-            "model_name": "panel_picture"\r
-          },\r
-          "speech_balloons": {\r
-            "foreign_key": "panel_id",\r
-            "model_name": "speech_balloon"\r
+            "through": "sheet_panels"\r
           },\r
-          "ground_pictures": {\r
-            "foreign_key": "panel_id",\r
-            "model_name": "ground_picture"\r
-          },\r
-          "ground_colors": {\r
-            "foreign_key": "panel_id",\r
-            "model_name": "ground_color"\r
-          }\r
+          "panel_pictures": {},\r
+          "speech_balloons": {},\r
+          "ground_pictures": {},\r
+          "ground_colors": {}\r
         }\r
       },\r
       "attributes": {\r
         }\r
       },\r
       "lists": {\r
-        "public_list": {\r
+        "public": {\r
           "type": "public"\r
         },\r
-        "private_list": {\r
+        "private": {\r
           "type": "private"\r
         },\r
         "by_scroll": {\r
-          "type": "through_filter"\r
+          "type": "through_filter",\r
+          "args": {\r
+            "through": "scroll_panels"\r
+          }\r
         },\r
         "by_sheet": {\r
-          "type": "through_filter"\r
+          "type": "through_filter",\r
+          "args": {\r
+            "through": "sheet_panels"\r
+          }\r
         },\r
         "by_author": {\r
           "type": "filter"\r
       }\r
     },\r
     "panel_picture": {\r
-      "class_name": "PanelPicture",\r
-      "table_name": "panel_pictures",\r
       "associations": {\r
         "belongs_to": {\r
-          "panel": {\r
-            "id_column": "panel_id"\r
-          }\r
+          "panel": {}\r
         },\r
         "has_many": {}\r
       },\r
           "type": "datetime"\r
         }\r
       },\r
+      "tree": {\r
+        "owner": "panel",\r
+        "panel": "panel"\r
+      },\r
       "lists": {\r
-        "public_list": {\r
+        "public": {\r
           "type": "public"\r
         },\r
-        "private_list": {\r
+        "private": {\r
           "type": "private"\r
         },\r
         "by_panel": {\r
-          "type": "filter"\r
+          "type": "filter",\r
+          "args": {\r
+            "where_name": "public_list_where"\r
+          }\r
         },\r
         "by_author": {\r
-          "type": "element_filter"\r
+          "type": "foreign_filter",\r
+          "args": {\r
+            "tree_name": "owner"\r
+          }\r
         }\r
       }\r
     },\r
     "speech_balloon": {\r
-      "class_name": "SpeechBalloon",\r
-      "table_name": "speech_balloons",\r
       "extend": "classname",\r
       "associations": {\r
         "belongs_to": {\r
-          "panel": {\r
-            "id_column": "panel_id"\r
-          }\r
+          "panel": {}\r
         },\r
         "has_many": {},\r
         "has_one": {\r
-          "balloon": {\r
-            "foreign_key": "speech_balloon_id",\r
-            "model_name": "balloon"\r
-          },\r
-          "speech": {\r
-            "foreign_key": "speech_balloon_id",\r
-            "model_name": "speech"\r
-          }\r
+          "balloon": {},\r
+          "speech": {}\r
         }\r
       },\r
       "attributes": {\r
           "type": "datetime"\r
         }\r
       },\r
+      "tree": {\r
+        "owner": "panel",\r
+        "panel": "panel"\r
+      },\r
       "lists": {\r
-        "public_list": {\r
+        "public": {\r
           "type": "public"\r
         },\r
-        "private_list": {\r
+        "private": {\r
           "type": "private"\r
         },\r
         "by_panel": {\r
           "type": "filter"\r
         },\r
         "by_author": {\r
-          "type": "element_filter"\r
+          "type": "foreign_filter"\r
         }\r
       }\r
     },\r
     "balloon": {\r
-      "class_name": "Balloon",\r
-      "table_name": "balloons",\r
       "associations": {\r
         "belongs_to": {\r
-          "speech_balloon": {\r
-            "id_column": "speech_balloon_id"\r
-          },\r
-          "system_picture": {\r
-            "id_column": "system_picture_id"\r
-          }\r
+          "speech_balloon": {},\r
+          "system_picture": {}\r
         },\r
         "has_many": {}\r
       },\r
           "type": "datetime"\r
         }\r
       },\r
+      "tree": {\r
+        "owner": "speech_balloon",\r
+        "panel": "speech_balloon"\r
+      },\r
       "lists": {\r
-        "public_list": {\r
+        "public": {\r
           "type": "public"\r
         },\r
-        "private_list": {\r
+        "private": {\r
           "type": "private"\r
         },\r
         "by_panel": {\r
           "type": "filter"\r
         },\r
         "by_author": {\r
-          "type": "element_filter"\r
+          "type": "foreign_filter"\r
         }\r
       }\r
     },\r
     "speech": {\r
-      "class_name": "Speech",\r
-      "table_name": "speeches",\r
       "associations": {\r
         "belongs_to": {\r
-          "speech_balloon": {\r
-            "id_column": "speech_balloon_id"\r
-          },\r
-          "writing_format": {\r
-            "id_column": "writing_format_id"\r
-          }\r
+          "speech_balloon": {},\r
+          "writing_format": {}\r
         },\r
         "has_many": {}\r
       },\r
           "type": "datetime"\r
         }\r
       },\r
+      "tree": {\r
+        "owner": "speech_balloon",\r
+        "panel": "speech_balloon"\r
+      },\r
       "lists": {\r
-        "public_list": {\r
+        "public": {\r
           "type": "public"\r
         },\r
         "by_speech_balloon": {\r
       }\r
     },\r
     "ground_picture": {\r
-      "class_name": "GroundPicture",\r
-      "table_name": "ground_pictures",\r
       "associations": {\r
         "belongs_to": {\r
-          "panel": {\r
-            "id_column": "panel_id"\r
-          }\r
+          "panel": {}\r
         },\r
         "has_many": {}\r
       },\r
           "type": "datetime"\r
         }\r
       },\r
+      "tree": {\r
+        "owner": "panel",\r
+        "panel": "panel"\r
+      },\r
       "lists": {\r
-        "public_list": {\r
+        "public": {\r
           "type": "public"\r
         },\r
-        "private_list": {\r
+        "private": {\r
           "type": "private"\r
         },\r
         "by_panel": {\r
           "type": "filter"\r
         },\r
         "by_author": {\r
-          "type": "element_filter"\r
+          "type": "foreign_filter"\r
         }\r
       }\r
     },\r
     "ground_color": {\r
-      "class_name": "GroundColor",\r
-      "table_name": "ground_colors",\r
       "associations": {\r
         "belongs_to": {\r
-          "panel": {\r
-            "id_column": "panel_id"\r
-          }\r
+          "panel": {}\r
         },\r
         "has_many": {}\r
       },\r
           "type": "datetime"\r
         }\r
       },\r
+      "tree": {\r
+        "owner": "panel",\r
+        "panel": "panel"\r
+      },\r
       "lists": {\r
-        "public_list": {\r
+        "public": {\r
           "type": "public"\r
         },\r
-        "private_list": {\r
+        "private": {\r
           "type": "private"\r
         },\r
         "by_panel": {\r
           "type": "filter"\r
         },\r
         "by_author": {\r
-          "type": "element_filter"\r
+          "type": "foreign_filter"\r
         }\r
       }\r
     },\r
     "original_picture": {\r
-      "class_name": "OriginalPicture",\r
-      "table_name": "original_pictures",\r
       "associations": {\r
         "belongs_to": {\r
-          "artist": {\r
-            "id_column": "artist_id"\r
-          }\r
+          "artist": {}\r
         },\r
         "has_many": {\r
-          "pictures": {\r
-            "foreign_key": "original_picture_id",\r
-            "model_name": "picture"\r
-          }\r
+          "pictures": {}\r
         },\r
         "has_one": {\r
-          "resource_picture": {\r
-            "foreign_key": "original_picture_id",\r
-            "model_name": "resource_picture"\r
-          }\r
+          "resource_picture": {}\r
         }\r
       },\r
       "attributes": {\r
         }\r
       },\r
       "lists": {\r
-        "private_list": {\r
+        "private": {\r
           "type": "private"\r
         }\r
       }\r
     },\r
     "picture": {\r
-      "class_name": "Picture",\r
-      "table_name": "pictures",\r
       "associations": {\r
         "belongs_to": {\r
-          "license": {\r
-            "id_column": "license_id"\r
-          },\r
-          "artist": {\r
-            "id_column": "artist_id"\r
-          }\r
+          "license": {},\r
+          "artist": {}\r
         },\r
         "has_many": {},\r
         "has_one": {}\r
       }\r
     },\r
     "resource_picture": {\r
-      "class_name": "ResourcePicture",\r
-      "table_name": "resource_pictures",\r
       "associations": {\r
         "belongs_to": {\r
-          "original_picture": {\r
-            "id_column": "original_picture_id"\r
-          },\r
-          "license": {\r
-            "id_column": "license_id"\r
-          },\r
-          "artist": {\r
-            "id_column": "artist_id"\r
-          }\r
+          "original_picture": {},\r
+          "license": {},\r
+          "artist": {}\r
         },\r
         "has_many": {},\r
         "has_one": {}\r
         }\r
       },\r
       "lists": {\r
-        "public_list": {\r
+        "public": {\r
           "type": "public"\r
         },\r
-        "private_list": {\r
+        "private": {\r
           "type": "private"\r
         },\r
         "by_license": {\r
       }\r
     },\r
     "speech_balloon_template": {\r
-      "class_name": "SpeechBalloonTemplate",\r
-      "table_name": "speech_balloon_templates",\r
       "associations": {\r
         "belongs_to": {\r
-          "system_picture": {\r
-            "id_column": "system_picture_id"\r
-          }\r
+          "system_picture": {}\r
         },\r
         "has_many": {\r
-          "speech_balloons": {\r
-            "foreign_key": "speech_balloon_template_id",\r
-            "model_name": "speech_balloon"\r
-          },\r
+          "speech_balloons": {},\r
           "panels": {\r
-            "through": "speech_balloons",\r
-            "foreign_key": "speech_balloon_template_id",\r
-            "model_name": "panel"\r
+            "through": "speech_balloons"\r
           }\r
         },\r
         "has_one": {}\r
         }\r
       },\r
       "lists": {\r
-        "public_list": {\r
+        "public": {\r
           "type": "public"\r
         },\r
         "select_items": {\r
       }\r
     },\r
     "writing_format": {\r
-      "class_name": "WritingFormat",\r
-      "table_name": "writing_formats",\r
       "associations": {\r
         "belongs_to": {\r
-          "system_picture": {\r
-            "id_column": "system_picture_id"\r
-          }\r
+          "system_picture": {}\r
         },\r
         "has_many": {\r
-          "speeches": {\r
-            "foreign_key": "writing_format_id",\r
-            "model_name": "speech"\r
-          }\r
+          "speeches": {}\r
         },\r
         "has_one": {}\r
       },\r
         }\r
       },\r
       "lists": {\r
-        "public_list": {\r
+        "public": {\r
           "type": "public"\r
         },\r
         "select_items": {\r
       }\r
     },\r
     "license_group": {\r
-      "class_name": "LicenseGroup",\r
-      "table_name": "license_groups",\r
       "associations": {\r
         "belongs_to": {},\r
         "has_many": {\r
-          "licenses": {\r
-            "foreign_key": "license_group_id",\r
-            "model_name": "license"\r
-          }\r
+          "licenses": {}\r
         },\r
         "has_one": {}\r
       },\r
         }\r
       },\r
       "lists": {\r
-        "public_list": {\r
+        "public": {\r
           "type": "public"\r
         },\r
         "select_items": {\r
       }\r
     },\r
     "license": {\r
-      "class_name": "License",\r
-      "table_name": "licenses",\r
       "associations": {\r
         "belongs_to": {\r
-          "license_group": {\r
-            "id_column": "license_group_id"\r
-          },\r
-          "system_picture": {\r
-            "id_column": "system_picture_id"\r
-          }\r
+          "license_group": {},\r
+          "system_picture": {}\r
         },\r
         "has_many": {\r
-          "resource_pictures": {\r
-            "foreign_key": "license_id",\r
-            "model_name": "resource_picture"\r
-          }\r
+          "resource_pictures": {}\r
         },\r
         "has_one": {}\r
       },\r
         }\r
       },\r
       "lists": {\r
-        "public_list": {\r
+        "public": {\r
           "type": "public"\r
         },\r
         "by_license_group": {\r
       }\r
     },\r
     "author": {\r
-      "class_name": "Author",\r
-      "table_name": "authors",\r
       "associations": {\r
         "belongs_to": {},\r
         "has_many": {\r
-          "scrolls": {\r
-            "foreign_key": "author_id",\r
-            "model_name": "scroll"\r
-          },\r
-          "comics": {\r
-            "foreign_key": "author_id",\r
-            "model_name": "comic"\r
-          },\r
-          "stories": {\r
-            "foreign_key": "author_id",\r
-            "model_name": "story"\r
-          },\r
-          "sheets": {\r
-            "foreign_key": "author_id",\r
-            "model_name": "sheet"\r
-          },\r
-          "panels": {\r
-            "foreign_key": "author_id",\r
-            "model_name": "panel"\r
-          }\r
+          "scrolls": {},\r
+          "comics": {},\r
+          "stories": {},\r
+          "sheets": {},\r
+          "panels": {}\r
         },\r
         "has_one": {}\r
       },\r
         }\r
       },\r
       "lists": {\r
-        "public_list": {\r
+        "public": {\r
           "type": "public"\r
         }\r
       }\r
     },\r
     "artist": {\r
-      "class_name": "Artist",\r
-      "table_name": "artists",\r
       "associations": {\r
         "belongs_to": {},\r
         "has_many": {\r
-          "resource_pictures": {\r
-            "foreign_key": "artist_id",\r
-            "model_name": "resource_picture"\r
-          }\r
+          "resource_pictures": {}\r
         },\r
         "has_one": {}\r
       },\r
         }\r
       },\r
       "lists": {\r
-        "public_list": {\r
+        "public": {\r
           "type": "public"\r
         }\r
       }\r
     },\r
     "system_picture": {\r
-      "class_name": "SystemPicture",\r
-      "table_name": "system_pictures",\r
       "associations": {\r
         "belongs_to": {},\r
         "has_many": {\r
-          "balloons": {\r
-            "foreign_key": "system_picture_id",\r
-            "model_name": "balloon"\r
-          },\r
-          "balloon_templates": {\r
-            "foreign_key": "system_picture_id",\r
-            "model_name": "balloon_template"\r
-          },\r
-          "licenses": {\r
-            "foreign_key": "system_picture_id",\r
-            "model_name": "license"\r
-          }\r
+          "balloons": {},\r
+          "speech_balloon_templates": {},\r
+          "licenses": {}\r
         },\r
         "has_one": {}\r
       },\r
         }\r
       },\r
       "lists": {\r
-        "public_list": {\r
+        "public": {\r
           "type": "public"\r
         }\r
       }\r
             "list_name": "by_scroll"\r
           }\r
         },\r
-        "columns": [\r
+        "column_names": [\r
           "id",\r
           "title",\r
           "description",\r
       },\r
       "system_picture": {\r
         "lists": {\r
-          "speech_balloon_templates.by_system_picture": {\r
-            "model_name": "speech_balloon_template",\r
-            "list_name": "by_system_picture"\r
-          },\r
           "licenses.by_system_picture": {\r
             "model_name": "license",\r
             "list_name": "by_system_picture"\r
         "associations": {\r
           "belongs_to": [],\r
           "has_many": [\r
-            "speech_balloon_templates.by_system_picture",\r
             "licenses.by_system_picture"\r
           ],\r
           "has_one": []\r
     },\r
     "lists": {\r
       "scroll": {\r
-        "public_list": {},\r
-        "private_list": {},\r
+        "public": {},\r
+        "private": {},\r
         "by_author": {},\r
         "by_panel": {},\r
         "play": {}\r
       },\r
       "scroll_panel": {\r
-        "public_list": {},\r
-        "private_list": {},\r
+        "public": {},\r
+        "private": {},\r
         "by_scroll": {},\r
         "by_panel": {}\r
       },\r
       "comic": {\r
-        "public_list": {},\r
-        "private_list": {},\r
+        "public": {},\r
+        "private": {},\r
         "by_author": {}\r
       },\r
       "story": {\r
-        "public_list": {},\r
-        "private_list": {},\r
+        "public": {},\r
+        "private": {},\r
         "by_comic": {},\r
         "by_sheet": {},\r
-        "by_author": {\r
-          "type": "element_filter",\r
-          "args": {\r
-            "from": "author",\r
-            "filter_key": "author_id"\r
-          }\r
-        },\r
-        "play": {\r
-          "type": "play",\r
-          "args": {\r
-            "model": "story_sheet",\r
-            "filter_key": "story_id"\r
-          }\r
-        }\r
+        "by_author": {},\r
+        "play": {}\r
       },\r
       "story_sheet": {\r
-        "public_list": {},\r
-        "private_list": {},\r
+        "public": {},\r
+        "private": {},\r
         "by_story": {},\r
         "by_sheet": {}\r
       },\r
       "sheet": {\r
-        "public_list": {},\r
-        "private_list": {},\r
+        "public": {},\r
+        "private": {},\r
         "by_story": {},\r
         "by_panel": {},\r
         "by_author": {},\r
-        "play": {\r
-          "type": "play",\r
-          "args": {\r
-            "model": "sheet_panel",\r
-            "filter_key": "sheet_id"\r
-          }\r
-        }\r
+        "play": {}\r
       },\r
       "sheet_panel": {\r
-        "public_list": {},\r
-        "private_list": {},\r
+        "public": {},\r
+        "private": {},\r
         "by_sheet": {},\r
         "by_panel": {}\r
       },\r
       "panel": {\r
-        "public_list": {},\r
-        "private_list": {},\r
+        "public": {},\r
+        "private": {},\r
         "by_scroll": {},\r
         "by_sheet": {},\r
         "by_author": {},\r
-        "by_speech_balloon_template": {\r
-          "type": "through_filter",\r
-          "args": {\r
-            "from": "speech_balloon_template",\r
-            "through": "speech_balloons",\r
-            "filter_key": "speech_balloon_template_id"\r
-          }\r
-        }\r
+        "by_speech_balloon_template": {}\r
       },\r
       "panel_picture": {\r
-        "public_list": {},\r
-        "private_list": {},\r
+        "public": {},\r
+        "private": {},\r
         "by_panel": {},\r
-        "by_author": {\r
-          "where": "by_author_where",\r
-          "includes": "by_author_includes"\r
-        }\r
+        "by_author": {}\r
       },\r
       "speech_balloon": {\r
-        "public_list": {},\r
-        "private_list": {},\r
+        "public": {},\r
+        "private": {},\r
         "by_panel": {},\r
-        "by_speech_balloon_template": {\r
-          "type": "filter",\r
-          "args": {\r
-            "from": "speech_balloon_template",\r
-            "filter_key": "speech_balloon_template_id"\r
-          }\r
-        },\r
+        "by_speech_balloon_template": {},\r
         "by_author": {}\r
       },\r
       "speech": {\r
-        "public_list": {},\r
-        "by_speech_balloon": {\r
-          "type": "filter",\r
-          "args": {\r
-            "from": "speech_balloon",\r
-            "includes": {\r
-              "speech_balloon": {\r
-                "panel": {}\r
-              }\r
-            },\r
-            "filter_key": "speech_balloon_id"\r
-          }\r
-        },\r
-        "by_writing_format": {\r
-          "type": "filter",\r
-          "args": {\r
-            "from": "writing_format",\r
-            "filter_key": "writing_format_id"\r
-          }\r
-        }\r
+        "public": {},\r
+        "by_speech_balloon": {},\r
+        "by_writing_format": {}\r
       },\r
       "balloon": {\r
-        "public_list": {},\r
-        "by_speech_balloon": {\r
-          "type": "filter",\r
-          "args": {\r
-            "from": "speech_balloon",\r
-            "includes": {\r
-              "speech_balloon": {\r
-                "panel": {}\r
-              }\r
-            },\r
-            "filter_key": "speech_balloon_id"\r
-          }\r
-        }\r
+        "public": {},\r
+        "by_speech_balloon": {}\r
       },\r
       "ground_picture": {\r
-        "public_list": {},\r
-        "private_list": {},\r
-        "by_panel": {\r
-          "type": "filter",\r
-          "args": {\r
-            "from": "panel",\r
-            "filter_key": "panel_id"\r
-          }\r
-        },\r
-        "by_author": {\r
-          "type": "element_filter",\r
-          "args": {\r
-            "from": "author",\r
-            "filter_key": "author_id"\r
-          }\r
-        }\r
+        "public": {},\r
+        "private": {},\r
+        "by_panel": {},\r
+        "by_author": {}\r
       },\r
       "ground_color": {\r
-        "public_list": {},\r
-        "private_list": {},\r
-        "by_panel": {\r
-          "type": "filter",\r
-          "args": {\r
-            "from": "panel",\r
-            "filter_key": "panel_id"\r
-          }\r
-        },\r
-        "by_author": {\r
-          "type": "element_filter",\r
-          "args": {\r
-            "from": "author",\r
-            "filter_key": "author_id"\r
-          }\r
-        }\r
+        "public": {},\r
+        "private": {},\r
+        "by_panel": {},\r
+        "by_author": {}\r
       },\r
       "original_picture": {\r
-        "private_list": {}\r
+        "private": {}\r
       },\r
       "picture": {},\r
       "resource_picture": {\r
-        "public_list": {},\r
-        "private_list": {},\r
-        "by_license": {\r
-          "type": "filter",\r
-          "args": {\r
-            "from": "license",\r
-            "filter_key": "license_id"\r
-          }\r
-        },\r
+        "public": {},\r
+        "private": {},\r
+        "by_license": {},\r
         "by_artist": {}\r
       },\r
       "speech_balloon_template": {\r
-        "public_list": {},\r
-        "select_items": {\r
-          "type": "system_resource"\r
-        }\r
+        "public": {},\r
+        "select_items": {}\r
       },\r
       "writing_format": {\r
-        "public_list": {},\r
-        "select_items": {\r
-          "type": "system_resource"\r
-        },\r
+        "public": {},\r
+        "select_items": {},\r
         "by_system_picture": {}\r
       },\r
       "license_group": {\r
-        "public_list": {},\r
-        "select_items": {\r
-          "type": "system_resource"\r
-        }\r
+        "public": {},\r
+        "select_items": {}\r
       },\r
       "license": {\r
-        "public_list": {},\r
+        "public": {},\r
         "by_license_group": {},\r
         "by_system_picture": {}\r
       },\r
       "author": {\r
-        "public_list": {}\r
+        "public": {}\r
       },\r
       "artist": {\r
-        "public_list": {}\r
+        "public": {}\r
       },\r
       "system_picture": {\r
-        "public_list": {}\r
+        "public": {}\r
       }\r
     },\r
     "elements": [\r