CSCI 4862/6962: Server-Side Development and Programming - IT Computer Science Assignment Help

Download Solution Order New Solution

Assignment Task

Assignment: Forms and Templates

Introduction

This assignment will give you an introduction to Node/Express templates, form handling, and validation. You will create a form that lists your sample products, and inputs the ID of the product to get more data about. You will then display a page giving details about that product.

 

Handlebars Template

You are to create a Handlebars template to create a common look for all of the pages on your site. At a minimum, it should have your company name/logo at the top and your name at the bottom:

Product Lists

For each of the pages described below, you will need to represent your sample products as an array of objects that gives the value of each field of your products. That is, something of the form:

You will also need code to search this array to get the object corresponding to a particular ID.

This code can be in your application for now, or you could put it in a separate file containing model functions if you would like to work ahead.

 

Product Selection Page

You are to create a Handlebars view for a “product selection page”. This page should:

  • Lists your example products and their corresponding IDs.
  • A form that provides a text input that lets the customer enter the ID of a product

Listing Products

Your application should pass your product list to the view. The view should then loop through that list, displaying the name of each product and its corresponding ID as shown above.

 

Selecting Products

You are also to provide a text element for the user to enter one of the IDs listed above. When they press the Get Details button that ID is to be passed to the application.

(Note that this is not the best way to have a customer select products. We will improve on this in the next assignment).

 

Using Form Data

When the above form is submitted, your application is to do the following:

  • Get the ID of the selected product from the request.
  • Search the list of products for the one with that ID.
  • Send that object to the view described in the next section.

 

Product Detail Page

This Handlebars view displays detailed information about the product passed to it:

Rather than having a separate static page for each product (as you did in the previous assignment), this will be a single page generated dynamically from the fields of the object passed to the view.

 

Validation

You are to validate that the user entered a legal ID into the form (that is, one that exists in your list of objects).

If they did not, rather than going to the product details view you should redisplay the product selection page, with a message stating that is not a valid ID.

You are also to echo back (that is, redisplay) the ID they entered previously.

For example, if the user enters 12345 as the ID, and 12345 is not a valid ID, the product selection page would be redisplayed as follows:

Note that this means your search will need to handle the case of an ID not in the list of objects.

 

Other Error Handling

Your application should still do the same basic error handling as before:

  • If the user sends a request for a nonexistent page, your application should send back a response of the form File Not Found.
  • If any other type of error occurs, your application should send back a response of the form Server Error.

 

Additional Requirements

  • Your application must be a complete and working directory. Please make sure that all of the needed middleware has been installed into it.
  • Your application must be a simple node application of the kind I have demonstrated in lectures. Do not use an application such as React to create it, as the directory structure will not match.
  • As always, your application must be well documented. Failure to do so may lose up to 5 points on the assignment.

 

What to Turn In

You are to compress (using a program such as gzip) your entire application directory into a single file.

Turn this file in using the Blackboard link.

 

This CSCI 4862/6962-IT Computer Science Assignment has been solved by our IT Computer Science Experts at My Uni Paper. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing Style. Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered.

You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turn tin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.

Get It Done! Today

Country
Applicable Time Zone is AEST [Sydney, NSW] (GMT+11)
+

Every Assignment. Every Solution. Instantly. Deadline Ahead? Grab Your Sample Now.