OSDN Git Service

fix Manifest lst
authoryasushiito <yas@pen-chan.jp>
Tue, 28 Jan 2014 02:50:58 +0000 (11:50 +0900)
committeryasushiito <yas@pen-chan.jp>
Tue, 28 Jan 2014 02:50:58 +0000 (11:50 +0900)
43 files changed:
app/assets/javascripts/manifest/work/forms.js.coffee.erb
app/assets/javascripts/manifest/work/lists.js.coffee.erb
app/assets/javascripts/manifest/work/models.js.coffee.erb
app/assets/javascripts/panels.js.coffee
app/controllers/application_controller.rb
app/controllers/scrolls_controller.rb
config/application.rb
config/environment.rb
config/environments/development.rb
config/routes.rb
lib/manifest.rb
lib/manifest/controller.rb
lib/manifest/controller/action.rb
lib/manifest/controller/action/base.rb [new file with mode: 0644]
lib/manifest/controller/action/list.rb
lib/manifest/controller/action/show.rb
lib/manifest/filer.rb
lib/manifest/form.rb
lib/manifest/list.rb [new file with mode: 0644]
lib/manifest/list/base.rb [new file with mode: 0644]
lib/manifest/list/element_filter.rb [new file with mode: 0644]
lib/manifest/list/filter.rb [new file with mode: 0644]
lib/manifest/list/play.rb [new file with mode: 0644]
lib/manifest/list/private.rb [new file with mode: 0644]
lib/manifest/list/public.rb [new file with mode: 0644]
lib/manifest/list/system_resource.rb [new file with mode: 0644]
lib/manifest/list/through_filter.rb [new file with mode: 0644]
lib/manifest/manifest.rb
lib/manifest/model.rb
lib/manifest/model/association.rb
lib/manifest/model/list/base.rb
lib/manifest/model/list/element_filter.rb
lib/manifest/model/list/filter.rb
lib/manifest/model/list/has_many.rb
lib/manifest/model/list/has_many_through.rb
lib/manifest/model/list/play.rb
lib/manifest/model/list/private.rb
lib/manifest/model/list/public.rb
lib/manifest/model/list/system_resource.rb
lib/manifest/model/list/through_filter.rb
lib/manifest/profiler.rb
lib/view/list/list.rb [new file with mode: 0644]
public/manifest.json

index 71d45e1..435ba73 100644 (file)
@@ -91,7 +91,7 @@
           args: {\r
             column: 'id',\r
             label: {\r
-              type: 'none ',\r
+              type: 'none',\r
             },\r
             tag: {\r
               type: 'hidden',\r
index 7bc0110..e26c3d5 100644 (file)
 #マニフェスト\r
 @lists = {\r
   scroll: {\r
-    lists: {\r
-      public_list: {\r
-        type: 'public',\r
-      },\r
-      private_list: {\r
-        type: 'private',\r
-      },\r
-      scroll_panels: {\r
-        type: 'has_many',\r
-        association_name: 'scroll_panels',\r
-      },\r
-      panels: {\r
-        type: 'has_many_through',\r
-        association_name: 'panels',\r
-      },\r
-      by_author: {\r
-        type: 'filter',\r
-        from: 'author',\r
-        filter_key: 'author_id',\r
-      },\r
-      by_panel: {\r
-        type: 'through_filter',\r
-        from: 'panel',\r
-        through: 'scroll_panels',\r
-        filter_key: 'panel_id',\r
-      },\r
-      play: {\r
-        type: 'play',\r
-        model: 'scroll_panel',\r
-        filter_key: 'scroll_id',\r
-      },\r
+    public_list: {\r
+    },\r
+    private_list: {\r
+    },\r
+    by_author: {\r
+      type: 'filter',\r
+      from: 'author',\r
+      filter_key: 'author_id',\r
+    },\r
+    by_panel: {\r
+      type: 'through_filter',\r
+      from: 'panel',\r
+      through: 'scroll_panels',\r
+      filter_key: 'panel_id',\r
+    },\r
+    play: {\r
+      type: 'play',\r
+      model: 'scroll_panel',\r
+      filter_key: 'scroll_id',\r
     },\r
   },\r
   scroll_panel: {\r
-    default_page_size: 20, \r
-    lists: {\r
-      public_list: {\r
-        type: 'public',\r
-      },\r
-      private_list: {\r
-        type: 'private',\r
-      },\r
-      by_scroll: {\r
-        type: 'filter',\r
-        from: 'scroll',\r
-        filter_key: 'scroll_id',\r
-      },\r
-      by_panel: {\r
-        type: 'filter',\r
-        from: 'panel',\r
-        filter_key: 'panel_id',\r
-      },\r
+    public_list: {\r
+    },\r
+    private_list: {\r
+    },\r
+    by_scroll: {\r
+      type: 'filter',\r
+      from: 'scroll',\r
+      filter_key: 'scroll_id',\r
+    },\r
+    by_panel: {\r
+      type: 'filter',\r
+      from: 'panel',\r
+      filter_key: 'panel_id',\r
     },\r
   },\r
   comic: {\r
-    default_page_size: 20, \r
-    lists: {\r
-      public_list: {\r
-        type: 'public',\r
-      },\r
-      private_list: {\r
-        type: 'private',\r
-      },\r
-      stories: {\r
-        type: 'has_many',\r
-        association_name: 'stories',\r
-      },\r
-      by_author: {\r
-        type: 'filter',\r
-        from: 'author',\r
-        filter_key: 'author_id',\r
-      },\r
+    public_list: {\r
+    },\r
+    private_list: {\r
+    },\r
+    by_author: {\r
+      type: 'filter',\r
+      from: 'author',\r
+      filter_key: 'author_id',\r
     },\r
   },\r
   story: {\r
-    default_page_size: 20, \r
-    lists: {\r
-      public_list: {\r
-        type: 'public',\r
-      },\r
-      private_list: {\r
-        type: 'private',\r
-      },\r
-      story_sheets: {\r
-        type: 'has_many',\r
-        association_name: 'story_sheets',\r
-      },\r
-      sheets: {\r
-        type: 'has_many',\r
-        association_name: 'sheets',\r
-      },\r
-      by_comic: {\r
-        type: 'filter',\r
-        from: 'comic',\r
-        filter_key: 'comic_id',\r
-      },\r
-      by_sheet: {\r
-        type: 'through_filter',\r
-        from: 'sheet',\r
-        through: 'story_sheets',\r
-        filter_key: 'sheet_id',\r
-      },\r
-      by_author: {\r
-        type: 'element_filter',\r
-        from: 'author',\r
-        filter_key: 'author_id',\r
-      },\r
-      play: {\r
-        type: 'play',\r
-        model: 'story_sheet',\r
-        filter_key: 'story_id',\r
-      },\r
+    public_list: {\r
+    },\r
+    private_list: {\r
+    },\r
+    by_comic: {\r
+      type: 'filter',\r
+      from: 'comic',\r
+      filter_key: 'comic_id',\r
+    },\r
+    by_sheet: {\r
+      type: 'through_filter',\r
+      from: 'sheet',\r
+      through: 'story_sheets',\r
+      filter_key: 'sheet_id',\r
+    },\r
+    by_author: {\r
+      type: 'element_filter',\r
+      from: 'author',\r
+      filter_key: 'author_id',\r
+    },\r
+    play: {\r
+      type: 'play',\r
+      model: 'story_sheet',\r
+      filter_key: 'story_id',\r
     },\r
   },\r
   story_sheet: {\r
-    default_page_size: 20, \r
-    lists: {\r
-      public_list: {\r
-        type: 'public',\r
-      },\r
-      private_list: {\r
-        type: 'private',\r
-      },\r
-      by_story: {\r
-        type: 'filter',\r
-        from: 'story',\r
-        filter_key: 'story_id',\r
-      },\r
-      by_sheet: {\r
-        type: 'filter',\r
-        from: 'sheet',\r
-        filter_key: 'sheet_id',\r
-      },\r
+    public_list: {\r
+      type: 'public',\r
+    },\r
+    private_list: {\r
+      type: 'private',\r
+    },\r
+    by_story: {\r
+      type: 'filter',\r
+      from: 'story',\r
+      filter_key: 'story_id',\r
+    },\r
+    by_sheet: {\r
+      type: 'filter',\r
+      from: 'sheet',\r
+      filter_key: 'sheet_id',\r
     },\r
   },\r
   sheet: {\r
-    default_page_size: 20, \r
-    lists: {\r
-      public_list: {\r
-        type: 'public',\r
-      },\r
-      private_list: {\r
-        type: 'private',\r
-      },\r
-      story_sheets: {\r
-        type: 'has_many',\r
-        association_name: 'story_sheets',\r
-      },\r
-      stories: {\r
-        type: 'has_many',\r
-        association_name: 'stories',\r
-      },\r
-      sheet_panels: {\r
-        type: 'has_many',\r
-        association_name: 'sheet_panels',\r
-      },\r
-      panels: {\r
-        type: 'has_many',\r
-        association_name: 'panels',\r
-      },\r
-      by_story: {\r
-        type: 'through_filter',\r
-        from: 'story',\r
-        through: 'story_sheets',\r
-        filter_key: 'story_id',\r
-      },\r
-      by_panel: {\r
-        type: 'through_filter',\r
-        from: 'panel',\r
-        through: 'sheet_panels',\r
-        filter_key: 'panel_id',\r
-      },\r
-      by_author: {\r
-        type: 'filter',\r
-        from: 'author',\r
-        filter_key: 'author_id',\r
-      },\r
-      play: {\r
-        type: 'play',\r
-        model: 'sheet_panel',\r
-        filter_key: 'sheet_id',\r
-      },\r
+    public_list: {\r
+    },\r
+    private_list: {\r
+    },\r
+    by_story: {\r
+      type: 'through_filter',\r
+      from: 'story',\r
+      through: 'story_sheets',\r
+      filter_key: 'story_id',\r
+    },\r
+    by_panel: {\r
+      type: 'through_filter',\r
+      from: 'panel',\r
+      through: 'sheet_panels',\r
+      filter_key: 'panel_id',\r
+    },\r
+    by_author: {\r
+      type: 'filter',\r
+      from: 'author',\r
+      filter_key: 'author_id',\r
+    },\r
+    play: {\r
+      type: 'play',\r
+      model: 'sheet_panel',\r
+      filter_key: 'sheet_id',\r
     },\r
   },\r
   sheet_panel: {\r
-    default_page_size: 20, \r
-    lists: {\r
-      public_list: {\r
-        type: 'public',\r
-      },\r
-      private_list: {\r
-        type: 'private',\r
-      },\r
-      by_sheet: {\r
-        type: 'filter',\r
-        association_name: 'sheet_panels',\r
-        from: 'sheet',\r
-        filter_key: 'sheet_id',\r
-      },\r
-      by_panel: {\r
-        type: 'filter',\r
-        from: 'panel',\r
-        filter_key: 'panel_id',\r
-      },\r
+    public_list: {\r
+    },\r
+    private_list: {\r
+    },\r
+    by_sheet: {\r
+      type: 'filter',\r
+      association_name: 'sheet_panels',\r
+      from: 'sheet',\r
+      filter_key: 'sheet_id',\r
+    },\r
+    by_panel: {\r
+      type: 'filter',\r
+      from: 'panel',\r
+      filter_key: 'panel_id',\r
     },\r
   },\r
   panel: {\r
-    default_page_size: 20, \r
-    lists: {\r
-      public_list: {\r
-        type: 'public',\r
-      },\r
-      private_list: {\r
-        type: 'private',\r
-      },\r
-      scroll_panels: {\r
-        type: 'has_many',\r
-        association_name: 'scroll_panels',\r
-      },\r
-      scrolls: {\r
-        type: 'has_many',\r
-        association_name: 'scrolls',\r
-      },\r
-      sheet_panels: {\r
-        type: 'has_many',\r
-        association_name: 'sheet_panels',\r
-      },\r
-      sheets: {\r
-        type: 'has_many',\r
-        association_name: 'sheets',\r
-      },\r
-      panel_pictures: {\r
-        type: 'has_many',\r
-        association_name: 'panel_pictures',\r
-      },\r
-      speech_balloons: {\r
-        type: 'has_many',\r
-        association_name: 'speech_balloons',\r
-      },\r
-      ground_pictures: {\r
-        type: 'has_many',\r
-        association_name: 'ground_pictures',\r
-      },\r
-      ground_colors: {\r
-        type: 'has_many',\r
-        association_name: 'ground_colors',\r
-      },\r
-      by_scroll: {\r
-        type: 'through_filter',\r
-        from: 'scroll',\r
-        through: 'scroll_panels',\r
-        filter_key: 'scroll_id',\r
-      },\r
-      by_sheet: {\r
-        type: 'through_filter',\r
-        from: 'sheet',\r
-        through: 'sheet_panels',\r
-        filter_key: 'sheet_id',\r
-      },\r
-      by_author: {\r
-        type: 'filter',\r
-        from: 'author',\r
-        filter_key: 'author_id',\r
-      },\r
-      by_speech_balloon_template: {\r
-        type: 'through_filter',\r
-        from: 'speech_balloon_template',\r
-        through: 'speech_balloons',\r
-        filter_key: 'speech_balloon_template_id',\r
-      },\r
+    public_list: {\r
+    },\r
+    private_list: {\r
+    },\r
+    by_scroll: {\r
+      type: 'through_filter',\r
+      from: 'scroll',\r
+      through: 'scroll_panels',\r
+      filter_key: 'scroll_id',\r
+    },\r
+    by_sheet: {\r
+      type: 'through_filter',\r
+      from: 'sheet',\r
+      through: 'sheet_panels',\r
+      filter_key: 'sheet_id',\r
+    },\r
+    by_author: {\r
+      type: 'filter',\r
+      from: 'author',\r
+      filter_key: 'author_id',\r
+    },\r
+    by_speech_balloon_template: {\r
+      type: 'through_filter',\r
+      from: 'speech_balloon_template',\r
+      through: 'speech_balloons',\r
+      filter_key: 'speech_balloon_template_id',\r
     },\r
   },\r
   panel_picture: {\r
-    default_page_size: 20, \r
-    lists: {\r
-      public_list: {\r
-        type: 'public',\r
-      },\r
-      private_list: {\r
-        type: 'private',\r
-      },\r
-      by_panel: {\r
-        type: 'filter',\r
-        from: 'panel',\r
-        filter_key: 'panel_id',\r
-      },\r
-      by_author: {\r
-        type: 'element_filter',\r
-        from: 'author',\r
-        filter_key: 'author_id',\r
-      },\r
+    public_list: {\r
+    },\r
+    private_list: {\r
+    },\r
+    by_panel: {\r
+      type: 'filter',\r
+      from: 'panel',\r
+      filter_key: 'panel_id',\r
+    },\r
+    by_author: {\r
+      type: 'element_filter',\r
+      from: 'author',\r
+      filter_key: 'author_id',\r
     },\r
   },\r
   speech_balloon: {\r
-    default_page_size: 20, \r
-    lists: {\r
-      public_list: {\r
-        type: 'public',\r
-      },\r
-      private_list: {\r
-        type: 'private',\r
-      },\r
-      by_panel: {\r
-        type: 'filter',\r
-        from: 'panel',\r
-        filter_key: 'panel_id',\r
-      },\r
-      by_speech_balloon_template: {\r
-        type: 'filter',\r
-        from: 'speech_balloon_template',\r
-        filter_key: 'speech_balloon_template_id',\r
-      },\r
-      by_author: {\r
-        type: 'element_filter',\r
-        from: 'author',\r
-        filter_key: 'author_id',\r
-      },\r
+    public_list: {\r
+    },\r
+    private_list: {\r
+    },\r
+    by_panel: {\r
+      type: 'filter',\r
+      from: 'panel',\r
+      filter_key: 'panel_id',\r
+    },\r
+    by_speech_balloon_template: {\r
+      type: 'filter',\r
+      from: 'speech_balloon_template',\r
+      filter_key: 'speech_balloon_template_id',\r
+    },\r
+    by_author: {\r
+      type: 'element_filter',\r
+      from: 'author',\r
+      filter_key: 'author_id',\r
     },\r
   },\r
   speech: {\r
-    default_page_size: 20, \r
-    lists: {\r
-      public_list: {\r
-        type: 'public',\r
-      },\r
-      by_speech_balloon: {\r
-        type: 'filter',\r
-        from: 'speech_balloon',\r
-        includes: {speech_balloon: {panel: {}}},\r
-        filter_key: 'speech_balloon_id',\r
-      },\r
-      by_writing_format: {\r
-        type: 'filter',\r
-        from: 'writing_format',\r
-        filter_key: 'writing_format_id',\r
-      },\r
+    public_list: {\r
+    },\r
+    by_speech_balloon: {\r
+      type: 'filter',\r
+      from: 'speech_balloon',\r
+      includes: {speech_balloon: {panel: {}}},\r
+      filter_key: 'speech_balloon_id',\r
+    },\r
+    by_writing_format: {\r
+      type: 'filter',\r
+      from: 'writing_format',\r
+      filter_key: 'writing_format_id',\r
     },\r
   },\r
   balloon: {\r
-    default_page_size: 20, \r
-    lists: {\r
-      public_list: {\r
-        type: 'public',\r
-      },\r
-      by_speech_balloon: {\r
-        type: 'filter',\r
-        from: 'speech_balloon',\r
-        includes: {speech_balloon: {panel: {}}},\r
-        filter_key: 'speech_balloon_id',\r
-      },\r
-      #by_system_picture: {\r
-      #  type: 'filter',\r
-      #  from: 'system_picture',\r
-      #  filter_key: 'system_picture_id',\r
-      #},\r
+    public_list: {\r
     },\r
+    by_speech_balloon: {\r
+      type: 'filter',\r
+      from: 'speech_balloon',\r
+      includes: {speech_balloon: {panel: {}}},\r
+      filter_key: 'speech_balloon_id',\r
+    },\r
+    #by_system_picture: {\r
+    #  type: 'filter',\r
+    #  from: 'system_picture',\r
+    #  filter_key: 'system_picture_id',\r
+    #},\r
   },\r
   ground_picture: {\r
-    default_page_size: 20, \r
-    lists: {\r
-      public_list: {\r
-        type: 'public',\r
-      },\r
-      private_list: {\r
-        type: 'private',\r
-      },\r
-      by_panel: {\r
-        type: 'filter',\r
-        from: 'panel',\r
-        filter_key: 'panel_id',\r
-      },\r
-      by_author: {\r
-        type: 'element_filter',\r
-        from: 'author',\r
-        filter_key: 'author_id',\r
-      },\r
+    public_list: {\r
+    },\r
+    private_list: {\r
+      type: 'private',\r
+    },\r
+    by_panel: {\r
+      type: 'filter',\r
+      from: 'panel',\r
+      filter_key: 'panel_id',\r
+    },\r
+    by_author: {\r
+      type: 'element_filter',\r
+      from: 'author',\r
+      filter_key: 'author_id',\r
     },\r
   },\r
   ground_color: {\r
-    default_page_size: 20, \r
-    lists: {\r
-      public_list: {\r
-        type: 'public',\r
-      },\r
-      private_list: {\r
-        type: 'private',\r
-      },\r
-      by_panel: {\r
-        type: 'filter',\r
-        from: 'panel',\r
-        filter_key: 'panel_id',\r
-      },\r
-      by_author: {\r
-        type: 'element_filter',\r
-        from: 'author',\r
-        filter_key: 'author_id',\r
-      },\r
+    public_list: {\r
+    },\r
+    private_list: {\r
+    },\r
+    by_panel: {\r
+      type: 'filter',\r
+      from: 'panel',\r
+      filter_key: 'panel_id',\r
+    },\r
+    by_author: {\r
+      type: 'element_filter',\r
+      from: 'author',\r
+      filter_key: 'author_id',\r
     },\r
   },\r
   original_picture: {\r
-    default_page_size: 20, \r
-    lists: {\r
-      private_list: {\r
-        type: 'private',\r
-      },\r
+    private_list: {\r
     },\r
   },\r
   picture: {\r
   },\r
   resource_picture: {\r
-    default_page_size: 20, \r
-    lists: {\r
-      public_list: {\r
-        type: 'public',\r
-      },\r
-      private_list: {\r
-        type: 'private',\r
-      },\r
-      by_license: {\r
-        type: 'filter',\r
-        from: 'license',\r
-        filter_key: 'license_id',\r
-      },\r
-      by_artist: {\r
-        type: 'filter',\r
-        from: 'artist',\r
-        filter_key: 'artist_id',\r
-      },\r
+    public_list: {\r
+    },\r
+    private_list: {\r
+    },\r
+    by_license: {\r
+      type: 'filter',\r
+      from: 'license',\r
+      filter_key: 'license_id',\r
+    },\r
+    by_artist: {\r
+      type: 'filter',\r
+      from: 'artist',\r
+      filter_key: 'artist_id',\r
     },\r
   },\r
   speech_balloon_template: {\r
-    default_page_size: 20, \r
-    lists: {\r
-      public_list: {\r
-        type: 'public',\r
-      },\r
-      select_items: {\r
-        type: 'system_resource',\r
-      },\r
-      speech_balloons: {\r
-        type: 'has_many',\r
-        association_name: 'speech_balloons',\r
-      },\r
-      panels: {\r
-        type: 'has_many',\r
-        association_name: 'panels',\r
-      },\r
+    public_list: {\r
+    },\r
+    select_items: {\r
+      type: 'system_resource',\r
     },\r
   },\r
   writing_format: {\r
-    default_page_size: 20, \r
-    lists: {\r
-      public_list: {\r
-        type: 'public',\r
-      },\r
-      select_items: {\r
-        type: 'system_resource',\r
-      },\r
-      speeches: {\r
-        type: 'has_many',\r
-        association_name: 'speeches',\r
-      },\r
-      by_system_picture: {\r
-        type: 'filter',\r
-        from: 'system_picture',\r
-        filter_key: 'system_picture_id',\r
-      },\r
+    public_list: {\r
+    },\r
+    select_items: {\r
+      type: 'system_resource',\r
+    },\r
+    by_system_picture: {\r
+      type: 'filter',\r
+      from: 'system_picture',\r
+      filter_key: 'system_picture_id',\r
     },\r
   },\r
   license_group: {\r
-    default_page_size: 20, \r
-    lists: {\r
-      public_list: {\r
-        type: 'public',\r
-      },\r
-      select_items: {\r
-        type: 'system_resource',\r
-      },\r
-      licenses: {\r
-        type: 'has_many',\r
-        association_name: 'licenses',\r
-      },\r
+    public_list: {\r
+    },\r
+    select_items: {\r
+      type: 'system_resource',\r
     },\r
   },\r
   license: {\r
-    default_page_size: 20, \r
-    lists: {\r
-      public_list: {\r
-        type: 'public',\r
-      },\r
-      resource_pictures: {\r
-        type: 'has_many',\r
-        association_name: 'resource_pictures',\r
-      },\r
-      by_license_group: {\r
-        type: 'filter',\r
-        from: 'license_group',\r
-        filter_key: 'license_group_id',\r
-      },\r
-      by_system_picture: {\r
-        type: 'filter',\r
-        from: 'system_picture',\r
-        filter_key: 'system_picture_id',\r
-      },\r
+    public_list: {\r
+    },\r
+    by_license_group: {\r
+      type: 'filter',\r
+      from: 'license_group',\r
+      filter_key: 'license_group_id',\r
+    },\r
+    by_system_picture: {\r
+      type: 'filter',\r
+      from: 'system_picture',\r
+      filter_key: 'system_picture_id',\r
     },\r
   },\r
   author: {\r
-    default_page_size: 20, \r
-    lists: {\r
-      public_list: {\r
-        type: 'public',\r
-      },\r
-      scrolls: {\r
-        type: 'has_many',\r
-        association_name: 'scrolls',\r
-      },\r
-      comics: {\r
-        type: 'has_many',\r
-        association_name: 'comics',\r
-      },\r
-      stories: {\r
-        type: 'has_many',\r
-        association_name: 'stories',\r
-      },\r
-      sheets: {\r
-        type: 'has_many',\r
-        association_name: 'sheets',\r
-      },\r
-      panels: {\r
-        type: 'has_many',\r
-        association_name: 'panels',\r
-      },\r
-      panel_pictures: {\r
-        type: 'has_many',\r
-        association_name: 'panel_pictures',\r
-      },\r
-      speech_balloons: {\r
-        type: 'has_many',\r
-        association_name: 'speech_balloons',\r
-      },\r
-      ground_pictures: {\r
-        type: 'has_many',\r
-        association_name: 'ground_pictures',\r
-      },\r
-      ground_colors: {\r
-        type: 'has_many',\r
-        association_name: 'ground_colors',\r
-      },\r
+    public_list: {\r
     },\r
   },\r
   artist: {\r
-    default_page_size: 20, \r
-    lists: {\r
-      public_list: {\r
-        type: 'public',\r
-      },\r
-      resource_pictures: {\r
-        type: 'has_many',\r
-        association_name: 'resource_pictures',\r
-      },\r
+    public_list: {\r
     },\r
   },\r
   system_picture: {\r
-    default_page_size: 20, \r
-    lists: {\r
-      public_list: {\r
-        type: 'public',\r
-      },\r
+    public_list: {\r
     },\r
   },\r
 }\r
index deb3e56..1072ec4 100644 (file)
       private_list: {\r
         type: 'private',\r
       },\r
-      scroll_panels: {\r
-        type: 'has_many',\r
-        args: {\r
-          association_name: 'scroll_panels',\r
-        },\r
-      },\r
-      panels: {\r
-        type: 'has_many_through',\r
-        args: {\r
-          association_name: 'panels',\r
-        },\r
-      },\r
       by_author: {\r
         type: 'filter',\r
-        args: {\r
-          from: 'author',\r
-          filter_key: 'author_id',\r
-        },\r
       },\r
       by_panel: {\r
         type: 'through_filter',\r
-        args: {\r
-          from: 'panel',\r
-          through: 'scroll_panels',\r
-          filter_key: 'panel_id',\r
-        },\r
       },\r
       play: {\r
         type: 'play',\r
-        args: {\r
-          model_name: 'scroll_panel',\r
-          filter_key: 'scroll_id',\r
-        },\r
       },\r
     },\r
   },\r
       },\r
       by_scroll: {\r
         type: 'filter',\r
-        args: {\r
-          from: 'scroll',\r
-          filter_key: 'scroll_id',\r
-        },\r
       },\r
       by_panel: {\r
         type: 'filter',\r
-        args: {\r
-          from: 'panel',\r
-          filter_key: 'panel_id',\r
-        },\r
       },\r
     },\r
   },\r
       private_list: {\r
         type: 'private',\r
       },\r
-      stories: {\r
-        type: 'has_many',\r
-        args: {\r
-          association_name: 'stories',\r
-        },\r
-      },\r
       by_author: {\r
         type: 'filter',\r
-        args: {\r
-          from: 'author',\r
-          filter_key: 'author_id',\r
-        },\r
       },\r
     },\r
   },\r
       private_list: {\r
         type: 'private',\r
       },\r
-      story_sheets: {\r
-        type: 'has_many',\r
-        args: {\r
-          association_name: 'story_sheets',\r
-        },\r
-      },\r
-      sheets: {\r
-        type: 'has_many',\r
-        args: {\r
-          association_name: 'sheets',\r
-        },\r
-      },\r
       by_comic: {\r
         type: 'filter',\r
-        args: {\r
-          from: 'comic',\r
-          filter_key: 'comic_id',\r
-        },\r
       },\r
       by_sheet: {\r
         type: 'through_filter',\r
-        args: {\r
-          from: 'sheet',\r
-          through: 'story_sheets',\r
-          filter_key: 'sheet_id',\r
-        },\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_name: 'story_sheet',\r
-          filter_key: 'story_id',\r
-        },\r
       },\r
     },\r
   },\r
       },\r
       by_story: {\r
         type: 'filter',\r
-        args: {\r
-          from: 'story',\r
-          filter_key: 'story_id',\r
-        },\r
       },\r
       by_sheet: {\r
         type: 'filter',\r
-        args: {\r
-          from: 'sheet',\r
-          filter_key: 'sheet_id',\r
-        },\r
       },\r
     },\r
   },\r
       private_list: {\r
         type: 'private',\r
       },\r
-      story_sheets: {\r
-        type: 'has_many',\r
-        args: {\r
-          association_name: 'story_sheets',\r
-        },\r
-      },\r
-      stories: {\r
-        type: 'has_many',\r
-        args: {\r
-          association_name: 'stories',\r
-        },\r
-      },\r
-      sheet_panels: {\r
-        type: 'has_many',\r
-        args: {\r
-          association_name: 'sheet_panels',\r
-        },\r
-      },\r
-      panels: {\r
-        type: 'has_many',\r
-        args: {\r
-          association_name: 'panels',\r
-        },\r
-      },\r
       by_story: {\r
         type: 'through_filter',\r
-        args: {\r
-          from: 'story',\r
-          through: 'story_sheets',\r
-          filter_key: 'story_id',\r
-        },\r
       },\r
       by_panel: {\r
         type: 'through_filter',\r
-        args: {\r
-          from: 'panel',\r
-          through: 'sheet_panels',\r
-          filter_key: 'panel_id',\r
-        },\r
       },\r
       by_author: {\r
         type: 'filter',\r
-        args: {\r
-          from: 'author',\r
-          filter_key: 'author_id',\r
-        },\r
       },\r
       play: {\r
         type: 'play',\r
-        args: {\r
-          model_name: 'sheet_panel',\r
-          filter_key: 'sheet_id',\r
-        },\r
       },\r
     },\r
   },\r
       },\r
       by_sheet: {\r
         type: 'filter',\r
-        args: {\r
-          association_name: 'sheet_panels',\r
-          from: 'sheet',\r
-          filter_key: 'sheet_id',\r
-        },\r
       },\r
       by_panel: {\r
         type: 'filter',\r
-        args: {\r
-          from: 'panel',\r
-          filter_key: 'panel_id',\r
-        },\r
       },\r
     },\r
   },\r
       private_list: {\r
         type: 'private',\r
       },\r
-      scroll_panels: {\r
-        type: 'has_many',\r
-        args: {\r
-          association_name: 'scroll_panels',\r
-        },\r
-      },\r
-      scrolls: {\r
-        type: 'has_many',\r
-        args: {\r
-          association_name: 'scrolls',\r
-        },\r
-      },\r
-      sheet_panels: {\r
-        type: 'has_many',\r
-        args: {\r
-          association_name: 'sheet_panels',\r
-        },\r
-      },\r
-      sheets: {\r
-        type: 'has_many',\r
-        args: {\r
-          association_name: 'sheets',\r
-        },\r
-      },\r
-      panel_pictures: {\r
-        type: 'has_many',\r
-        args: {\r
-          association_name: 'panel_pictures',\r
-        },\r
-      },\r
-      speech_balloons: {\r
-        type: 'has_many',\r
-        args: {\r
-          association_name: 'speech_balloons',\r
-        },\r
-      },\r
-      ground_pictures: {\r
-        type: 'has_many',\r
-        args: {\r
-          association_name: 'ground_pictures',\r
-        },\r
-      },\r
-      ground_colors: {\r
-        type: 'has_many',\r
-        args: {\r
-          association_name: 'ground_colors',\r
-        },\r
-      },\r
       by_scroll: {\r
         type: 'through_filter',\r
-        args: {\r
-          from: 'scroll',\r
-          through: 'scroll_panels',\r
-          filter_key: 'scroll_id',\r
-        },\r
       },\r
       by_sheet: {\r
         type: 'through_filter',\r
-        args: {\r
-          from: 'sheet',\r
-          through: 'sheet_panels',\r
-          filter_key: 'sheet_id',\r
-        },\r
       },\r
       by_author: {\r
         type: 'filter',\r
-        args: {\r
-          from: 'author',\r
-          filter_key: 'author_id',\r
-        },\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
   },\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
   },\r
       },\r
       by_panel: {\r
         type: 'filter',\r
-        args: {\r
-          from: 'panel',\r
-          filter_key: 'panel_id',\r
-        },\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
         type: 'element_filter',\r
-        args: {\r
-          from: 'author',\r
-          filter_key: 'author_id',\r
-        },\r
       },\r
     },\r
   }, \r
       },\r
       by_panel: {\r
         type: 'filter',\r
-        args: {\r
-          from: 'panel',\r
-          filter_key: 'panel_id',\r
-        },\r
       },\r
-      by_speech_balloon_template: {\r
+      by_speech_balloon: {\r
         type: 'filter',\r
-        args: {\r
-          from: 'speech_balloon_template',\r
-          filter_key: 'speech_balloon_template_id',\r
-        },\r
       },\r
       by_author: {\r
         type: 'element_filter',\r
-        args: {\r
-          from: 'author',\r
-          filter_key: 'author_id',\r
-        },\r
       },\r
     },\r
   },\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
   },\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
   },\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
   },\r
       },\r
       by_license: {\r
         type: 'filter',\r
-        args: {\r
-          from: 'license',\r
-          filter_key: 'license_id',\r
-        },\r
       },\r
       by_artist: {\r
         type: 'filter',\r
-        args: {\r
-          from: 'artist',\r
-          filter_key: 'artist_id',\r
-        },\r
       },\r
     },\r
   },\r
       select_items: {\r
         type: 'system_resource',\r
       },\r
-      speech_balloons: {\r
-        type: 'has_many',\r
-        args: {\r
-          association_name: 'speech_balloons',\r
-        },\r
-      },\r
-      panels: {\r
-        type: 'has_many',\r
-        args: {\r
-          association_name: 'panels',\r
-        },\r
-      },\r
     },\r
   },\r
   writing_format: {\r
       select_items: {\r
         type: 'system_resource',\r
       },\r
-      speeches: {\r
-        type: 'has_many',\r
-        args: {\r
-          association_name: 'speeches',\r
-        },\r
-      },\r
       by_system_picture: {\r
         type: 'filter',\r
-        args: {\r
-          from: 'system_picture',\r
-          filter_key: 'system_picture_id',\r
-        },\r
       },\r
     },\r
   },\r
       select_items: {\r
         type: 'system_resource',\r
       },\r
-      licenses: {\r
-        type: 'has_many',\r
-        args: {\r
-          association_name: 'licenses',\r
-        },\r
-      },\r
     },\r
   },\r
   license: {\r
       public_list: {\r
         type: 'public',\r
       },\r
-      resource_pictures: {\r
-        type: 'has_many',\r
-        args: {\r
-          association_name: 'resource_pictures',\r
-        },\r
-      },\r
       by_license_group: {\r
         type: 'filter',\r
-        args: {\r
-          from: 'license_group',\r
-          filter_key: 'license_group_id',\r
-        },\r
       },\r
       by_system_picture: {\r
         type: 'filter',\r
-        args: {\r
-          from: 'system_picture',\r
-          filter_key: 'system_picture_id',\r
-        },\r
       },\r
     },\r
   },\r
       public_list: {\r
         type: 'public',\r
       },\r
-      scrolls: {\r
-        type: 'has_many',\r
-        args: {\r
-          association_name: 'scrolls',\r
-        },\r
-      },\r
-      comics: {\r
-        type: 'has_many',\r
-        args: {\r
-          association_name: 'comics',\r
-        },\r
-      },\r
-      stories: {\r
-        type: 'has_many',\r
-        args: {\r
-          association_name: 'stories',\r
-        },\r
-      },\r
-      sheets: {\r
-        type: 'has_many',\r
-        args: {\r
-          association_name: 'sheets',\r
-        },\r
-      },\r
-      panels: {\r
-        type: 'has_many',\r
-        args: {\r
-          association_name: 'panels',\r
-        },\r
-      },\r
-      panel_pictures: {\r
-        type: 'has_many',\r
-        args: {\r
-          association_name: 'panel_pictures',\r
-        },\r
-      },\r
-      speech_balloons: {\r
-        type: 'has_many',\r
-        args: {\r
-          association_name: 'speech_balloons',\r
-        },\r
-      },\r
-      ground_pictures: {\r
-        type: 'has_many',\r
-        args: {\r
-          association_name: 'ground_pictures',\r
-        },\r
-      },\r
-      ground_colors: {\r
-        type: 'has_many',\r
-        args: {\r
-          association_name: 'ground_colors',\r
-        },\r
-      },\r
     },\r
   },\r
   artist: {\r
       public_list: {\r
         type: 'public',\r
       },\r
-      resource_pictures: {\r
-        type: 'has_many',\r
-        args: {\r
-          association_name: 'resource_pictures',\r
-        },\r
-      },\r
     },\r
   },\r
   system_picture: {\r
index a0af1b5..d0834fa 100644 (file)
@@ -11,13 +11,13 @@ $ ->
   configurations =  {\r
     controllers: window.controllers,\r
     models: window.models,\r
-    lists: window.lists,\r
     system_resources: window.system_resources,\r
     magic_numbers: window.magic_numbers,\r
     select_items: window.select_items,\r
     locals: {\r
       profilers: window.profilers,\r
       filers: window.filers,\r
+      lists: window.lists,\r
       elements: window.elements,\r
       forms: window.forms,\r
     }\r
index 9866d9c..28f9beb 100644 (file)
@@ -101,7 +101,7 @@ class ApplicationController < ActionController::Base
   end
   
   def self.controller
-    Manifest.manifest.controller_managers[self.model.item_name]
+    Manifest.manifest.controllers[self.model.item_name]
   end
   
   def self.profiler_manager
@@ -109,9 +109,12 @@ class ApplicationController < ActionController::Base
   end
   
   def public_list 
-    action_name = params[:action]
-    @action = self.class.controller.open(action_name, params, @operators)
-    @items = @action.items 
+    c = Manifest.manifest.controllers[self.class.model.item_name]
+    a = c.actions[params[:action].to_s]
+    ml = Manifest.manifest.models[a.item_name].lists[a.list_name]
+    l = Manifest.manifest.lists[a.item_name][a.list_name]
+    r = l.open({:id => params}, @operators)
+    @items = r.items 
     respond_to do |format|
       format.html {
         @filer = @action.filer
index 3ee8fb2..6bffe7d 100644 (file)
@@ -3,7 +3,7 @@ class ScrollsController < ApplicationController
     before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
     before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
   else
-    before_filter :authenticate_reader, :only => [:top, :index, :show, :play, :scroll_panels, :panels, :by_author, :by_panel]
+    before_filter :authenticate_reader, :only => [:top, :index, :show, :play, :by_author, :by_panel]
     before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
     before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
   end
@@ -16,14 +16,6 @@ class ScrollsController < ApplicationController
     public_list
   end
   
-  def scroll_panels
-    has_many_list
-  end
-  
-  def panels
-    has_many_list
-  end
-  
   def by_author
     filter_list
   end
@@ -75,6 +67,22 @@ class ScrollsController < ApplicationController
     end
   end
   
+  def scroll_panels_count
+    has_many_list
+  end
+  
+  def panels_count
+    has_many_list
+  end
+  
+  def count_by_author
+    filter_list
+  end
+  
+  def count_by_panel
+    filter_list
+  end
+  
   def new
     @scroll = Scroll.new
     @scroll.supply_default
index 1d97308..346cb0d 100644 (file)
@@ -16,7 +16,6 @@ if defined?(Bundler)
   # Bundler.require(:default, :assets, Rails.env)
 end
 require 'manifest'
-Manifest::load JSON.parse(open(File.expand_path('../../public/manifest.json', __FILE__)).read)
 
 module Pettanr
   VERSION = '0.6.2'
index d9a67b0..25c8b0a 100644 (file)
@@ -15,6 +15,7 @@ require 'owner'
 require 'content'
 require 'element'
 require 'element_part'
+# require_dependency 'manifest'
 require_dependency 'editor/editor'
 # Initialize the rails application
 Pettanr::Application.initialize!
index 79542a1..ce877c6 100644 (file)
@@ -2,6 +2,7 @@ Pettanr::Application.configure do
 
   ActiveSupport::Dependencies.autoload_paths << File::join( Rails.root, 'lib')
   ActiveSupport::Dependencies.explicitly_unloadable_constants << 'Editor' 
+  ActiveSupport::Dependencies.explicitly_unloadable_constants << 'Manifest' 
   # Settings specified here will take precedence over those in config/application.rb
 
   # In the development environment your application's code is reloaded on
index 670f49e..d1b42eb 100644 (file)
@@ -27,6 +27,10 @@ Pettanr::Application.routes.draw do
       get :panels
       get :by_author
       get :by_panel
+      get :scroll_panels_count
+      get :panels_count
+      get :count_by_author
+      get :count_by_panel
       get :play
       get :edit
       put :update
@@ -46,6 +50,8 @@ Pettanr::Application.routes.draw do
     member do
       get :by_panel
       get :by_scroll
+      get :count_by_panel
+      get :count_by_scroll
       get :edit
       put :update
       delete :destroy
@@ -65,6 +71,9 @@ Pettanr::Application.routes.draw do
       get :stories
       get :by_author
       get :by_me
+      get :stories_count
+      get :count_by_author
+      get :count_by_me
       get :play
       get :edit
       put :update
@@ -86,6 +95,11 @@ Pettanr::Application.routes.draw do
       get :by_comic
       get :by_sheet
       get :by_author
+      get :story_sheets_count
+      get :sheets_count
+      get :count_by_comic
+      get :count_by_sheet
+      get :count_by_author
       get :play
       get :edit
       put :update
@@ -104,6 +118,8 @@ Pettanr::Application.routes.draw do
     member do
       get :by_story
       get :by_sheet
+      get :count_by_story
+      get :count_by_sheet
       get :edit
       put :update
       delete :destroy
@@ -127,6 +143,13 @@ Pettanr::Application.routes.draw do
       get :by_story
       get :by_panel
       get :by_author
+      get :story_sheets_count
+      get :stories_count
+      get :sheet_panels_count
+      get :panels_count
+      get :count_by_story
+      get :count_by_panel
+      get :count_by_author
       get :play
       get :edit
       put :update
@@ -145,6 +168,8 @@ Pettanr::Application.routes.draw do
     member do
       get :by_sheet
       get :by_panel
+      get :count_by_sheet
+      get :count_by_panel
       get :edit
       put :update
       delete :destroy
@@ -172,6 +197,17 @@ Pettanr::Application.routes.draw do
       get :by_scroll
       get :by_sheet
       get :by_author
+      get :scroll_panels_count
+      get :scrolls_count
+      get :sheet_panels_count
+      get :sheets_count
+      get :panel_pictures_count
+      get :speech_balloons_count
+      get :ground_pictures_count
+      get :ground_colors_count
+      get :count_by_scroll
+      get :count_by_sheet
+      get :count_by_author
       get :catch
       get :edit
       put :update
@@ -190,6 +226,8 @@ Pettanr::Application.routes.draw do
     member do
       get :by_panel
       get :by_author
+      get :count_by_panel
+      get :count_by_author
       get :edit
       put :update
       delete :destroy
@@ -208,6 +246,8 @@ Pettanr::Application.routes.draw do
       get :by_panel
       get :by_author
       #get :by_speech_balloon_template
+      get :count_by_panel
+      get :count_by_author
       get :edit
       put :update
       delete :destroy
@@ -221,6 +261,7 @@ Pettanr::Application.routes.draw do
     member do
       get :by_speech_balloon
       #get :by_system_picture
+      get :count_by_speech_balloon
     end
   end
   resources :speeches do
@@ -231,6 +272,8 @@ Pettanr::Application.routes.draw do
     member do
       get :by_speech_balloon
       get :by_writing_format
+      get :count_by_speech_balloon
+      get :count_by_writing_format
     end
   end
   resources :ground_pictures do
@@ -244,6 +287,8 @@ Pettanr::Application.routes.draw do
     member do
       get :by_panel
       get :by_author
+      get :count_by_panel
+      get :count_by_author
       get :edit
       put :update
       delete :destroy
@@ -260,6 +305,8 @@ Pettanr::Application.routes.draw do
     member do
       get :by_panel
       get :by_author
+      get :count_by_panel
+      get :count_by_author
       get :edit
       put :update
       delete :destroy
@@ -305,6 +352,9 @@ Pettanr::Application.routes.draw do
       get :by_license
         get :by_license_group
       get :by_artist
+      get :count_by_license
+        get :count_by_license_group
+      get :count_by_artist
       delete :destroy
       get :credit
     end
@@ -318,6 +368,9 @@ Pettanr::Application.routes.draw do
       get :speech_balloons
       get :panels
       get :by_system_picture
+      get :speech_balloons_count
+      get :panels_count
+      get :count_by_system_picture
       delete :destroy
     end
   end
@@ -329,6 +382,8 @@ Pettanr::Application.routes.draw do
     member do
       get :speeches
       get :by_system_picture
+      get :speeches_count
+      get :count_by_system_picture
     end
   end
   resources :license_groups do
@@ -338,6 +393,7 @@ Pettanr::Application.routes.draw do
     end
     member do
       get :licenses
+      get :licenses_count
       delete :destroy
     end
   end
@@ -351,6 +407,9 @@ Pettanr::Application.routes.draw do
       get :resource_pictures
       get :by_license_group
       get :by_system_picture
+      get :resource_pictures_count
+      get :count_by_license_group
+      get :count_by_system_picture
     end
   end
   resources :authors do
@@ -376,6 +435,18 @@ Pettanr::Application.routes.draw do
       get :speech_balloons
       get :ground_pictures
       get :ground_colors
+      get :scrolls_count
+      get :scroll_panels_count
+      get :comics_count
+      get :stories_count
+      get :story_sheets_count
+      get :sheets_count
+      get :sheet_panels_count
+      get :panels_count
+      get :panel_pictures_count
+      get :speech_balloons_count
+      get :ground_pictures_count
+      get :ground_colors_count
       get :edit
       put :update
       delete :destroy
@@ -393,6 +464,7 @@ Pettanr::Application.routes.draw do
     end
     member do
       get :resource_pictures
+      get :resource_pictures_count
       get :edit
       put :update
       delete :destroy
@@ -407,6 +479,8 @@ Pettanr::Application.routes.draw do
       #get :balloons
       get :speech_balloon_templates
       get :licenses
+      get :speech_balloon_templates_count
+      get :licenses_count
       delete :destroy
     end
   end
index 1121a97..a1975c5 100644 (file)
@@ -1,10 +1,13 @@
 module Manifest
 end
-  require_dependency "manifest/manifest"
-  require_dependency "manifest/controller"
-  require_dependency "manifest/model"
-  require_dependency "manifest/profiler"
-  require_dependency "manifest/filer"
-  require_dependency "manifest/form"
-  require_dependency "manifest/system_resources"
+require_dependency "manifest/manifest"
+require_dependency "manifest/controller"
+require_dependency "manifest/model"
+require_dependency "manifest/profiler"
+require_dependency "manifest/filer"
+require_dependency "manifest/form"
+require_dependency "manifest/list"
+require_dependency "manifest/system_resources"
+Manifest::load JSON.parse(open(File.expand_path('../../public/manifest.json', __FILE__)).read)
 
+Manifest.manifest.init
index 63d8f66..ba858e2 100644 (file)
@@ -3,12 +3,11 @@ module Manifest
   class Controller
     include ControllerModule
     def self.manager manifest, my_manifests
-      my_manifests.map {|controller_name, controller_manifest|
-        self.new(manifest, controller_name, controller_manifest)
+      controllers = {}
+      my_manifests.each {|controller_name, controller_manifest|
+        controllers[controller_name] = self.new(manifest, controller_name, controller_manifest)
       }
-    end
-    
-    class Recipe
+      controllers
     end
     
     attr :manifest, :controller_name, :controller_manifest, :item_name, :actions
index 4261e3e..bf89cd0 100644 (file)
@@ -1,3 +1,4 @@
+require_dependency "manifest/controller/action/base"
 require_dependency "manifest/controller/action/list"
 require_dependency "manifest/controller/action/show"
 module Manifest
diff --git a/lib/manifest/controller/action/base.rb b/lib/manifest/controller/action/base.rb
new file mode 100644 (file)
index 0000000..64700b4
--- /dev/null
@@ -0,0 +1,37 @@
+module Manifest
+  module ControllerModule
+    module ActionModule
+      class Base
+        attr :controller, :action_name, :action_manifest, 
+          :item_name
+        def initialize controller, action_name, action_manifest
+          @controller = controller
+          @action_name = action_name
+          @action_manifest = action_manifest
+          self.set_default
+          self.init
+        end
+        
+        def set_default
+          @action_manifest['args'] ||= {}
+          @action_manifest['args']['item_name'] ||= self.controller.item_name
+        end
+        
+        def init
+          @args = @action_manifest['args']
+          @item_name = @args['item_name']
+        end
+        
+        def controller_name
+          @controller.controller_name
+        end
+        
+        def controller_manifest
+          @controller.controller_manifest
+        end
+        
+      end
+      
+    end
+  end
+end
index 3cc2dce..201240c 100644 (file)
@@ -1,63 +1,21 @@
 module Manifest
-  module ActionModule
-    class ActionList
-      attr :controller, :action_name, :action_manifest, 
-        :item_name, :list_name
-      def initialize controller, action_name, action_manifest
-        @controller = controller
-        @action_name = action_name
-        @action_manifest = action_manifest
-        self.set_default
-        self.init
-      end
-      
-      def set_default
-        @action_manifest['args'] ||= {}
-        @action_manifest['args']['item_name'] ||= self.controller.item_name
-      end
-      
-      def init
-        @args = @action_manifest['args']
-        @item_name = @args['item_name']
-        raise "undefined list_name for controllers > #{self.controller_name} > actions > #{@action_name} > args\n" unless @args['list_name']
-        @list_name = @args['list_name']
-      end
-      
-      def controller_name
-        @controller.controller_name
-      end
-      
-      def controller_manifest
-        @controller.controller_manifest
-      end
-      
-      def list params, operators
-        Manifest.list_managers[@item_name].open(@list_name)
-      end
-      
-      def ready params, operators
-        @items = self.list.items params, operators
-      end
-      
-      def exec
-      end
-      
-      def render
-        format.html {
-          @filer = self.list.filer
-          render :template => 'system/filer', :locals => {
-            :filer => @filer
-          }
-        }
-      end
-      
-      def cook params, operators
-        self.ready params, operators
-        self.exec
-        self.render
+  module ControllerModule
+    module ActionModule
+      class ActionList < Base
+        attr :list_name
+        
+        def set_default
+          super
+        end
+        
+        def init
+          super
+          raise "undefined list_name for controllers > #{self.controller_name} > actions > #{@action_name} > args\n" unless @args['list_name']
+          @list_name = @args['list_name']
+        end
+        
       end
       
     end
-    
   end
 end
index ed5a27e..43b745a 100644 (file)
@@ -1,43 +1,18 @@
 module Manifest
-  module ActionModule
-    class ActionShow
-      attr :controller, :action_name, :action_manifest, :item_name
-      def initialize controller, action_name, action_manifest
-        @controller = controller
-        @action_name = action_name
-        @action_manifest = action_manifest
-        self.set_default
-        self.init
-      end
-      
-      def set_default
-        @action_manifest['item_name'] ||= self.controller.item_name
-        @action_manifest['args'] ||= {}
-      end
-      
-      def init
-        @item_name = @action_manifest['item_name']
-      end
-      
-      def ready params, operators
-        @item = @model.show(params[:id], operators)
-      end
-      
-      def exec
-      end
-      
-      def render
-        format.html {
-        }
-      end
-      
-      def cook params, operators
-        self.ready params, operators
-        self.exec
-        self.render
+  module ControllerModule
+    module ActionModule
+      class ActionShow < Base
+        
+        def set_default
+          super
+        end
+        
+        def init
+          super
+        end
+        
       end
       
     end
-    
   end
 end
index 408a856..2b5cbbf 100644 (file)
@@ -6,12 +6,13 @@ require_dependency "manifest/filer/date"
 require_dependency "manifest/filer/edit"
 module Manifest
   class Filer
-    include FilerModule
     
     def self.manager manifest, my_manifests
-      my_manifests.map {|item_name, filer_manifest|
-        self.new(manifest, item_name, filer_manifest)
+      filers = {}
+      my_manifests.each {|item_name, filer_manifest|
+        filers[item_name] = self.new(manifest, item_name, filer_manifest)
       }
+      filers
     end
     
     attr :filer_manifest, :item_name, :manifest,
@@ -34,22 +35,18 @@ module Manifest
     end
     
     def init
-      @symbol = Symbol.new self, @filer_manifest['symbol']
-      @caption = Caption.new self, @filer_manifest['caption']
-      @summary = SummaryFactory.factory self, @filer_manifest['summary']
-      @icon = IconFactory.factory self, @filer_manifest['icon']
-      @date = DateFactory.factory self, @filer_manifest['date']
-      @edit = EditFactory.factory self, @filer_manifest['edit']
+      @symbol = FilerModule::Symbol.new self, @filer_manifest['symbol']
+      @caption = FilerModule::Caption.new self, @filer_manifest['caption']
+      @summary = FilerModule::SummaryFactory.factory self, @filer_manifest['summary']
+      @icon = FilerModule::IconFactory.factory self, @filer_manifest['icon']
+      @date = FilerModule::DateFactory.factory self, @filer_manifest['date']
+      @edit = FilerModule::EditFactory.factory self, @filer_manifest['edit']
     end
     
     def filer_name
       @item_name
     end
     
-    def open item_name, items, operators, paginate
-      FilerView.new item_name, items, operators, paginate, @symbol, @caption, @summary, @icon, @date, @edit, @manifest
-    end
-    
   end
   
 end
index 0801d41..f3e24ad 100644 (file)
@@ -1,8 +1,8 @@
 require_dependency "manifest/form/field"
 module Manifest
   class Form
-    
     include FormModule
+    
     def self.base_manager manifest, my_manifests
       form = {}
       base = my_manifests['base'] || {}
diff --git a/lib/manifest/list.rb b/lib/manifest/list.rb
new file mode 100644 (file)
index 0000000..557a4dd
--- /dev/null
@@ -0,0 +1,49 @@
+require_dependency "manifest/list/base"
+require_dependency "manifest/list/public"
+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/play"
+module Manifest
+  module ListModule
+    class ListFactory
+      @@types = {
+        'public' => ListModule::PublicList, 'private' => PrivateList, 'system_resource' => SystemResourceList,
+        'filter' => FilterList, 
+        'through_filter' => ThroughFilterList, 'element_filter' => ElementFilterList, 
+        'play' => PlayList
+      }
+      def self.factory manifest, item_name, my_manifests
+        lists = {}
+        my_manifests.each {|list_name, my_manifest|
+          model_manifest = manifest.models[item_name]
+          raise "undefined model for lists > #{item_name}\n" unless model_manifest
+          model_list_manifest = model_manifest.lists[list_name]
+          raise "undefined model_list for lists > #{item_name} > #{list_name}\n" unless model_list_manifest
+          type = model_list_manifest.type
+          raise "undefined type for lists > #{item_name} > #{list_name}\n" unless type
+          my_class = @@types[type]
+          raise "undefined class for lists > #{item_name} > #{list_name} > #{type}\n" unless my_class
+          my_class.new(manifest, item_name, list_name, my_manifest)
+        }
+        lists
+      end
+      
+    end
+  end
+  
+  class List
+    include ListModule
+    def self.manager manifest, my_manifests
+      lists = {}
+      my_manifests.each {|item_name, list_manifest|
+        lists[item_name] = ListModule::ListFactory.factory(manifest, item_name, list_manifest)
+      }
+      lists
+    end
+  end
+  
+end
+
diff --git a/lib/manifest/list/base.rb b/lib/manifest/list/base.rb
new file mode 100644 (file)
index 0000000..fe3738e
--- /dev/null
@@ -0,0 +1,96 @@
+module Manifest
+  module ListModule
+    class Base
+      class ListResult
+        attr :items, :paginate
+        def initialize items, paginate
+          @items = items
+          @paginate = paginate
+        end
+        
+      end
+      
+      attr :manifest, :item_name, :list_name, :list_manifest, 
+        :default_page_size, :max_page_size
+      def initialize manifest, item_name, list_name, list_manifest
+        @manifest = manifest
+        @item_name = item_name
+        @list_name = list_name
+        @list_manifest = list_manifest
+        self.set_default
+        self.init
+      end
+      
+      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
+      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
+      end
+      
+      def page_number prm = nil
+        page = prm.to_i
+        page = 1 if page < 1
+        page
+      end
+      
+      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
+      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
+      
+      def items options, offset, page_size
+        @model.where(self.where(filter_item)).includes(self.includes).order(self.order).offset(offset).limit(page_size)
+      end
+      
+      def paginate items, offset, page_size
+        c = items ? items.count : 0
+        Kaminari.paginate_array(Array.new(c, nil)).page(offset).per(page_size)
+      end
+      
+      def open operators, options
+        page = self.page_number(options[:page]) 
+        page_size = self.page_size options[:page_size]
+        offset = (page -1) * page_size
+        items = self.items options, offset, page_size
+        paginate = self.paginate items, offset, page_size
+        ListResult.new items, paginate
+      end
+      
+    end
+  end
+end
diff --git a/lib/manifest/list/element_filter.rb b/lib/manifest/list/element_filter.rb
new file mode 100644 (file)
index 0000000..b846268
--- /dev/null
@@ -0,0 +1,29 @@
+module Manifest
+  module ListModule
+    class ElementFilterList < FilterList
+      
+      def set_default
+        super
+      end
+      
+      def init
+        super
+      end
+      
+      def includes
+        {@owner_model.item_name => {}}
+      end
+      
+      def where filter_item
+        w = @model.list_where
+        w += ' and ' unless w.blank?
+        [w + @owner_table_name + '.' + @filter_key + ' = ?', filter_item.id] 
+      end
+      
+      def self.add_action item_name, action_name, list_name, list_conf
+        return
+      end
+    end
+    
+  end
+end
diff --git a/lib/manifest/list/filter.rb b/lib/manifest/list/filter.rb
new file mode 100644 (file)
index 0000000..eb69f3e
--- /dev/null
@@ -0,0 +1,52 @@
+module Manifest
+  module ListModule
+    class FilterList < Base
+      
+      def set_default
+        super
+      end
+      
+      def init
+        super
+        return
+      end
+      
+      def where filter_item
+        w = @model.list_where
+        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 => {} }) 
+      end
+      
+      def items filter_item
+        @model.where(self.where(filter_item)).includes(self.includes).order(self.order).offset(@offset).limit(@page_size)
+      end
+      
+      def paginate filter_item
+        Kaminari.paginate_array(Array.new(@model.where(self.where(filter_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
+        model = item_name.classify.constantize
+        controller_name = model.plural + 'Controller'
+        controller = controller_name.constantize
+        list_list_conf = Pettanr::Application::manifest.list(item_name).lists[list_name] || {}
+        from = list_list_conf['from']
+        filter_model = from.classify.constantize
+        filter_key = list_list_conf['filter_key']
+        return if controller.method_defined?(action_name)
+        controller.define_method(action_name) do 
+          filter_list filter_model, params
+        end
+      end
+      
+    end
+    
+  end
+end
diff --git a/lib/manifest/list/play.rb b/lib/manifest/list/play.rb
new file mode 100644 (file)
index 0000000..338e2f2
--- /dev/null
@@ -0,0 +1,108 @@
+module Manifest
+  module ListModule
+    class PlayList
+      attr :model, :list_name, :list_manifest
+      
+      def initialize manifest, item_name, list_name, list_manifest
+        @manifest = manifest
+        @item_name = item_name
+        @list_name = list_name
+        @list_manifest = list_manifest
+        self.set_default
+        self.init
+      end
+      
+      def set_default
+        return
+        @default_page_size = @conf['default_page_size'] || 25
+        @max_page_size = @conf['max_page_size'] || 100
+        @params_offset = params_offset
+        @params_count = params_count
+        @list_list_conf = @manifest.list(@item_name).lists[list_name] || {}
+        @model_name = @list_list_conf['model']
+        @filter_key = @list_list_conf['filter_key']
+        @model = @model_name.classify.constantize
+        @table_name = @model.table_name
+        if @model.content?
+          @owner_model = @model.owner_model
+          @owner_table_name = @owner_model.table_name if @owner_model
+        end
+      end
+      
+      def init
+      end
+      
+      def offset cnt, prm = nil
+        offset = prm.to_i
+        offset = cnt - 1 if offset >= cnt
+        offset = cnt - offset.abs if offset < 0
+        offset = 0 if offset < 0
+        offset
+      end
+      
+      def limit prm
+        prm ||= @default_page_size
+        count = prm.to_i
+        count = @max_page_size if count > @max_page_size
+        count = @default_page_size if count < 1
+        count
+      end
+      
+      def count filter_item
+        @count ||= @model.count(:conditions => self.where(filter_item), :include => self.includes).to_i
+      end
+      
+      def where filter_item
+        w = @model.list_where
+        w += ' and ' unless w.blank?
+        [w + @table_name + '.' + @filter_key + ' = ?', filter_item.id] 
+      end
+      
+      def includes
+        {@owner_model.item_name => {}}
+      end
+      
+      def order
+        @table_name + '.t'
+      end
+      
+      def items filter_item
+        c  = @count || self.count(filter_item)
+        o  = self.offset c, @offset
+        l  = self.limit @count
+        @model.where(self.where(filter_item)).includes(self.includes).order(self.order).offset(o).limit(l)
+      end
+      
+      def prev_offset filter_item
+        c  = @count || self.count(filter_item)
+        o  = self.offset c, @offset
+        l  = self.limit @count
+        if o > 0
+          if o - l < 0
+            0
+          else
+            o - l
+          end
+        else
+          nil
+        end
+      end
+      
+      def next_offset filter_item
+        c  = @count || self.count(filter_item)
+        o  = self.offset c, @offset
+        l  = self.limit @count
+        if o + l > c
+          nil
+        else
+          o + l
+        end
+      end
+      
+      def self.add_action item_name, action_name, list_name, list_conf
+        return
+      end
+    end
+    
+  end
+end
diff --git a/lib/manifest/list/private.rb b/lib/manifest/list/private.rb
new file mode 100644 (file)
index 0000000..cb37336
--- /dev/null
@@ -0,0 +1,26 @@
+module Manifest
+  module ListModule
+    class PrivateList < Base
+      def where 
+        case @model.owner_type
+        when :author
+          operator = @operators.author
+        when :artist
+          operator = @operators.artist
+        end
+        t = if @owner_model
+          if @owner_model.owner_model
+            @owner_model.owner_model.table_name
+          else
+            @owner_model.table_name
+          end
+        else
+          @table_name
+        end
+        [t + '.' + @model.owner_type.to_s + '_id = ?', operator.id]
+      end
+    
+    end
+    
+  end
+end
diff --git a/lib/manifest/list/public.rb b/lib/manifest/list/public.rb
new file mode 100644 (file)
index 0000000..767299c
--- /dev/null
@@ -0,0 +1,35 @@
+module Manifest
+  module ListModule
+    class PublicList < Base
+      
+      def set_default
+        super
+      end
+      
+      def init
+        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
+    end
+    
+  end
+end
diff --git a/lib/manifest/list/system_resource.rb b/lib/manifest/list/system_resource.rb
new file mode 100644 (file)
index 0000000..5d272be
--- /dev/null
@@ -0,0 +1,23 @@
+module Manifest
+  module ListModule
+    class SystemResourceList < Base
+      
+      def set_default
+        super
+      end
+      
+      def init
+        super
+      end
+      
+      def items
+        @model.enable_list
+      end
+      
+      def self.add_action item_name, action_name, list_name, list_conf
+        return
+      end
+    end
+    
+  end
+end
diff --git a/lib/manifest/list/through_filter.rb b/lib/manifest/list/through_filter.rb
new file mode 100644 (file)
index 0000000..d8b35dd
--- /dev/null
@@ -0,0 +1,29 @@
+module Manifest
+  module ListModule
+    class ThroughFilterList < FilterList
+      attr :list, :list_name, :list_manifest
+      
+      def set_default
+        super
+      end
+      
+      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] 
+      end
+      
+    end
+    
+  end
+end
index e12d5c0..984233a 100644 (file)
@@ -2,7 +2,7 @@ module Manifest
   class Manifest
     cattr_accessor :manifest
     attr :system_resources, :magic_numbers, :select_items,
-      :controllers, :models, :lists, :profilers, :filers, :forms
+      :controllers, :models, :lists, :profilers, :filers, :forms, :lists
     # call me before load routes.rb
     # routes.rb needs engine_resources manifest in system_resources
     # ex. it's adding license_groups routes
@@ -16,6 +16,7 @@ module Manifest
     # managers can't initialize at application.rb
     # call me after configured Rails Application
     def init
+      return unless defined? ::Pettanr
       @controllers = Controller.manager(self, @manifest['controllers'])
       @models = Model.manager(self, @manifest['models'])
       @locals = @manifest['locals']
@@ -23,6 +24,7 @@ module Manifest
       @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'])
       select_items_loader
       add_action
     end
index 30748c2..087f791 100644 (file)
@@ -4,15 +4,17 @@ require_dependency "manifest/model/list"
 
 module Manifest
   class Model
-    include ModelModule
     
     def self.manager manifest, my_manifests
-      my_manifests.map {|model_name, model_manifest|
-        self.new(manifest, model_name, model_manifest)
+      models = {}
+      my_manifests.each {|model_name, model_manifest|
+        models[model_name] = self.new(manifest, model_name, model_manifest)
       }
+      models
     end
     
-    attr :model_name, :model_manifest
+    attr :model_name, :model_manifest, 
+      :attributes, :associations, :lists
     def initialize manifest, model_name, model_manifest
       @manifest = manifest
       @model_name = model_name
@@ -30,15 +32,15 @@ module Manifest
     def init
       @attributes = {}
       @model_manifest['attributes'].each {|attribute_name, attribute_manifest|
-        @attributes[attribute_name] = Attribute.new(self, 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] = Association.new(self, association_name, association_manifest)
+        @associations[association_name] = ModelModule::Association.new(self, association_name, association_manifest)
       }
       @lists = {}
       @model_manifest['lists'].each {|list_name, list_manifest|
-        @lists[list_name] = ListFactory.factory(self, list_name, list_manifest)
+        @lists[list_name] = ModelModule::ListFactory.factory(self, list_name, list_manifest)
       }
     end
     
index 5d74e66..6a806b1 100644 (file)
@@ -1,10 +1,9 @@
-require "manifest/model/association/belongs_to"
-require "manifest/model/association/has_many"
-require "manifest/model/association/has_one"
+require_dependency "manifest/model/association/belongs_to"
+require_dependency "manifest/model/association/has_many"
+require_dependency "manifest/model/association/has_one"
 module Manifest
   module ModelModule
     class Association
-      include AssociationModule
       attr :model, :association_name, :association_manifest, 
         :belongs_to, :has_many, :has_one
       def initialize model, association_name, association_manifest
index 805f315..93df4dd 100644 (file)
@@ -1,95 +1,43 @@
 module Manifest
-  module ListModule
-    class BaseList
-      attr :model, :list_name, :list_manifest, 
-        :default_page_size, :max_page_size
-      def initialize model, list_name, list_manifest
-        @model = model
-        @list_name = list_name
-        @list_manifest = list_manifest
-        self.set_default
-        self.init
+  module ModelModule
+    module ListModule
+      class Base
+        attr :model, :list_name, :list_manifest, :type, 
+          :default_page_size, :max_page_size
+        def initialize model, list_name, list_manifest
+          @model = model
+          @list_name = list_name
+          @list_manifest = list_manifest
+          self.set_default
+          self.init
+        end
         
-        @model = ::Manifest.item_name_to_model self.model_name
-        @table_name = @model.table_name
-        if @model.content?
-          @owner_model = @model.owner_model
-          @owner_table_name = @owner_model.table_name if @owner_model
+        def set_default
+          self.list_manifest['args'] ||= {}
+          @list_manifest['args']['default_page_size'] ||= 25
+          @list_manifest['args']['max_page_size'] ||= 100
         end
-      end
-      
-      def set_default
-        self.list_manifest['args'] ||= {}
-        @list_manifest['args']['default_page_size'] ||= 25
-        @list_manifest['args']['max_page_size'] ||= 100
-      end
-      
-      def init
-        @args = @list_manifest['args']
-        @default_page_size = @list_manifest['args']['default_page_size']
-        @max_page_size = @list_manifest['args']['max_page_size']
-      end
-      
-      def model_name
-        @model.model_name
-      end
-      
-      def model_manifest
-        @model.model_manifest
-      end
-      
-      def page_number prm = nil
-        page = prm.to_i
-        page = 1 if page < 1
-        page
-      end
-      
-      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
-      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
-          {}
+        
+        def init
+          @type = @list_manifest['type']
+          @args = @list_manifest['args']
+          @default_page_size = @list_manifest['args']['default_page_size']
+          @max_page_size = @list_manifest['args']['max_page_size']
+        end
+        
+        def model_name
+          @model.model_name
+        end
+        
+        def model_manifest
+          @model.model_manifest
+        end
+        
+        def self.add_action item_name, action_name, list_name, list_conf
+          return
         end
       end
       
-      def order
-        @model.list_order
-      end
-      
-      def a page, page_size, operators
-        @page = self.page_number(page) 
-        @page_size = self.page_size page_size
-        @offset = (@page -1) * @page_size
-      end
-      
-      def items
-        @model.where(self.where()).includes(self.includes).order(self.order).offset(@offset).limit(@page_size)
-      end
-      
-      def paginate
-        c = @model.where(self.where()).includes(self.includes).count
-        Kaminari.paginate_array(Array.new(c, nil)).page(@offset).per(@page_size)
-      end
-      
-      def self.add_action item_name, action_name, list_name, list_conf
-        return
-      end
     end
-    
   end
 end
index b846268..2dea906 100644 (file)
@@ -1,29 +1,31 @@
 module Manifest
-  module ListModule
-    class ElementFilterList < FilterList
-      
-      def set_default
-        super
-      end
-      
-      def init
-        super
-      end
-      
-      def includes
-        {@owner_model.item_name => {}}
-      end
-      
-      def where filter_item
-        w = @model.list_where
-        w += ' and ' unless w.blank?
-        [w + @owner_table_name + '.' + @filter_key + ' = ?', filter_item.id] 
+  module ModelModule
+    module ListModule
+      class ElementFilterList < FilterList
+        
+        def set_default
+          super
+        end
+        
+        def init
+          super
+        end
+        
+        def includes
+          {@owner_model.item_name => {}}
+        end
+        
+        def where filter_item
+          w = @model.list_where
+          w += ' and ' unless w.blank?
+          [w + @owner_table_name + '.' + @filter_key + ' = ?', filter_item.id] 
+        end
+        
+        def self.add_action item_name, action_name, list_name, list_conf
+          return
+        end
       end
       
-      def self.add_action item_name, action_name, list_name, list_conf
-        return
-      end
     end
-    
   end
 end
index c8eee97..daf0ea2 100644 (file)
@@ -1,52 +1,54 @@
 module Manifest
-  module ListModule
-    class FilterList < BaseList
-      
-      def set_default
-        super
-      end
-      
-      def init
-        super
-        return
-      end
-      
-      def where filter_item
-        w = @model.list_where
-        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 => {} }) 
-      end
-      
-      def items filter_item
-        @model.where(self.where(filter_item)).includes(self.includes).order(self.order).offset(@offset).limit(@page_size)
-      end
-      
-      def paginate filter_item
-        Kaminari.paginate_array(Array.new(@model.where(self.where(filter_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
-        model = item_name.classify.constantize
-        controller_name = model.plural + 'Controller'
-        controller = controller_name.constantize
-        list_list_conf = Pettanr::Application::manifest.list(item_name).lists[list_name] || {}
-        from = list_list_conf['from']
-        filter_model = from.classify.constantize
-        filter_key = list_list_conf['filter_key']
-        return if controller.method_defined?(action_name)
-        controller.define_method(action_name) do 
-          filter_list filter_model, params
+  module ModelModule
+    module ListModule
+      class FilterList < Base
+        
+        def set_default
+          super
+        end
+        
+        def init
+          super
+          return
+        end
+        
+        def where filter_item
+          w = @model.list_where
+          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 => {} }) 
+        end
+        
+        def items filter_item
+          @model.where(self.where(filter_item)).includes(self.includes).order(self.order).offset(@offset).limit(@page_size)
+        end
+        
+        def paginate filter_item
+          Kaminari.paginate_array(Array.new(@model.where(self.where(filter_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
+          model = item_name.classify.constantize
+          controller_name = model.plural + 'Controller'
+          controller = controller_name.constantize
+          list_list_conf = Pettanr::Application::manifest.list(item_name).lists[list_name] || {}
+          from = list_list_conf['from']
+          filter_model = from.classify.constantize
+          filter_key = list_list_conf['filter_key']
+          return if controller.method_defined?(action_name)
+          controller.define_method(action_name) do 
+            filter_list filter_model, params
+          end
         end
+        
       end
       
     end
-    
   end
 end
index 4a97cdc..869c978 100644 (file)
@@ -1,66 +1,68 @@
 module Manifest
-  module ListModule
-    class HasManyList < BaseList
-      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
+  module ModelModule
+    module ListModule
+      class HasManyList < Base
+        def initialize list, list_name, list_manifest
+          super
         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
+        
+        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
index a4e1bd6..21c12df 100644 (file)
@@ -1,53 +1,55 @@
 module Manifest
-  module ListModule
-    class HasManyThroughList < BaseList
-      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
+  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
       
-      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
index a916a8c..9c519ad 100644 (file)
 module Manifest
-  module ListModule
-    class PlayList
-      attr :model, :list_name, :list_manifest
-      
-      def initialize model, list_name, list_manifest
-        @model = model
-        @list_name = list_name
-        @list_manifest = list_manifest
-        self.set_default
-        self.init
-      end
-      
-      def set_default
-        return
-        @default_page_size = @conf['default_page_size'] || 25
-        @max_page_size = @conf['max_page_size'] || 100
-        @params_offset = params_offset
-        @params_count = params_count
-        @list_list_conf = @manifest.list(@item_name).lists[list_name] || {}
-        @model_name = @list_list_conf['model']
-        @filter_key = @list_list_conf['filter_key']
-        @model = @model_name.classify.constantize
-        @table_name = @model.table_name
-        if @model.content?
-          @owner_model = @model.owner_model
-          @owner_table_name = @owner_model.table_name if @owner_model
+  module ModelModule
+    module ListModule
+      class PlayList
+        attr :model, :list_name, :list_manifest, :type, 
+          :default_page_size, :max_page_size
+        
+        def initialize model, list_name, list_manifest
+          @model = model
+          @list_name = list_name
+          @list_manifest = list_manifest
+          self.set_default
+          self.init
         end
-      end
-      
-      def init
-      end
-      
-      def list_name
-        @list.list_name
-      end
-      
-      def list_manifest
-        @list.list_manifest
-      end
-      
-      def offset cnt, prm = nil
-        offset = prm.to_i
-        offset = cnt - 1 if offset >= cnt
-        offset = cnt - offset.abs if offset < 0
-        offset = 0 if offset < 0
-        offset
-      end
-      
-      def limit prm
-        prm ||= @default_page_size
-        count = prm.to_i
-        count = @max_page_size if count > @max_page_size
-        count = @default_page_size if count < 1
-        count
-      end
-      
-      def count filter_item
-        @count ||= @model.count(:conditions => self.where(filter_item), :include => self.includes).to_i
-      end
-      
-      def where filter_item
-        w = @model.list_where
-        w += ' and ' unless w.blank?
-        [w + @table_name + '.' + @filter_key + ' = ?', filter_item.id] 
-      end
-      
-      def includes
-        {@owner_model.item_name => {}}
-      end
-      
-      def order
-        @table_name + '.t'
-      end
-      
-      def items filter_item
-        c  = @count || self.count(filter_item)
-        o  = self.offset c, @offset
-        l  = self.limit @count
-        @model.where(self.where(filter_item)).includes(self.includes).order(self.order).offset(o).limit(l)
-      end
-      
-      def prev_offset filter_item
-        c  = @count || self.count(filter_item)
-        o  = self.offset c, @offset
-        l  = self.limit @count
-        if o > 0
-          if o - l < 0
-            0
-          else
-            o - l
+        
+        def set_default
+          @list_manifest['args'] ||= {}
+          return
+          @default_page_size = @conf['default_page_size'] || 25
+          @max_page_size = @conf['max_page_size'] || 100
+          @params_offset = params_offset
+          @params_count = params_count
+          @list_list_conf = @manifest.list(@item_name).lists[list_name] || {}
+          @model_name = @list_list_conf['model']
+          @filter_key = @list_list_conf['filter_key']
+          @model = @model_name.classify.constantize
+          @table_name = @model.table_name
+          if @model.content?
+            @owner_model = @model.owner_model
+            @owner_table_name = @owner_model.table_name if @owner_model
           end
-        else
-          nil
         end
-      end
-      
-      def next_offset filter_item
-        c  = @count || self.count(filter_item)
-        o  = self.offset c, @offset
-        l  = self.limit @count
-        if o + l > c
-          nil
-        else
-          o + l
+        
+        def init
+          @type = @list_manifest['type']
+          @args = @list_manifest['args']
+        end
+        
+        def self.add_action item_name, action_name, list_name, list_conf
+          return
         end
       end
       
-      def self.add_action item_name, action_name, list_name, list_conf
-        return
-      end
     end
-    
   end
 end
index 4d9cc1b..631788d 100644 (file)
@@ -1,38 +1,40 @@
 module Manifest
-  module ListModule
-    class PrivateList < BaseList
-      
-      def set_default
-        super
-      end
-      
-      def init
-        super
-      end
-      
-      def where 
-        case @model.owner_type
-        when :author
-          operator = @operators.author
-        when :artist
-          operator = @operators.artist
+  module ModelModule
+    module ListModule
+      class PrivateList < Base
+        
+        def set_default
+          super
         end
-        t = if @owner_model
-          if @owner_model.owner_model
-            @owner_model.owner_model.table_name
+        
+        def init
+          super
+        end
+        
+        def where 
+          case @model.owner_type
+          when :author
+            operator = @operators.author
+          when :artist
+            operator = @operators.artist
+          end
+          t = if @owner_model
+            if @owner_model.owner_model
+              @owner_model.owner_model.table_name
+            else
+              @owner_model.table_name
+            end
           else
-            @owner_model.table_name
+            @table_name
           end
-        else
-          @table_name
+          [t + '.' + @model.owner_type.to_s + '_id = ?', operator.id]
+        end
+        
+        def self.add_action item_name, action_name, list_name, list_conf
+          return
         end
-        [t + '.' + @model.owner_type.to_s + '_id = ?', operator.id]
       end
       
-      def self.add_action item_name, action_name, list_name, list_conf
-        return
-      end
     end
-    
   end
 end
index 3395610..ae689cd 100644 (file)
@@ -1,30 +1,32 @@
 module Manifest
-  module ListModule
-    class PublicList < BaseList
-      
-      def initialize model, list_name, list_manifest
-        super
-      end
-      
-      def set_default
-        super
-      end
-      
-      def init
-        super
-      end
-      
-      def self.add_action item_name, action_name, list_name, list_conf
-        return
-        model = item_name.classify.constantize
-        controller_name = model.plural + 'Controller'
-        controller = controller_name.constantize
-        return if controller.method_defined?(action_name)
-        controller.define_method(action_name) do 
-          public_list
+  module ModelModule
+    module ListModule
+      class PublicList < Base
+        
+        def initialize model, list_name, list_manifest
+          super
+        end
+        
+        def set_default
+          super
+        end
+        
+        def init
+          super
+        end
+        
+        def self.add_action item_name, action_name, list_name, list_conf
+          return
+          model = item_name.classify.constantize
+          controller_name = model.plural + 'Controller'
+          controller = controller_name.constantize
+          return if controller.method_defined?(action_name)
+          controller.define_method(action_name) do 
+            public_list
+          end
         end
       end
+      
     end
-    
   end
 end
index 0378b07..84f2624 100644 (file)
@@ -1,23 +1,25 @@
 module Manifest
-  module ListModule
-    class SystemResourceList < BaseList
-      
-      def set_default
-        super
-      end
-      
-      def init
-        super
+  module ModelModule
+    module ListModule
+      class SystemResourceList < Base
+        
+        def set_default
+          super
+        end
+        
+        def init
+          super
+        end
+        
+        def items
+          @model.enable_list
+        end
+        
+        def self.add_action item_name, action_name, list_name, list_conf
+          return
+        end
       end
       
-      def items
-        @model.enable_list
-      end
-      
-      def self.add_action item_name, action_name, list_name, list_conf
-        return
-      end
     end
-    
   end
 end
index d8b35dd..9149e37 100644 (file)
@@ -1,29 +1,31 @@
 module Manifest
-  module ListModule
-    class ThroughFilterList < FilterList
-      attr :list, :list_name, :list_manifest
-      
-      def set_default
-        super
-      end
-      
-      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] 
+  module ModelModule
+    module ListModule
+      class ThroughFilterList < FilterList
+        attr :list, :list_name, :list_manifest
+        
+        def set_default
+          super
+        end
+        
+        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] 
+        end
+        
       end
       
     end
-    
   end
 end
index 7ab98ba..1eb54ff 100644 (file)
@@ -4,11 +4,12 @@ require_dependency "manifest/profiler/association"
 module Manifest
   class Profiler
     
-    include ProfilerModule
     def self.manager manifest, my_manifests
-      my_manifests.map {|item_name, profiler_manifest|
-        self.new(manifest, item_name, profiler_manifest)
+      profilers = {}
+      my_manifests.each {|item_name, profiler_manifest|
+        profilers[item_name] = self.new(manifest, item_name, profiler_manifest)
       }
+      profilers
     end
     
     attr :profiler_manifest, :item_name, :manifest, 
@@ -31,9 +32,9 @@ module Manifest
       @columns = @profiler_manifest['columns']
       @lists = {}
       @profiler_manifest['lists'].each {|list_name, list_manifest|
-        @lists[list_name] = List.new(self, list_name, list_manifest)
+        @lists[list_name] = ProfilerModule::List.new(self, list_name, list_manifest)
       }
-      @associations = Association.new(self, @profiler_manifest['associations'])
+      @associations = ProfilerModule::Association.new(self, @profiler_manifest['associations'])
     end
     
     def open item, operators
diff --git a/lib/view/list/list.rb b/lib/view/list/list.rb
new file mode 100644 (file)
index 0000000..523c42a
--- /dev/null
@@ -0,0 +1,63 @@
+  class ListViewFactory
+    attr :item, :operators
+      @@types = {
+        'public' => PublicListView, 'private' => PrivateListView, 'system_resource' => SystemResourceList,
+        'filter' => FilterListView, 
+        'through_filter' => ThroughFilterList, 'element_filter' => ElementFilterList, 
+        'play' => PlayListView
+      }
+    def initialize item, operators, list_manifest
+      list_manifest.type
+      
+      
+      
+      @item = item
+      @operators = operators
+      @filer_manifest = filer_manifest
+      @symbol = SymbolView self, @filer_manifest.symbol.symbol_manifest
+    end
+    
+  class PublicListView
+      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
+      
+  class PrivateListView
+      
+      def where 
+        case @model.owner_type
+        when :author
+          operator = @operators.author
+        when :artist
+          operator = @operators.artist
+        end
+        t = if @owner_model
+          if @owner_model.owner_model
+            @owner_model.owner_model.table_name
+          else
+            @owner_model.table_name
+          end
+        else
+          @table_name
+        end
+        [t + '.' + @model.owner_type.to_s + '_id = ?', operator.id]
+      end
+    
+  end
+  
index fc2a2d5..1b23598 100644 (file)
         "private_list": {\r
           "type": "private"\r
         },\r
-        "scroll_panels": {\r
-          "type": "has_many",\r
-          "args": {\r
-            "association_name": "scroll_panels"\r
-          }\r
-        },\r
-        "panels": {\r
-          "type": "has_many_through",\r
-          "args": {\r
-            "association_name": "panels"\r
-          }\r
-        },\r
         "by_author": {\r
-          "type": "filter",\r
-          "args": {\r
-            "from": "author",\r
-            "filter_key": "author_id"\r
-          }\r
+          "type": "filter"\r
         },\r
         "by_panel": {\r
-          "type": "through_filter",\r
-          "args": {\r
-            "from": "panel",\r
-            "through": "scroll_panels",\r
-            "filter_key": "panel_id"\r
-          }\r
+          "type": "through_filter"\r
         },\r
         "play": {\r
-          "type": "play",\r
-          "args": {\r
-            "model_name": "scroll_panel",\r
-            "filter_key": "scroll_id"\r
-          }\r
+          "type": "play"\r
         }\r
       }\r
     },\r
           "type": "private"\r
         },\r
         "by_scroll": {\r
-          "type": "filter",\r
-          "args": {\r
-            "from": "scroll",\r
-            "filter_key": "scroll_id"\r
-          }\r
+          "type": "filter"\r
         },\r
         "by_panel": {\r
-          "type": "filter",\r
-          "args": {\r
-            "from": "panel",\r
-            "filter_key": "panel_id"\r
-          }\r
+          "type": "filter"\r
         }\r
       }\r
     },\r
         "private_list": {\r
           "type": "private"\r
         },\r
-        "stories": {\r
-          "type": "has_many",\r
-          "args": {\r
-            "association_name": "stories"\r
-          }\r
-        },\r
         "by_author": {\r
-          "type": "filter",\r
-          "args": {\r
-            "from": "author",\r
-            "filter_key": "author_id"\r
-          }\r
+          "type": "filter"\r
         }\r
       }\r
     },\r
         "private_list": {\r
           "type": "private"\r
         },\r
-        "story_sheets": {\r
-          "type": "has_many",\r
-          "args": {\r
-            "association_name": "story_sheets"\r
-          }\r
-        },\r
-        "sheets": {\r
-          "type": "has_many",\r
-          "args": {\r
-            "association_name": "sheets"\r
-          }\r
-        },\r
         "by_comic": {\r
-          "type": "filter",\r
-          "args": {\r
-            "from": "comic",\r
-            "filter_key": "comic_id"\r
-          }\r
+          "type": "filter"\r
         },\r
         "by_sheet": {\r
-          "type": "through_filter",\r
-          "args": {\r
-            "from": "sheet",\r
-            "through": "story_sheets",\r
-            "filter_key": "sheet_id"\r
-          }\r
+          "type": "through_filter"\r
         },\r
         "by_author": {\r
-          "type": "element_filter",\r
-          "args": {\r
-            "from": "author",\r
-            "filter_key": "author_id"\r
-          }\r
+          "type": "element_filter"\r
         },\r
         "play": {\r
-          "type": "play",\r
-          "args": {\r
-            "model_name": "story_sheet",\r
-            "filter_key": "story_id"\r
-          }\r
+          "type": "play"\r
         }\r
       }\r
     },\r
           "type": "private"\r
         },\r
         "by_story": {\r
-          "type": "filter",\r
-          "args": {\r
-            "from": "story",\r
-            "filter_key": "story_id"\r
-          }\r
+          "type": "filter"\r
         },\r
         "by_sheet": {\r
-          "type": "filter",\r
-          "args": {\r
-            "from": "sheet",\r
-            "filter_key": "sheet_id"\r
-          }\r
+          "type": "filter"\r
         }\r
       }\r
     },\r
         "private_list": {\r
           "type": "private"\r
         },\r
-        "story_sheets": {\r
-          "type": "has_many",\r
-          "args": {\r
-            "association_name": "story_sheets"\r
-          }\r
-        },\r
-        "stories": {\r
-          "type": "has_many",\r
-          "args": {\r
-            "association_name": "stories"\r
-          }\r
-        },\r
-        "sheet_panels": {\r
-          "type": "has_many",\r
-          "args": {\r
-            "association_name": "sheet_panels"\r
-          }\r
-        },\r
-        "panels": {\r
-          "type": "has_many",\r
-          "args": {\r
-            "association_name": "panels"\r
-          }\r
-        },\r
         "by_story": {\r
-          "type": "through_filter",\r
-          "args": {\r
-            "from": "story",\r
-            "through": "story_sheets",\r
-            "filter_key": "story_id"\r
-          }\r
+          "type": "through_filter"\r
         },\r
         "by_panel": {\r
-          "type": "through_filter",\r
-          "args": {\r
-            "from": "panel",\r
-            "through": "sheet_panels",\r
-            "filter_key": "panel_id"\r
-          }\r
+          "type": "through_filter"\r
         },\r
         "by_author": {\r
-          "type": "filter",\r
-          "args": {\r
-            "from": "author",\r
-            "filter_key": "author_id"\r
-          }\r
+          "type": "filter"\r
         },\r
         "play": {\r
-          "type": "play",\r
-          "args": {\r
-            "model_name": "sheet_panel",\r
-            "filter_key": "sheet_id"\r
-          }\r
+          "type": "play"\r
         }\r
       }\r
     },\r
           "type": "private"\r
         },\r
         "by_sheet": {\r
-          "type": "filter",\r
-          "args": {\r
-            "association_name": "sheet_panels",\r
-            "from": "sheet",\r
-            "filter_key": "sheet_id"\r
-          }\r
+          "type": "filter"\r
         },\r
         "by_panel": {\r
-          "type": "filter",\r
-          "args": {\r
-            "from": "panel",\r
-            "filter_key": "panel_id"\r
-          }\r
+          "type": "filter"\r
         }\r
       }\r
     },\r
         "private_list": {\r
           "type": "private"\r
         },\r
-        "scroll_panels": {\r
-          "type": "has_many",\r
-          "args": {\r
-            "association_name": "scroll_panels"\r
-          }\r
-        },\r
-        "scrolls": {\r
-          "type": "has_many",\r
-          "args": {\r
-            "association_name": "scrolls"\r
-          }\r
-        },\r
-        "sheet_panels": {\r
-          "type": "has_many",\r
-          "args": {\r
-            "association_name": "sheet_panels"\r
-          }\r
-        },\r
-        "sheets": {\r
-          "type": "has_many",\r
-          "args": {\r
-            "association_name": "sheets"\r
-          }\r
-        },\r
-        "panel_pictures": {\r
-          "type": "has_many",\r
-          "args": {\r
-            "association_name": "panel_pictures"\r
-          }\r
-        },\r
-        "speech_balloons": {\r
-          "type": "has_many",\r
-          "args": {\r
-            "association_name": "speech_balloons"\r
-          }\r
-        },\r
-        "ground_pictures": {\r
-          "type": "has_many",\r
-          "args": {\r
-            "association_name": "ground_pictures"\r
-          }\r
-        },\r
-        "ground_colors": {\r
-          "type": "has_many",\r
-          "args": {\r
-            "association_name": "ground_colors"\r
-          }\r
-        },\r
         "by_scroll": {\r
-          "type": "through_filter",\r
-          "args": {\r
-            "from": "scroll",\r
-            "through": "scroll_panels",\r
-            "filter_key": "scroll_id"\r
-          }\r
+          "type": "through_filter"\r
         },\r
         "by_sheet": {\r
-          "type": "through_filter",\r
-          "args": {\r
-            "from": "sheet",\r
-            "through": "sheet_panels",\r
-            "filter_key": "sheet_id"\r
-          }\r
+          "type": "through_filter"\r
         },\r
         "by_author": {\r
-          "type": "filter",\r
-          "args": {\r
-            "from": "author",\r
-            "filter_key": "author_id"\r
-          }\r
+          "type": "filter"\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
+          "type": "through_filter"\r
         }\r
       }\r
     },\r
           "type": "private"\r
         },\r
         "by_panel": {\r
-          "type": "filter",\r
-          "args": {\r
-            "from": "panel",\r
-            "filter_key": "panel_id"\r
-          }\r
+          "type": "filter"\r
         },\r
         "by_author": {\r
-          "type": "element_filter",\r
-          "args": {\r
-            "from": "author",\r
-            "filter_key": "author_id"\r
-          }\r
+          "type": "element_filter"\r
         }\r
       }\r
     },\r
           "type": "private"\r
         },\r
         "by_panel": {\r
-          "type": "filter",\r
-          "args": {\r
-            "from": "panel",\r
-            "filter_key": "panel_id"\r
-          }\r
+          "type": "filter"\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
+          "type": "filter"\r
         },\r
         "by_author": {\r
-          "type": "element_filter",\r
-          "args": {\r
-            "from": "author",\r
-            "filter_key": "author_id"\r
-          }\r
+          "type": "element_filter"\r
         }\r
       }\r
     },\r
           "type": "private"\r
         },\r
         "by_panel": {\r
-          "type": "filter",\r
-          "args": {\r
-            "from": "panel",\r
-            "filter_key": "panel_id"\r
-          }\r
+          "type": "filter"\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
+        "by_speech_balloon": {\r
+          "type": "filter"\r
         },\r
         "by_author": {\r
-          "type": "element_filter",\r
-          "args": {\r
-            "from": "author",\r
-            "filter_key": "author_id"\r
-          }\r
+          "type": "element_filter"\r
         }\r
       }\r
     },\r
           "type": "public"\r
         },\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
+          "type": "filter"\r
         },\r
         "by_writing_format": {\r
-          "type": "filter",\r
-          "args": {\r
-            "from": "writing_format",\r
-            "filter_key": "writing_format_id"\r
-          }\r
+          "type": "filter"\r
         }\r
       }\r
     },\r
           "type": "private"\r
         },\r
         "by_panel": {\r
-          "type": "filter",\r
-          "args": {\r
-            "from": "panel",\r
-            "filter_key": "panel_id"\r
-          }\r
+          "type": "filter"\r
         },\r
         "by_author": {\r
-          "type": "element_filter",\r
-          "args": {\r
-            "from": "author",\r
-            "filter_key": "author_id"\r
-          }\r
+          "type": "element_filter"\r
         }\r
       }\r
     },\r
           "type": "private"\r
         },\r
         "by_panel": {\r
-          "type": "filter",\r
-          "args": {\r
-            "from": "panel",\r
-            "filter_key": "panel_id"\r
-          }\r
+          "type": "filter"\r
         },\r
         "by_author": {\r
-          "type": "element_filter",\r
-          "args": {\r
-            "from": "author",\r
-            "filter_key": "author_id"\r
-          }\r
+          "type": "element_filter"\r
         }\r
       }\r
     },\r
           "type": "private"\r
         },\r
         "by_license": {\r
-          "type": "filter",\r
-          "args": {\r
-            "from": "license",\r
-            "filter_key": "license_id"\r
-          }\r
+          "type": "filter"\r
         },\r
         "by_artist": {\r
-          "type": "filter",\r
-          "args": {\r
-            "from": "artist",\r
-            "filter_key": "artist_id"\r
-          }\r
+          "type": "filter"\r
         }\r
       }\r
     },\r
         },\r
         "select_items": {\r
           "type": "system_resource"\r
-        },\r
-        "speech_balloons": {\r
-          "type": "has_many",\r
-          "args": {\r
-            "association_name": "speech_balloons"\r
-          }\r
-        },\r
-        "panels": {\r
-          "type": "has_many",\r
-          "args": {\r
-            "association_name": "panels"\r
-          }\r
         }\r
       }\r
     },\r
         "select_items": {\r
           "type": "system_resource"\r
         },\r
-        "speeches": {\r
-          "type": "has_many",\r
-          "args": {\r
-            "association_name": "speeches"\r
-          }\r
-        },\r
         "by_system_picture": {\r
-          "type": "filter",\r
-          "args": {\r
-            "from": "system_picture",\r
-            "filter_key": "system_picture_id"\r
-          }\r
+          "type": "filter"\r
         }\r
       }\r
     },\r
         },\r
         "select_items": {\r
           "type": "system_resource"\r
-        },\r
-        "licenses": {\r
-          "type": "has_many",\r
-          "args": {\r
-            "association_name": "licenses"\r
-          }\r
         }\r
       }\r
     },\r
         "public_list": {\r
           "type": "public"\r
         },\r
-        "resource_pictures": {\r
-          "type": "has_many",\r
-          "args": {\r
-            "association_name": "resource_pictures"\r
-          }\r
-        },\r
         "by_license_group": {\r
-          "type": "filter",\r
-          "args": {\r
-            "from": "license_group",\r
-            "filter_key": "license_group_id"\r
-          }\r
+          "type": "filter"\r
         },\r
         "by_system_picture": {\r
-          "type": "filter",\r
-          "args": {\r
-            "from": "system_picture",\r
-            "filter_key": "system_picture_id"\r
-          }\r
+          "type": "filter"\r
         }\r
       }\r
     },\r
       "lists": {\r
         "public_list": {\r
           "type": "public"\r
-        },\r
-        "scrolls": {\r
-          "type": "has_many",\r
-          "args": {\r
-            "association_name": "scrolls"\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
         },\r
-        "comics": {\r
-          "type": "has_many",\r
-          "args": {\r
-            "association_name": "comics"\r
+        "has_one": {}\r
+      },\r
+      "attributes": {\r
+        "id": {\r
+          "type": "number",\r
+          "primary_key": 1,\r
+          "rules": {\r
+            "number": true\r
           }\r
         },\r
-        "stories": {\r
-          "type": "has_many",\r
-          "args": {\r
-            "association_name": "stories"\r
-          }\r
-        },\r
-        "sheets": {\r
-          "type": "has_many",\r
-          "args": {\r
-            "association_name": "sheets"\r
-          }\r
-        },\r
-        "panels": {\r
-          "type": "has_many",\r
-          "args": {\r
-            "association_name": "panels"\r
-          }\r
-        },\r
-        "panel_pictures": {\r
-          "type": "has_many",\r
-          "args": {\r
-            "association_name": "panel_pictures"\r
-          }\r
-        },\r
-        "speech_balloons": {\r
-          "type": "has_many",\r
-          "args": {\r
-            "association_name": "speech_balloons"\r
-          }\r
-        },\r
-        "ground_pictures": {\r
-          "type": "has_many",\r
-          "args": {\r
-            "association_name": "ground_pictures"\r
-          }\r
-        },\r
-        "ground_colors": {\r
-          "type": "has_many",\r
-          "args": {\r
-            "association_name": "ground_colors"\r
-          }\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
-        },\r
-        "has_one": {}\r
-      },\r
-      "attributes": {\r
-        "id": {\r
-          "type": "number",\r
-          "primary_key": 1,\r
-          "rules": {\r
-            "number": true\r
-          }\r
-        },\r
-        "name": {\r
-          "type": "text",\r
-          "rules": {\r
-            "required": true\r
+        "name": {\r
+          "type": "text",\r
+          "rules": {\r
+            "required": true\r
           }\r
         },\r
         "author_id": {\r
             "number": true\r
           }\r
         },\r
-        "created_at": {\r
-          "type": "datetime"\r
-        },\r
-        "updated_at": {\r
-          "type": "datetime"\r
-        }\r
-      },\r
-      "lists": {\r
-        "public_list": {\r
-          "type": "public"\r
-        },\r
-        "resource_pictures": {\r
-          "type": "has_many",\r
-          "args": {\r
-            "association_name": "resource_pictures"\r
-          }\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
-        },\r
-        "has_one": {}\r
-      },\r
-      "attributes": {\r
-        "id": {\r
-          "type": "number",\r
-          "primary_key": 1,\r
-          "rules": {\r
-            "number": true\r
-          }\r
-        },\r
-        "ext": {\r
-          "type": "text",\r
-          "rules": {\r
-            "required": true\r
-          }\r
-        },\r
-        "width": {\r
-          "type": "number",\r
-          "rules": {\r
-            "required": true,\r
-            "number": true\r
-          }\r
-        },\r
-        "height": {\r
-          "type": "number",\r
-          "rules": {\r
-            "required": true,\r
-            "number": true\r
-          }\r
-        },\r
-        "filesize": {\r
-          "type": "number",\r
-          "rules": {\r
-            "required": true,\r
-            "number": true\r
-          }\r
-        },\r
-        "md5": {\r
-          "type": "text",\r
-          "rules": {\r
-            "required": true\r
-          }\r
-        },\r
-        "created_at": {\r
-          "type": "datetime"\r
-        },\r
-        "updated_at": {\r
-          "type": "datetime"\r
-        }\r
-      },\r
-      "lists": {\r
-        "public_list": {\r
-          "type": "public"\r
-        }\r
-      }\r
-    }\r
-  },\r
-  "lists": {\r
-    "scroll": {\r
-      "lists": {\r
-        "public_list": {\r
-          "type": "public"\r
-        },\r
-        "private_list": {\r
-          "type": "private"\r
-        },\r
-        "scroll_panels": {\r
-          "type": "has_many",\r
-          "association_name": "scroll_panels"\r
-        },\r
-        "panels": {\r
-          "type": "has_many_through",\r
-          "association_name": "panels"\r
-        },\r
-        "by_author": {\r
-          "type": "filter",\r
-          "from": "author",\r
-          "filter_key": "author_id"\r
-        },\r
-        "by_panel": {\r
-          "type": "through_filter",\r
-          "from": "panel",\r
-          "through": "scroll_panels",\r
-          "filter_key": "panel_id"\r
-        },\r
-        "play": {\r
-          "type": "play",\r
-          "model": "scroll_panel",\r
-          "filter_key": "scroll_id"\r
-        }\r
-      }\r
-    },\r
-    "scroll_panel": {\r
-      "default_page_size": 20,\r
-      "lists": {\r
-        "public_list": {\r
-          "type": "public"\r
-        },\r
-        "private_list": {\r
-          "type": "private"\r
-        },\r
-        "by_scroll": {\r
-          "type": "filter",\r
-          "from": "scroll",\r
-          "filter_key": "scroll_id"\r
-        },\r
-        "by_panel": {\r
-          "type": "filter",\r
-          "from": "panel",\r
-          "filter_key": "panel_id"\r
-        }\r
-      }\r
-    },\r
-    "comic": {\r
-      "default_page_size": 20,\r
-      "lists": {\r
-        "public_list": {\r
-          "type": "public"\r
-        },\r
-        "private_list": {\r
-          "type": "private"\r
-        },\r
-        "stories": {\r
-          "type": "has_many",\r
-          "association_name": "stories"\r
-        },\r
-        "by_author": {\r
-          "type": "filter",\r
-          "from": "author",\r
-          "filter_key": "author_id"\r
-        }\r
-      }\r
-    },\r
-    "story": {\r
-      "default_page_size": 20,\r
-      "lists": {\r
-        "public_list": {\r
-          "type": "public"\r
-        },\r
-        "private_list": {\r
-          "type": "private"\r
-        },\r
-        "story_sheets": {\r
-          "type": "has_many",\r
-          "association_name": "story_sheets"\r
-        },\r
-        "sheets": {\r
-          "type": "has_many",\r
-          "association_name": "sheets"\r
-        },\r
-        "by_comic": {\r
-          "type": "filter",\r
-          "from": "comic",\r
-          "filter_key": "comic_id"\r
-        },\r
-        "by_sheet": {\r
-          "type": "through_filter",\r
-          "from": "sheet",\r
-          "through": "story_sheets",\r
-          "filter_key": "sheet_id"\r
-        },\r
-        "by_author": {\r
-          "type": "element_filter",\r
-          "from": "author",\r
-          "filter_key": "author_id"\r
-        },\r
-        "play": {\r
-          "type": "play",\r
-          "model": "story_sheet",\r
-          "filter_key": "story_id"\r
-        }\r
-      }\r
-    },\r
-    "story_sheet": {\r
-      "default_page_size": 20,\r
-      "lists": {\r
-        "public_list": {\r
-          "type": "public"\r
-        },\r
-        "private_list": {\r
-          "type": "private"\r
-        },\r
-        "by_story": {\r
-          "type": "filter",\r
-          "from": "story",\r
-          "filter_key": "story_id"\r
-        },\r
-        "by_sheet": {\r
-          "type": "filter",\r
-          "from": "sheet",\r
-          "filter_key": "sheet_id"\r
-        }\r
-      }\r
-    },\r
-    "sheet": {\r
-      "default_page_size": 20,\r
-      "lists": {\r
-        "public_list": {\r
-          "type": "public"\r
-        },\r
-        "private_list": {\r
-          "type": "private"\r
-        },\r
-        "story_sheets": {\r
-          "type": "has_many",\r
-          "association_name": "story_sheets"\r
-        },\r
-        "stories": {\r
-          "type": "has_many",\r
-          "association_name": "stories"\r
-        },\r
-        "sheet_panels": {\r
-          "type": "has_many",\r
-          "association_name": "sheet_panels"\r
-        },\r
-        "panels": {\r
-          "type": "has_many",\r
-          "association_name": "panels"\r
-        },\r
-        "by_story": {\r
-          "type": "through_filter",\r
-          "from": "story",\r
-          "through": "story_sheets",\r
-          "filter_key": "story_id"\r
-        },\r
-        "by_panel": {\r
-          "type": "through_filter",\r
-          "from": "panel",\r
-          "through": "sheet_panels",\r
-          "filter_key": "panel_id"\r
-        },\r
-        "by_author": {\r
-          "type": "filter",\r
-          "from": "author",\r
-          "filter_key": "author_id"\r
-        },\r
-        "play": {\r
-          "type": "play",\r
-          "model": "sheet_panel",\r
-          "filter_key": "sheet_id"\r
-        }\r
-      }\r
-    },\r
-    "sheet_panel": {\r
-      "default_page_size": 20,\r
-      "lists": {\r
-        "public_list": {\r
-          "type": "public"\r
-        },\r
-        "private_list": {\r
-          "type": "private"\r
-        },\r
-        "by_sheet": {\r
-          "type": "filter",\r
-          "association_name": "sheet_panels",\r
-          "from": "sheet",\r
-          "filter_key": "sheet_id"\r
-        },\r
-        "by_panel": {\r
-          "type": "filter",\r
-          "from": "panel",\r
-          "filter_key": "panel_id"\r
-        }\r
-      }\r
-    },\r
-    "panel": {\r
-      "default_page_size": 20,\r
-      "lists": {\r
-        "public_list": {\r
-          "type": "public"\r
-        },\r
-        "private_list": {\r
-          "type": "private"\r
-        },\r
-        "scroll_panels": {\r
-          "type": "has_many",\r
-          "association_name": "scroll_panels"\r
-        },\r
-        "scrolls": {\r
-          "type": "has_many",\r
-          "association_name": "scrolls"\r
-        },\r
-        "sheet_panels": {\r
-          "type": "has_many",\r
-          "association_name": "sheet_panels"\r
-        },\r
-        "sheets": {\r
-          "type": "has_many",\r
-          "association_name": "sheets"\r
-        },\r
-        "panel_pictures": {\r
-          "type": "has_many",\r
-          "association_name": "panel_pictures"\r
-        },\r
-        "speech_balloons": {\r
-          "type": "has_many",\r
-          "association_name": "speech_balloons"\r
-        },\r
-        "ground_pictures": {\r
-          "type": "has_many",\r
-          "association_name": "ground_pictures"\r
-        },\r
-        "ground_colors": {\r
-          "type": "has_many",\r
-          "association_name": "ground_colors"\r
-        },\r
-        "by_scroll": {\r
-          "type": "through_filter",\r
-          "from": "scroll",\r
-          "through": "scroll_panels",\r
-          "filter_key": "scroll_id"\r
-        },\r
-        "by_sheet": {\r
-          "type": "through_filter",\r
-          "from": "sheet",\r
-          "through": "sheet_panels",\r
-          "filter_key": "sheet_id"\r
-        },\r
-        "by_author": {\r
-          "type": "filter",\r
-          "from": "author",\r
-          "filter_key": "author_id"\r
-        },\r
-        "by_speech_balloon_template": {\r
-          "type": "through_filter",\r
-          "from": "speech_balloon_template",\r
-          "through": "speech_balloons",\r
-          "filter_key": "speech_balloon_template_id"\r
-        }\r
-      }\r
-    },\r
-    "panel_picture": {\r
-      "default_page_size": 20,\r
-      "lists": {\r
-        "public_list": {\r
-          "type": "public"\r
-        },\r
-        "private_list": {\r
-          "type": "private"\r
-        },\r
-        "by_panel": {\r
-          "type": "filter",\r
-          "from": "panel",\r
-          "filter_key": "panel_id"\r
-        },\r
-        "by_author": {\r
-          "type": "element_filter",\r
-          "from": "author",\r
-          "filter_key": "author_id"\r
-        }\r
-      }\r
-    },\r
-    "speech_balloon": {\r
-      "default_page_size": 20,\r
-      "lists": {\r
-        "public_list": {\r
-          "type": "public"\r
-        },\r
-        "private_list": {\r
-          "type": "private"\r
-        },\r
-        "by_panel": {\r
-          "type": "filter",\r
-          "from": "panel",\r
-          "filter_key": "panel_id"\r
-        },\r
-        "by_speech_balloon_template": {\r
-          "type": "filter",\r
-          "from": "speech_balloon_template",\r
-          "filter_key": "speech_balloon_template_id"\r
-        },\r
-        "by_author": {\r
-          "type": "element_filter",\r
-          "from": "author",\r
-          "filter_key": "author_id"\r
-        }\r
-      }\r
-    },\r
-    "speech": {\r
-      "default_page_size": 20,\r
-      "lists": {\r
-        "public_list": {\r
-          "type": "public"\r
-        },\r
-        "by_speech_balloon": {\r
-          "type": "filter",\r
-          "from": "speech_balloon",\r
-          "includes": {\r
-            "speech_balloon": {\r
-              "panel": {}\r
-            }\r
-          },\r
-          "filter_key": "speech_balloon_id"\r
-        },\r
-        "by_writing_format": {\r
-          "type": "filter",\r
-          "from": "writing_format",\r
-          "filter_key": "writing_format_id"\r
-        }\r
-      }\r
-    },\r
-    "balloon": {\r
-      "default_page_size": 20,\r
-      "lists": {\r
-        "public_list": {\r
-          "type": "public"\r
-        },\r
-        "by_speech_balloon": {\r
-          "type": "filter",\r
-          "from": "speech_balloon",\r
-          "includes": {\r
-            "speech_balloon": {\r
-              "panel": {}\r
-            }\r
-          },\r
-          "filter_key": "speech_balloon_id"\r
-        }\r
-      }\r
-    },\r
-    "ground_picture": {\r
-      "default_page_size": 20,\r
-      "lists": {\r
-        "public_list": {\r
-          "type": "public"\r
-        },\r
-        "private_list": {\r
-          "type": "private"\r
-        },\r
-        "by_panel": {\r
-          "type": "filter",\r
-          "from": "panel",\r
-          "filter_key": "panel_id"\r
-        },\r
-        "by_author": {\r
-          "type": "element_filter",\r
-          "from": "author",\r
-          "filter_key": "author_id"\r
-        }\r
-      }\r
-    },\r
-    "ground_color": {\r
-      "default_page_size": 20,\r
-      "lists": {\r
-        "public_list": {\r
-          "type": "public"\r
-        },\r
-        "private_list": {\r
-          "type": "private"\r
-        },\r
-        "by_panel": {\r
-          "type": "filter",\r
-          "from": "panel",\r
-          "filter_key": "panel_id"\r
-        },\r
-        "by_author": {\r
-          "type": "element_filter",\r
-          "from": "author",\r
-          "filter_key": "author_id"\r
-        }\r
-      }\r
-    },\r
-    "original_picture": {\r
-      "default_page_size": 20,\r
-      "lists": {\r
-        "private_list": {\r
-          "type": "private"\r
-        }\r
-      }\r
-    },\r
-    "picture": {},\r
-    "resource_picture": {\r
-      "default_page_size": 20,\r
-      "lists": {\r
-        "public_list": {\r
-          "type": "public"\r
-        },\r
-        "private_list": {\r
-          "type": "private"\r
-        },\r
-        "by_license": {\r
-          "type": "filter",\r
-          "from": "license",\r
-          "filter_key": "license_id"\r
-        },\r
-        "by_artist": {\r
-          "type": "filter",\r
-          "from": "artist",\r
-          "filter_key": "artist_id"\r
-        }\r
-      }\r
-    },\r
-    "speech_balloon_template": {\r
-      "default_page_size": 20,\r
-      "lists": {\r
-        "public_list": {\r
-          "type": "public"\r
-        },\r
-        "select_items": {\r
-          "type": "system_resource"\r
-        },\r
-        "speech_balloons": {\r
-          "type": "has_many",\r
-          "association_name": "speech_balloons"\r
-        },\r
-        "panels": {\r
-          "type": "has_many",\r
-          "association_name": "panels"\r
-        }\r
-      }\r
-    },\r
-    "writing_format": {\r
-      "default_page_size": 20,\r
-      "lists": {\r
-        "public_list": {\r
-          "type": "public"\r
-        },\r
-        "select_items": {\r
-          "type": "system_resource"\r
-        },\r
-        "speeches": {\r
-          "type": "has_many",\r
-          "association_name": "speeches"\r
-        },\r
-        "by_system_picture": {\r
-          "type": "filter",\r
-          "from": "system_picture",\r
-          "filter_key": "system_picture_id"\r
-        }\r
-      }\r
-    },\r
-    "license_group": {\r
-      "default_page_size": 20,\r
-      "lists": {\r
-        "public_list": {\r
-          "type": "public"\r
-        },\r
-        "select_items": {\r
-          "type": "system_resource"\r
+        "created_at": {\r
+          "type": "datetime"\r
         },\r
-        "licenses": {\r
-          "type": "has_many",\r
-          "association_name": "licenses"\r
+        "updated_at": {\r
+          "type": "datetime"\r
         }\r
-      }\r
-    },\r
-    "license": {\r
-      "default_page_size": 20,\r
+      },\r
       "lists": {\r
         "public_list": {\r
           "type": "public"\r
-        },\r
-        "resource_pictures": {\r
-          "type": "has_many",\r
-          "association_name": "resource_pictures"\r
-        },\r
-        "by_license_group": {\r
-          "type": "filter",\r
-          "from": "license_group",\r
-          "filter_key": "license_group_id"\r
-        },\r
-        "by_system_picture": {\r
-          "type": "filter",\r
-          "from": "system_picture",\r
-          "filter_key": "system_picture_id"\r
         }\r
       }\r
     },\r
-    "author": {\r
-      "default_page_size": 20,\r
-      "lists": {\r
-        "public_list": {\r
-          "type": "public"\r
-        },\r
-        "scrolls": {\r
-          "type": "has_many",\r
-          "association_name": "scrolls"\r
-        },\r
-        "comics": {\r
-          "type": "has_many",\r
-          "association_name": "comics"\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
         },\r
-        "stories": {\r
-          "type": "has_many",\r
-          "association_name": "stories"\r
+        "has_one": {}\r
+      },\r
+      "attributes": {\r
+        "id": {\r
+          "type": "number",\r
+          "primary_key": 1,\r
+          "rules": {\r
+            "number": true\r
+          }\r
         },\r
-        "sheets": {\r
-          "type": "has_many",\r
-          "association_name": "sheets"\r
+        "ext": {\r
+          "type": "text",\r
+          "rules": {\r
+            "required": true\r
+          }\r
         },\r
-        "panels": {\r
-          "type": "has_many",\r
-          "association_name": "panels"\r
+        "width": {\r
+          "type": "number",\r
+          "rules": {\r
+            "required": true,\r
+            "number": true\r
+          }\r
         },\r
-        "panel_pictures": {\r
-          "type": "has_many",\r
-          "association_name": "panel_pictures"\r
+        "height": {\r
+          "type": "number",\r
+          "rules": {\r
+            "required": true,\r
+            "number": true\r
+          }\r
         },\r
-        "speech_balloons": {\r
-          "type": "has_many",\r
-          "association_name": "speech_balloons"\r
+        "filesize": {\r
+          "type": "number",\r
+          "rules": {\r
+            "required": true,\r
+            "number": true\r
+          }\r
         },\r
-        "ground_pictures": {\r
-          "type": "has_many",\r
-          "association_name": "ground_pictures"\r
+        "md5": {\r
+          "type": "text",\r
+          "rules": {\r
+            "required": true\r
+          }\r
         },\r
-        "ground_colors": {\r
-          "type": "has_many",\r
-          "association_name": "ground_colors"\r
-        }\r
-      }\r
-    },\r
-    "artist": {\r
-      "default_page_size": 20,\r
-      "lists": {\r
-        "public_list": {\r
-          "type": "public"\r
+        "created_at": {\r
+          "type": "datetime"\r
         },\r
-        "resource_pictures": {\r
-          "type": "has_many",\r
-          "association_name": "resource_pictures"\r
+        "updated_at": {\r
+          "type": "datetime"\r
         }\r
-      }\r
-    },\r
-    "system_picture": {\r
-      "default_page_size": 20,\r
+      },\r
       "lists": {\r
         "public_list": {\r
           "type": "public"\r
       "ground_color": {\r
         "symbol": {\r
           "face": {\r
-            "type": "template",\r
+            "type": "template",\r
+            "args": {\r
+              "name": "symbol"\r
+            }\r
+          },\r
+          "link": {\r
+            "type": "none"\r
+          }\r
+        },\r
+        "caption": {\r
+          "face": {\r
+            "type": "column",\r
+            "args": {\r
+              "name": "caption"\r
+            }\r
+          },\r
+          "link": {\r
+            "type": "none"\r
+          }\r
+        },\r
+        "summary": {\r
+          "type": "template",\r
+          "args": {\r
+            "name": "summary"\r
+          }\r
+        },\r
+        "edit": {\r
+          "type": "none"\r
+        }\r
+      },\r
+      "original_picture": {\r
+        "symbol": {\r
+          "face": {\r
+            "type": "picture",\r
+            "args": {\r
+              "name": "symbol_option"\r
+            }\r
+          },\r
+          "link": {\r
+            "type": "action",\r
+            "args": {\r
+              "name": "show"\r
+            }\r
+          }\r
+        },\r
+        "caption": {\r
+          "face": {\r
+            "type": "method",\r
+            "args": {\r
+              "name": "revision"\r
+            }\r
+          },\r
+          "link": {\r
+            "type": "action",\r
+            "args": {\r
+              "name": "history"\r
+            }\r
+          }\r
+        },\r
+        "summary": {\r
+          "type": "template",\r
+          "args": {\r
+            "name": "summary"\r
+          }\r
+        },\r
+        "edit": {\r
+          "type": "template",\r
+          "args": {\r
+            "name": "publish"\r
+          }\r
+        }\r
+      },\r
+      "picture": {\r
+        "symbol": {\r
+          "face": {\r
+            "type": "picture",\r
+            "args": {\r
+              "name": "symbol_option"\r
+            }\r
+          },\r
+          "link": {\r
+            "type": "action",\r
+            "args": {\r
+              "name": "show"\r
+            }\r
+          }\r
+        },\r
+        "caption": {\r
+          "face": {\r
+            "type": "column",\r
+            "args": {\r
+              "name": "revision"\r
+            }\r
+          },\r
+          "link": {\r
+            "type": "action",\r
+            "args": {\r
+              "name": "show"\r
+            }\r
+          }\r
+        },\r
+        "summary": {\r
+          "type": "template",\r
+          "args": {\r
+            "name": "summary"\r
+          }\r
+        },\r
+        "edit": {\r
+          "type": "none"\r
+        }\r
+      },\r
+      "resource_picture": {\r
+        "symbol": {\r
+          "face": {\r
+            "type": "picture",\r
+            "args": {\r
+              "name": "symbol_option"\r
+            }\r
+          },\r
+          "link": {\r
+            "type": "action",\r
+            "args": {\r
+              "name": "show"\r
+            }\r
+          }\r
+        },\r
+        "caption": {\r
+          "face": {\r
+            "type": "none",\r
+            "args": {}\r
+          },\r
+          "link": {\r
+            "type": "none",\r
+            "args": {}\r
+          }\r
+        },\r
+        "summary": {\r
+          "type": "template",\r
+          "args": {\r
+            "name": "summary"\r
+          }\r
+        },\r
+        "edit": {\r
+          "type": "none"\r
+        }\r
+      },\r
+      "speech_balloon_template": {\r
+        "symbol": {\r
+          "face": {\r
+            "type": "picture",\r
             "args": {\r
-              "name": "symbol"\r
+              "name": "symbol_option"\r
             }\r
           },\r
           "link": {\r
-            "type": "none"\r
+            "type": "action",\r
+            "args": {\r
+              "name": "show"\r
+            }\r
           }\r
         },\r
         "caption": {\r
             }\r
           },\r
           "link": {\r
-            "type": "none"\r
+            "type": "action",\r
+            "args": {\r
+              "name": "show"\r
+            }\r
           }\r
         },\r
         "summary": {\r
-          "type": "template",\r
-          "args": {\r
-            "name": "summary"\r
-          }\r
+          "type": "none"\r
         },\r
         "edit": {\r
           "type": "none"\r
         }\r
       },\r
-      "original_picture": {\r
+      "writing_format": {\r
         "symbol": {\r
           "face": {\r
-            "type": "picture",\r
+            "type": "image",\r
             "args": {\r
-              "name": "symbol_option"\r
+              "name": "/assets/item.png"\r
             }\r
           },\r
           "link": {\r
         },\r
         "caption": {\r
           "face": {\r
-            "type": "method",\r
+            "type": "column",\r
             "args": {\r
-              "name": "revision"\r
+              "name": "caption"\r
             }\r
           },\r
           "link": {\r
             "type": "action",\r
             "args": {\r
-              "name": "history"\r
+              "name": "show"\r
             }\r
           }\r
         },\r
         "summary": {\r
-          "type": "template",\r
-          "args": {\r
-            "name": "summary"\r
-          }\r
+          "type": "none"\r
         },\r
         "edit": {\r
-          "type": "template",\r
-          "args": {\r
-            "name": "publish"\r
-          }\r
+          "type": "none"\r
         }\r
       },\r
-      "picture": {\r
+      "license_group": {\r
         "symbol": {\r
           "face": {\r
-            "type": "picture",\r
+            "type": "image",\r
             "args": {\r
-              "name": "symbol_option"\r
+              "name": "/assets/item.png"\r
             }\r
           },\r
           "link": {\r
           "face": {\r
             "type": "column",\r
             "args": {\r
-              "name": "revision"\r
+              "name": "caption"\r
             }\r
           },\r
           "link": {\r
-            "type": "action",\r
+            "type": "url_column",\r
             "args": {\r
-              "name": "show"\r
+              "name": "url"\r
             }\r
           }\r
         },\r
         "summary": {\r
-          "type": "template",\r
-          "args": {\r
-            "name": "summary"\r
-          }\r
+          "type": "none",\r
+          "args": {}\r
         },\r
         "edit": {\r
           "type": "none"\r
         }\r
       },\r
-      "resource_picture": {\r
+      "license": {\r
         "symbol": {\r
           "face": {\r
-            "type": "picture",\r
+            "type": "image",\r
             "args": {\r
-              "name": "symbol_option"\r
+              "name": "/assets/item.png"\r
             }\r
           },\r
           "link": {\r
         },\r
         "caption": {\r
           "face": {\r
-            "type": "none",\r
-            "args": {}\r
+            "type": "method",\r
+            "args": {\r
+              "name": "caption_with_group"\r
+            }\r
           },\r
           "link": {\r
-            "type": "none",\r
-            "args": {}\r
+            "type": "url_column",\r
+            "args": {\r
+              "name": "url"\r
+            }\r
           }\r
         },\r
         "summary": {\r
           "type": "none"\r
         }\r
       },\r
-      "speech_balloon_template": {\r
+      "author": {\r
         "symbol": {\r
           "face": {\r
-            "type": "picture",\r
+            "type": "image",\r
             "args": {\r
-              "name": "symbol_option"\r
+              "name": "/assets/item.png"\r
             }\r
           },\r
           "link": {\r
           "face": {\r
             "type": "column",\r
             "args": {\r
-              "name": "caption"\r
+              "name": "name"\r
             }\r
           },\r
           "link": {\r
           }\r
         },\r
         "summary": {\r
-          "type": "none"\r
+          "type": "template",\r
+          "args": {\r
+            "name": "summary"\r
+          }\r
         },\r
         "edit": {\r
-          "type": "none"\r
+          "type": "account"\r
         }\r
       },\r
-      "writing_format": {\r
+      "artist": {\r
         "symbol": {\r
           "face": {\r
             "type": "image",\r
           "face": {\r
             "type": "column",\r
             "args": {\r
-              "name": "caption"\r
+              "name": "name"\r
             }\r
           },\r
           "link": {\r
           }\r
         },\r
         "summary": {\r
-          "type": "none"\r
+          "type": "template",\r
+          "args": {\r
+            "name": "summary"\r
+          }\r
         },\r
         "edit": {\r
-          "type": "none"\r
+          "type": "account"\r
         }\r
       },\r
-      "license_group": {\r
+      "system_picture": {\r
         "symbol": {\r
           "face": {\r
-            "type": "image",\r
+            "type": "picture",\r
             "args": {\r
-              "name": "/assets/item.png"\r
+              "name": "symbol_option"\r
             }\r
           },\r
           "link": {\r
         },\r
         "caption": {\r
           "face": {\r
-            "type": "column",\r
-            "args": {\r
-              "name": "caption"\r
-            }\r
+            "type": "none",\r
+            "args": {}\r
           },\r
           "link": {\r
-            "type": "url_column",\r
-            "args": {\r
-              "name": "url"\r
-            }\r
+            "type": "none",\r
+            "args": {}\r
           }\r
         },\r
         "summary": {\r
-          "type": "none",\r
-          "args": {}\r
+          "type": "none"\r
+        },\r
+        "edit": {\r
+          "type": "none"\r
+        }\r
+      }\r
+    },\r
+    "lists": {\r
+      "scroll": {\r
+        "public_list": {},\r
+        "private_list": {},\r
+        "by_author": {\r
+          "type": "filter",\r
+          "from": "author",\r
+          "filter_key": "author_id"\r
+        },\r
+        "by_panel": {\r
+          "type": "through_filter",\r
+          "from": "panel",\r
+          "through": "scroll_panels",\r
+          "filter_key": "panel_id"\r
+        },\r
+        "play": {\r
+          "type": "play",\r
+          "model": "scroll_panel",\r
+          "filter_key": "scroll_id"\r
+        }\r
+      },\r
+      "scroll_panel": {\r
+        "public_list": {},\r
+        "private_list": {},\r
+        "by_scroll": {\r
+          "type": "filter",\r
+          "from": "scroll",\r
+          "filter_key": "scroll_id"\r
+        },\r
+        "by_panel": {\r
+          "type": "filter",\r
+          "from": "panel",\r
+          "filter_key": "panel_id"\r
+        }\r
+      },\r
+      "comic": {\r
+        "public_list": {},\r
+        "private_list": {},\r
+        "by_author": {\r
+          "type": "filter",\r
+          "from": "author",\r
+          "filter_key": "author_id"\r
+        }\r
+      },\r
+      "story": {\r
+        "public_list": {},\r
+        "private_list": {},\r
+        "by_comic": {\r
+          "type": "filter",\r
+          "from": "comic",\r
+          "filter_key": "comic_id"\r
+        },\r
+        "by_sheet": {\r
+          "type": "through_filter",\r
+          "from": "sheet",\r
+          "through": "story_sheets",\r
+          "filter_key": "sheet_id"\r
+        },\r
+        "by_author": {\r
+          "type": "element_filter",\r
+          "from": "author",\r
+          "filter_key": "author_id"\r
+        },\r
+        "play": {\r
+          "type": "play",\r
+          "model": "story_sheet",\r
+          "filter_key": "story_id"\r
+        }\r
+      },\r
+      "story_sheet": {\r
+        "public_list": {\r
+          "type": "public"\r
+        },\r
+        "private_list": {\r
+          "type": "private"\r
+        },\r
+        "by_story": {\r
+          "type": "filter",\r
+          "from": "story",\r
+          "filter_key": "story_id"\r
+        },\r
+        "by_sheet": {\r
+          "type": "filter",\r
+          "from": "sheet",\r
+          "filter_key": "sheet_id"\r
+        }\r
+      },\r
+      "sheet": {\r
+        "public_list": {},\r
+        "private_list": {},\r
+        "by_story": {\r
+          "type": "through_filter",\r
+          "from": "story",\r
+          "through": "story_sheets",\r
+          "filter_key": "story_id"\r
+        },\r
+        "by_panel": {\r
+          "type": "through_filter",\r
+          "from": "panel",\r
+          "through": "sheet_panels",\r
+          "filter_key": "panel_id"\r
+        },\r
+        "by_author": {\r
+          "type": "filter",\r
+          "from": "author",\r
+          "filter_key": "author_id"\r
+        },\r
+        "play": {\r
+          "type": "play",\r
+          "model": "sheet_panel",\r
+          "filter_key": "sheet_id"\r
+        }\r
+      },\r
+      "sheet_panel": {\r
+        "public_list": {},\r
+        "private_list": {},\r
+        "by_sheet": {\r
+          "type": "filter",\r
+          "association_name": "sheet_panels",\r
+          "from": "sheet",\r
+          "filter_key": "sheet_id"\r
+        },\r
+        "by_panel": {\r
+          "type": "filter",\r
+          "from": "panel",\r
+          "filter_key": "panel_id"\r
+        }\r
+      },\r
+      "panel": {\r
+        "public_list": {},\r
+        "private_list": {},\r
+        "by_scroll": {\r
+          "type": "through_filter",\r
+          "from": "scroll",\r
+          "through": "scroll_panels",\r
+          "filter_key": "scroll_id"\r
+        },\r
+        "by_sheet": {\r
+          "type": "through_filter",\r
+          "from": "sheet",\r
+          "through": "sheet_panels",\r
+          "filter_key": "sheet_id"\r
         },\r
-        "edit": {\r
-          "type": "none"\r
+        "by_author": {\r
+          "type": "filter",\r
+          "from": "author",\r
+          "filter_key": "author_id"\r
+        },\r
+        "by_speech_balloon_template": {\r
+          "type": "through_filter",\r
+          "from": "speech_balloon_template",\r
+          "through": "speech_balloons",\r
+          "filter_key": "speech_balloon_template_id"\r
         }\r
       },\r
-      "license": {\r
-        "symbol": {\r
-          "face": {\r
-            "type": "image",\r
-            "args": {\r
-              "name": "/assets/item.png"\r
-            }\r
-          },\r
-          "link": {\r
-            "type": "action",\r
-            "args": {\r
-              "name": "show"\r
-            }\r
-          }\r
+      "panel_picture": {\r
+        "public_list": {},\r
+        "private_list": {},\r
+        "by_panel": {\r
+          "type": "filter",\r
+          "from": "panel",\r
+          "filter_key": "panel_id"\r
         },\r
-        "caption": {\r
-          "face": {\r
-            "type": "method",\r
-            "args": {\r
-              "name": "caption_with_group"\r
-            }\r
-          },\r
-          "link": {\r
-            "type": "url_column",\r
-            "args": {\r
-              "name": "url"\r
-            }\r
-          }\r
+        "by_author": {\r
+          "type": "element_filter",\r
+          "from": "author",\r
+          "filter_key": "author_id"\r
+        }\r
+      },\r
+      "speech_balloon": {\r
+        "public_list": {},\r
+        "private_list": {},\r
+        "by_panel": {\r
+          "type": "filter",\r
+          "from": "panel",\r
+          "filter_key": "panel_id"\r
         },\r
-        "summary": {\r
-          "type": "template",\r
-          "args": {\r
-            "name": "summary"\r
-          }\r
+        "by_speech_balloon_template": {\r
+          "type": "filter",\r
+          "from": "speech_balloon_template",\r
+          "filter_key": "speech_balloon_template_id"\r
         },\r
-        "edit": {\r
-          "type": "none"\r
+        "by_author": {\r
+          "type": "element_filter",\r
+          "from": "author",\r
+          "filter_key": "author_id"\r
         }\r
       },\r
-      "author": {\r
-        "symbol": {\r
-          "face": {\r
-            "type": "image",\r
-            "args": {\r
-              "name": "/assets/item.png"\r
-            }\r
-          },\r
-          "link": {\r
-            "type": "action",\r
-            "args": {\r
-              "name": "show"\r
-            }\r
-          }\r
-        },\r
-        "caption": {\r
-          "face": {\r
-            "type": "column",\r
-            "args": {\r
-              "name": "name"\r
+      "speech": {\r
+        "public_list": {},\r
+        "by_speech_balloon": {\r
+          "type": "filter",\r
+          "from": "speech_balloon",\r
+          "includes": {\r
+            "speech_balloon": {\r
+              "panel": {}\r
             }\r
           },\r
-          "link": {\r
-            "type": "action",\r
-            "args": {\r
-              "name": "show"\r
-            }\r
-          }\r
-        },\r
-        "summary": {\r
-          "type": "template",\r
-          "args": {\r
-            "name": "summary"\r
-          }\r
+          "filter_key": "speech_balloon_id"\r
         },\r
-        "edit": {\r
-          "type": "account"\r
+        "by_writing_format": {\r
+          "type": "filter",\r
+          "from": "writing_format",\r
+          "filter_key": "writing_format_id"\r
         }\r
       },\r
-      "artist": {\r
-        "symbol": {\r
-          "face": {\r
-            "type": "image",\r
-            "args": {\r
-              "name": "/assets/item.png"\r
+      "balloon": {\r
+        "public_list": {},\r
+        "by_speech_balloon": {\r
+          "type": "filter",\r
+          "from": "speech_balloon",\r
+          "includes": {\r
+            "speech_balloon": {\r
+              "panel": {}\r
             }\r
           },\r
-          "link": {\r
-            "type": "action",\r
-            "args": {\r
-              "name": "show"\r
-            }\r
-          }\r
+          "filter_key": "speech_balloon_id"\r
+        }\r
+      },\r
+      "ground_picture": {\r
+        "public_list": {},\r
+        "private_list": {\r
+          "type": "private"\r
         },\r
-        "caption": {\r
-          "face": {\r
-            "type": "column",\r
-            "args": {\r
-              "name": "name"\r
-            }\r
-          },\r
-          "link": {\r
-            "type": "action",\r
-            "args": {\r
-              "name": "show"\r
-            }\r
-          }\r
+        "by_panel": {\r
+          "type": "filter",\r
+          "from": "panel",\r
+          "filter_key": "panel_id"\r
         },\r
-        "summary": {\r
-          "type": "template",\r
-          "args": {\r
-            "name": "summary"\r
-          }\r
+        "by_author": {\r
+          "type": "element_filter",\r
+          "from": "author",\r
+          "filter_key": "author_id"\r
+        }\r
+      },\r
+      "ground_color": {\r
+        "public_list": {},\r
+        "private_list": {},\r
+        "by_panel": {\r
+          "type": "filter",\r
+          "from": "panel",\r
+          "filter_key": "panel_id"\r
         },\r
-        "edit": {\r
-          "type": "account"\r
+        "by_author": {\r
+          "type": "element_filter",\r
+          "from": "author",\r
+          "filter_key": "author_id"\r
         }\r
       },\r
-      "system_picture": {\r
-        "symbol": {\r
-          "face": {\r
-            "type": "picture",\r
-            "args": {\r
-              "name": "symbol_option"\r
-            }\r
-          },\r
-          "link": {\r
-            "type": "action",\r
-            "args": {\r
-              "name": "show"\r
-            }\r
-          }\r
+      "original_picture": {\r
+        "private_list": {}\r
+      },\r
+      "picture": {},\r
+      "resource_picture": {\r
+        "public_list": {},\r
+        "private_list": {},\r
+        "by_license": {\r
+          "type": "filter",\r
+          "from": "license",\r
+          "filter_key": "license_id"\r
         },\r
-        "caption": {\r
-          "face": {\r
-            "type": "none",\r
-            "args": {}\r
-          },\r
-          "link": {\r
-            "type": "none",\r
-            "args": {}\r
-          }\r
+        "by_artist": {\r
+          "type": "filter",\r
+          "from": "artist",\r
+          "filter_key": "artist_id"\r
+        }\r
+      },\r
+      "speech_balloon_template": {\r
+        "public_list": {},\r
+        "select_items": {\r
+          "type": "system_resource"\r
+        }\r
+      },\r
+      "writing_format": {\r
+        "public_list": {},\r
+        "select_items": {\r
+          "type": "system_resource"\r
         },\r
-        "summary": {\r
-          "type": "none"\r
+        "by_system_picture": {\r
+          "type": "filter",\r
+          "from": "system_picture",\r
+          "filter_key": "system_picture_id"\r
+        }\r
+      },\r
+      "license_group": {\r
+        "public_list": {},\r
+        "select_items": {\r
+          "type": "system_resource"\r
+        }\r
+      },\r
+      "license": {\r
+        "public_list": {},\r
+        "by_license_group": {\r
+          "type": "filter",\r
+          "from": "license_group",\r
+          "filter_key": "license_group_id"\r
         },\r
-        "edit": {\r
-          "type": "none"\r
+        "by_system_picture": {\r
+          "type": "filter",\r
+          "from": "system_picture",\r
+          "filter_key": "system_picture_id"\r
         }\r
+      },\r
+      "author": {\r
+        "public_list": {}\r
+      },\r
+      "artist": {\r
+        "public_list": {}\r
+      },\r
+      "system_picture": {\r
+        "public_list": {}\r
       }\r
     },\r
     "elements": [\r
               "args": {\r
                 "column": "id",\r
                 "label": {\r
-                  "type": "none "\r
+                  "type": "none"\r
                 },\r
                 "tag": {\r
                   "type": "hidden"\r