Jason's Google Code-in Blog

GCI Organization: FOSSASIA

REST API with Teapot

smalltalk

Today, my task was to write a REST API in Pharo using the Teapot framework. Teapot is a packaged designed to make making REST APIs with Pharo A LOT easier than writing a REST API from scratch in Zinc. For example, to output Hello World when a user navigates to /hello, this is all the code that is needed: Teapot on GET: '/welcome' -> 'Hello World!'; start. I wrote a package named UserAPI on SmallTalkHub that relies on the ContactManager package here to retrieve a list of users and display it as JSON in the browser after a user navigates to /users.

24 Jan 2016 #smalltalk #pharo #teapot #squeak #rest #api #zinc

Creating a Web App with Zinc

smalltalk

Working with Zinc on Pharo Smalltalk to create a small web application was extremely different than creating a Web App with PHP, NodeJS, or even Python. Zinc is a framework in smalltalk that deals with the HTTP networking protocol using the reference platform of Pharo. I have followed this tutorial to develop a web app which allows the user to change the picture. I have to say that the process was a lot more complicated than I thought.

21 Jan 2016 #pharo #smalltalk #zinc #webserver

Further Extend a User Management Application in Pharo

smalltalk

My task was to add a few more fields to the existing ConstantManager package and implement some type of checking mechanism to ensure the password fields match. I accomplished this by adding the instance variables and adding a few methods. I added a small check using if statements to check that the two passwords match. If the passwords do not match, an alert generated by UIManager pops up to warn the user.

15 Jan 2016 #pharo #smalltalk #user management #image

Extend a User Management Application in Pharo

smalltalk

My task was to extend an address book located on this blog: http://magaloma.blogspot.de/2011/01/pharo-gui-with-polymorph.html. It featured adding, editing, and deleting a contact and only had two fields: first name and last name. I extended the applicatino by adding an email field after loading the program in Pharo 4.0. Gofer it squeaksource: 'Pharocasts'; package: 'ContactManager'; load. First, in the contact class, I added an instance variable called email. After that, I could add methods in the accessing protocol that returns the email and also add the email to be printed in the printOn method in the printing protocol.

29 Dec 2015 #pharo #smalltalk #user management #image