| Sign In |
| Home | Posts | Entry 6 | |||
generate restful scaffolding with code stylist for win/mac/lin |
|||
|
Posted February 25th, 2007 by brian Code Stylist is a graphical development utility which can generate model, view and controller code for Web-database applications. The program is designed to work with the dbscript open source framework, which combines REST-style Web services with content-negotiation. This tutorial will walk you through generating an edit form for records in an SQL database. step 1to install code stylist on your workstation, browse to codestylist.com and choose your desktop platform. installation is quick and painless, and it can be completely uninstalled just by deleting the application folder. (windows versions include an uninstaller) step 2the codestylist.php file must be placed in your Web server folder. to copy the file, launch the code stylist application and choose the menu item: File > Copy to... pick a destination folder to copy the file to. in the same folder where codestylist.php is installed, create a folder named site.
on linux & mac systems you must set the permissions on the site folder to allow write-access.
step 3click the Setup button in code stylist. set the Base URL to match the location of your codestylist.php file. punch in your database settings and click the Verify Setup button to test your configuration.
step 4if you've gotten this far, you're ready to generate some application code. at the bottom left of the code stylist window, click the + button to add a new page. choose a database table to begin the process.
step 5the mvc generation templates are written in php and can be customized to suit your taste, you will find a range of built-in templates to experiment with. some templates, such as index.html, can render an unlimited number of database fields, while others such as image.jpg are limited to just one or a few fields. the file extensions of the templates are designed to tie into the content-negotiation features of the dbscript framework, representations can be chosen automatically by client preference, or explicitly by adding an extension to the url.
step 6check the boxes for the fields to appear on the new page. drag fields up and down to change their order of appearance.
step 7click on each of the fields to choose what type of form control to use for that field.
step 8choose a name for the new page, in most cases you can accept the default.
step 9now you can see the page that has been generated from the template.
and here is the page controller, which will execute before the page is rendered.
step 10click the Publish button to send the generated files to the site folder. this will forward your browser to the introspection (list of tables) page, from which you can navigate to your generated page.
on your desktop you will find a folder named Untitled with all of the generated files. this folder is monitored by code stylist, and any changes you make to the files can be propagated to your site folder by clicking the Publish button in code stylist.
updating dbscriptnew releases of dbscript are coming out all the time, these instructions will help you update your code stylist installation to use the latest version.
|
|||
Contributor: |
Brian Hendrickson | ||
Created: |
Mon Sep 17 02:52 AM | ||
|
|
|||
|
|||
Fri Sep 21 12:07 AM | |||
|
|
|||
|
Sign In to post comments | |||
|
|
|||
Bookmark this page: |
|||
|
|
|||