Hot File

ASP.NET Issue Tracker Starter Kit in PHP and PostgreSQL (Race to Linux)

View: 515    Dowload: 0   Comment: 0   Post by: naruto  
Author: none   Category: PostgreSQL   Fields: Computers - Technology

0 point/4 review File has been tested

Download   asp-net-issue-tracker-starter.rar (86.20 KB)

You need to Sign In to download the file asp-net-issue-tracker-starter.rar
If you do not have an account then Sign up for free here

Download error   Report copyright violation

Porting the ASP.NET application for the Race to Linux has been quite a challenge this week. I was eager to test my latest development tools, which include a small persistent PHP framework with a data access layer, and a new novice-friendly generative software development application I call Code Stylist IDE. These tools were written by me and are available from my software company, http://www.megapump.com/.

Introduction

Porting the ASP.NET application for the Race to Linux has been quite a challenge this week. I was eager to test my latest development tools, which include a small persistent PHP framework with a data access layer, and a new novice-friendly generative software development application I call Code Stylist IDE. These tools were written by me and are available from my software company,

Porting from ASP.NET

First things first, I looked at the table schemas for the ASP.NET Issue Tracker. Hmm, 18 tables, not a trivial project! I shortened the table names a bit and began creating the PostgreSQL tables via Code Stylist. Next, I mapped the relationships between the tables, and in less than an hour I had 90% of the PHP, SQL, CSS, JavaScript and the HTML template code ready to go. In fact, I could have submitted my entry the same day but the contest requirements stipulated that the ported application should look nearly identical to the original.

Challenges

The hardest part about porting the ASP.NET application to PHP was trying to thread the auto-generated back-end code into the repurposed front-end code. I saved the original pages as HTML and used the web browser OmniWeb (it has a great 'Reformat' command) to tidy it up before extracting the crucial bits of the layout code. I was very much impressed by the ASP.NET output, it was quite concise and Microsoft has some amazing JavaScript wizardry going on in there. Unfortunately, given that this was a Race, I decided right away to implement much of that functionality server-side (in PHP) rather than try to adapt the JavaScript. Given more time it might be possible to take advantage of some of that infrastructure.

The template

After analyzing the HTML from the ASP.NET application, I was able to slice the header, footer and the sidebar code that was common to each page. I added a %content% tag at the center and pasted it into the template view in Code Stylist. On previewing or publishing, the %content% tag gets replaced with . When opening a page in a browser, the execution order dictated by Code Stylist is roughly:

  1. Front controller connects to the database and reads page-specific template values from the XML store.
  2. Page controller builds data objects for the views.
  3. Page view is cached using output buffering.
  4. Template view (header, footer and sidebars) wraps the page view (content) and the whole is sent to the browser.

The pages

The default page generators plus the user-defined table relationships were all I needed to instantly build the complete page and the template views and controllers, including the complex multi-table SELECT/JOIN queries, for most of the pages in the application. However, the generated views did not look at all like the original and I didn't have time to customize the generators, so it was necessary to throw out the view code in favor of the chunks carefully cut from the ASP.NET Issue Tracker.

Integration

The final step of porting the ASP.NET application to PHP was to replace the form input names so that they matched the auto-generated controller code. For instance, in the ASP.NET implementation an input field has code like name="txtTitle", but the generated code uses tablename_fieldname so I would change the source to name="issues_title" and that was the routine throughout. After getting the forms sorted out, I added behaviors with simple JavaScript for the various buttons, and server-side code to populate popup menus.

Results

The resulting application looks and works almost exactly like the original, since it shares most of the same HTML. It was a lot of painstaking handiwork to get everything functional, but my new generative coding methods were of big help and are sure to improve from the experience that I have gained. This code will be implemented for MySQL, keep an eye on  for more "developments".

The environment

I tested with PHP 4.3.11 and PostgreSQL 7.4.8, but everything should work under PHP 5 as well. Code Stylist IDE (Windows, Mac, Linux) can output the IssueTracker.cst project file to MySQL or PostgreSQL, with more databases to be supported soon.

Setting it up (short version)

PostgreSQL

  • Inside the .zip file is a file named issue_tracker.tar.gz - this file should be transferred to the Linux server.
  • SSH or Telnet to the Linux server, use the following command to unpack the archive: 'tar -xvzf issue_tracker.tar.gz'.
  • Create a PostgreSQL database: 'createdb issuetracker' and create the tables 'psql issuetracker < issue_tracker/tables.sql'.
  • Edit the CONFIG file (Pico is an easy text editor) 'pico issue_tracker/config.php'.
  • And finally, copy the folder to your web server document folder. In my case I typed 'mv issue_tracker /home/brian/public_html/megapump/tracker'.
  • Open a browser to the index.php file and you are ready to go!

MySQL (new!)

  • Inside the .zip file is a file named issue_tracker_mysql.tar.gz - this file should be transferred to the Linux server.
  • SSH or Telnet to the Linux server, use the following command to unpack the archive: 'tar -xvzf issue_tracker_mysql.tar.gz'.
  • Create a MySQL database: 'mysql -u root' and then 'create database issuetracker'.
  • Select the database: 'use issuetracker'.
  • Run the SQL script file to make the tables: '. issue_tracker/tables.sql'.
  • Edit the CONFIG file (Pico is an easy text editor) 'pico issue_tracker/config.php'.
  • And finally, copy the folder to your web server document folder. In my case I typed 'mv issue_tracker /home/brian/public_html/megapump/tracker'.

Setting it up (SUSE Linux step-by-step)

You must be logged in with a standard (not root) user account.

  1. Open YaST.
  2. Click Install and Remove Software.
  3. Search for 'mysql'.
  4. Check these boxes:
    • mysql
    • mysql-client
    • php4-mysql
  5. Search for 'php'.
  6. Check these boxes:
    • php4
    • php4-session
    • php4-mcrypt
    • php4-gd
  7. Search for 'apache'.
  8. Check these boxes:
    • apache2
    • apache2-mod_php4
  9. Click the Accept button.
  10. Click Continue (accept Automatic Changes) (may be prompted to insert SUSE install CDs at this point).
  11. Click Finish.
  12. Close YaST.
  13. Open Konsole (System->Terminal->Konsole).
  14. Type 'su' [enter].
  15. Type the root password [enter].
  16. Type '/etc/init.d/mysqld restart' [enter].
  17. Type '/etc/init.d/apache2 restart' [enter].
  18. Type 'exit' [enter] (leave Konsole open).
  19. In a web browser (Konquerer, Firefox) go to www.codeproject.com.
  20. Log in.
  21. Go to www.codeproject.com/useritems/codestylist.asp.
  22. Click the Download Source Code link (MySQL).
  23. Click Save As [enter].
  24. On the left half of the window (if using Konqueror), click public_html.
  25. Close the browser.
  26. In Konsole type 'cd public_html' [enter].
  27. Type 'unzip *zip' [enter].
  28. Type 'tar -xvzf *gz' [enter].
  29. Type 'mysql -u root' [enter].
  30. Type 'create database issuetracker;' [enter].
  31. Type 'use issuetracker;' [enter].
  32. Type '. issue_tracker/tables.sql' [enter].
  33. Type 'q' [enter].
  34. Type 'pico issue_tracker/config.php' [enter].
  35. Use arrow keys to move down to the line with db_name = "".
  36. Type 'issuetracker' between the quotes.
  37. Type control-x.
  38. Type 'y'.
  39. Type [enter].
  40. Open a browser to localhost/~username/issue_tracker (where username is your SUSE login name).

System settings

If you get 'error in connect function of PostgreSQL class'

In the issue_tracker/config.php file, set $db_host = ''; and $db_port = '';. With those strings blank, PHP will use local sockets instead of TCP/IP to connect to PostgreSQL.

And

(As root) check the access control file called pg_hba.conf. On many systems (RedHat/SUSE) it's in /var/lib/pgsql/data. You can find it like this: 'find / -name pg_hba.conf' and edit it like this 'pico /var/lib/pgsql/data/pg_hba.conf'. At the end of the file you can paste the following two lines:

 
host all all 0.0.0.0 255.255.255.255 trust
local all all trust trust

All other lines should be commented out with a '#'. Now restart PostgreSQL (as root) '/etc/init.d/postgresql restart'

Final possibility

You may need to set 'tcpip_socket = true' in /var/lib/pgsql/data/postgresql.conf. Change issue_tracker/config.php to use $db_host='localhost'; and $db_port='5432';. And finally restart PostgreSQL.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found http://www.codeproject.com/info/Licenses.aspx

ASP.NET Issue Tracker Starter Kit in PHP and PostgreSQL (Race to Linux)

ASP.NET Issue Tracker Starter Kit in PHP and PostgreSQL (Race to Linux) Posted on 21-03-2014  Porting the ASP.NET application for the Race to Linux has been quite a challenge this week. I was eager to test my latest development tools, which include a small persistent PHP framework with a data access layer, and a new novice-friendly generative software development application I call Code Stylist IDE. These tools were written by me and are available from my software company, http://www.megapump.com/. 5/10 515

Comment:

To comment you must be logged in members.

Files with category

  • Accessing: MySQL Database using MySQL C API

    View: 2332    Download: 2   Comment: 0   Author: none  

    Accessing: MySQL Database using MySQL C API

    Category: PostgreSQL
    Fields: Other

    0.75/6 review
    This article was written for beginners, developers that do not know how to access MySql database using MySQL C API and would like to have a small introduction.

  • Full Database Abstraction Layer Generator

    View: 2418    Download: 0   Comment: 0   Author: none  

    Full Database Abstraction Layer Generator

    Category: PostgreSQL
    Fields: Other

    0/23 review
    This article presents yet another Data Abstraction Layer generator (popular topic). The DAL structure is directly inspired from the DotNetNuke, DAL document and the SQL generation is done using SQLpp. The generator takes care of pretty much...

  • Code .NET 2.0; Build Java; Run Linux

    View: 1956    Download: 0   Comment: 0   Author: none  

    Code .NET 2.0; Build Java; Run Linux

    Category: PostgreSQL
    Fields: Other

    1.5/3 review
    This article is in the Product Showcase section for our sponsors at CodeProject. These reviews are intended to provide you with information on products and services that we consider useful and of value to developers. This is a showcase review for...

  • Postgres Database Backup/Restore From C#

    View: 2818    Download: 2   Comment: 0   Author: none  

    Postgres Database Backup/Restore From C#

    Category: PostgreSQL
    Fields: Other

    0/9 review
    This article provides Postgres database backup/restore functionality. By using this application we can check whether a Postgres database is installed or not in a system. If a Postgres database is installed then the Postgres databases list is...

  • Installing Redmine on Windows in production

    View: 5265    Download: 0   Comment: 0   Author: none  

    Installing Redmine on Windows in production

    Category: PostgreSQL
    Fields: Other

    0/9 review
    This is a very simple step by step guide to install Redmine on Windows server in production. This guide is applicable to IIS 7+ based servers, which include Windows Server 2008, 2008 R2, Windows Vista and Windows 7. Latter two should not be used for...

  • A SQL Management Console for MSSQL 2000 & 2005, MySQL 5.0,...

    View: 3076    Download: 0   Comment: 0   Author: none  

    A SQL Management Console for MSSQL 2000 & 2005, MySQL 5.0,...

    Category: PostgreSQL
    Fields: Other

    0.5625/8 review
    Since MSSQL is not holding the lion share of the market yet, integration/interaction with other RDBMS like PL/Oracle, MySQL, FireBird, DB2, is inevitable. With the class System.Data.Common in ADO .NET 2.0, different data providers can write the...

  • Creating an Interactive Map in ASP.NET 2.0 Using SharpMap

    View: 4164    Download: 5   Comment: 0   Author: none  

    Creating an Interactive Map in ASP.NET 2.0 Using SharpMap

    Category: PostgreSQL
    Fields: Other

    0/2 review
    Showing maps on the web is becoming more and more common. The most well-known ones are Google Maps and Microsoft's Virtual Earth. Creating your own websites with interactive maps require you to get hold on the map-data and convert this data to...

  • DevShot - Database Snapshots for Developers

    View: 867    Download: 0   Comment: 0   Author: none  

    DevShot - Database Snapshots for Developers

    Category: PostgreSQL
    Fields: Other

    0/2 review
    A few weeks back, I got an idea of writing a simple tool for switching database states between coding cycles. I thought this would be a good tool for anyone who is working on database related projects and have to switch between database states since...

 
Newsletter Email

File suggestion for you

File top downloads

logo codetitle
Codetitle.com - library source code to share, download the file to the community
Copyright © 2015. All rights reserved. codetitle.com Develope by Vinagon .Ltd