summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel <darthdaniel85@gmail.com>2013-12-08 00:55:07 -0500
committerDaniel <darthdaniel85@gmail.com>2013-12-08 00:55:07 -0500
commite04fb5c765252593fb88fb56eaefbdc88bbeb7d1 (patch)
treedcaa8725486cd33d2813d92543b46323ff99f693
parentf64d3a13f628706bc2f24f420f1e096543bad377 (diff)
QS Doc completed!
-rw-r--r--demos/quickstart/protected/pages/GettingStarted/Wsat.page48
-rw-r--r--demos/quickstart/protected/pages/GettingStarted/wsat_generate_ar.pngbin0 -> 75503 bytes
-rw-r--r--demos/quickstart/protected/pages/GettingStarted/wsat_login.pngbin0 -> 47951 bytes
-rw-r--r--framework/Wsat/TWsatARGenerator.php22
-rw-r--r--framework/Wsat/pages/TWsatGenerateAR.page4
-rw-r--r--framework/Wsat/pages/TWsatGenerateAR.php20
6 files changed, 65 insertions, 29 deletions
diff --git a/demos/quickstart/protected/pages/GettingStarted/Wsat.page b/demos/quickstart/protected/pages/GettingStarted/Wsat.page
index cb821a30..02f07e1d 100644
--- a/demos/quickstart/protected/pages/GettingStarted/Wsat.page
+++ b/demos/quickstart/protected/pages/GettingStarted/Wsat.page
@@ -1,6 +1,15 @@
<com:TContent ID="body">
<h1>Web Site Administration Tool</h1>
- <p class="block-content">Web Site Administration Tool (WSAT) allows you
+ <p class="block-content">
+ Web Site Administration Tool (WSAT) is a development tool which allows you to perform several
+ tedious tasks of a PRADO project in a GUI fashion. Its inspired in both Asp.Net - Web Site Administration Tool and Yii's Gii.
+ WSAT will continue gaining new features along the time, at the moment it bring you the followings:
+
+ <ul>
+ <li>Generate one or all <a href="?page=Database.ActiveRecord">Active Record Classes.</a></li>
+ <li>Optionally generate all relationships in Active Record Classes.</li>
+ <li>Generate the magic __toString() method in all AR Classes.</li>
+ </ul>
</p>
<h2>Requirements</h2>
@@ -18,9 +27,38 @@
<h2>Usage</h2>
<p class="block-content">
- Then you are ready to go to: http://localhost/yoursite/index.php?wsat=TWsatLogin
+ Then you are ready to go to: http://localhost/yoursite/index.php?wsat=TWsatLogin and doing so you should see
+ the following page:
</p>
- <com:TTextHighlighter Language="cli" CssClass="source block-content cli" id="code_70006">
-
- </com:TTextHighlighter>
+ <img src="<%~wsat_login.png%>" style="width: 700px;" />
+ <p class="block-content">
+ Where in the text field you need to type the password previosly specified in the service inclusion. This
+ is part of a basic security system to avoid undesirable persons to use this tool.
+ </p>
+
+ <h2>Active Record classes generation</h2>
+ <p class="block-content">
+ In order to generate AR classes you need to go to: http://localhost/divermania/index.php?wsat=TWsatGenerateAR
+ by clicking the proper links in the welcome page. Then you should see the following page:
+ </p>
+ <img src="<%~wsat_generate_ar.png%>" style="width: 700px;" />
+ <p class="block-content">
+ In which you can find a basic usage documentation in a light green panel
+ and then some proper fields in order to generate active record classes. These fields are:
+ </p>
+
+ <ul>
+ <li><b>Table Name: </b> refers to the table name in your database for which you want to generate an AR class.
+ Let it as come by default with an * to generate them all.</li>
+ <li><b>Output Folder: </b> refers to the folder where you want to save your generated classes.
+ It only accepts namespace format which means that you need to specify your path separated with points in between.
+ It default value is: "Application.App_Data.AR_Classes" which references the protected/App_Data/AR_Classes
+ file of your project, if you haven't created them yet and you want to, don't bother, WSAT will do it for you.</li>
+ <li><b>Class Prefix: </b> refers to the prefix that you whish to specify in front of every class name.
+ Clear the field to specify no prefix.</li>
+ <li><b>Class Suffix: </b> refers to the suffix that you whish to specify at the end of every class name.
+ Clear the field to specify no suffix.</li>
+ <li><b>Build Relations: </b> whether or not you want to add relationships to AR classes generation.</li>
+ </ul>
+
</com:TContent>
diff --git a/demos/quickstart/protected/pages/GettingStarted/wsat_generate_ar.png b/demos/quickstart/protected/pages/GettingStarted/wsat_generate_ar.png
new file mode 100644
index 00000000..8f0f59e7
--- /dev/null
+++ b/demos/quickstart/protected/pages/GettingStarted/wsat_generate_ar.png
Binary files differ
diff --git a/demos/quickstart/protected/pages/GettingStarted/wsat_login.png b/demos/quickstart/protected/pages/GettingStarted/wsat_login.png
new file mode 100644
index 00000000..dbe1ad8b
--- /dev/null
+++ b/demos/quickstart/protected/pages/GettingStarted/wsat_login.png
Binary files differ
diff --git a/framework/Wsat/TWsatARGenerator.php b/framework/Wsat/TWsatARGenerator.php
index d5b87a4f..2d4aeb12 100644
--- a/framework/Wsat/TWsatARGenerator.php
+++ b/framework/Wsat/TWsatARGenerator.php
@@ -27,17 +27,17 @@ class TWsatARGenerator
/**
* Output folder where AR classes will be generated.
*/
- private $_op_file;
+ private $_opFile;
/**
* Class name prefix
*/
- private $_clas_prefix;
+ private $_clasPrefix;
/**
* Class name sufix
*/
- private $_class_sufix;
+ private $_classSufix;
/**
* all table relations array
@@ -48,7 +48,7 @@ class TWsatARGenerator
* unquote chars
* @var array
*/
- private $uq_chars = array('[', ']', '"', '`', "'");
+ private $uqChars = array('[', ']', '"', '`', "'");
function __construct()
{
@@ -77,17 +77,17 @@ class TWsatARGenerator
throw new Exception("You need to fix your output folder namespace.");
if (!is_dir($op_file))
mkdir($op_file, 0777, true);
- $this->_op_file = $op_file;
+ $this->_opFile = $op_file;
}
public function setClasPrefix($_clas_prefix)
{
- $this->_clas_prefix = $_clas_prefix;
+ $this->_clasPrefix = $_clas_prefix;
}
public function setClassSufix($_clas_sufix)
{
- $this->_class_sufix = $_clas_sufix;
+ $this->_classSufix = $_clas_sufix;
}
//-----------------------------------------------------------------------------
@@ -185,7 +185,7 @@ class TWsatARGenerator
$clasName = $this->_getProperClassName($tableName);
$class = $this->generateClass($properties, $tableName, $clasName, $toString);
- $output = $this->_op_file . DIRECTORY_SEPARATOR . $clasName . ".php";
+ $output = $this->_opFile . DIRECTORY_SEPARATOR . $clasName . ".php";
file_put_contents($output, $class);
}
@@ -204,7 +204,7 @@ class TWsatARGenerator
{
$table_name_words = str_replace("_", " ", strtolower($tableName));
$final_conversion = str_replace(" ", "", ucwords($table_name_words));
- return $this->_clas_prefix . $final_conversion . $this->_class_sufix;
+ return $this->_clasPrefix . $final_conversion . $this->_classSufix;
}
public function renderAllTablesInformation()
@@ -258,10 +258,10 @@ class TWsatARGenerator
foreach ($tableInfo->getColumns() as $column)
{
if (isset($column->IsPrimaryKey) && $column->IsPrimaryKey)
- $property = str_replace($this->uq_chars, "", $column->ColumnName);
+ $property = str_replace($this->uqChars, "", $column->ColumnName);
elseif ($column->PHPType == "string" && $column->DBType != "date")
{
- $property = str_replace($this->uq_chars, "", $column->ColumnName);
+ $property = str_replace($this->uqChars, "", $column->ColumnName);
break;
}
}
diff --git a/framework/Wsat/pages/TWsatGenerateAR.page b/framework/Wsat/pages/TWsatGenerateAR.page
index b1cd98aa..926d6b0f 100644
--- a/framework/Wsat/pages/TWsatGenerateAR.page
+++ b/framework/Wsat/pages/TWsatGenerateAR.page
@@ -33,8 +33,8 @@
</div>
<div class="form_row">
- <com:TLabel Text="Class Sufix:" ForControl="class_sufix" style="margin-right: 27px"/>
- <com:TTextBox ID="class_sufix" CssClass="in_text" />
+ <com:TLabel Text="Class Suffix:" ForControl="class_suffix" style="margin-right: 27px"/>
+ <com:TTextBox ID="class_suffix" CssClass="in_text" />
</div>
<div class="form_row">
diff --git a/framework/Wsat/pages/TWsatGenerateAR.php b/framework/Wsat/pages/TWsatGenerateAR.php
index c9584038..2c85445d 100644
--- a/framework/Wsat/pages/TWsatGenerateAR.php
+++ b/framework/Wsat/pages/TWsatGenerateAR.php
@@ -18,23 +18,23 @@ class TWsatGenerateAR extends TPage
{
if ($this->IsValid)
{
- $table_name = $this->table_name->Text;
- $output_folder_ns = $this->output_folder->Text;
- $class_prefix = $this->class_prefix->Text;
- $class_sufix = $this->class_sufix->Text;
+ $tableName = $this->table_name->Text;
+ $outputFolderNs = $this->output_folder->Text;
+ $classPrefix = $this->class_prefix->Text;
+ $classSuffix = $this->class_suffix->Text;
try
{
$ar_generator = new TWsatARGenerator();
- $ar_generator->setOpFile($output_folder_ns);
- $ar_generator->setClasPrefix($class_prefix);
- $ar_generator->setClassSufix($class_sufix);
+ $ar_generator->setOpFile($outputFolderNs);
+ $ar_generator->setClasPrefix($classPrefix);
+ $ar_generator->setClassSufix($classSuffix);
if ($this->build_rel->Checked)
$ar_generator->buildRelations();
- if ($table_name != "*")
- $ar_generator->generate($table_name);
+ if ($tableName != "*")
+ $ar_generator->generate($tableName);
else
$ar_generator->generateAll();
@@ -51,8 +51,6 @@ class TWsatGenerateAR extends TPage
public function preview($sender)
{
-// $ar_generator = new TWsatARGenerator();
-// $ar_generator->renderAllTablesInformation();
throw new THttpException(500, "Not implemented yet.");
}