summaryrefslogtreecommitdiff
path: root/framework/Wsat/pages
diff options
context:
space:
mode:
authorDaniel <darthdaniel85@gmail.com>2013-11-25 12:49:07 -0500
committerDaniel <darthdaniel85@gmail.com>2013-11-25 12:49:07 -0500
commit227ef973f923ec201a1ece197f6242b3248c66ae (patch)
tree9eae95c47d7ac19a15d1f61f19d417e354b943c0 /framework/Wsat/pages
parentefde949d00b808f55710abbd3d82ceb490545116 (diff)
WSAT beta release with doc.
Diffstat (limited to 'framework/Wsat/pages')
-rw-r--r--framework/Wsat/pages/TWsatGenerateAR.page47
-rw-r--r--framework/Wsat/pages/TWsatGenerateAR.php22
-rw-r--r--framework/Wsat/pages/TWsatHome.page16
-rw-r--r--framework/Wsat/pages/TWsatHome.php33
-rw-r--r--framework/Wsat/pages/TWsatLogin.page8
-rw-r--r--framework/Wsat/pages/TWsatLogin.php11
-rw-r--r--framework/Wsat/pages/TWsatScaffolding.php33
7 files changed, 113 insertions, 57 deletions
diff --git a/framework/Wsat/pages/TWsatGenerateAR.page b/framework/Wsat/pages/TWsatGenerateAR.page
index acd456fd..b1cd98aa 100644
--- a/framework/Wsat/pages/TWsatGenerateAR.page
+++ b/framework/Wsat/pages/TWsatGenerateAR.page
@@ -1,33 +1,56 @@
<com:TContent ID="Content">
- <div style="margin-left: 220px; font-size: 14px">
+ <div style="margin: 10px; font-size: 16px; font-weight: bold">Active Record Classes Generator</div>
+ <div class="green_panel" style="text-align: left; font-size: 14px; margin: 15px 5px">
+ <label>This generator generates an AR class for the specified database table.</label><br/>
+ <label>Fields with <b style="color: red">*</b> are required.</label>
+ <hr/>
+ <div style="font-size: 12px; font-style: italic">
+ <ul>
+ <li>If you want to generate all AR Classes, keep the "Table Name" field as appears by default.</li>
+ <li>"Output Folder" field refers to the directory that the new AR class file should be generated under... where Application refers to the protected folder of your project. You can let this default field value and PRADO will create the proper folders for you.</li>
+ </ul>
+ </div>
+ </div>
+
+ <div style="font-size: 14px">
<div class="form_row">
- <com:TLabel Text="Table Name:" ForControl="table_name" style="margin-right: 24px" />
- <com:TTextBox ID="table_name" Text="*" CssClass="in_text" />
- <com:TRequiredFieldValidator ControlToValidate="table_name" Text="Table name cannot be blank." Display="Dynamic" />
+ <com:TLabel Text="Table Name:" ForControl="table_name" style="margin-right: 24px" />
+ <com:TTextBox ID="table_name" Text="*" CssClass="in_text" />
+ <label style="color: red">*</label>
+ <com:TRequiredFieldValidator ControlToValidate="table_name" Text="Table name cannot be blank." Display="Dynamic" />
</div>
+
+ <div class="form_row">
+ <com:TLabel Text="Output Folder:" ForControl="output_folder" style="margin-right: 8px"/>
+ <com:TTextBox ID="output_folder" Text="Application.App_Data.AR_Classes" CssClass="in_text" />
+ <label style="color: red">*</label>
+ <com:TRequiredFieldValidator ControlToValidate="output_folder" Text="Output folder cannot be blank." Display="Dynamic" />
+ </div>
+
<div class="form_row">
<com:TLabel Text="Class Prefix:" ForControl="class_prefix" style="margin-right: 25px"/>
<com:TTextBox ID="class_prefix" Text="AR_" CssClass="in_text" />
</div>
+
<div class="form_row">
- <com:TLabel Text="Output Folder:" ForControl="output_folder" style="margin-right: 8px"/>
- <com:TTextBox ID="output_folder" Text="Application.App_Data.AR_Classes" CssClass="in_text" />
+ <com:TLabel Text="Class Sufix:" ForControl="class_sufix" style="margin-right: 27px"/>
+ <com:TTextBox ID="class_sufix" CssClass="in_text" />
</div>
-
+
<div class="form_row">
<com:TLabel Text="Build Relations:" ForControl="build_rel"/>
<com:TCheckBox ID="build_rel" Checked="true" />
</div>
-
- <com:TPanel ID="success_panel" Visible="false">
- <com:TLabel ID="generation_msg" />
+
+ <com:TPanel ID="feedback_panel" Visible="false" style="width: 400px">
+ <com:TLabel ID="generation_msg" />
</com:TPanel>
<br/>
- <div style="text-align: center">
+ <div style="text-align: center; width: 400px">
<com:TButton Text="Preview" OnClick="preview" Visible="false" />
<com:TButton Text="Generate" OnClick="generate" />
</div>
</div>
-
+
</com:TContent>
diff --git a/framework/Wsat/pages/TWsatGenerateAR.php b/framework/Wsat/pages/TWsatGenerateAR.php
index 3d4291e2..d5934686 100644
--- a/framework/Wsat/pages/TWsatGenerateAR.php
+++ b/framework/Wsat/pages/TWsatGenerateAR.php
@@ -1,9 +1,13 @@
<?php
/**
- * Description of Inicio
- *
- * @author daniels
+ * @author Daniel Sampedro Bello <darthdaniel85@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @version $Id$
+ * @since 3.3
+ * @package Wsat.pages
*/
Prado::using("System.Wsat.TWsatARGenerator");
@@ -12,13 +16,15 @@ class TWsatGenerateAR extends TPage {
public function generate($sender) {
if ($this->IsValid) {
$table_name = $this->table_name->Text;
- $class_prefix = $this->class_prefix->Text;
$output_folder_ns = $this->output_folder->Text;
+ $class_prefix = $this->class_prefix->Text;
+ $class_sufix = $this->class_sufix->Text;
try {
$ar_generator = new TWsatARGenerator();
$ar_generator->setOpFile($output_folder_ns);
$ar_generator->setClasPrefix($class_prefix);
+ $ar_generator->setClassSufix($class_sufix);
if ($this->build_rel->Checked) {
$ar_generator->buildRelations();
@@ -28,20 +34,20 @@ class TWsatGenerateAR extends TPage {
} else {
$ar_generator->generateAll();
}
- $this->success_panel->CssClass = "success_panel";
+ $this->feedback_panel->CssClass = "green_panel";
$this->generation_msg->Text = "The code has been generated successfully.";
} catch (Exception $ex) {
- $this->success_panel->CssClass = "exception_panel";
+ $this->feedback_panel->CssClass = "red_panel";
$this->generation_msg->Text = $ex->getMessage();
}
- $this->success_panel->Visible = true;
+ $this->feedback_panel->Visible = true;
}
}
public function preview($sender) {
// $ar_generator = new TWsatARGenerator();
// $ar_generator->renderAllTablesInformation();
- throw new THttpException(500, "Not implemented yet.");
+ throw new THttpException(500, "Not implemented yet.");
}
}
diff --git a/framework/Wsat/pages/TWsatHome.page b/framework/Wsat/pages/TWsatHome.page
index 16aa3669..e8796ccd 100644
--- a/framework/Wsat/pages/TWsatHome.page
+++ b/framework/Wsat/pages/TWsatHome.page
@@ -1,5 +1,17 @@
<com:TContent ID="Content">
- <label style="font-size: 18px; font-weight: bold">Welcome to Web Site Administration Tool</label>
-
+ <label style="font-size: 18px; font-weight: bold">Welcome to the Web Site Administration Tool</label>
+
<div style="margin-top: 25px"><b>Application Dir:</b> <%= Prado::getPathOfNamespace('Application') %></div>
+
+ <br/>
+ <table>
+ <tr style="background-color: #cccccc">
+ <td style="padding: 5px; width: 100px">
+ <com:THyperLink NavigateUrl="<%= $this->Service->constructUrl('TWsatGenerateAR') %>" Text="AR Classes" />
+ </td>
+ <td style="padding: 5px">
+ Enables you to generate all Active Record Classes with relations included.
+ </td>
+ </tr>
+ </table>
</com:TContent>
diff --git a/framework/Wsat/pages/TWsatHome.php b/framework/Wsat/pages/TWsatHome.php
index 3c1358e1..035dd7c6 100644
--- a/framework/Wsat/pages/TWsatHome.php
+++ b/framework/Wsat/pages/TWsatHome.php
@@ -1,15 +1,20 @@
-<?php
-
-/**
- * Description of Inicio
- *
- * @author daniels
- */
-Prado::using("System.Wsat.TWsatARGenerator");
-
-class TWsatHome extends TPage {
-
-
-}
-
+<?php
+
+/**
+ * @author Daniel Sampedro Bello <darthdaniel85@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @version $Id$
+ * @since 3.3
+ * @package Wsat.pages
+ */
+
+Prado::using("System.Wsat.TWsatARGenerator");
+
+class TWsatHome extends TPage {
+
+
+}
+
?> \ No newline at end of file
diff --git a/framework/Wsat/pages/TWsatLogin.page b/framework/Wsat/pages/TWsatLogin.page
index d0a94f2a..79578f59 100644
--- a/framework/Wsat/pages/TWsatLogin.page
+++ b/framework/Wsat/pages/TWsatLogin.page
@@ -29,10 +29,10 @@
<div class="login_form">
<com:TLabel Text="Please enter your password:" ForControl="password"/><br/>
<com:TTextBox ID="password" TextMode="Password" style="margin: 5px" /><br/>
- <com:TRequiredFieldValidator ControlToValidate="password" ValidationGroup="loginGroup" Text="Password cannot be blank." /><br/>
- <com:TCustomValidator ControlToValidate="password" ValidationGroup="loginGroup" OnServerValidate="validatePassword" Text="Incorrect password." />
-
- <com:TButton Text="Enter" ValidationGroup="loginGroup" OnClick="login" />
+ <com:TRequiredFieldValidator ControlToValidate="password" ValidationGroup="loginGroup" Text="Password cannot be blank." Display="Dynamic" /><br/>
+ <com:TCustomValidator ControlToValidate="password" ValidationGroup="loginGroup" OnServerValidate="validatePassword" Text="Incorrect password." Display="Dynamic" />
+
+ <div><com:TButton Text="Enter" ValidationGroup="loginGroup" OnClick="login" /></div>
</div>
<div id="footer">
diff --git a/framework/Wsat/pages/TWsatLogin.php b/framework/Wsat/pages/TWsatLogin.php
index 0bbdc53f..7c4570af 100644
--- a/framework/Wsat/pages/TWsatLogin.php
+++ b/framework/Wsat/pages/TWsatLogin.php
@@ -1,10 +1,15 @@
<?php
/**
- * Description of Inicio
- *
- * @author daniels
+ * @author Daniel Sampedro Bello <darthdaniel85@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @version $Id$
+ * @since 3.3
+ * @package Wsat.pages
*/
+
class TWsatLogin extends TPage {
public function login() {
diff --git a/framework/Wsat/pages/TWsatScaffolding.php b/framework/Wsat/pages/TWsatScaffolding.php
index afa00273..2fc036ad 100644
--- a/framework/Wsat/pages/TWsatScaffolding.php
+++ b/framework/Wsat/pages/TWsatScaffolding.php
@@ -1,15 +1,20 @@
-<?php
-
-/**
- * Description of Inicio
- *
- * @author daniels
- */
-Prado::using("System.Wsat.TWsatARGenerator");
-
-class TWsatScaffolding extends TPage {
-
-
-}
-
+<?php
+
+/**
+ * @author Daniel Sampedro Bello <darthdaniel85@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @version $Id$
+ * @since 3.3
+ * @package Wsat.pages
+ */
+
+Prado::using("System.Wsat.TWsatARGenerator");
+
+class TWsatScaffolding extends TPage {
+
+
+}
+
?> \ No newline at end of file