/doc/core/z_module_indexer.html

https://code.google.com/p/zotonic/ · HTML · 108 lines · 91 code · 17 blank · 0 comment · 0 complexity · 78a59ba6652a22d00aae97a4f101f3ac MD5 · raw file

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html>
  3. <head>
  4. <title>Module z_module_indexer</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. <h1>Module z_module_indexer</h1>
  11. <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>Implements the module extension mechanisms for scomps, templates, actions etc.
  12. <p>Copyright Š 2009 Marc Worrell
  13. Date: 2009-06-06
  14. </p>
  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. <h2><a name="description">Description</a></h2>Implements the module extension mechanisms for scomps, templates, actions etc. Scans all active modules
  18. for scomps (etc) and maintains lookup lists for when the system tries to find a scomp (etc).
  19. <h2><a name="index">Function Index</a></h2>
  20. <table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#all-2">all/2</a></td><td>Return a list of all templates, scomps etc per module.</td></tr>
  21. <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="#find-3">find/3</a></td><td>Find a scomp, validator etc.</td></tr>
  23. <tr><td valign="top"><a href="#find_all-3">find_all/3</a></td><td>Find a scomp, validator etc.</td></tr>
  24. <tr><td valign="top"><a href="#handle_call-3">handle_call/3</a></td><td>Find a template definition.</td></tr>
  25. <tr><td valign="top"><a href="#handle_cast-2">handle_cast/2</a></td><td>Scan for all scomps etc.</td></tr>
  26. <tr><td valign="top"><a href="#handle_info-2">handle_info/2</a></td><td>Handling all non call/cast messages.</td></tr>
  27. <tr><td valign="top"><a href="#init-1">init/1</a></td><td>Initiates the server.</td></tr>
  28. <tr><td valign="top"><a href="#reindex-1">reindex/1</a></td><td>Reindex the list of all scomps, etc for the site in the context.</td></tr>
  29. <tr><td valign="top"><a href="#start_link-1">start_link/1</a></td><td>Starts the server.</td></tr>
  30. <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
  31. terminate.</td></tr>
  32. <tr><td valign="top"><a href="#translations-1">translations/1</a></td><td>Find all .po files in all modules and the active site.</td></tr>
  33. </table>
  34. <h2><a name="functions">Function Details</a></h2>
  35. <h3 class="function"><a name="all-2">all/2</a></h3>
  36. <div class="spec">
  37. <p><tt>all(What, Context) -&gt; any()</tt></p>
  38. </div><p>Return a list of all templates, scomps etc per module</p>
  39. <h3 class="function"><a name="code_change-3">code_change/3</a></h3>
  40. <div class="spec">
  41. <p><tt>code_change(OldVsn, State, Extra) -&gt; {ok, NewState}</tt></p>
  42. </div><p>Convert process state when code is changed</p>
  43. <h3 class="function"><a name="find-3">find/3</a></h3>
  44. <div class="spec">
  45. <p><tt>find(What, Name, Context) -&gt; {ok, term()} | {error, Reason}</tt></p>
  46. </div><p>Find a scomp, validator etc.</p>
  47. <h3 class="function"><a name="find_all-3">find_all/3</a></h3>
  48. <div class="spec">
  49. <p><tt>find_all(What, Name, Context) -&gt; list()</tt></p>
  50. </div><p>Find a scomp, validator etc.</p>
  51. <h3 class="function"><a name="handle_call-3">handle_call/3</a></h3>
  52. <div class="spec">
  53. <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>
  54. </div><p>Find a template definition</p>
  55. <h3 class="function"><a name="handle_cast-2">handle_cast/2</a></h3>
  56. <div class="spec">
  57. <p><tt>handle_cast(Message::Msg, State) -&gt; {noreply, State} | {noreply, State, Timeout} | {stop, Reason, State}</tt></p>
  58. </div><p>Scan for all scomps etc. for the context given.</p>
  59. <h3 class="function"><a name="handle_info-2">handle_info/2</a></h3>
  60. <div class="spec">
  61. <p><tt>handle_info(Info, State) -&gt; {noreply, State} | {noreply, State, Timeout} | {stop, Reason, State}</tt></p>
  62. </div><p>Handling all non call/cast messages</p>
  63. <h3 class="function"><a name="init-1">init/1</a></h3>
  64. <div class="spec">
  65. <p><tt>init(SiteProps) -&gt; {ok, State} | {ok, State, Timeout} | ignore | {stop, Reason}</tt></p>
  66. </div><p>Initiates the server.</p>
  67. <h3 class="function"><a name="reindex-1">reindex/1</a></h3>
  68. <div class="spec">
  69. <p><tt>reindex(Context) -&gt; any()</tt></p>
  70. </div><p>Reindex the list of all scomps, etc for the site in the context.</p>
  71. <h3 class="function"><a name="start_link-1">start_link/1</a></h3>
  72. <div class="spec">
  73. <p><tt>start_link(SiteProps::Props) -&gt; {ok, Pid} | ignore | {error, Error}</tt></p>
  74. </div><p>Starts the server</p>
  75. <h3 class="function"><a name="terminate-2">terminate/2</a></h3>
  76. <div class="spec">
  77. <p><tt>terminate(Reason, State) -&gt; <a href="#type-void">void()</a></tt></p>
  78. </div><p>This function is called by a gen_server when it is about to
  79. terminate. It should be the opposite of Module:init/1 and do any necessary
  80. cleaning up. When it returns, the gen_server terminates with Reason.
  81. The return value is ignored.</p>
  82. <h3 class="function"><a name="translations-1">translations/1</a></h3>
  83. <div class="spec">
  84. <p><tt>translations(Context::#context{}) -&gt; [{module, {ModuleDirectory, [{Language, File}]}}]</tt></p>
  85. </div><p>Find all .po files in all modules and the active site.
  86. This is an active scan, not designed to be fast.</p>
  87. <hr>
  88. <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>
  89. <p><i>Generated by EDoc, Aug 12 2011, 20:01:39.</i></p>
  90. </body>
  91. </html>