INFO 2480-61: Website Database Implementation
  • Syllabus
  • Welcome Letter
  • Week 1: Software and Setup
    • Folder Structure
    • Git: Getting Started
      • Installing a Git Client
      • Creating a Local Repository
      • Making Changes and Merging them
      • Git Wrap Up
    • Git: Github
      • Creating a New Account
      • Creating a Repo on Github
      • Cloning and Forking
      • Cloning a Repo from Github
      • Pushing Changes to Github.com
      • Github: Adding a Collaborator
    • Command Box
      • Downloading the Software
      • Unzipping and Running the Software for the first time
      • Using CommandBox And Installing the UML-Info package.
      • Setting Up Your Local Server
      • Last Step
    • IDE ( Integrated Development Environment )
      • VS Code
      • IntelliJ
    • Journal
  • Week 2: Review of HTML and CSS
    • Making Point In Time and Working Branches
    • Opening our Project from Week 1 and Starting our BoxLang server
    • HTTP Calls and Requests
    • Making a Static Website Dynamic
    • Creating The Management Index.bxm
    • Creating An HTML Form with Bootstrap
    • Last Steps
  • Week 3: Working Forms and our First Table
    • Data Types
    • Case Types and Naming Conventions
    • Database Tools and Your First DB
      • Installing MySql WorkBench
      • Connecting to your MySQL database
      • Creating Your First Table
    • Working Forms
      • Separation of Concerns
      • Configuring Our Site To Use Our Database
      • Capturing Your Form Data
      • Creating Our Server Side Logic
  • Week 5: SQL and Modelling
    • Our Project And Its Users
    • Introduction to SQL
    • Completing our Articles page.
      • Adapting manageArticles.bxm to display existing articles in the database
      • Completing ManageArticles.bxm to Edit Existing Articles.
      • Making Active Articles Appear On The Public Page
  • Week 6: Managing Books
    • Introduction To Modelling
    • Our Data Models
    • Adapting Our Management Page To Be Multi-Tool
    • Creating The Manage Books Page
    • Adding Search To Our Front Index Page
  • Week 7: Working with Selects, Files, WYSIWYG and more.
    • Adding WYSIWYG Capabilities
    • Adding WYSIWYG to the Manage Books Tool
    • Adding Images To Our Store
    • Creating Our Publisher Select Control
  • Week 9: Joins and Better Searching
    • Displaying Our Publisher
    • Searching By Publisher
    • Creating a Browse by Genre
      • Adapting Our Database
      • Building our Queries: Part 1
      • Assigning Genres to a Book in our AddEdit.bxm page
      • Building our Queries: Part 2
      • Building the GenreNav.bxm
      • Adapting The Details.bxm Page to Search By Genre
  • End of Project Checkllist
Powered by GitBook
On this page
  • In addEdit.bxm
  • Create our Data Functions
  1. Week 6: Managing Books

Creating The Manage Books Page

Our Manage Book tool is called addEdit.bxm and has the same basic layout as the manageArticles.bxm page. On the left will be a list of the books in the database and on the right will be the form that allows us to enter or edit the data in our db. As you work through these steps, use the existing articles.bx and manageArticles.bxm as a model.

In addEdit.bxm

  1. Using manageArticles.bxm as a model, use the row and col classes in Bootstrap to create a left column ( col-3 ) and a column ( col-9 ).

  2. Again, using manageArticles.bxm as a model, create a form which has one control ( <input /> ) for each field in your books table except for the publisherId. This might include the title, ISBN13, ISBN, year, weight, and pages.

Create our Data Functions

  1. Create a new class file in the bookstore/common folder called books.bx.

  2. Create 2 functions in books.bx. Call the first saveBooks and the second searchBooks.

  3. Using articles.bx as a model, write the SQL to save a new book to the db in the saveBooks function.

  4. Again, using articles.bx as a model, write the searchBooks function so that you can either return all books in the books table or search on the title or isbn13 field.

Back in addEdit.bxm

  1. Create the side navigation which lists all the books in your database. Make each item be a link to use the addEdit.bxm template and send the isbn13 of the book through the address bar.

  2. Use the submitted isbn13 to retrieve the book details from the database and populate the form so you can edit the book.

PreviousAdapting Our Management Page To Be Multi-ToolNextAdding Search To Our Front Index Page

Last updated 3 months ago