Getting into the code

So it has been a couple of weeks since I have posted. But now we need to set up some base code before we can go forward with the details and then adding in the Facebook Graph API. In the last post, the Data model was set up. We have skills and certifications as standalone tables. Skills with the levels and areas tables connected together. We also have the main glue of resumes, connected to covers and tasks which itself is connected to jobs. A lot of tables to create the resume section, but will keep some of this information all together. We need to create some code so that we can get all this information.

If you Baked each object, and used the Bake methods to create the model, and associations, as well as the controllers an views, you will have some code ready to use and ready to go. After you have Baked these items, the sample code that is created is ok to begin with. However, we want to take advantage of a very important technique, and the is the centralization of code, and prevent code duplication. There is one other thing that gets to me, and this is more of an OCD thing for me in code, and that is the way that Cake does the edit check in the controller. In the base created code, it creates a section of code that checks for an ID. If it is not passed, then it redirects the page elsewhere. Like so:

function edit($id = null) {
    if (!$id && empty($this->data)) {
        $this->Session->setFlash(__('Invalid resume', true));
        $this->redirect(array('action' => 'index'));
    }
    . . . . 
}

So in this code segment, if one gets to the edit form, and an ID is passed, and the form is not filled in, then it will display the actual form. And if the ID is not passed in, then it redirects to the Index page. For examples, if the site name was test.com:
www.test.com/resume/edit/2 – will result in the form being shown
www.test.com/resume/edit – will result in a redirect and the error message

Now here is where my OCD kicks in a little. . . .
Continue reading Getting into the code

The Data Model and the Set Up

So in this post, I will cover what I did for a data model on the resume part of the site. When I was looking into this part, I was looking to see what I needed, or what needed to happen for this to be effective and capable of doing what I wanted. So I started to look at my own resume, and some of the other sites out there that do this. In any application, it is important to understand exactly what data needs to be captured and why. I think that is where most people usually skimp on, is the why. They think once the data is identified, then that is all they need. but it is not so. One need to understand the “why” of the data in order to properly map and design the DB schema.

Take for example a simple address. It consists of a name it belongs to, number, street name, may or may not contain an apartment/suite number (address line 2), city, state and zip code. Now if we have this information we could maybe say that the name is part of a “Persons” table, and they would be linked to the “Address” table where each field is contained. And normally that may work. But why are you collecting this data in the first place? Is it a basic business application to store customer shipping addresses? Or is it for the city planning, emergency response and police units? Could it be for a post office application, or even political boundary application for a government unit? Each one of these questions may alter the way the data is stored, drastically. For a basic customer database, you could get away with two tables, and in the “Address” table you have one field for address1, address2, and so on. For a city-use application, that may not be normalized enough, and you may have to switch out to three or four tables, and break up address fields into three or more including one field for the number, one for the street name, one for the direction of the street, and one for the type of street. And they may be linked to other tables that contain that data. So just knowing that you have the data identified is not the end. You need to understand the “why”.

So, now we go on to this resume application. And remember, I am building this for me, and only me. I am not building a resume repository so others can create theirs and post it online and via Facebook. This is applicable to me. So I need to find the data that will work for me. I also need to find the data that will work for the people looking to hire people like me. What do they want to see, and why? So after I searched through to see where that would be, I came to the following conclusions. . .
Continue reading The Data Model and the Set Up

Design and Focus for Connecting on Social Media

OK, after the long break I took, I want to refocus on the Resume/personal web application I am building, and how to integrate with Facebook using the Graph API. But before we get into the nuts and bolts of the application, I just want to go over some of the design and focus for this application.

This application is mainly a learning tool, and way to get familiar with the Graph API and keep going with CakePHP. The main user for the administration sections are going to be me. So certain aspects can be adjusted, while others should not. One thing that I can be a little more relaxed on is the input fields. I will allow certain content, but not all. Sanitation of the input data does not need to be paranoid, and I can allow other things to slip through. However, I still want to have security in the back end and allow for checking of proper field id’s and other items that will allow the form to be secure, but give me the flexibility to enter different items in the backend.

Then there is the front end. This will be the forward facing end of the application and will also be the Facebook front. We have added in comments to the application. The next focus is the resume portion. And here is where we can look at the design and focus. By design I mean the design of the application. The UI can be really anything, and I will focus on a simple UI that utilizes HTML5 and CSS3. However, some people I talk to seem to question the aspect of resume portion, as in “why do that when there are countless other sites out there that already allow for this”? That is a good question. And I am not taking anything away from Monster, CareerBuilder, or any other site. LinkedIn provides a way to post your resume as well, and provides a social aspect for it. All of which are great. Remember, firstly, this is a way to experiment and learn more, grow in Graph API and CakePHP. But look at how the world is trending right now in technology.
Continue reading Design and Focus for Connecting on Social Media