Thursday, 28 January 2010

Rewrite and Reread!

Today has felt like a very unproductive day even thought in reality it hasn't been. I took the MyPortfolioController and rewritten the add item section which was a huge section and a big mess. Now what happens is from the page data it will create a NewItem which is from the Item class and in the item class I have many methods and variables which I can set and get to create a complete new Item. It will work out if its type of text, title, gallery, video or image and work correctly with each. It will set all the rowstatus, created and updated values as well as detailed and type.

When setting detailed it will realise if it has one file or more. If its more then one it look at creating a gallery. If its one then it looks at extensions and decides if its a video or a image and again takes the approicate directions. From here it will call a File class which does with the dealing with working out image or video and converting or compressing apporiately.

All of this hard aching work should mean its easier in future and the files look atlot clearer. UI changes have come in form that now i can merge title and text into one item and Video and Image(infact for this one you can just ask a user for Video/Image) and what ever they upload the code will work it out correctly.

I have also added a youtube option which is in its early stages but at the moment will take a normal youtube url with no extras on the end of it and add it to database of type youtube and then will display it correctly and of correct size.

Thats it for now but alot of testing to do on this area, Changing the UI buttons with some more JS and also adding other video site types like Vidmeo!

No comments:

Post a Comment