diff options
Diffstat (limited to 'demos/quickstart/protected/pages')
-rw-r--r--[-rwxr-xr-x] | demos/quickstart/protected/pages/GettingStarted/CommandLine.page | 30 | ||||
-rw-r--r-- | demos/quickstart/protected/pages/GettingStarted/Wsat.page | 64 | ||||
-rw-r--r-- | demos/quickstart/protected/pages/GettingStarted/wsat_generate_ar.png | bin | 0 -> 75503 bytes | |||
-rw-r--r-- | demos/quickstart/protected/pages/GettingStarted/wsat_login.png | bin | 0 -> 47951 bytes |
4 files changed, 94 insertions, 0 deletions
diff --git a/demos/quickstart/protected/pages/GettingStarted/CommandLine.page b/demos/quickstart/protected/pages/GettingStarted/CommandLine.page index 5f5dacb9..bc8f2f55 100755..100644 --- a/demos/quickstart/protected/pages/GettingStarted/CommandLine.page +++ b/demos/quickstart/protected/pages/GettingStarted/CommandLine.page @@ -103,4 +103,34 @@ PostRecord#1 )
</com:TTextHighlighter>
</p>
+
+<h2>Creating Active Record Classes</h2>
+<p>
+In the blog demo project, we need to create two <a href="?page=Database.ActiveRecord">Active Record</a> classes, <tt>UserRecord</tt> and <tt>PostRecord</tt>, to represent data records in the <tt>users</tt> and <tt>posts</tt> tables, respectively. Active Record classes must extend from the base class <tt>ActiveRecord</tt>, and must define property names that matches with the field names of the corresponding table.
+</p>
+
+<p>
+To better organize our directories, we create a new directory <tt>protected/database</tt> to hold the class files. We also modify our application configuration by inserting the following lines. It is equivalent to adding the directory <tt>protected/database</tt> to PHP include_path, which allows us to use the classes without explicitly including them.
+</p>
+
+<com:TTextHighlighter CssClass="source" Language="xml">
+<paths>
+ <using namespace="Application.database.*" />
+</paths>
+</com:TTextHighlighter>
+
+<p>
+At the prompt, enter the following two commands to create <tt>UserRecord</tt> and <tt>PostRecord</tt> classes:
+</p>
+
+<com:TTextHighlighter CssClass="source cli" Language="text">
+>> generate users Application.database.UserRecord
+
+>> generate posts Application.database.PostRecord
+</com:TTextHighlighter>
+
+<p>
+Here we used the <a href="?page=Fundamentals.Components">namespace format</a> again to specify the classes to be created. The path <tt>Application.database.UserRecord</tt> indicates that we want the <tt>UserRecord</tt> class file to be <tt>protected/database/UserRecord.php</tt>.
+</p>
+
</com:TContent>
diff --git a/demos/quickstart/protected/pages/GettingStarted/Wsat.page b/demos/quickstart/protected/pages/GettingStarted/Wsat.page new file mode 100644 index 00000000..3d07e6f2 --- /dev/null +++ b/demos/quickstart/protected/pages/GettingStarted/Wsat.page @@ -0,0 +1,64 @@ +<com:TContent ID="body"> + <h1>Web Site Administration Tool</h1> + <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> + <p class="block-content"> + To use WSAT, you need to add in your project configuration file: <tt>application.xml</tt>, + in the services section the wsat service like follows: + +<com:TTextHighlighter CssClass="source" Language="xml"> +<services> + ... + <service id="wsat" class="System.Wsat.TWsatService" Password="my_secret_password" /> +</services> +</com:TTextHighlighter> + </p> + + <h2>Usage</h2> + <p class="block-content"> + Then you are ready to go to: http://localhost/yoursite/index.php?wsat=TWsatLogin and doing so you should see + the following page: + </p> + <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>
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/GettingStarted/wsat_generate_ar.png b/demos/quickstart/protected/pages/GettingStarted/wsat_generate_ar.png Binary files differnew file mode 100644 index 00000000..8f0f59e7 --- /dev/null +++ b/demos/quickstart/protected/pages/GettingStarted/wsat_generate_ar.png diff --git a/demos/quickstart/protected/pages/GettingStarted/wsat_login.png b/demos/quickstart/protected/pages/GettingStarted/wsat_login.png Binary files differnew file mode 100644 index 00000000..dbe1ad8b --- /dev/null +++ b/demos/quickstart/protected/pages/GettingStarted/wsat_login.png |