SlideShare une entreprise Scribd logo
1  sur  4
AdminUsers Module – Changesin Web-Layerto use Spring MVC
Overview
In this module following functions willbe coveredinREL.
1. Show Users List
2. Add New User
3. Edit Existing User
4. Save Changespost Editing
5. Delete Existing User
Module functions in Sample Application:
The users module inthe sample applicationwill support the followingfunctions exposedbythe listed URLs.
# URL Method Description
1
/admin/users/view/{id}
/admin/users/view
GET
Gets the list of users inthis
REL application
2 /admin/users/new GET
Shows the UI to adda new
user.
3 /admin/users/edit/{id} GET
Show the UI to edit the
info of existing user.
4 /admin/users/delete/{id} POST Deletes the existing user.
5 /admin/users/save POST
Saves the informationof
new andexisting user.
Controller – UserController.java
Create a newfile 'web/ UserController.java'. This class handlesthe "/adminUsers/*" requests.
package com.pearson.rel.webapp.controller;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import com.pearson.rel.model.User;
@Controller
@RequestMapping(value="/adminUsers")
public classUsersController {
@RequestMapping(value="/view",method= RequestMethod.GET)
public String view(User user) {
return "userList";
}
@RequestMapping(value="/addNew",method= RequestMethod.GET)
public String addNew(Modelmodel,User user) {
return "userForm";
}
@RequestMapping(value="/edit/{userName}",method= RequestMethod.GET)
public String edit(Model model,User user){
model.addAttribute("userForm",new User());
return "userForm";
}
@RequestMapping(value="/delete",method = RequestMethod.POST)
public String delete(Model model,User user){
return "userList";
}
@RequestMapping(value="/save",method= RequestMethod.POST)
public String save(Modelmodel,User user) {
return "userForm";
}
}
Models & Services
(1) Model: Due to simplicityof requests, noadditional model needs to be added.
(2) Service: No changesat the servicesare required.
Subtasks
(1) Validations :
a. To check User withthe same name alreadyexists
b. To validate the “password” and“confirm password” fields match.
c. Validate mandatoryfields.
New functionality - Bulk Import from Spreadsheet
Overview:
Bulk Import from SpreadSheet: New linkwill be providedadjacent to “Addnew User” onview page. Using this link ,user can
import multiple admin users from XLS. After performing the validations, users would be addedto the database.
Steps Involved:
1. After clickingon link “BulkImport from SpreadSheet ” a newpage willget openas follows:
2. On UploadSpreadsheet : Uploaded data from XLS will be shown inJquerydata-gridas shownbelow:
3. After all the validations are validated, onclick of “Save” buttonnew adminusers will be savedin “appUser” table in
Relational database.
4. After saving indatabase, updatedstatus of the user will be shownas follows:
Module Functions:
# URL Method Description
1 /adminUsers/downloadTemplate GET
Downloads a newXLS
template to enter the user
records
2 /adminUsers/uploadSpreadSheet POST
Uploads the XLS file and
show the records inData
Grid on UI.
3 /adminUsers/saveAllUsers POST
Saves allthe validated
users in datatbase.
4 /adminUsers/editSheetUser POST
Edits the selecteduser in
the data grid.
5 /adminUsers/deleteSheetUser POST
Deletes the selecteduser
from the grid
Controller Changes – UserController.java
New functions will be added in UserController to achieve the above functionality is as follows:
@RequestMapping(value="/downloadTemplate",method= RequestMethod.GET)
public String downloadTemplate(Model model,User user) {
return "downloadTemplate";
}
@RequestMapping(value="/uploadSpreadSheet",method= RequestMethod.POST)
public String uploadSpreadSheet(Model model,User user) {
return "jsonView";
}
@RequestMapping(value="/saveAllUsers",method= RequestMethod.POST)
public String saveAllUsers(Model model,User user) {
return "successUsers";
}
@RequestMapping(value="/editSheetUser",method= RequestMethod.POST)
public String editSheetUser(Model model,User user) {
return "jsonView";
}
@RequestMapping(value="/deleteSheetUser",method= RequestMethod.POST)
public String deleteSheetUser(Model model,User user) {
return "jsonView";
}
Models & Services
(1) Model: No additionalmodel needs to be added.
(2) Service: Service that requires modification: service/UserManager.java.
(3) Helper: A new Helper class that needs to be added:web/BulkImportUserHelper”.

Contenu connexe

En vedette

En vedette (9)

Spring mvc
Spring mvcSpring mvc
Spring mvc
 
Spring MVC Annotations
Spring MVC AnnotationsSpring MVC Annotations
Spring MVC Annotations
 
Spring MVC
Spring MVCSpring MVC
Spring MVC
 
Rest services caching
Rest services cachingRest services caching
Rest services caching
 
Caching Strategies
Caching StrategiesCaching Strategies
Caching Strategies
 
Caching in HTTP
Caching in HTTPCaching in HTTP
Caching in HTTP
 
Spring Security
Spring SecuritySpring Security
Spring Security
 
Proxy design pattern (Class Ambassador)
Proxy design pattern (Class Ambassador)Proxy design pattern (Class Ambassador)
Proxy design pattern (Class Ambassador)
 
Proxy Design Pattern
Proxy Design PatternProxy Design Pattern
Proxy Design Pattern
 

Similaire à User module

LearningMVCWithLINQToSQL
LearningMVCWithLINQToSQLLearningMVCWithLINQToSQL
LearningMVCWithLINQToSQL
Akhil Mittal
 
Cis407 a ilab 6 web application development devry university
Cis407 a ilab 6 web application development devry universityCis407 a ilab 6 web application development devry university
Cis407 a ilab 6 web application development devry university
lhkslkdh89009
 
Cis 407 i lab 6 of 7
Cis 407 i lab 6 of 7Cis 407 i lab 6 of 7
Cis 407 i lab 6 of 7
helpido9
 
need help completing week 6 ilab.. i will upload what I currently ha.docx
need help completing week 6 ilab.. i will upload what I currently ha.docxneed help completing week 6 ilab.. i will upload what I currently ha.docx
need help completing week 6 ilab.. i will upload what I currently ha.docx
niraj57
 
Student_result_management_system_project.doc
Student_result_management_system_project.docStudent_result_management_system_project.doc
Student_result_management_system_project.doc
AnshChhabra6
 
M2ModuleDevelopmenteBook
M2ModuleDevelopmenteBookM2ModuleDevelopmenteBook
M2ModuleDevelopmenteBook
Trọng Huỳnh
 
10 Howto Administer Docpublisher
10 Howto Administer Docpublisher10 Howto Administer Docpublisher
10 Howto Administer Docpublisher
SWING Software
 
FABEX DOCUMENTATION
FABEX DOCUMENTATIONFABEX DOCUMENTATION
FABEX DOCUMENTATION
Jacob Wunude
 

Similaire à User module (20)

LearningMVCWithLINQToSQL
LearningMVCWithLINQToSQLLearningMVCWithLINQToSQL
LearningMVCWithLINQToSQL
 
ASP.NET Identity
ASP.NET IdentityASP.NET Identity
ASP.NET Identity
 
359555069 aae-control room-usermanual
359555069 aae-control room-usermanual359555069 aae-control room-usermanual
359555069 aae-control room-usermanual
 
Cis407 a ilab 6 web application development devry university
Cis407 a ilab 6 web application development devry universityCis407 a ilab 6 web application development devry university
Cis407 a ilab 6 web application development devry university
 
Task scheduling in laravel 8 tutorial
Task scheduling in laravel 8 tutorialTask scheduling in laravel 8 tutorial
Task scheduling in laravel 8 tutorial
 
Devise and Rails
Devise and RailsDevise and Rails
Devise and Rails
 
Cis 407 i lab 6 of 7
Cis 407 i lab 6 of 7Cis 407 i lab 6 of 7
Cis 407 i lab 6 of 7
 
need help completing week 6 ilab.. i will upload what I currently ha.docx
need help completing week 6 ilab.. i will upload what I currently ha.docxneed help completing week 6 ilab.. i will upload what I currently ha.docx
need help completing week 6 ilab.. i will upload what I currently ha.docx
 
Alfredo-PUMEX
Alfredo-PUMEXAlfredo-PUMEX
Alfredo-PUMEX
 
Alfredo-PUMEX
Alfredo-PUMEXAlfredo-PUMEX
Alfredo-PUMEX
 
Alfredo-PUMEX
Alfredo-PUMEXAlfredo-PUMEX
Alfredo-PUMEX
 
Alfredo-PUMEX
Alfredo-PUMEXAlfredo-PUMEX
Alfredo-PUMEX
 
Mvc4 crud operations.-kemuning senja
Mvc4 crud operations.-kemuning senjaMvc4 crud operations.-kemuning senja
Mvc4 crud operations.-kemuning senja
 
Student_result_management_system_project.doc
Student_result_management_system_project.docStudent_result_management_system_project.doc
Student_result_management_system_project.doc
 
M2ModuleDevelopmenteBook
M2ModuleDevelopmenteBookM2ModuleDevelopmenteBook
M2ModuleDevelopmenteBook
 
ChircuVictor StefircaMadalin rad_aspmvc3_wcf_vs2010
ChircuVictor StefircaMadalin rad_aspmvc3_wcf_vs2010ChircuVictor StefircaMadalin rad_aspmvc3_wcf_vs2010
ChircuVictor StefircaMadalin rad_aspmvc3_wcf_vs2010
 
Migration of application schema to windows azure
Migration of application schema to windows azureMigration of application schema to windows azure
Migration of application schema to windows azure
 
Phase 2
Phase 2Phase 2
Phase 2
 
10 Howto Administer Docpublisher
10 Howto Administer Docpublisher10 Howto Administer Docpublisher
10 Howto Administer Docpublisher
 
FABEX DOCUMENTATION
FABEX DOCUMENTATIONFABEX DOCUMENTATION
FABEX DOCUMENTATION
 

Dernier

Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
panagenda
 
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
UK Journal
 

Dernier (20)

Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoft
 
TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch Tuesday
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
 
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
 
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties ReimaginedEasier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
 
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
 
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The InsideCollecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptx
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptx
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentation
 

User module

  • 1. AdminUsers Module – Changesin Web-Layerto use Spring MVC Overview In this module following functions willbe coveredinREL. 1. Show Users List 2. Add New User 3. Edit Existing User 4. Save Changespost Editing 5. Delete Existing User Module functions in Sample Application: The users module inthe sample applicationwill support the followingfunctions exposedbythe listed URLs. # URL Method Description 1 /admin/users/view/{id} /admin/users/view GET Gets the list of users inthis REL application 2 /admin/users/new GET Shows the UI to adda new user. 3 /admin/users/edit/{id} GET Show the UI to edit the info of existing user. 4 /admin/users/delete/{id} POST Deletes the existing user. 5 /admin/users/save POST Saves the informationof new andexisting user. Controller – UserController.java Create a newfile 'web/ UserController.java'. This class handlesthe "/adminUsers/*" requests. package com.pearson.rel.webapp.controller; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import com.pearson.rel.model.User; @Controller @RequestMapping(value="/adminUsers") public classUsersController { @RequestMapping(value="/view",method= RequestMethod.GET) public String view(User user) { return "userList"; } @RequestMapping(value="/addNew",method= RequestMethod.GET) public String addNew(Modelmodel,User user) { return "userForm"; } @RequestMapping(value="/edit/{userName}",method= RequestMethod.GET) public String edit(Model model,User user){ model.addAttribute("userForm",new User()); return "userForm"; }
  • 2. @RequestMapping(value="/delete",method = RequestMethod.POST) public String delete(Model model,User user){ return "userList"; } @RequestMapping(value="/save",method= RequestMethod.POST) public String save(Modelmodel,User user) { return "userForm"; } } Models & Services (1) Model: Due to simplicityof requests, noadditional model needs to be added. (2) Service: No changesat the servicesare required. Subtasks (1) Validations : a. To check User withthe same name alreadyexists b. To validate the “password” and“confirm password” fields match. c. Validate mandatoryfields. New functionality - Bulk Import from Spreadsheet Overview: Bulk Import from SpreadSheet: New linkwill be providedadjacent to “Addnew User” onview page. Using this link ,user can import multiple admin users from XLS. After performing the validations, users would be addedto the database. Steps Involved: 1. After clickingon link “BulkImport from SpreadSheet ” a newpage willget openas follows: 2. On UploadSpreadsheet : Uploaded data from XLS will be shown inJquerydata-gridas shownbelow:
  • 3. 3. After all the validations are validated, onclick of “Save” buttonnew adminusers will be savedin “appUser” table in Relational database. 4. After saving indatabase, updatedstatus of the user will be shownas follows: Module Functions: # URL Method Description 1 /adminUsers/downloadTemplate GET Downloads a newXLS template to enter the user records 2 /adminUsers/uploadSpreadSheet POST Uploads the XLS file and show the records inData Grid on UI. 3 /adminUsers/saveAllUsers POST Saves allthe validated users in datatbase. 4 /adminUsers/editSheetUser POST Edits the selecteduser in the data grid. 5 /adminUsers/deleteSheetUser POST Deletes the selecteduser from the grid Controller Changes – UserController.java New functions will be added in UserController to achieve the above functionality is as follows: @RequestMapping(value="/downloadTemplate",method= RequestMethod.GET) public String downloadTemplate(Model model,User user) { return "downloadTemplate"; } @RequestMapping(value="/uploadSpreadSheet",method= RequestMethod.POST) public String uploadSpreadSheet(Model model,User user) { return "jsonView"; } @RequestMapping(value="/saveAllUsers",method= RequestMethod.POST) public String saveAllUsers(Model model,User user) {
  • 4. return "successUsers"; } @RequestMapping(value="/editSheetUser",method= RequestMethod.POST) public String editSheetUser(Model model,User user) { return "jsonView"; } @RequestMapping(value="/deleteSheetUser",method= RequestMethod.POST) public String deleteSheetUser(Model model,User user) { return "jsonView"; } Models & Services (1) Model: No additionalmodel needs to be added. (2) Service: Service that requires modification: service/UserManager.java. (3) Helper: A new Helper class that needs to be added:web/BulkImportUserHelper”.