PageRenderTime 32ms CodeModel.GetById 12ms app.highlight 14ms RepoModel.GetById 1ms app.codeStats 0ms

/doc/core/z_sites_manager.html

https://code.google.com/p/zotonic/
HTML | 143 lines | 120 code | 23 blank | 0 comment | 0 complexity | 6724a52f5fde48fed80f6ebd457ade92 MD5 | raw file
  1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2<html>
  3<head>
  4<title>Module z_sites_manager</title>
  5<link rel="stylesheet" type="text/css" href="stylesheet.css" title="EDoc">
  6</head>
  7<body bgcolor="white">
  8<div class="navbar"><a name="#navbar_top"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div>
  9<hr>
 10
 11<h1>Module z_sites_manager</h1>
 12<ul class="index"><li><a href="#description">Description</a></li><li><a href="#index">Function Index</a></li><li><a href="#functions">Function Details</a></li></ul>Server managing all sites running inside Zotonic.
 13<p>Copyright Š 2009-2010 Marc Worrell</p>
 14
 15<p><b>Behaviours:</b> <a href="gen_server.html"><tt>gen_server</tt></a>.</p>
 16<p><b>Authors:</b> Marc Worrell (<a href="mailto:marc@worrell.nl"><tt>marc@worrell.nl</tt></a>).</p>
 17
 18<h2><a name="description">Description</a></h2>Server managing all sites running inside Zotonic.  Starts the sites
 19  according to the config files in the sites subdirectories.
 20<h2><a name="index">Function Index</a></h2>
 21<table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#code_change-3">code_change/3</a></td><td>Convert process state when code is changed.</td></tr>
 22<tr><td valign="top"><a href="#get_fallback_site-0">get_fallback_site/0</a></td><td>Return the name of the site to handle unknown Host requests.</td></tr>
 23<tr><td valign="top"><a href="#get_site_config-1">get_site_config/1</a></td><td>Fetch the configuration of a specific site.</td></tr>
 24<tr><td valign="top"><a href="#get_site_contexts-0">get_site_contexts/0</a></td><td>Return a list of contexts initialized for all active sites.</td></tr>
 25<tr><td valign="top"><a href="#get_sites-0">get_sites/0</a></td><td>Return a list of active site names.</td></tr>
 26<tr><td valign="top"><a href="#get_sites_all-0">get_sites_all/0</a></td><td>Return a list of all site names.</td></tr>
 27<tr><td valign="top"><a href="#get_sites_status-0">get_sites_status/0</a></td><td>Return a list of all sites and their status.</td></tr>
 28<tr><td valign="top"><a href="#handle_call-3">handle_call/3</a></td><td>Return the active sites.</td></tr>
 29<tr><td valign="top"><a href="#handle_cast-2">handle_cast/2</a></td><td>Sync known sites with loaded sites.</td></tr>
 30<tr><td valign="top"><a href="#handle_info-2">handle_info/2</a></td><td>Handling all non call/cast messages.</td></tr>
 31<tr><td valign="top"><a href="#init-1">init/1</a></td><td>Initiates the server.</td></tr>
 32<tr><td valign="top"><a href="#restart-1">restart/1</a></td><td>Restart a site.</td></tr>
 33<tr><td valign="top"><a href="#start-1">start/1</a></td><td>Start a site.</td></tr>
 34<tr><td valign="top"><a href="#start_link-0">start_link/0</a></td><td>Starts the server.</td></tr>
 35<tr><td valign="top"><a href="#stop-1">stop/1</a></td><td>Stop a site.</td></tr>
 36<tr><td valign="top"><a href="#terminate-2">terminate/2</a></td><td>This function is called by a gen_server when it is about to
 37  terminate.</td></tr>
 38<tr><td valign="top"><a href="#update_dispatchinfo-0">update_dispatchinfo/0</a></td><td>Update the webmachine dispatch information.</td></tr>
 39<tr><td valign="top"><a href="#upgrade-0">upgrade/0</a></td><td>Sync the supervised sites with the sites in the sites directory.</td></tr>
 40</table>
 41
 42<h2><a name="functions">Function Details</a></h2>
 43
 44<h3 class="function"><a name="code_change-3">code_change/3</a></h3>
 45<div class="spec">
 46<p><tt>code_change(OldVsn, State, Extra) -&gt; {ok, NewState}</tt></p>
 47</div><p>Convert process state when code is changed</p>
 48
 49<h3 class="function"><a name="get_fallback_site-0">get_fallback_site/0</a></h3>
 50<div class="spec">
 51<p><tt>get_fallback_site() -&gt; atom() | undefined</tt></p>
 52</div><p>Return the name of the site to handle unknown Host requests</p>
 53
 54<h3 class="function"><a name="get_site_config-1">get_site_config/1</a></h3>
 55<div class="spec">
 56<p><tt>get_site_config(Site::atom()) -&gt; SiteProps::list() | {error, Reason}</tt></p>
 57</div><p>Fetch the configuration of a specific site.</p>
 58
 59<h3 class="function"><a name="get_site_contexts-0">get_site_contexts/0</a></h3>
 60<div class="spec">
 61<p><tt>get_site_contexts() -&gt; [Context]</tt></p>
 62</div><p>Return a list of contexts initialized for all active sites.</p>
 63
 64<h3 class="function"><a name="get_sites-0">get_sites/0</a></h3>
 65<div class="spec">
 66<p><tt>get_sites() -&gt; [atom()]</tt></p>
 67</div><p>Return a list of active site names.</p>
 68
 69<h3 class="function"><a name="get_sites_all-0">get_sites_all/0</a></h3>
 70<div class="spec">
 71<p><tt>get_sites_all() -&gt; [atom()]</tt></p>
 72</div><p>Return a list of all site names.</p>
 73
 74<h3 class="function"><a name="get_sites_status-0">get_sites_status/0</a></h3>
 75<div class="spec">
 76<p><tt>get_sites_status() -&gt; PropList</tt></p>
 77</div><p>Return a list of all sites and their status.</p>
 78
 79<h3 class="function"><a name="handle_call-3">handle_call/3</a></h3>
 80<div class="spec">
 81<p><tt>handle_call(Message::Request, From, State) -&gt; {reply, Reply, State} | {reply, Reply, State, Timeout} | {noreply, State} | {noreply, State, Timeout} | {stop, Reason, Reply, State} | {stop, Reason, State}</tt></p>
 82</div><p>Return the active sites</p>
 83
 84<h3 class="function"><a name="handle_cast-2">handle_cast/2</a></h3>
 85<div class="spec">
 86<p><tt>handle_cast(Message::Msg, State) -&gt; {noreply, State} | {noreply, State, Timeout} | {stop, Reason, State}</tt></p>
 87</div><p>Sync known sites with loaded sites</p>
 88
 89<h3 class="function"><a name="handle_info-2">handle_info/2</a></h3>
 90<div class="spec">
 91<p><tt>handle_info(Info, State) -&gt; {noreply, State} | {noreply, State, Timeout} | {stop, Reason, State}</tt></p>
 92</div><p>Handling all non call/cast messages</p>
 93
 94<h3 class="function"><a name="init-1">init/1</a></h3>
 95<div class="spec">
 96<p><tt>init(X1::Args) -&gt; {ok, State} | {ok, State, Timeout} | ignore | {stop, Reason}</tt></p>
 97</div><p>Initiates the server.</p>
 98
 99<h3 class="function"><a name="restart-1">restart/1</a></h3>
100<div class="spec">
101<p><tt>restart(Site) -&gt; any()</tt></p>
102</div><p>Restart a site.</p>
103
104<h3 class="function"><a name="start-1">start/1</a></h3>
105<div class="spec">
106<p><tt>start(Site) -&gt; any()</tt></p>
107</div><p>Start a site.</p>
108
109<h3 class="function"><a name="start_link-0">start_link/0</a></h3>
110<div class="spec">
111<p><tt>start_link() -&gt; {ok, Pid} | ignore | {error, Error}</tt></p>
112</div><p>Starts the server</p>
113
114<h3 class="function"><a name="stop-1">stop/1</a></h3>
115<div class="spec">
116<p><tt>stop(Site) -&gt; any()</tt></p>
117</div><p>Stop a site.</p>
118
119<h3 class="function"><a name="terminate-2">terminate/2</a></h3>
120<div class="spec">
121<p><tt>terminate(Reason, State) -&gt; <a href="#type-void">void()</a></tt></p>
122</div><p>This function is called by a gen_server when it is about to
123  terminate. It should be the opposite of Module:init/1 and do any necessary
124  cleaning up. When it returns, the gen_server terminates with Reason.
125  The return value is ignored.</p>
126
127<h3 class="function"><a name="update_dispatchinfo-0">update_dispatchinfo/0</a></h3>
128<div class="spec">
129<p><tt>update_dispatchinfo() -&gt; any()</tt></p>
130</div><p>Update the webmachine dispatch information. Collects dispatch information from all sites and sends it
131  to webmachine for updating its dispatch lists and host information.</p>
132
133<h3 class="function"><a name="upgrade-0">upgrade/0</a></h3>
134<div class="spec">
135<p><tt>upgrade() -&gt; any()</tt></p>
136</div><p>Sync the supervised sites with the sites in the sites directory.
137  Removes and stops deleted sites, adds (but does not start) new sites.</p>
138<hr>
139
140<div class="navbar"><a name="#navbar_bottom"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div>
141<p><i>Generated by EDoc, Aug 12 2011, 20:01:39.</i></p>
142</body>
143</html>