Posted: August 23rd, 2009 | Author: Kornelije Sajler | Filed under: Test Lab | Tags: Kanban, NHibernate, SQL Server, TargetProcess | 4 Comments »
TargetProcess is a proprietary agile project management tool supports Scrum, Extreme Programming (XP). From the start of August, and with version 2.15 TargetProcess have support for Kanban. A Kanaban is new switch in Software Development from Agile to Lean – also known as JIT (Just-In-Time). For more about Kanban read writings of Michael Dubakov CEO of TargetProcess and Derick Bailey on Los Techies.
The notion of existence for TargetProcess (TP) I’ve had from Steve Bohlen excellent screencast series Autumn Of Agile (never finished, though). TP is just plain simple, user-friendly, fun to work with, and TP have Community Edition for 5 users pack for free. Community Edition version is more than enough for me and for many others.
The installation of TP is quite trivial even though I have had problems with IIS 7 Application Pool user on Windows 7 RC release, but with this final version, no problem, quick and smooth, of course only if prerequisites are satisfied.
I think TP is made with Spring.NET, uses NHibernate for ORM, I think NVelocity is templeate engine, and its user friendliness entirely comes from ExtJS.
Gathering Reuquirements
First we have to download TargetProcess Community Edition. It can only be through signup, and as I remember, you have to wait for TP reply mail one or more days. In mail is a link to download TP and also licence and good thing is, once signup, you’ll get all TP updates, revisiting this mailed link.
TP requirement is a SQL Server database either 2005 or 2008 and what is good Express version are supported but for Windows 7 we have to install SQL Server 2005 SP3, older, I think are not compatibile with Windows 7.
SQL Server 2005
TP have requirement for SQL Server to use SQL Server Authentication. It is no problem if you haven’t install SQL Server, you can use Mixed mode during installation and apply password for sa user, but if you have SQL Server installed, you have to do two things, easily done with SSMS Express (and use SP3 version for Windows 7) :
- Log on to your SQL Server SSMS Express then right-click on your server (SQLEXPRESS), choose Properties. It popup the window where you have to choose Security and on Server Authetication click radio button SQL Server and Windows Authentication, save it, and it requires to restart the server – easily done through SQL Server Configuration Manager or Administrative Tools – Services
- Enable sa user and give him a password – In your SSMS SQLEXPRESS instance click on Security node in tree view to expand, then expand Logins. Here is the sa user, right-click on him Properties in popup window first choose Status. sa user is disabled by default so in status there is Login and we have to click radio button Enabled, and when is sa user is enabled on General in popup window you have to set password for our sa user.
Note: It is not wise to use sa user in production or over Internet, this is only for testing and local purpose. For production you could create new user and give ownership on database created for TP and used through installation.
TP have a also requirement for .NET 3.5 SP1 to be installed and IIS 7 which is not installed by default in Windows 7 but can be easily done with Turn Windows features on or of (inside Programs in Control Panel). Where you have to choose (check) Internet Information Services. It is clever to check every feature inside except FTP Server (of course you can check it if you need it). It can all be done through Web Platform Installer, but for me it is better to do it manually!
Smooth installation
Now the installation of TP should be quick and smooth, and only thing you have to enter is Database server (.\SQLEXPRESS), and password entered during installation of SQL Server or added through Security/Logins. After install, you can run TP from your local Web Server with username admin and password admin.
First thing when you’re logged inside TP is to apply your given licence, choosing Admin -> Licence. If you have serial number you will choose Automatically or Manually if you have .lic file on your disk, and in People link in upper menu change the admin account password to whatever you want. Nice thing is, at your home page is a link to generate the sample project from which you can learn a lot.
Enjoy in TargetProcess because, it is a wonderful product. If you have some questions please ask and stay Lean and Agile!
Posted: August 14th, 2009 | Author: Kornelije Sajler | Filed under: CakePHP, Learnaholism, The Clash of MVC Frameworks | Tags: CackePHP, MVC, MVC Frameworks, MySQL, PHP, XAMPP | 9 Comments »
It is time for some coding. The first MVC Framework is CakePHP, because the final application for my firm will be in PHP. I will not write about installing and configuring CakePHP and I think that readers have notion of MVC Frameworks and how they work.
System requirements for CakePHP:
- PHP 4.3.2+ (PHP 5 recommended)
- Apache Web Server with mod_rewrite enabled (I recommend installing XAMPP)
- Supported Database – MySQL in my case
CakePHP Folder Structure
Before begin there is need for explanation of CakePHP structure. When you download cake and extract it you should get this folder structure:
- app – the folder where our application code shall reside.
- cake – core CakePHP files, where magic resides.
- vendors – where to place third-party PHP libraries you need to use with your CakePHP applications.
The app directory is only relevant to this application and it has this structure:
- config – database connection details, bootstrapping, core configuration files should be stored here.
- controllers – contains your application’s controllers and their components.
- locale – stores string files for internationalization.
- models – contains your application’s models, behaviors, and datasources.
- plugins – contains plugin packages.
- tests – unit test for the application.
- tmp – this is where CakePHP stores temporary data.
- vendors – any third-party classes or libraries should be placed here.
- views – presentational files are placed here: elements, error pages, helpers, layouts, and view files.
- webroot - in a production setup, this folder should serve as the document root for your application. Folders here also serve as holding places for CSS stylesheets, images, and JavaScript files.
So, when I post source for this application it’ll be only app directory!
But, before we begin, you should create a MySQL database in my case “cake” and create the users table with this script:
CREATE TABLE `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(8),
`password` varchar(64),
PRIMARY KEY (`id`)
) ENGINE=InnoDB;
We also need to tell CakePHP where to find database. In app/config there is a file database.php.default which should be renamed in to database.php and add database information, in my case:
<?php
class DATABASE_CONFIG
{
var $default = array(
'driver' => 'mysql',
'persistent' => false,
'host' => 'localhost',
'login' => 'root',
'password' => 'lida',
'database' => 'cake',
'prefix' => '',
);
}
?>
Note: Here is only default configuration for database, test configuration is not important for now!
Authentication
CakePHP in its Core Components has a Authentication – AuthComponent is used for creating authentication easily and quickly. The components in cake are added to the list of components in your controller. Since we want to use authentication component for all of our controllers we shall create AppController as our global controller for application:
<?php
class AppController extends Controller
{
var $components = array('Auth');
}
?>
Note: The AppController is not added to the app/controller directory where controllers reside, instead it is in root of app directory.
User Model
Since user as entity is for its self, model is very simple. It consists of $name attribute, set to the controller name. This is only important for PHP 4, even though I use PHP 5, we shall declare the $name attribute only.
Users Controller
The user controller is where our actions reside. We have this actions for user:
- index – only redirects to a login action/page.
- register - serves only for registration and to put some users to test login. Totally insecure and will not be a part of application. Password will be given to our users, and there will be no registration available!
- login – authenticate the user and if Username/Password input is valid, redirects user to the main page.
- logout – logout the user from application.
Because we add AuthComponent to AppController, then authentication is for all application. In user controller we add this snippet of code:
function beforeFilter()
{
$this->Auth->allow('register');
}
The Before Filter is added to allow registration of users, and this is only for test!
Login
function login()
{
if(isset($this->data['User']))
{
if($this->Auth->login($this->data['User']))
{
$this->redirect('/');
}
$this->flash("Username/Password is incorrect");
}
}
Logout
function logout()
{
$this->Auth->logout();
/* $this->flash('You are now logged out.'); */
$this->redirect('login');
}
This code is very straight forward and it explain itself.
User Views – Presentation
First and foremost the views are inside the app/views/{NameOfController} folder in our case the folder is users. The extension for CakePHP view (presentation) files is .ctp and they are with name of controller actions. Since index and logout actions have no reason to have presentation files we have only presentation for register and login actions. But first we have to include some presentational helpers to ease our working with HTML and Forms. Helpers are included within each controller. To use presentational helpers for user views we have to add this line of code to our UserController:
var $helpers = array('Html', 'Form');</pre>
<h3>Register.ctp</h3>
<pre class="brush:php"><?php
echo $form->create('User', array('action' => 'register'));
echo $form->input('username');
echo $form->input('password');
echo $form->input('password_confirm', array('type' => 'password'));
echo $form->submit('Register');
echo $form->end();
?></pre>
<h3>Login.ctp</h3>
<pre class="brush:php"><?php
$session->flash('auth');
echo $form->create('User', array('action' => 'login'));
echo $form->inputs(array(
'legend' => __('Login', true),
'username',
'password'
));
echo $form->end('Login');
?>
Both of views uses entirely helpers, which are also very self-explanatory.
We only have to test our login and logout and for that we need to have main page. Since we don’t want to create Home Controller and Index action we can add in our app/views/pages, a page home.ctp, which will be our home page when we call our domain. And all we have to do is put the logout link:
<?php
echo $html->link('Logout', array('controller' => 'users', 'action'=>'logout'));
?>
I think that would be all for User Authentication, and bear in mind to remove this insecure registration. It is only for testing and easily adding users to database. Next, we shall start to add strong entities like Clients and Voucher Types. Since then if you have any question please, ask or go to the manual of CakePHP for more informations.
Source code for this post: app.zip
Posted: August 8th, 2009 | Author: Kornelije Sajler | Filed under: IT | 4 Comments »
Yesterday, I download and install final version of Windows 7 from MSDN. Officially will be released on October 22. Since I was having a Beta and RC version and I am glade to say that Beta and RC were the best Microsoft products released, with both of them I have expression that they are final releases with few minor bugs.
So, what are a new features in Windows 7 and my impressions on them:
Improved Taskbar
Well, the new taskbar is very nice especially feature Jump Lists is a neat way to reach files that you’ve been working. But full-screen previews are messy for me, they are good for Windows Media Player 12 to have controls displayed in it but when I have a lots of same documents open like Notepad2, I’m just lost. Mac Exposé or similar feature Scale in Linux Compiz are far more better solutions, at least have much wider preview. Windows 7 have similar feature Aero Peek but it only shows shapes of opened applications, with no previews and no selecting.
Desktop enhancements
They are OK, I mentioned above Aero Peek but there is feature Snap for easier resizing windows, and there is a Aero Shake when you click on top pane and shake it with mouse, focuses on this window and minimizes all rest. In general nice features but for me far more away from those of Mac and especially of Linux compiz.
Windows Search
The feature introduced in Vista, something that was awaited for so many years, and reason why I don’t user XP and older versions of Windows. Even though that in XP Windows Search can be installed, but usability comparing with Vista and Windows 7 is a far poorer.
Internet Explorer 8
I must admit that i really hated IE 6 and things I have to do make some web pages do right in it. But with IE7 things have changed far more better, and with IE 8 we can say that Microsoft had make a pretty decent browser, and W3C compliant, that will put smile on most web developers.
View Available Network (VAN)
I’ve been very shaken with Vista Network Management, I really need some time to get used to it, but now I really pleased with it. Windows 7 is a two step better, and it’s quite a joy working with networks!
All in all Windows 7 is a great product, but only for newer hardware, and at least 1GB of RAM. I have enjoy it in Beta, RC and I see no reason why I shouldn’t enjoy it in this final version.
Posted: August 8th, 2009 | Author: Kornelije Sajler | Filed under: The Clash of MVC Frameworks | Tags: CackePHP, Data Model, MVC Frameworks, Mysql Workbench, Specification, Vouchers | 1 Comment »
This post is all about application data model, specification and logic for my MVC Framework contest. For data model I used MySQL Workbench 5.2.2 and it is quite OK for an alpha version. I will include in the end of post a workbench .rwb file. I have placed inside comments for tables and attributes. Now, let’s specify it!
Specification:
This application is for generating vouchers for the clients. And it is not our importance what the clients will do with them. The job of application is to generate them, keep track of clients, and keep track vouchers belonging to each client, so they can be billed. Billing is also not important here, only generate and deliver.
The application will have the way to keep track of clients. The vouchers will have its type in witch we can give them some logical name like 30 minutes, 1 day, and will also track the duration or period of voucher in minutes, so for 1 day will be 1440 minutes. This value is important for second module in which we aren’t interested now, and it is for calculating the period of voucher once its activated.
The client is not interested in one voucher and we are also not interested in selling one voucher. The client wants for example 100 units of vouchers of one type, let’s say 30 minutes, and 50 units of vouchers of type 90 minutes. Application have to be able to generate this units, and also it can be generated but not given to any client. So voucher had to have a status: sold or pending. And each voucher unit will have status: pending, active and inactive, but this is not our importance and is not included in this model for application. Each voucher has its creation date, and also when we deliver voucher to client, we have to keep track of sold date.
Tricky part of this story is that I call voucher, what is not voucher itself, but the collection of vouchers of some “periodic” type and voucher itself is called voucher unit. Because I don’t know how to give appropriate name for collection of vouchers. If someone have a better solution, please, tell it?
And of course to protect our applications we have users who can authenticate, and register. Registration will be for everyone, only made to create some users and test this feature in MVC Frameworks, and to provide easy way to put users into database.
Data Model:
I don’t know will this model survive UI implementation, probably I will change it during the building of application. I mentioned before about trickiness of voucher(collection) and voucher(unit). So this is the model.

Now, when I see clock, today I will write and blog it a implementation of registration and login for our first MVC Framework CakePHP. Today, afternoon I’m going on vacation and I really think that I will have no touch with computers till second Wednesday or Thursday. I will be on island Rab in Lopar, and you could find me on some of this beautiful beaches.
MySQL Workbench Model: Vouchers.mwb
Recent Comments: