Permalink
Browse files

Implements handler_tile, to be used together with (a modified) form o…

…f renderd, allowing it to render meta tiles, but writing them out as single files.

Opposed to mod_tile which serves meta tiles, we might add this functionality later.

http://code.google.com/p/cherokee/issues/detail?id=683
  • Loading branch information...
1 parent e7daa3d commit 4d1d238c23624c72496598662c29a140acf94143 @skinkie committed Oct 13, 2011
Showing with 445 additions and 2 deletions.
  1. +1 −1 admin/consts.py
  2. +1 −0 admin/plugins/Makefile.am
  3. +52 −0 admin/plugins/tile.py
  4. +18 −0 cherokee/Makefile.am
  5. +286 −0 cherokee/handler_tile.c
  6. +85 −0 cherokee/handler_tile.h
  7. +2 −1 configure.in
View
@@ -51,7 +51,6 @@
('', N_('None')),
('common', N_('List & Send')),
('file', N_('Static Content')),
- ('tile', N_('Renderd Frontend')),
('dirlist', N_('Only Listing')),
('redir', N_('Redirection')),
('fcgi', N_('FastCGI')),
@@ -69,6 +68,7 @@
('admin', N_('Remote Administration')),
('empty_gif', N_('1x1 Transparent GIF')),
('drop', N_('Drop Connection')),
+ ('tile', N_('Renderd Frontend')),
]
ERROR_HANDLERS = [
@@ -48,6 +48,7 @@ server_info.py \
ssi.py \
streaming.py \
target_ip.py \
+tile.py \
url_arg.py \
uwsgi.py \
wildcard.py \
View
@@ -0,0 +1,52 @@
+# -*- coding: utf-8 -*-
+#
+# Cherokee-admin
+#
+# Authors:
+# Alvaro Lopez Ortega <alvaro@alobbs.com>
+# Stefan de Konink <stefan@konink.de>
+#
+# Copyright (C) 2010 Alvaro Lopez Ortega
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of version 2 of the GNU General Public
+# License as published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
+
+import CTK
+import Handler
+import Cherokee
+import Balancer
+
+from util import *
+from consts import *
+
+URL_APPLY = '/plugin/tile/apply'
+HELPS = []
+
+class Plugin_tile (Handler.PluginHandler):
+ def __init__ (self, key, **kwargs):
+ kwargs['show_document_root'] = False
+ Handler.PluginHandler.__init__ (self, key, **kwargs)
+ Handler.PluginHandler.AddCommon (self)
+
+ # Load Balancing
+ modul = CTK.PluginSelector('%s!balancer'%(key), trans_options(Cherokee.support.filter_available (BALANCERS)))
+ table = CTK.PropsTable()
+ table.Add (_("Balancer"), modul.selector_widget, _(Balancer.NOTE_BALANCER))
+
+ self += CTK.RawHTML ('<h2>%s</h2>' %(_('Renderd Balancing')))
+ self += CTK.Indenter (table)
+ self += modul
+
+CTK.publish ('^%s$'%(URL_APPLY), CTK.cfg_apply_post, method="POST")
View
@@ -567,6 +567,22 @@ else
dynamic_handler_file_lib = libplugin_file.la
endif
+#
+# Handler tile
+#
+handler_tile = \
+handler_tile.c \
+handler_tile.h
+
+libplugin_tile_la_LDFLAGS = $(module_ldflags)
+libplugin_tile_la_SOURCES = $(handler_tile)
+
+if STATIC_HANDLER_TILE
+static_handler_tile_src = $(handler_tile)
+else
+dynamic_handler_tile_lib = libplugin_tile.la
+endif
+
#
# Handler dirlist
@@ -1547,6 +1563,7 @@ $(static_handler_post_report_src) \
$(static_collector_rrd_src) \
\
$(static_handler_file_src) \
+$(static_handler_tile_src) \
$(static_handler_dirlist_src) \
$(static_handler_cgi_src) \
$(static_handler_fcgi_src) \
@@ -1737,6 +1754,7 @@ $(dynamic_gen_evhost_lib) \
$(dynamic_post_track_lib) \
$(dynamic_handler_post_report_lib) \
$(dynamic_handler_file_lib) \
+$(dynamic_handler_tile_lib) \
$(dynamic_handler_server_info_lib) \
$(dynamic_handler_render_rrd_lib) \
$(dynamic_handler_dirlist_lib) \
Oops, something went wrong.

0 comments on commit 4d1d238

Please sign in to comment.