| <?php |
| |
| require_once $_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/app.class.php"; |
| require_once $_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/nav.class.php"; |
| require_once $_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/menu.class.php"; |
| $App = new App(); |
| $Nav = new Nav(); |
| $Menu = new Menu(); |
| include($App->getProjectCommon()); |
| |
| $pageTitle = "Auto-Reminder Tool"; |
| $pageKeywords = ""; |
| $pageAuthor = "Mario Parra Virgen 22/02/06"; |
| |
| ob_start(); |
| ?> |
| <style type="text/css"> |
| .code { font-family: Courier New; } |
| .codeblue { color: #0000FF; font-family: Courier New; } |
| .codeblock { font-family: Courier New; border: 1px dashed black; padding: 2px; background-color: ivory; } |
| .codesample { font-family: Courier New; border: 1px dashed black; padding: 2px; background-color: #ACC6FF; } |
| .coderesult { border: 1px dashed black; padding: 2px; } |
| </style> |
| <div id="maincontent"> |
| <div id="midcolumn"> |
| <h1><?= $pageTitle ?></h1> |
| |
| |
| <p><b>Auto-Reminder Tool Externals </b></p> |
| <p>The auto-reminder is an automatic tool that helps to ensure the up-to-date information described inside the project-info files of each project. This tool runs on a cron-job that executes the auto-reminder at least every quarter.</p> |
| <p>When the auto-reminder routine is executed, it looks for the <span class="codeblue">"rules"</span> directory. This location contains all the rules that the routine will be verifying during its execution. The current rules that the auto-reminder tool will be verifying are described in the following paragraphs:</p> |
| <ul> |
| <li>Dates file rule: This rule verifies if the project still uses the <span class="codeblue">"dates.txt"</span> file to store information about the current project.</li> |
| <li>Project page paragraph file rule: This rule verifies if the project still uses the <span class="codeblue">"project-page-paragraph"</span> file inside the project's root directory instead of the project-info directory of the current project.</li> |
| <li>Releases rule: This rule verifies the time line of each project release, and check for the releases that are not up-to-date at the time the tool was executed.</li> |
| <li>Summary paragraph rule: The summary paragraph of each project has to be updated at least every quarter, this rule verifies if that clause is been achieved on every project.</li> |
| </ul> |
| <p>Creating a rule</p> |
| <p>Adding rules to the auto-reminder is a pretty simple process. How ever there are some |
| specific points that must be covered in order to make the new rule work properly, please |
| read the <a href='README_FIRST.php'>README FIRST</a> document before |
| adding/removing/modifying rules.</p> |
| |
| <p>The first step when creating a new rule is create the php class inside the <span class="codeblue">"rules"</span> |
| directory, let's suppouse our rule will verify if the project-info file has all the |
| required fields filled. The class file will be something like:</p> |
| <pre class="codeblock"> www/projects/common/rules/project_info_required_fields_rule.class.php</pre> |
| <p>Next step is writting the code for the rule, as we can see our file is a PHP class, so |
| it has to start with someting like:</p> |
| <pre class="codeblock"> |
| class project_info_required_fields_rule { |
| |
| .... |
| } |
| </pre> |
| <p>Then we need a constructor, which can be empty:</p> |
| <pre class="codeblock"> |
| function project_info_required_fields_rule(){ |
| |
| .... |
| } |
| </pre> |
| <p>Next step is very important, every rule class file MUST contain a standard "process |
| function" which will be the main routine that will execute first. This special function |
| must receive only 2 parameters, the old and new project-info-objects, no matter if the |
| rule uses both or not: |
| <pre class="codeblock"> |
| function process($old_object, $new_object){ |
| |
| .... |
| } |
| </pre> |
| <p>These two special parameters are project-info-object objects, an abstract of the |
| project-info object to add the capability of the object to be serialized, therefor they |
| ca be used to obtain project's information as follows:</p> |
| <pre class="codeblock"> |
| $project_name = $old_object->getName(); |
| |
| or |
| |
| $old_releases = $old_object->getNumReleases(); |
| </pre> |
| <p>Another special consideration of the process function is the return value, this has to |
| be an string with a message describing a suggestion action for the project lead(s) if the |
| rule fails, otherwise the return message has to be an empty string "" or NULL.</p> |
| <pre class="codeblock" style="margin: 0 -50px 0 0; "> |
| $result = "\n - Please fill all the required fields of your project-info"; |
| |
| .... |
| |
| return $result; |
| </pre> |
| <p>Additional functions can be added to any rule class file.</p> |
| |
| <p> </p> |
| <h2><b>Auto-Reminder Tool Internals</b></h2> |
| <p>The auto-reminder tool has a special location where all the rules are stored, those rule files must be php classes, so the main routine can make an instance object of each class and execute the rule. </p> |
| <p>The dynamic capability of add/remove/modify rules without getting into the tool code is another feature. All the rules are located inside one special directory called <span class="codeblue">"rules"</span>, all the files that end with <span class="codeblue">".class.php"</span> inside that location will be interpreted as rules that the auto-reminder tool will verify on the next ride. (see <a href='README_FIRST.php'>README FIRST</a>)</p> |
| <p>Every rule will return the error message to send if the verification fails, otherwise it will return "" or NULL. So, once every rule was executed the main routine will have all the error messages that the rules returned, then it will fetch for the project lead(s) information and send an email with the proper messages to each project lead of the current project. If no rule returned an error message, then no email is send to the project lead(s). </p> |
| |
| <br/><br/><br/> |
| </div> |
| </div> |
| <?php |
| # Paste your HTML content between the EOHTML markers! |
| $html = ob_get_contents(); |
| ob_end_clean(); |
| |
| # Generate the web page |
| $App->generatePage($theme, $Menu, $Nav, $pageAuthor, $pageKeywords, $pageTitle, $html); |
| ?> |