9196 WebS CA2 WebbasedMovieRecordSystem
9196 WebS CA2 WebbasedMovieRecordSystem
(Autonomous)
NEW PANVEL
PROJECT REPORT ON
SEMESTER V – 2024-2025
PROJECT GUIDE :-
Prof.Abhijeet Salvi
Introduction/ Description of
the Case 1 2 3 /3
2 3 4 /4
Delivery/presentation skills
1 2 3 /3
Total
/15
Co-ordinator,Shubhangi Pawar
Project Title: Web-based Movie Record System
Project Description:
The Web-based Movie Record System is a comprehensive and user-friendly
application designed to manage and catalog movie information. This system
leverages web services to provide seamless access to movie data, enhancing the
user experience by enabling them to search, explore, and interact with a vast
database of movies.
Features of the Web-based Movie Record System:
1. Movie Management:
2. RESTful Web Service Integration:
3. Database Connectivity:
4. Responsive Client-Side:
5. Data Fetching with AJAX:
6. Entity Class for Movie Records:
7. Styled Web Interface:
System Requirements:
Hardware Requirements:
• Minimum of 4GB RAM
• 2.0 GHz Processor or higher
• 500 MB of free disk space
Software Requirements:
• Windows, Linux, or macOS
• Java EE Web Profile or higher
• GlassFish/WildFly server or any Java EE compliant server
Objectives of the Project:
1. Efficient Movie Record Management:
2. Seamless Interaction Between Client and Server:
3. Database Integration:
4. User-Friendly Interface:
5. Real-Time Data Fetching:
Server-Side:
1] movie.java:
package com.movies;
/**
*
* @author Goutham
*/
@Entity
@XmlRootElement
public class movie implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
/**
* Get the value of moviename
*
* @return the value of moviename
*/
public String getMoviename() {
return moviename;
}
/**
* Set the value of moviename
*
* @param moviename new value of moviename
*/
public void setMoviename(String moviename) {
this.moviename = moviename;
}
/**
* Get the value of genre
*
* @return the value of genre
*/
public String getGenre() {
return genre;
}
/**
* Set the value of genre
*
* @param genre new value of genre
*/
public void setGenre(String genre) {
this.genre = genre;
}
/**
* Get the value of heroname
*
* @return the value of heroname
*/
public String getHeroname() {
return heroname;
}
/**
* Set the value of heroname
*
* @param heroname new value of heroname
*/
public void setHeroname(String heroname) {
this.heroname = heroname;
}
/**
* Get the value of directorname
*
* @return the value of directorname
*/
public String getDirectorname() {
return directorname;
}
/**
* Set the value of directorname
*
* @param directorname new value of directorname
*/
public void setDirectorname(String directorname) {
this.directorname = directorname;
}
/**
* Get the value of imdbrating
*
* @return the value of imdbrating
*/
public int getImdbrating() {
return imdbrating;
}
/**
* Set the value of imdbrating
*
* @param imdbrating new value of imdbrating
*/
public void setImdbrating(int imdbrating) {
this.imdbrating = imdbrating;
@Override public
int hashCode() { int
hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are
not set
if (!(object instanceof movie)) {
return false;
}
movie other = (movie) object;
if ((this.id == null && other.id != null) || (this.id != null &&
!this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "com.movies.movie[ id=" + id + " ]";
}
2] movieFacadeRest.java: package
com.movies.service;
/**
*
* @author Goutham
*/
@Stateless
@Path("com.movies.movie")
public class movieFacadeREST extends AbstractFacade<movie> {
@PersistenceContext(unitName = "imdratingPU") private
EntityManager em;
public movieFacadeREST() {
super(movie.class);
}
@POST
@Override
@Consumes({ "application/json"})
public void create(movie entity) {
super.create(entity);
}
@PUT
@Path("{id}")
@Consumes({ "application/json"})
public void edit(@PathParam("id") Long id, movie entity) {
super.edit(entity);
}
@DELETE
@Path("{id}")
public void remove(@PathParam("id") Long id) {
super.remove(super.find(id));
}
@GET
@Path("{id}")
@Produces({"application/json"}) public
movie find(@PathParam("id") Long id) {
return super.find(id);
}
@GET
@Override
@Produces({ "application/json"})
public List<movie> findAll() {
return super.findAll();
}
@GET
@Path("{from}/{to}")
@Produces({ "application/json"})
public List<movie> findRange(@PathParam("from") Integer from,
@PathParam("to") Integer to) {
return super.findRange(new int[]{from, to});
}
@GET
@Path("count")
@Produces("text/plain") public String
countREST() { return
String.valueOf(super.count());
}
@Override
protected EntityManager getEntityManager() {
return em;
}
OUTPUT:
CLIENT-Side:
Index.html:
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Movies record system</title>
<style>
h1 {
text-align: center;
background-color: #3498db; /* Background color for the title */
color: white; /* Text color for the title */ text-shadow: 2px 2px
4px rgba(0, 0, 0, 0.3); font-size: 36px; margin-top:
20px;
padding: 10px 0; /* Add padding to increase the background size */
}
body {
font-family: Arial, sans-serif;
} table { width:
80%; margin: 20px auto;
border-collapse: collapse;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); /* Adding a box shadow for
the table */
}
th, td {
border: 1px solid #ddd;
padding: 8px; text-align:
left;
}
th {
background-color: #f2f2f2;
}
tr:nth-child(even) {
background-color: #f2f2f2;
}
</style>
<script>
var request = new XMLHttpRequest();
request.open('GET',
'http://localhost:33689/imdrating/webresources/com.movies.movie', true);
request.onload = function () { // begin accessing JSON data here
var data = JSON.parse(this.response);
cell1.innerHTML = data[i].id;
cell2.innerHTML = data[i].moviename;
cell3.innerHTML = data[i].genre;
cell4.innerHTML = data[i].heroname;
cell5.innerHTML = data[i].directorname;
cell6.innerHTML = data[i].imdbrating;
}
};
request.send();
</script>
</head>
<body>
<header>
<h1>Movies record system</h1>
</header>
<div class="container">
<!-- Add your content here -->
<h2>Welcome to the Movies record system</h2>
<p>This is a simple template for your Movies record system
website.</p>
</div>
</body>
</html>
OUTPUT:
Conclusion:
Thank you!