SahanaTaiwan Homepage Layout

1 view
Skip to first unread message

TsungWei Hu

unread,
Aug 5, 2010, 12:18:01 AM8/5/10
to sahan...@googlegroups.com
Last day in the camp, new layout for homepage is presented by hsiaojan, and assigned to pwchi and Daniel (aka linpct) to study and implement.
Discovered by pwchi is that eden/views/default/index.html is the starting point, with eden/views/layout.html responsible for header and footer. He will try modification according to the draft. Here are the foreseeable challenges:
1. Homepage is supposed to be updated, say, every 3 hours. How to make homepage cached and updating frequency configurable?
2. How to display the map with markers?
3. Retrieving and counting data entries, should such task better be implemented using controllers?

/marr/

Fran Boon

unread,
Aug 5, 2010, 7:43:49 AM8/5/10
to sahan...@googlegroups.com
On 5 August 2010 12:18, TsungWei Hu <mar...@gmail.com> wrote:
> 1. Homepage is supposed to be updated, say, every 3 hours. How to make
> homepage cached and updating frequency configurable?

If you want the browser to refresh the page automatically, then you
can set a meta-refresh:
http://en.wikipedia.org/wiki/Meta_refresh

def index():
...
response.refresh = ...
return dict(...)

If you want to invalidate caches, then you can do this within Apache:
http://eden.sahanafoundation.org/wiki/InstallationGuidelinesApacheModWSGI#Apachemod_deflatemod_expires

> 2. How to display the map with markers?

def index():
map = gis.show_map(...)
return dict(map=map,...)

http://eden.sahanafoundation.org/wiki/DeveloperGuidelinesGIS#GuidelinesforDeveloperswishingtomakeuseofMappingwithintheirModule

> 3. Retrieving and counting data entries, should such task better be
> implemented using controllers?

Yes, I would include the db lookups in the index() controller & pass
back a snippet of HTML to the view...

F

SahanaTW PL - Hsiaojan

unread,
Aug 5, 2010, 8:04:22 AM8/5/10
to SahanaTWPY
My concerns about the update frequency as below:

1. HP is public for all people and are expected to be eager for the
info about disaster response/situation/relief. However, we should be
careful about the stabability of the server during the disaster peak.
Keep the server run smoothly and have all SahanaTW users are able to
work without any disruption of unexpected shutdown is the top
priority.

2. The update frequency for twitter should be higher than map. How is
this for now?

3. Not all layer of map will be displayed on HP, 2 would be maximan.

Hsiaojan

Fran Boon

unread,
Aug 5, 2010, 8:32:43 AM8/5/10
to sahan...@googlegroups.com
2010/8/5 SahanaTW PL - Hsiaojan <hsiaoj...@gmail.com>:

> 1. HP is public for all people and are expected to be eager for the
> info about disaster response/situation/relief. However, we should be
> careful about the stabability of the server during the disaster peak.
> Keep the server run smoothly  and have all SahanaTW users are able to
> work without any disruption of unexpected shutdown is the top
> priority.

You may want to consider setting up multiple servers.
Multiple webservers for load-balancing is easy, but can also keep one
just for core team.
Whilst the writable database can only be on one server, it is a good
idea to replicate this to a backup server anyway.
If the normal public don't write, their views can be generated from
this backup copy.
With a little work, the odd writable forms they have to submit
requests could be sent to the main DB.
db = (slave db for reads)
db2 = (master db for writes) <- then amend the odd writable forms to
use this db2 instead of db.

The server used by internal staff could simple have db2 = db

> 2. The update frequency for twitter should be higher than map. How is
> this for now?

// Default time in milliseconds for the feed to be reloaded.
GFdynamicFeedControl.DEFAULT_FEED_CYCLE_TIME = 1800000;

=> every 30 minutes
I pushed this down to 5 minutes in Trunk I think & this also exposes
the setting to Sahana:
http://bazaar.launchpad.net/~flavour/sahana-eden/trunk/revision/934

Note that this is all done within the clients, so doesn't add any
extra load to the main server :)

> 3. Not all layer of map will be displayed on HP, 2 would be maximan.

The Map API is fully-configurable :)

F

SahanaTW PL - Hsiaojan

unread,
Aug 5, 2010, 9:00:36 AM8/5/10
to SahanaTWPY
Marr:

we should raise this as an issue in the next meeting and have a plan
to know how much HW resourse ShanaTW will need in the coming months.

Hsiaojan

On 8月5日, 下午8時32分, Fran Boon <francisb...@gmail.com> wrote:
> 2010/8/5 SahanaTW PL - Hsiaojan <hsiaojan....@gmail.com>:

SahanaTW PL - Hsiaojan

unread,
Aug 5, 2010, 9:00:44 AM8/5/10
to SahanaTWPY
Marr:

we should raise this as an issue in the next meeting and have a plan
to know how much HW resourse ShanaTW will need in the coming months.

Hsiaojan

On 8月5日, 下午8時32分, Fran Boon <francisb...@gmail.com> wrote:
> 2010/8/5 SahanaTW PL - Hsiaojan <hsiaojan....@gmail.com>:
Reply all
Reply to author
Forward
0 new messages