DWS - Web development at the Server


Jump to the 2nd Term material !

Introduction:
1.- Miniprogramació del curs

English Resources:
 Word Reference (English dictionary, you can listen how  to say the words)

English tasks done :
1.- Six Minutes English vist a classe 
2.- Linus Torvalds exercise 
3.- Steve Jobs video and questions (for Monday 5th in Moodle)

Talking with the native assistant
  •  "One to One". The students will have some time to talk alone with the Language Assistant. The one to ones are an excellent way to intereact in private and learn in confidence. Read example.
1st Term
Study of Web company
artifices.net
Exemples de preus
Exemple pressupost senzill 
Exemple de pressupost Web
Exemple de pressupost James 
Comentaris James

Sumary of Jame's talk

1.- Preparació d'un pressupost d'una Web en PHP amb BD.
descripció de la tasca
S'entrega en dues setmanes al Moodle.

Programming at the Server concepts 
1.- Questions about the B Book
solution

PHP programming 

1.- php project: Library management web
     Project requirement and evaluation method
User Manual Sample1
User Manual Sample2
Technical manual Index

2.-  Install XAMPP (php and mySQL)

      a- Have a look to the D book -see Moodle- from page 271. Do the "hello world" and so on

      b- Go to the page 157 of your W book: create a form for "Hello world"
      Experiment to do more interesting similar forms

3.- php resources:

4.- All to be done at class!  Classes in php (sumary in Spanish)
     Classes at the manual php.net

5.- Sample to connect to mySQL

6.- php exercises 

7.- Cookies and sessions

Test it with cookies enabled/disabled. See how to disable in Firefox here 

8.- Sessions using SID when cookies disabled 

9.- Examples of Classes: mail sort

10.-  W-Book: form samples 

11.- Editing the DB: W-Book chapter 6

12.- Table Class exercise 
solution (for the teacher only)

13.- Global, local and static variables

14.- include vs require to incorporate common files to applications
      Consider also include_once and require_once

15.- Sample to upload files to the server. Useful for images, profiles, etc.
       Theory explained in w3schools.com 

16.- D-Book Page 411: creation of a Form class. Use it to extend your Table class. Optionally you can use it in your php practical
solution (teacher only)

17.- Theory variable variables
Sample
Exercise
Solution (teacher only)

18.- Filters in PHP 

Note: You will see that it uses === to compare. It gives true if both sides have the same value and both data types are also the same.

19.- Error Handling The default error handling in PHP is very simple. An error 
                                   message with filename, line number and a message describing
                                   the error is sent to the browser.

       Exception Handling - Exceptions are used to change the normal flow of a script if
                                            a specified error occurs.

20.- Testing postgreSQL from php
Compare some DBMS: SQLite, MySQL and postgreSQL
ACID DBMS 


Sample php to query a table in postgreSQL
Connect to the teacher's computer and test this script at:
http://192.168.2.192:8080/kico/ 



 21.- Five common PHP dessign patterns
        Sample Code
       Dessign pattern Questions
 solution (Teacher only)

Patters Game
Patterns Sol (teacher)

22.- MVC for PHP book : POO y MVC en PHP por Eugenia Bahit 
Sample to create clean HTML file good for designers (page  36)
MVC sample from book (page 36 theory, sample page 42)

Exercise to do

End of the book material

23.- Optional task: try a know website API (Facebook. Twitter, IMDB) and from PHP paint some of the data you can get.
sample about IMDB 

24.- Optional task: download and install the CMS prestashop to build online stores.

25.- Optional task: upload your Library project to a free server. For example to AwardSpace.com

Laravel course 2017

2nd Term:

Platform comparison

INDEX:
1.- Programming with J2EE: Servlets and JSPs
2.- IDE Menorca Seminar
3.- Web Services
4.- Introduction to Dependency Injection
5.- .NET overview 

Practicals to be done:
  • Servlets practical with Maps
  • Web Services Practical
  • .NET practical

1.- Programming with J2EE
We are going to follow the theory of the HF-Book (in the Moodle) and do our practicals in Eclipse EE with the application server Tomcat.

chapter 1: Why use Servlets & JSPs: an introduction
chapter 2: Web App Architecture: hig-level overview
chapter 3: mini MVC tutorial: hands-on MVC
chapter 4  GET vs POST and "Idempotent" concept - pages 142-156
chapter 5  Not to be seen but ok to read if you have time 
chapter 6: Session management Mostly pages 260-288
chapter 7: Being a JSP: using JSP mostly pages 315-331
chapter 8: scriptless JSP mostly pages 393-410 (not pages: 388-390)

Remember many things done using Eclipse, not exactly as in the book. 
For example Deploy description or deployment paths!

Chapter 1 is explained by the students, as it is not really new material: 
Each student has to choose one part from the following.

1.-What web servers and clients do. Pag 37-40 
2.-2 min guide to html pag 41-43
3.-what is the http protocol p 44 - 48
4.-anatomy of the Get and post request p. 49-53
5.-Locating web pages with url p 54-57
6.-web seervers, static and dynamic pages p 58-63
7.-servers desmystified p 64-67
8.-jsp is what happened...p 68 
9 -Butlet points pag 69

Chapter 2
Solution exerc pag 74 (teacher only)

Chapter 4 
solucion exerc pag 324 (teacher only)
JPS options summary:
- Java code (scriptlet): <% ...%>
- directive: <%@ ...%>
    a) page <%@ page import= "..."%> 
    ex:  <%@ page import= "foo.*,java.util.*" %>
    b) include
    c) taglib

- expression  <%= ... %>
- declaration <%! ... %>  It can declare attributes and methods from the servlet/JSP class

  Ex1: <%! int count = 0; %>
  Ex2: <%! int doubleCount() {
          count = count*2;
          return count;
          }
      %>


Note not ";" in the directives and expressions, yes in declarations and scriptlets.



Chapter 8: 
 JavaBeans: In computing based on the Java Platform, JavaBeans are classes that encapsulate many objects into a single object (the bean). They have to be classes that are:
- serializable
- have a zero-argument constructor
- allow access to properties using getter and setter methods. They have to follow the standard naming for getters/setters.
- All attributes have to be private.
The name "Bean" was given to encompass this standard, which aims to create reusable software components for Java.
Also explained at the end of pag 286 (HF-Book) 
More info in Spanish

If you don't want Java or the less as possible in a JSP you can:
a) use standard actions 
ex:
<html><body>
<jsp:useBean id=”person” class=”foo.Person” scope=”request” />
Person created by servlet: <jsp:getProperty name=”person” property=”name” />

</body></html>


b) use the Expression Language (EL) HF-Book page 402
ex:
<html><body>
Dog’s name is: ${person.dog.name}
</body></html>

 

Question: 
Can you find a way through the city that crosses each bridge exactly once?

solucion (teacher only)
history (teacher only)

If you liked it you might like:
Entscheidungsproblem
The Entscheidungsproblem asks for an algorithm that takes as input a statement of a first-order logic (possibly with a finite number of axioms beyond the usual axioms of first-order logic) and answers "Yes" or "No" according to whether the statement is universally valid, i.e., valid in every structure satisfying the axioms.
solution

Practicals:
1.1 - Install Eclipse EE and Tomcat
1.2 - Servlet Hello World
1.3 - Showing POST data in a Servlet
1.4 - Calling a Servlet with a link (with and without parameters)  
1.5 - Redirecting to  another page in a Servlet
1.6 - Using Servlets/JSPs, create a main form asking for username/password and:
    1) save the data in cookies to control in other pages that you have logged in
    2) idem with sessions

 You don't need to use a DataBase. Simulate the correct username/password with constants.

 Show the program to the Teacher to mark it as DONE.


Create an Expert System to decide whish is the best sport for you. Develop it using Servlets/JSPs.

Prototype of an expert system in Prolog
The previous file contains information about how to install and use it. It is a way to do the Expert System suggested to be done at class with Servlets/JSP. 
The beginning has comments that explain a bit how to install it in Ubuntu and run it with the Prolog interpreter.


1.7 -  JSP/Servlet list of Exercices

1.8 - JSP/Servlet practical with maps

2.- Sessió de phonegap i cartografia per en Marc Rosés 
You can also reach it going to the "racó del programador de la IDE menorca i selccionar el nou taller de Phonegap.
The missing route documentation is done.
Comments by Marc:
1.- Ens faltava crear la pàgina on mostrar la informació de la ruta òptima, per això no la mostrava. Aneu l'apartat "Routing: WebServices per a càlcul de rutes" i cap al final de tot, és quan crea la pàgina que mostra la informació de la ruta a l'arxiu index.htm (busca "PANTALLA INFO RECORREGUT"). 2.- Per si les mosques, torneu a copiar el codi de l'arxiu "js/routing.js"
  
Instal.lació previa

Resenya de la seva visita

If you want to use Phonegap Build instead of Phonegap, you don't need to install anything.
http://cartografia.cime.es/WebEditor/Pagines/p14.htm
¿Cómo sabe el GPS qué ruta recomendarnos? - El Pais

3.- Web Services

Practical:
Create a Web service Server and its client for a Java application you already have or a simple one you might create quickly.
Agree with someone else in the classroom to test his/her Web Service.

Example: 
If you had a program to exchange between differents degrees units (Celsius, Farenhait and Kelvin)  you could expose it as a Web Service.

Show it to the teacher in your Computer. It does not need to be uploaded to the Moodle.

4.- Dependency Injection Introduction

5.- .NET overview
At the Moodle you can see resources about it: The "B-Book"
Platform comparison2 (php vs .NET)

Questions about the previous article 
solution (teacher only)

Install from here Visual Studio. Use the default installation

How to create a Login website


Web service in .Net/VB:


Creating a Web Service


Task: Using the previous document, create a Web Service in asp.Net. Something simple can be ok, like the example that translates betweeen different kinds of degrees.
Then publish it and connect to it developing a client using J2EE technology. Remember: wsimport, and using the downloaded classes find the way to access to the exposed methods.


Connect to teachers WS for Degrees conversions:

http://192.168.2.183:50340/WebService1.asmx?WSDL

visor web
http://192.168.2.183:50340/WebService1.asmx



How to create a complete Solution in .Net (Microsoft seminar)

No comments:

Post a Comment