Download
develop a simple crud application in minutes with cuba platform n.
Skip this Video
Loading SlideShow in 5 Seconds..
Develop a Simple CRUD Application in Minutes with CUBA Platform PowerPoint Presentation
Download Presentation
Develop a Simple CRUD Application in Minutes with CUBA Platform

Develop a Simple CRUD Application in Minutes with CUBA Platform

198 Views Download Presentation
Download Presentation

Develop a Simple CRUD Application in Minutes with CUBA Platform

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. Develop a Simple CRUD Application in Minutes with CUBA Platform

  2. Objectives • This documentwillguideyouthroughsomekey featuresoftheCUBAPlatformframeworkandshowhowyoucanrapidly create a Full Stack CRUD application from an existing database. • It is presented as a Hands-on-Lab. • Estimated time to complete this lab is 15 minutes. • Actual development time is less than 5 minutes. • The audience is assumed to have a basicknowledgeof an RDBMS

  3. WhatisCUBAPlatform? AhighlevelJavaframework forrapidenterprisesoftwaredevelopment.The platformprovidesarichsetoffeatures: Richweb/desktopUI CRUD Role basedandrowlevelsecurity Reporting Charts Fulltextsearch REST-API Scalabledeployment ● ● ● ● ● ● ● ●

  4. Why the CUBAPlatform? Reduces code that a developer must write

  5. Whtearegingtoutomate What wearegoingtoautomate

  6. What we are going to automate • Generation of a data model, mapped to the legacy DB • The database update to match the CUBA Platform requirements • Generation of standard CRUD UI

  7. World Data Model

  8. Whatwearegoingtoautomate Applicationfeatures Ourapplication will: HaveRichWebUI, withAjax communicationPerformbasic CRUDoperations Provide web application access from desktop or mobile devices Allowustocreate mobileapplications orwebsite usingREST-API ● ● ● ● ● ● ● Just5 minutes of development time - andwearereadydemo!

  9. Environmentandtools

  10. Environmentand tools Developmentenvironment CUBAStudiohttps://www.cuba-platform.com/download Existing PostgreSQL database called world

  11. Gettingstarted

  12. WhatisCUBAStudio? Gettingstarted CUBAStudio–aweb baseddevelopmenttoolthat Offersaquickwaytoconfigureaprojectand describe data model Manages DBscripts Enablesscaffoldingand visualdesignforthe userinterfaceWorks in parallelwithyour favoriteIDE: IntelliJIDEAorEclipse ● ● ● ●

  13. Createanewproject Gettingstarted ClickCreate Newonwelcomescreen Fillupprojectname:workshop ClickOKand you’llgetinto theCUBAStudio workspace

  14. CUBAStudioworkspace Gettingstarted UsingCUBAStudio youcaneasily createEntities, Screensand stubs forServices. Youcan hide/showtheHelp panelusing menuHelp - Show helppanel 1. ClickEditintheProjectPropertiessection

  15. Projectproperties screen Gettingstarted This isa pagewhereweconfigureourproject. TheCUBAPlatformsupportsPostgreSQL,MSSQL, OracleandHSQL databases.

  16. Database

  17. Database We Already Have a Database PostgreSQL database PostgreSQL version of MySQL World database

  18. We will Access the Database using JPA Entities

  19. Database UI Connection to the Database Using JPA and the Data Model The User Interface does not communicate directly with the database. Instead JAVA Classes are created for each table or view in the database and the programs communicate with those classes via a REST API In CUBA Studio we specify which tables or views we need to access and create a Data Model for each table or view. CUBA Automatically creates REST API’s when it generates the data model. We then specify the type ofuser interface we need to access the REST APIs that represent the Data Model.

  20. Database Database Access with JPA in CUBA Platform CUBA Studio reverse engineers the database to create JAVA CRUD Classes that correspond to each table These CRUD classes also implement REST APIs JAVA Classes are used by the application as proxies in conjunction with the Eclipselink JPA framework to access tables in the database We call these JAVA classes the Data Model or entities Our next step is to generate the Data Model

  21. Datamodel

  22. Generation of Data Model and UI’s Data model Press Data Model

  23. Generation of Data Model and UI’s Data model Press Show tables

  24. Generation of Data Model and UI’s Data model Press Select All Press Next

  25. UserInterface

  26. Screensscaffolding UserInterface Now let’screatestandardbrowserand editorscreens for theSparePartentity. SelectSparePartin thenavigationpanel ClickontheCreatestandard screenslink ClickCreate Onthisscreenwecan specifywhereto placethescreensand whichmenuitem willbeusedtoopenthebrowserscreen. Thefollowing terminologyis used: Browserscreen —screenwithlistof records Editorscreen —simple editformforrecord ● ●

  27. Generate UI from Data Model UserInterface

  28. Generate UI from Data Model UserInterface

  29. Generate UI from Data Model UserInterface

  30. FirstlaunchandCRUD

  31. UI UserInterface Let'stest it Ourapplicationisdone,of course,to afirstapproximation. Let’s compileand launchit! InvoketheRun - Startapplicationactionfromthe menu. Studio willdeploy alocalTomcatinstancein theprojectsubdirectory, deploy thecompiledapplicationthereandlaunchit. Opentheapplication by clickingalinkinthebottompartof theStudio.

  32. Loginscreen Firstlaunchand CRUD Thesystem loginscreenhas appeared. This isastandardCUBAscreen,whichcanbecustomized, aseverything inCUBA, tomeetspecificrequirements. 1. ClickSubmitto login

  33. Orderbrowser Firstlaunch Firstlaunchand CRUD Sincewehavenotchangedtheapplicationmenu, our items aredisplayedbydefaultunder theApplication menu. 1. OpenApplication— Ordersfromthemenu This isastandardbrowserscreenwithafilterontopand atablebelow.

  34. Ordereditscreen UI Firstlaunch Firstlaunchand CRUD ClickCreateand enter thedescription SelectStatus:New Clickbutton[…]to selectaclientfor theorder

  35. CRUD application UI Firstlaunch Firstlaunchand CRUD 1. ClickOKto savetheorder This isasmallworkingCRUD applicationthatwrites datato thedatabaseandallows youtosimplykeeptrackof orders. Wecansearch for ordersusingour Filter. Tablecomponentenables ustohideandchangewidthofcolumns.Alsoourtableis sortable.

  36. Questions? Visitourforum https://www.cuba-platform.com/support