DOTWEB5(OJ7) Samples for WebApplication
🌐 DOTWEB(OJ7) Samples for WebApplication
📖 Sample A: Introduction
Why Java/J2EE is not a secure programming language
Difference between Java (JDK 1.8) and DotWeb5 (OJ7)
Overview of DotWeb5 (OJ7) Divisions and FAQs
🔹 DotWeb5 (OJ7) Divisions
DotWeb5 (OJ7) is organized into six divisions:
Scroll Server with DotWeb5 (OJ7)
Supports .web and .ojava7 formats.
Scroll Server with Java/J2EE and JDK 1.8 Compiler
DotWeb5 compiler is not used here.
JDK 1.8 is required because frameworks like Hibernate, MyBatis, Java Spring, and EJB are written in JDK 1.8.
Limitations: JSP and Servlets do not work in Scroll Server, but EJB and JMS are supported.
Scroll Server with .java7 using DotWeb5 (OJ7) Compiler
Machine Learning and Data Science
Supported through user-friendly frameworks (OJ7UA).
Advanced Samples
Includes .web and DotWeb5 (OJ7) console applications.
Remote-X Application (Advanced)
Not yet released.
❓ Doubtful FAQs
Can DotWeb5 (OJ7) compiler work with JDK 1.8 and Java/J2EE frameworks?
No.
Can DotWeb5 (OJ7) compile JDK 1.8 programs?
No, it does not accept JDK 1.8 or later versions.
Is DotWeb5 (OJ7) a competitor to Java/J2EE?
No, its business model is entirely different from Oracle’s.
Can DotWeb5 (OJ7) work as a standalone application?
Yes, it functions independently of Java/J2EE.
Is DotWeb5 (OJ7) a secure programming language?
Yes, it is designed with high security in mind.
The Differences Between Java(JDK 1.8) or Java latest version and DotWeb5(OJ7) are given below...
⚠️ Demerits of Java/J2EE Programming Language
🔒 Why Java/J2EE Is Not Secure
Java programs are compiled into .class files. These files can be easily decompiled using tools such as JAD Decompiler, which converts compiled bytecode back into readable source code. As a result, sensitive information such as database connections and business logic becomes exposed, leading to a complete failure of security across Java JDK 1.8 and other versions.
📂 Example: MySQL Program in Java
import java.sql.*;
class MysqlCon{
public static void main(String args[]){
try{
Class.forName("com.mysql.jdbc.Driver");
Connection con=DriverManager.getConnection(
"jdbc:mysql://localhost:3306/wil","root","Dove12345");
//here sonoo is database name, root is username and password
Statement stmt=con.createStatement();
ResultSet rs=stmt.executeQuery("select * from emp");
while(rs.next())
System.out.println(rs.getInt(1)+" "+rs.getString(2)+" "+rs.getString(3));
con.close();
}catch(Exception e){ System.out.println(e);}
}
}
🔓 Decompiled Output (via JAD)
MysqlCon.jad
// Decompiled by Jad v1.5.8f. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3)
// Source File Name: MysqlCon.java
import java.io.PrintStream;
import java.sql.*;
class MysqlCon
{
MysqlCon()
{
}
public static void main(String args[])
{
try
{
Class.forName("com.mysql.jdbc.Driver");
Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/wil", "root", "Dove12345");
Statement statement = connection.createStatement();
for(ResultSet resultset = statement.executeQuery("select * from emp"); resultset.next(); System.out.println((new StringBuilder()).append(resultset.getInt(1)).append(" ").append(resultset.getString(2)).append(" ").append(resultset.getString(3)).toString()));
connection.close();
}
catch(Exception exception)
{
System.out.println(exception);
}
}
}
🚨 Security Implications
All database connections and business logic are visible to hackers.
Writing Java programs becomes risky, as attackers can easily steal data.
Vulnerabilities extend across EJB, Servlet, JSP, and JMS frameworks.
This is why Java/J2EE is considered weak in security.
🌟 Emergence of DotWeb5 (OJ7)
To address these shortcomings, a new interactive, secure, and advanced programming language was introduced: DotWeb5 (OJ7).
Created in DotWeb3.0 and Java JDK 1.6 by Wilmix Jemin J.
Designed to be highly secure, user-friendly, and cost-effective.
Supports advanced features like obfuscation, shortest function statements, and WNOSQL database integration.
🔤 Expansion of DotWeb5 (OJ7)
Dot→ stands for versatile and music.
W → Wilmix (Inventor)
E → Electronic (technology, business, internet: e-commerce, e-mail, e-learning)
B → Contextual meanings (brother, base, born, etc.)
5 → Adventure, linked to Remote-X Application
0 → Represents additional features in DotWeb5.0
O → Olive
J → Jemin
7 → Completeness, perfection, spirituality, and pursuit of knowledge
✅ Key Takeaway
Developers must understand the difference between DotWeb5 (OJ7) and JDK 1.8 to fully appreciate the security, efficiency, and advanced capabilities offered by DotWeb5 (OJ7).
📘 SAMPLE‑17: Performing an Autocomplete Operation
🔹 Overview
This sample demonstrates how to perform an autocomplete operation using DotWeb5 (OJ7) in combination with HTML and jQuery.
🖥️ DotWeb5 (OJ7) Program
<WEB> //start of DotWeb5(OJ7) program
<PACK> Program12 // create namespace as Program12 so that we can use this namespace as a library in
//another DotWeb5(OJ7) program
{
<CLASS> Prog // <CLASS> represents class
{
public void main() // C type main
{
HTML.displayhtml("autocomplete1.html"); // now your declare HTML.displayhtml //to load autocomplete1.html
<PRINTLN>("[");
<PRINTLN>("'JWEB(JDollar)',");
<PRINTLN>("'DOTWEB',");
<PRINTLN>("'DotWeb5(OJ7)',");
<PRINTLN>("'PHP',");
<PRINTLN>("'Python',");
<PRINTLN>("'C',");
<PRINTLN>("'DOTNET',");
<PRINTLN>("'JAVA',");
<PRINTLN>("'GO',");
<PRINTLN>("'Angularjs',");
<PRINTLN>("'Android',");
<PRINTLN>("'Bootstrap.js',");
<PRINTLN>("'JavaScript'");
<PRINTLN>("]");
// add the data values
HTML.displayhtml("autocomplete2.html");// now you declare HTML.displayhtml to load autocomplete2.html
}
}
}
🌐 HTML File (autocomplete2.html)
Autocomplete Example
autocomplete2.html
;
$( "#tags" ).autocomplete({
source: availableTags
});
} );
</script>
</head>
<body>
<div class="ui-widget">
<label for="tags">Tags: </label>
<input id="tags">
</div>
</body>
</html>
Tags:
📥 Input
A list of programming languages is added to the list box.
📤 Output
When you type a letter (e.g., J), the autocomplete will suggest Java,OakJava7
==============================================================================================================
✨ Unit 2: How a Normal Web Application Works in Dotweb5.0 ✨
====================================================================================================================
# ✨ Unit 2: How a Normal Web Application Works in Dotweb5.0 ✨
## 🌐 Overview
In **Dotweb5.0**, a normal web application works with two types of extensions:
- **`.scroll`** → Common extension for Dotweb5.0 and OakJava7, accepted by **ScrollServer**.
Used for constructing the **first webpage application**.
- **`.exe`** → Used as a **second-page application**, but only in **Dotweb5.0 Professional Edition**.
In the **Enterprise Edition**, `.scroll` is used for the first page, while the second page is a **Logic Page** (not `.exe`).
---
## 📝 Workflow of a Dotweb5.0 Web Application
1. The user submits a form (e.g., for insertion or login).
2. The request goes to the **Logic Page**, which displays the information provided in the registration page.
3. Data can be printed in a **table format**.
4. When **wnosql DB** is used, all requested values (via wnosql query) are listed on the Logic Page.
5. Form field values are not stored in the browser. Instead, they are securely saved in a file, ensuring that sensitive data
remains protected and cannot be exposed outside the application environment.
**J7Cookie** is different from a normal cookie (explained in the Cookies chapter).
---
## 📖 Example: Dotweb5.0 Web Application
**File: `jindex1.web`**
---
### 🔒 Security Setup
```dotweb5
<WEB>
// Load Security files
<USE> Security;
<USE> <OJ7UTIL>;
// Dotweb5 package
<PACK> web5array
```
---
### 🏗️ Program Structure
```dotweb5
<CLASS> Program {
public void main() {
<TRY> {
HTML.displayhtml("formdemowsql21.html");
// Add form field values to OJ7UTIL ArrayList
<OJ7UTIL>.ArrayList arm1 = new <OJ7UTIL>.ArrayList();
arm1.add("name1");
arm1.add("uname1");
arm1.add("password1");
arm1.add("state1");
arm1.add("country1");
arm1.add("NOT");
<PRINTLN>("<!DOCTYPE html>");
<PRINTLN>("<BODY bgcolor=pink>");
<PRINTLN>("<form>");
```
---
### 📊 Handling Form Data
- **Request.Query** retrieves form fields from `jindex1j7.dsn`.
- The `.dsn` file is dynamically created when navigating to the next webpage.
- Example:
```dotweb5
<OJ7UTIL>.ArrayList armg = Request.Query(arm1,"jindex1j7.dsn",5,1);
```
- `5` → Number of fields in the form.
- `1` → Stores all field values.
- If `2` is used instead of `1`, only selected fields (name, password, country) are stored.
---
### 📋 Displaying Data in Table Format
```dotweb5
<PRINTLN>("<table bgcolor=gold>");
<PRINTLN>("<tr>");
<PRINTLN>(" <th>Name</th>");
<PRINTLN>(" <th>Username</th>");
<PRINTLN>(" <th>Password</th>");
<PRINTLN>(" <th>State</th>");
<PRINTLN>(" <th>Country</th>");
<PRINTLN>(" </tr>");
```
---
### ✅ Validation Logic
- The program validates:
- **Name** = "Admin"
- **Password** = "password"
If correct → Displays user details in a table with a **“Valid User”** message.
If incorrect → Displays **“Invalid User”** message.
---
### ⚙️ Exception Handling
```dotweb5
<CATCH> (Exception e) {
<PRINTLN>("Error.... " + e);
}
<Finally> {
<PRINTLN>("The Finally block is executed...");
}
```
---
📖 Complete Code for the given Example: Dotweb5.0 Web Application
// jindex1.web
// ========================================
// Example Dotweb5.0 Web Application
// ========================================
<WEB>
// Load Security files
<USE> Security;
<USE> <OJ7UTIL>;
// Dotweb5 package
<PACK> web5array;
<CLASS> Program {
public void main() {
<TRY> {
// Display the HTML form
HTML.displayhtml("formdemowsql21.html");
// Initialize form field values
<OJ7UTIL>.ArrayList arm1 = new <OJ7UTIL>.ArrayList();
arm1.add("name1");
arm1.add("uname1");
arm1.add("password1");
arm1.add("state1");
arm1.add("country1");
arm1.add("NOT");
// Print basic HTML structure
<PRINTLN>("<!DOCTYPE html>");
<PRINTLN>("<html>");
<PRINTLN>("<body bgcolor='pink'>");
<PRINTLN>("<form>");
// Request.Query retrieves form fields from jindex1j7.dsn
// The .dsn file is dynamically created when navigating to the next page
<OJ7UTIL>.ArrayList armg = Request.Query(arm1, "jindex1j7.dsn", 5, 1);
// Build table to display results
<PRINTLN>("<table bgcolor='gold'>");
<PRINTLN>("<tr>");
<PRINTLN>("<th>Name</th>");
<PRINTLN>("<th>Username</th>");
<PRINTLN>("<th>Password</th>");
<PRINTLN>("<th>State</th>");
<PRINTLN>("<th>Country</th>");
<PRINTLN>("</tr>");
// Validate user credentials
for (int i = 0; i < armg.size() - 1; i += 4) {
String name = armg.get(i).ToString();
String username = armg.get(i + 1).ToString();
String password = armg.get(i + 2).ToString();
String state = armg.get(i + 3).ToString();
String country = armg.get(i + 4).ToString();
// Check if credentials are valid
if (name.Equals("Admin") && password.Equals("password")) {
<PRINTLN>("<tr>");
<PRINTLN>("<td>" + name + "</td>");
<PRINTLN>("<td>" + username + "</td>");
<PRINTLN>("<td>" + password + "</td>");
<PRINTLN>("<td>" + state + "</td>");
<PRINTLN>("<td>" + country + "</td>");
<PRINTLN>("</tr>");
<PRINTLN>("<br><marquee>Valid User!</marquee><br>");
} else {
<PRINTLN>("<br><marquee>Invalid User!</marquee><br>");
break;
}
}
// Close table and form
<PRINTLN>("</table>");
<PRINTLN>("</form>");
<PRINTLN>("</body>");
<PRINTLN>("</html>");
}
<CATCH> (Exception e) {
<PRINTLN>("Error: " + e);
}
<Finally> {
<PRINTLN>("The Finally block is executed...");
}
}
}
🌐 Dotweb5.0 Web Application – View Part
formdemowsql21.html
<html>
<body>
<form action="http://localhost:9000/jindex1.web5" method="post">
<table align="center" border="3" width="500" height="500" bgcolor="lightgreen">
<!-- Title Row -->
<tr>
<td>
<h2>
<a href="#chapter1">
<center>Enter Your Form Details</center>
</a>
</h2>
</td>
</tr>
<!-- Input Fields -->
<tr>
<td>
<p>Enter Your Name:
<input type="text" name="name1" size="25" />
</p>
</td>
</tr>
<tr>
<td>
<p>Enter Your Username:
<input type="text" name="uname1" size="15" />
</p>
</td>
</tr>
<tr>
<td>
<p>Enter Your Password:
<input type="password" name="password1" size="25" />
</p>
</td>
</tr>
<tr>
<td>
<p>Choose Your State:
<input type="text" name="state1" size="15" />
</p>
</td>
</tr>
<tr>
<td>
<p>Choose Your Country:
<input type="text" name="country1" size="15" />
</p>
</td>
</tr>
<!-- Register Section -->
<tr>
<td>
<h2>
<a href="#chapter2">REGISTER</a>
</h2>
</td>
</tr>
<!-- Submit and Reset Buttons -->
<tr>
<td>
<input type="submit" name="Click" value="Submit" />
<input type="reset" name="Clear" value="Clear" />
</td>
</tr>
</table>
</form>
</body>
</html>
## 🌟 Key Takeaways
1. Dotweb5.0 uses for the first page and a Logic Page for the second.
2. .exe files are only supported in the Professional Edition, not in the Enterprise Edition.
3. The Logic Page processes form submissions, displays registration data, and interacts with wnosql DB queries.
4. Validation ensures secure login and controlled data display.
5. Form field values are not stored in the browser. Instead, they are securely saved in a file,
ensuring that sensitive data remains protected and cannot be exposed outside the application environment.
6. J7Cookie is different from a normal cookie (explained in the Cookies chapter).
7. Exception handling ensures robustness and reliability in the application workflow.
---
# ⚙️ Running the Scroll Server in Dotweb5.0 ⚙️
---
## 🚀 Starting the Server
To run the **Scroll Server** in Dotweb5.0, follow these steps:
1. Navigate to the correct directory.
2. Type the command:
```
ScrollServer1.0.3-EnterpriseEditionv.1.exe --Start
```
3. Alternatively, you can use the **EnlightEditor** to run Dotweb5.0 web files.
---
## 📂 Configuration File (params.txt)
In the `params.txt` file, you must specify the correct directory path.
Here is an example configuration:
```
############################################################################
# #
# Configuration File for WILMIX CAT Web Server #
# #
############################################################################
# Directive ServerRoot holds the path of the publication directory
ServerRoot d:\WOJ3\project\bin\apps\wilmix
# Directive Port contains the listening server port number
Port 9000
# Directive Welcome specifies the welcome page
Welcome /
# Directive Icons contains the virtual directory name where server icons are located
Icons d:\WOJ3\project\bin\apps\wilmix
# Directive LogFile indicates the path of the server log file
LogFile 10.29.153.50
# Path for the location of the WebServer
Serverpath d:\WOJ3\project\bin\apps\wilmix
# Server validity time
Validitytime 15/05/2027
# Server status (on/off); type Dotweb3.0 code if on
ServerStatus jit-https-77plJSTAR123$$
```
---
## 🔑 Password Information
The password for the Scroll Server is:
```
jit-https-77plJSTAR123$
```
---
## 🌟 Key Notes
- Always ensure the **directory path** in `params.txt` matches your project location.
- The **Port** directive defines the server’s listening port (default: 9000).
- The **ServerStatus** directive must be set correctly for the server to run.
- The password is required for secure access to the Scroll Server.
Here’s a clear **step‑by‑step startup guide** for running the Scroll Server in Dotweb5.0, written in checklist format so you can follow it easily:
---
# ✅ Step‑by‑Step Guide to Running Scroll Server
---
## 1. 📂 Navigate to the Directory
- Open your terminal or command prompt.
- Go to the directory where **ScrollServer1.0.3-EnterpriseEditionv.1.exe** is located.
Example:
```
cd d:\WOJ3\project\bin\apps\wilmix
```
---
## 2. ▶️ Start the Scroll Server
- Run the following command:
```
ScrollServer1.0.3-EnterpriseEditionv.1.exe --Start
```
- Alternatively, you can use **EnlightEditor** to run Dotweb5.0 web files.
---
## 3. 📝 Configure params.txt
- Open the `params.txt` file.
- Ensure the following directives are correctly set:
```
ServerRoot d:\WOJ3\project\bin\apps\wilmix
Port 9000
Welcome /
Icons d:\WOJ3\project\bin\apps\wilmix
LogFile 10.29.153.50
Serverpath d:\WOJ3\project\bin\apps\wilmix
Validitytime 15/05/2020
ServerStatus jit-https-77plJSTAR123$$
```
---
## 4. 🔑 Password Setup
- The password for the Scroll Server is:
```
jit-https-77plJSTAR123$
```
- Keep this password secure, as it is required for server authentication.
---
## 5. 📊 Verify Server Status
- After starting, check the server log file (`LogFile`) to confirm it is running.
- Ensure the **Port (9000)** is listening.
- Confirm that the **ServerStatus** directive is set to `on` (Dotweb3.0 code).
---
## 6. 🌐 Access the Web Application
- Open a browser and go to:
```
http://localhost:9000/
```
- You should see the **welcome page** or your configured Dotweb5.0 application.
---
## ✨ Quick Checklist
- [ ] Navigate to correct directory
- [ ] Run `ScrollServer...exe --Start`
- [ ] Configure `params.txt` properly
- [ ] Secure the password
- [ ] Verify server logs and port
- [ ] Access via browser
---
# ⏹️ Stopping the Scroll Server
To stop the **Scroll Server** in Dotweb5.0:
- Simply press **CTRL + C** in the terminal or command prompt window where the server is running.
- This command will terminate the server process and shut it down safely.
---
## 🌟 Key Note
Always ensure you stop the server properly using **CTRL + C** before closing the terminal, to avoid leaving background processes running.
---
📸 Note on Screenshot
Note: This screenshot shows the first page (Scroll Page) and the second page (Logic Page) of the Dotweb5.0 application.
===============================================================================================================
📸 Note on Screenshot
Note: The screenshot of the Dotweb5.0 application with the Scroll Server Welcome Page is shown below.
If you don't type http://localhost:9000/index.html or you type wrongly like http://localhost:9000/index
it will display "Page Not Found" error.
==============================================================================================================
🌟 Sorting Objects in Dotweb5.0
# 🌟 Sorting Objects in Dotweb5.0
### A Demonstration with Employee and Student Classes
---
## 📖 Scenario
In my scenario:
1. I created an **Employee class** which contains the fields: `Id`, `Name`, and `Salary`.
- I want to sort the employees based on:
- **Name**
- **Salary**
2. I created a **Student class** which contains the fields: `StudentId`, `Name`, `Class`, and `TotalMarks`.
- I want to sort the students based on **Total Marks**.
---
This program illustrates how to **sort objects dynamically** in Dotweb5.0 using a **generic BubbleSort method**. The example covers two scenarios:
1. **Employee Class** → Sorted by *Name* and *Salary*
2. **Student Class** → Sorted by *Total Marks*
3. **Use Dotweb5.0 Web1.0 Theme only
---
## 📑 Program Structure
- **Employee Class**
- Fields: `Id`, `Name`, `Salary`
- **Student Class**
- Fields: `StudentId`, `Name`, `Class`, `TotalMarks`
- **Program Class**
- Contains the `main()` method
- Demonstrates sorting and displays results in **HTML card format**
---
## ⚙️ Sorting Logic
- The program uses:
- `SortedType.SortByObject.BubbleSort()`
- A **lambda selector** (`e @L e.Name`, `e @L e.Salary`, `s @L s.TotalMarks`)
- This makes the sorting **generic and reusable** for any object type.
---
## 🎨 Output Presentation
The results are displayed with **HTML styling** for clarity and attraction:
- **Card Layouts** → neatly separate each sorted result.
- **Headings and Titles** → emphasize the sorting criteria.
- **Line Breaks** → improve readability.
---
🌟 GUI HTML for this given SortByObjects.web program is
Sortingdecasc.html
<head>
<title>Dotweb5.0 Theme</title>
//Calling WEB1.0 Style Sheet for DOTWEB5.0 Theme
<link rel="stylesheet" href="http://localhost:8082/DefaultThemedotweb5.WS">
</head>
<BODY>
<div class="container">
<h2>Sort by Employee Name and Employee Salary and Sort By Student Total Marks </h2>
---
-
## 📑 Dotweb5.0 Code
**File:** `SortByObjects.web`
```dotweb5
<WEB>
<USE> format;
<PACK> sorting
{
public <CLASS> Employee
{
public int Id;
public string Name;
public double Salary;
}
// Example Student class
public <CLASS> Student
{
public int StudentId;
public string Name;
public string Class;
public int TotalMarks;
}
<CLASS> Program
{
public void main()
{
Employee[] employees = {
new Employee { Id = 1, Name = "Charlie", Salary = 5000 },
new Employee { Id = 2, Name = "Alice", Salary = 7000 },
new Employee { Id = 3, Name = "Bob", Salary = 6000 }
};
// Sort employees by Name
SortedType.SortByObject.BubbleSort(employees, e @L e.Name);
<PRINTLN>("<HTML>");
// J7HTML will print one blank line for the Html contents
J7HTML.displayhtml("Sortingdecasc.html");
<PRINTLN>("<div <CLASS>=\"card\">");
<PRINTLN>("Employees sorted by Name:");
<PRINTLN>("<BR><BR>");
foreach (var emp in employees)
<PRINTLN>(emp.Id+ " - "+ emp.Name +" - "+ emp.Salary+" | ");
<PRINTLN>("<BR><BR>");
<PRINTLN>("</div>");
// Sort employees by Salary
SortedType.SortByObject.BubbleSort(employees, e @L e.Salary);
<PRINTLN>("<div <CLASS>=\"card\">");
<PRINTLN>("\nEmployees sorted by Salary:");
<PRINTLN>("<BR><BR>");
foreach (var emp in employees)
<PRINTLN>(emp.Id+" - "+ emp.Name+" - "+ emp.Salary +" | ");
<PRINTLN>("<BR><BR>");
<PRINTLN>("</div>");
// Now with Students
Student[] students = {
new Student { StudentId = 101, Name = "David", Class = "10A", TotalMarks = 450 },
new Student { StudentId = 102, Name = "Eva", Class = "10B", TotalMarks = 480 },
new Student { StudentId = 103, Name = "Frank", Class = "10A", TotalMarks = 420 }
};
// Sort students by TotalMarks
<PRINTLN>("<div <CLASS>=\"card\">");
SortedType.SortByObject.BubbleSort(students, s @L s.TotalMarks);
<PRINTLN>("<BR><BR>");
<PRINTLN>("\nStudents sorted by Total Marks:");
<PRINTLN>("<BR><BR>");
foreach (var stu in students)
<PRINTLN>(stu.StudentId+" - "+ stu.Name +" - "+ stu.Class +" - "+stu.TotalMarks+" | ");
<PRINTLN>("<BR><BR>");
<PRINTLN>("</div>");
}
}
}
```
---
## 🎨 Output
==============================================================================================================
Sort by Employee Name and Salary and Sort by Student Total Marks using Dotweb5.0 Theme
==============================================================================================================
### 📖 Design a Elevator using DOTWEB5.0
# 🚇 Elevator Simulation in Dotweb5.0
### 📖 Scenario
An elevator begins at the **First Floor**, waits for **10 seconds**, then the door closes and it moves to the **Second Floor**.
At each floor:
- The **door opens**
- A **horn sound** is heard
- The elevator **waits for 10 seconds**
- The **door closes**
This continues until the elevator reaches the **Fifth Floor**, where it again waits for 10 seconds before closing the door.
---
## 🏢 First Floor
- Door opens
- Horn sound heard
- Door remains open for 10 seconds
- Door closes
---
## 🏢 Second Floor
- Door opens
- Horn sound heard
- Door remains open for 10 seconds
- Door closes
---
## 🏢 Third Floor
- Door opens
- Horn sound heard
- Door remains open for 10 seconds
- Door closes
---
## 🏢 Fourth Floor
- Door opens
- Horn sound heard
- Door remains open for 10 seconds
- Door closes
---
## 🏢 Fifth Floor
- Door opens
- Horn sound heard
- Door remains open for 10 seconds
- Door closes
---
### ✨ Key Highlights
- **Horn Sound**: Signals arrival at each floor.
- **Timed Wait**: Ensures passengers have 10 seconds to enter or exit.
- **Sequential Flow**: Elevator progresses floor by floor until the fifth.
- **Decorative Output**: Each floor’s actions are displayed inside a **card layout** for clarity.
### 📖 DOTWEB5.0 Program For Elevator
<WEB>
<USE> Java7sound;
<USE> format;
<USE> System.Threading;
<PACK> Elevator
{
<CLASS> Lifts
{
public void main()
{
<PRINTLN>("<HTML>");
int floorno=1;
J7HTML.displayhtml("Sortingdecasc.html");
if (floorno==1)
{
<PRINTLN>("<div <CLASS>=\"card\">");
<PRINTLN>("First floor door open");
<PRINTLN>("<BR><BR>");
Program.java7sound();
<PRINTLN>("<BR><BR>");
for (int i = 0; i < 5; i++)
{
<PRINTLN>("Door open for 2 seconds."); <PRINTLN>("<BR><BR>");
Thread.Sleep(2000);
}
<PRINTLN>("<BR><BR>");
<PRINTLN>("First floor door closed");
<PRINTLN>("</div>");
}
<PRINTLN>("<BR><BR></div>");
floorno++;
<PRINTLN>("<div <CLASS>=\"card\">");
if (floorno==2)
{
<PRINTLN>("Second floor door open");
Program.java7sound();
for (int i = 0; i < 5; i++)
{
<PRINTLN>("Door open for 2 seconds.");<PRINTLN>("<BR><BR>");
Thread.Sleep(2000);
}
<PRINTLN>("Second floor door closed");
}
<PRINTLN>("<BR><BR></div>");
floorno++;
<PRINTLN>("<div <CLASS>=\"card\">");
if (floorno==3)
{
<PRINTLN>("Third floor door open");
Program.java7sound();
<PRINTLN>("<BR><BR>");
for (int i = 0; i < 5; i++)
{
<PRINTLN>("Door open for 2 seconds.");<PRINTLN>("<BR><BR>");
Thread.Sleep(2000);
}
<PRINTLN>("Third floor door closed");
}
<PRINTLN>("<BR><BR></div>");
floorno++;
<PRINTLN>("<div <CLASS>=\"card\">");
if (floorno==4)
{
<PRINTLN>("Fourth floor door open");
Program.java7sound();
<PRINTLN>("<BR><BR>");
for (int i = 0; i < 5; i++)
{
<PRINTLN>("Door open for 2 seconds.");<PRINTLN>("<BR><BR>");
Thread.Sleep(2000);
}
<PRINTLN>("Fourth floor door closed");
}
<PRINTLN>("<BR><BR></div>");
floorno++;
<PRINTLN>("<div <CLASS>=\"card\">");
if (floorno==5)
{
<PRINTLN>("Fifth floor door open");
<PRINTLN>("<BR><BR>");
Program.java7sound();
for (int i = 0; i < 5; i++)
{
<PRINTLN>("Door open for 2 seconds.");<PRINTLN>("<BR><BR>");
Thread.Sleep(2000);
}
<PRINTLN>("<BR><BR>");
<PRINTLN>("Fifth floor door closed");
<PRINTLN>("</div>");
}
<PRINTLN>("</body></HTML>");
}
}
}
### 📖 Output For Elevator
Here’s a polished version of your explanation with standard English and attractive headings to make it clear and professional:
In the given .web program, we are invoking an HTML file (j7UserLogin.html) using the following structure:
<WEB>
<PACK> ScrollServer
{
<CLASS> Programs
{
public void main()
{
<TRY>
{
HTML.displayhtml("j7UserLogin.html");
}
<CATCH> (Exception e)
{
<PRINTLN>("Error.... " + e);
}
<Finally>
{
<PRINTLN>("The Finally block is executed...");
}
}
}
}
This program demonstrates exception handling with <TRY>, <CATCH>, and <Finally> blocks while displaying the j7UserLogin.html page.
<head>
<title>User Login</title>
<link rel="stylesheet" href="http://localhost:8082/modelbox1.WS">
</head>
The page title is User Login.
A Web1.0 style sheet (modelbox1.WS) is invoked from the local server ie) Web1.0 Wilmix cat Server
<body onLoad="disableClick()" oncontextmenu="return false"
background="https://picsum.photos/200/300/?random" bgcolor="gold">
Security features: Right-click is disabled, and clicks are restricted.
Background: A random image is loaded with a golden background color.
<button onclick="document.getElementById('id01').style.display='block'" style="width:auto;">Sign Up</button>
<div id="id01" class="modal">
<span onclick="document.getElementById('id01').style.display='none'" class="close" title="Close Modal">×</span>
<form class="modal-content" action="http://localhost:9000/OakJ7Process.web5" method="post">
<div class="container">
<h2><a href="#chapter1">Enter your Details</a></h2>
<p><label> User Name: <input type="text" name="uname" size="25" /></label></p>
<p><label> Password: <input type="password" name="password" size="15" /></label></p>
<div class="clearfix">
<input type="submit" name="Click">
<input type="reset" name="Clear">
</div>
</div>
</form>
</div>
Modal Window: Displays a sign-up form when the button is clicked.
Form Action: Submits data to OakJ7Process.web5 running on port 9000.
Fields: Username and password input fields with submit/reset options.
<div class="container" style="background-color:#f1f1f1">
<p align="center"> Jemin Information Technology 2024 (C) All Rights Reserved </p>
</div>
A footer with copyright.
<script>
var modal = document.getElementById('id01');
window.onclick = function(event) {
if (event.target == modal) {
modal.style.display = "none";
}
}
</script>
Ensures the modal closes when clicking outside of it.
Dotweb5.0 + Web1.0 Integration: Demonstrates how modern templates can invoke legacy-style sheets (.WS).
Robust Exception Handling: Java7 program ensures errors are caught and handled gracefully.
User-Friendly Design: Modal-based login form with clear input fields.
Security Features: Disabled right-click and restricted clicks for protection.
Professional Footer: Branding and rights reserved notice.
===============================================================================================================
✨ OUTPUT
=============================================================================================================
🚀 Dotweb5.0 Advanced Concepts – Part 1 (With Example)
=============================================================================================================
OakJava7 (Java7.0), also known as OJ7, is a powerful collection framework that integrates with Dotweb5.0. It allows developers to insert, update, and merge data seamlessly with executables.
To store an ArrayList inside the Java7.0 collection memory, use:
Java7Collection.InsertQUERY(<String data>);
This ensures your dynamic list data is preserved in the collection memory.
You can merge the output of an executable (e.g., Elevator.exe) with the inserted ArrayList:
Java7Collection.QUERY(<String data>, "<application.exe>");
This feature highlights integration between program data and external applications.
To fetch previously stored data from the Java7 collection and place it into the ArrayList at index 0:
Java7Collection.QUERY();
This demonstrates data persistence and retrieval.
The Box.Java7 program showcases:
Object creation (Box1, Box2)
Volume calculation
ArrayList operations (add, remove, search, update)
Java7Collection integration
The program produces:
📋 List Output → Results of ArrayList operations
🚀 Elevator Output → Merged executable output
Below is a sample program demonstrating these advanced OakJava7 features.
Box1.java7
<JAVA>
// CUTIL Package
<USE> CUTIL;
<PACK> BoxApplication
{
<CLASS> Box
{
private double length; // Length of a box
private double breadth; // Breadth of a box
private double height; // Height of a box
public void setLength(double len) { length = len; }
public void setBreadth(double bre) { breadth = bre; }
public void setHeight(double hei) { height = hei; }
public double getVolume() { return length * breadth * height; }
}
<CLASS> Boxtester
{
public void main()
{
Box Box1 <NEW> Box();
Box Box2 <NEW> Box();
double volume;
// Box1 specification
Box1.setLength(6.0);
Box1.setBreadth(7.0);
Box1.setHeight(5.0);
// Box2 specification
Box2.setLength(12.0);
Box2.setBreadth(13.0);
Box2.setHeight(10.0);
// Volume of Box1
volume = Box1.getVolume();
<PRINTLN>("Volume of Box1 :" + volume);
// Volume of Box2
volume = Box2.getVolume();
<PRINTLN>("Volume of Box2 :" + volume);
// ArrayList operations
CUTIL.ArrayList x <NEW> CUTIL.ArrayList();
<PRINTLN>("Initial size is " + x.size());
if (x.isEmpty())
<PRINTLN>("The list is empty");
else
<PRINTLN>("The list is not empty");
// Insert previous data from Java7Collection
x.add(0, Java7Collection.QUERY());
x.add(1, (6));
x.add(0, (1));
x.add(2, (4));
<PRINTLN>("List size is " + x.size());
<PRINTLN>("The list is " + x);
// Switch-case demonstration
String JAVA5 = "Java 5";
String JAVA6 = "Java 6";
String JAVA7 = "Java 7";
int c = 1;
switch (c) {
case 1: <PRINTLN>(JAVA5); break;
case 2: <PRINTLN>(JAVA6); break;
case 3: <PRINTLN>(JAVA7); break;
}
<TRY>
{
Java7Collection.InsertQUERY(x.ToString()); // Insert ArrayList into Java7 collection memory
Java7Collection.QUERY(x.ToString(), "Elevator"); // Merge Elevator.exe output with ArrayList
}
<CATCH> (<EXE> e) {}
// Index operations
int index = x.indexOf((4));
if (index < 0)
<PRINTLN>("4 not found");
else
<PRINTLN>("The index of 4 is " + index);
index = x.indexOf((3));
if (index < 0)
<PRINTLN>("3 not found");
else
<PRINTLN>("The index of 3 is " + index);
// Get elements
<PRINTLN>("Element at 0 is " + x.get(0));
<PRINTLN>("Element at 3 is " + x.get(3));
// Remove elements
<PRINTLN>(x.remove(1) + " removed");
<PRINTLN>("The list is " + x);
<PRINTLN>(x.remove(2) + " removed");
<PRINTLN>("The list is " + x);
if (x.isEmpty())
<PRINTLN>("The list is empty");
else
<PRINTLN>("The list is not empty");
<PRINTLN>("List size is " + x.size());
}
}
}
Here’s a clear explanation of the Box.Java7 program you shared, focusing on how it demonstrates adding, removing, and updating elements in CUTIL.ArrayList along with integration of Java7Collection:
The program defines two classes:
Box → Represents a 3D box with length, breadth, and height, and provides methods to calculate its volume.
Boxtester → Acts as the driver class, testing both the Box class and the advanced OakJava7 collection features (CUTIL.ArrayList and Java7Collection).
Two Box objects (Box1 and Box2) are created.
Their dimensions are set using setter methods.
Volumes are calculated and printed using getVolume().
This part shows basic object-oriented programming in OakJava7.
The program then shifts to collection handling using CUTIL.ArrayList.
x.add(0, Java7Collection.QUERY()); // Inserts previous data from Java7Collection at index 0
x.add(1, (6));
x.add(0, (1));
x.add(2, (4));
Elements are inserted at specific indices.
Notice that inserting at index 0 shifts existing elements forward.
<PRINTLN>("Initial size is " + x.size());
if (x.isEmpty()) <PRINTLN>("The list is empty");
Demonstrates how to check if the list has elements.
Shows dynamic resizing behavior of ArrayList.
Java7Collection.InsertQUERY(x.ToString());
Java7Collection.QUERY(x.ToString(), "Elevator");
The current ArrayList contents are inserted into Java7Collection memory.
Then, the program merges the ArrayList output with an executable (Elevator.exe).
This illustrates updating stored data with new values and combining outputs.
int index = x.indexOf((4));
Finds the index of a given element.
If not found, prints "not found".
<PRINTLN>("Element at 0 is " + x.get(0));
<PRINTLN>("Element at 3 is " + x.get(3));
Accesses elements by index.
Demonstrates random access capability of ArrayList.
<PRINTLN>(x.remove(1) + " removed");
<PRINTLN>(x.remove(2) + " removed");
Removes elements at specified indices.
Shows how the list shrinks and reorders itself after removal.
The program produces:
Box Volumes → Volume of Box1 and Box2.
ArrayList Operations → Insertions, removals, size checks, and element retrievals.
Java7Collection Integration → Previous data retrieval, insertion, and merging with executable output.
Final List State → Displays the updated list after modifications.
Add → You can insert new elements or previous stored data into the list.
Remove → You can delete elements by index, and the list reorganizes itself.
Update → You can push the current list back into Java7Collection memory, effectively refreshing stored data.
Merge → You can combine list data with external executable outputs for advanced integration.
Got it — let’s make each heading attractive and engaging so your explanation feels polished and professional. I’ll add a touch of style and emphasis to draw attention to each section:
This program demonstrates object-oriented design with the Box class and advanced collection handling using CUTIL.ArrayList and Java7Collection.
Two Box objects are created, dimensions are set, and volumes are calculated.
This shows the foundation of encapsulation and method usage in OakJava7.
The program highlights how to:
Add elements at specific positions
Check size and emptiness
Display contents dynamically
This section illustrates the flexibility of dynamic lists compared to static arrays.
Using Java7Collection.InsertQUERY() and Java7Collection.QUERY(), the program:
Inserts the current ArrayList into Java7Collection memory
Merges the ArrayList with external executable output (Elevator.exe)
This demonstrates data persistence and integration with external applications.
The indexOf() method is used to locate elements in the list.
If the element is not found, the program prints a clear message.
This shows search functionality within collections.
The get() method retrieves elements by index.
This highlights random access capability, allowing direct retrieval without iteration.
The remove() method deletes elements at specific indices.
After removal, the list automatically reorganizes itself.
This demonstrates dynamic memory management in collections.
The final output includes:
Box volumes (calculated from dimensions)
ArrayList operations (insert, update, remove, search)
Java7Collection integration (previous data + executable merge)
Final list state after all modifications
Add → Insert new or previous data into the list.
Remove → Delete elements and watch the list adjust.
Update → Refresh stored data with current values.
Merge → Combine list data with external outputs.
🖥️ Output
==============================================================================================================
This section demonstrates how Dotweb5.0 integrates with AngularJS to create interactive forms.
We will build a program (w3j7forms.java7) that displays different messages and titles based on user selection.
Create a file named w3j7forms.java7.
Use AngularJS with three option boxes:
Dogs → Displays “Welcome to the World of Dogs” with title Dogs
Tutorials → Displays “Learn from examples” with title Tutorials
Cars → Displays “Read about cars” with title Cars
<JAVA>
<PACK> Program5
{
<CLASS> w3Prog
{
public void main()
{
HTML.displayhtml("w3forms.html");
}
}
}
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
<body ng-app="">
<form>
Pick a topic:
<input type="radio" ng-model="myVar" value="dogs">Dogs
<input type="radio" ng-model="myVar" value="tuts">Tutorials
<input type="radio" ng-model="myVar" value="cars">Cars
</form>
<div ng-switch="myVar">
<div ng-switch-when="dogs">
<h1>Dogs</h1>
<p>Welcome to the World of Dogs.</p>
</div>
<div ng-switch-when="tuts">
<h1>Tutorials</h1>
<p>Learn from examples.</p>
</div>
<div ng-switch-when="cars">
<h1>Cars</h1>
<p>Read about cars.</p>
</div>
</div>
<p>The ng-switch directive hides and shows HTML sections depending on the value of the radio buttons.</p>
</body>
</html>
The output will be displayed in an attractive format using .soweb styling:
When Dogs is selected → Title: Dogs, Message: Welcome to the World of Dogs
When Tutorials is selected → Title: Tutorials, Message: Learn from examples
When Cars is selected → Title: Cars, Message: Read about cars
This is about How to use Dotweb5.0 with Angularjs..
=========================================================================================================
🚀 Integrating DotWeb5.0 and OakJava7 Streams 🚀
==========================================================================================================
# 🌿 OakJava7 Streams
### ✨ Overview
OakJava7 Streams (OakJava7Streams) are designed to **optimize code execution** and simplify iteration. They provide **built-in shortcut functions** that make data traversal faster and more concise compared to traditional streams.
OakJava7Streams emphasize:
- ⚡ **Performance** – faster than conventional streams
- 🧩 **Shortcut Functions** – reduce boilerplate code
- 🎨 **Beautiful Syntax** – clean, readable, and expressive
- 🔄 **Flexible Iteration** – forward or backward traversal in a single statement
---
### 🔑 Key Feature Example
```oakjava7
<J7ITERATOR>(listtype1, 3, listtype1.size());
```
- `listtype1` → the list being traversed
- `3` → indicates backward traversal
- `listtype1.size()` → specifies the endpoint
👉 In most programming languages, iterating elements requires a `while` loop with multiple lines.
With OakJava7 Streams, iteration is reduced to **one elegant statement**.
---
🌐 Example Programs for Oakjava7 Streams is given below...
oj7stream255.web
<WEB>
//load the util package OJ7UTIL
<USE> OJ7UTIL;
<PACK> console {
public <CLASS> oj7stream255 {
public void main() {
Stream()->
// Print line breaks
<PRINTLN>("<BR>"); <PRINTLN>("<BR>");
Stream.Generate(() -> {
<PRINTLN>("<BR>"); <PRINTLN>("<BR>");
<PRINTLN>("----------------------------------------------");
<PRINTLN>("<BR>");
<PRINTLN>("----------------------------------------------");
<PRINTLN>("<BR>"); <PRINTLN>("<BR>");
<J7PRINT>("welcome");
<PRINTLN>("<BR>"); <PRINTLN>("<BR>");
// Example object array
object[] arg12 = {1, 5, 3, 89, 45};
// Example string of comma-separated values
string w1 = "13,5,17,9,11,25,27,131";
<PRINTLN>("<BR>");
// Convert comma-separated string to ArrayList using <AUTOBOX_ARRAY>
<OJ7UTIL>.ArrayList list235 = <AUTOBOX_ARRAY>(w1);
<PRINTLN>("<BR>");
<PRINTLN>("----------------------------------------------");
<PRINTLN>("<BR>"); <PRINTLN>("<BR>");
// Display object array contents without spaces
<J7ForLoopDisplayt1>(arg12);
<PRINTLN>("<BR>");
// Display object array contents with spaces
// Demonstrates minimizing a for-loop to a single statement
<J7ForLoopDisplayt2>(arg12);
<PRINTLN>("<BR>"); <PRINTLN>("<BR>");
// Use OakJava7 Iterator to traverse list in insertion order
OJ7UTIL.ArrayList ar99t1 = <J7ITERATOR>(list235, 1, 0);
<PRINTLN>("<BR>");
<PRINTLN>("List in Insertion Order: <BR>");
<OJ7Displayt2>(ar99t1);
<PRINTLN>("<BR>");
// Traverse list in forward order
OJ7UTIL.ArrayList ar991 = <J7ITERATOR>(list235, 2, 0);
<PRINTLN>("List in Insertion Order - Front: <BR>");
<OJ7Displayt1>(ar991);
<PRINTLN>("<BR>"); <PRINTLN>("<BR>");
// Traverse list in backward order
<PRINTLN>("List in Insertion Order - Back: <BR>");
OJ7UTIL.ArrayList ar992 = <J7ITERATOR>(list235, 3, list235.size());
<PRINTLN>(ar992);
<PRINTLN>("<BR>");
<PRINTLN>("----------------------------------------------");
<PRINTLN>("<BR>");
})->
}->
}}}
### 🛠 Built-in OakJava7 Statements (Brief Explanation)
- **`<PRINTLN>`** → Prints output with line breaks
- **`<J7PRINT>`** → Prints output without line breaks
- **`<AUTOBOX_ARRAY>`** → Converts comma-separated strings into ArrayLists
- **`<J7ForLoopDisplayt1>`** → Displays array contents without spaces
- **`<J7ForLoopDisplayt2>`** → Displays array contents with spaces
- **`<J7ITERATOR>`** → Iterates lists in forward or backward order
- **`<OJ7Displayt1>` / `<OJ7Displayt2>`** → Displays ArrayList contents in different formats
---
### 📌 Example Use Cases
- **Forward Iteration** → `<J7ITERATOR>(list, 2, 0)`
- **Backward Iteration** → `<J7ITERATOR>(list, 3, list.size())`
- **Insertion Order Display** → `<OJ7Displayt2>(list)`
---
## 📖 Further Reading
**Note:**
For more detailed information about OakJava7 Streams, please refer to the **OakJava7 Tutorial when it is released**.
---
🌐 OUTPUT
================================================================================================================
# 🔐✨ **DotWeb5.0 Encryption with OakJava7 ** ✨🔐
===============================================================================================================
## 📌 Program Overview
This program demonstrates how **DotWeb5.0** integrates with **OakJava7 encryption functions** to securely process text.
It shows both **encryption** and **decryption** operations using concise OakJava7 syntax.
```
# 🔐✨ **DotWeb5.0 Encryption with OakJava7 ** ✨🔐
---
## 📌 Program Overview
This program demonstrates how **DotWeb5.0** integrates with **OakJava7 encryption functions** to securely process text.
It shows both **encryption** and **decryption** operations using concise OakJava7 syntax.
---
## 🛠 Example Program
```Dotweb5.0
<WEB>
<PACK> j7security1 {
<CLASS> Prog {
public void main() {
// Display HTML page with gold background
<PRINTLN>("<html><body bgcolor=gold");
// Encrypt the given text using OakJava7's j7Encrypt function
string sop = j7security.Ojava7Process.j7Encrypt(
"wilmix is going1 , cat is going , dog is chasing cat"
);
// Print the encrypted output
<PRINTLN>("Encrypt=" + sop);
<PRINTLN>("<BR><BR><BR><BR><BR><BR>");
<PRINTLN>("------------------------------------------------------------");
<PRINTLN>("------------------------------------------------------------");
<PRINTLN>("<BR><BR>");
// Encrypt another text string
string sop1 = j7security.Ojava7Process.j7Encrypt(
"wilmix is going , cat is going , dog is chasing cat"
);
// Print the encrypted output
<PRINTLN>("Encrypt=" + sop1);
<PRINTLN>("<BR><BR><BR><BR>");
// Decrypt the text using OakJava7's Decrypt function
<PRINTLN>("Decrypt=" + j7security.Ojava7Process.Decrypt());
<PRINTLN>("<BR><BR><BR><BR>");
// Close HTML body
<PRINTLN>("</body></html>");
<PRINTLN>("------------------------------------------------------------");
}
}
}
```
---
## 🔑 Brief Explanation of Steps
- **HTML Setup:**
Prints an HTML body with a gold background for styled output.
- **Encryption (j7Encrypt):**
The `j7Encrypt` function takes a plain text string and returns its encrypted format.
- **Output Display:**
Encrypted text is displayed with line breaks and separators for clarity.
- **Decryption (Decrypt):**
The `Decrypt` function is called to convert the encrypted text back to its original form.
- **Final Output:**
Results are shown inside a styled HTML page.
---
🌐 OUTPUT
==========================================================================================================
⚡📊 **DotWeb5.0 WNOSQL Program with OakJava7 Soweb Template** 📊⚡
===========================================================================================================
---
## 📝 Question
**Question:**
Write a **WNOSQL program** to list all the items from the `datastorehg` table using the **OakJava7 Soweb template**.
- Display the results in the format **A1 A2**.
- Calculate the **time taken** to list all the data from `datastorehg`.
- Implement the solution using **DotWeb5.0**.
---
## 💻 Program
```dotweb5
<WEB>
<USE> Security; // Load security packages
<USE> <OJ7UTIL>; // Load utility packages
<USE> fx; // Load file packages
<WNOSQL> // Load WNOSQL packages for database connections
<PACK> Program8 {
<CLASS> Prog {
public void main() {
// Read the file path from filepath.txt sequentially
String fpath = fx.FileSequentialAccess.Read("filepath.txt");
// Pass the file path to WDBASQLS for database setup
String g = WDBASQL.WDBASQLS("datastores", "USEDATABASE", "dbpwds", fpath);
// Establish connection using WDBASQLS with user credentials
String t = WDBASQL.WDBASQLS("dbuser", "dbpwds", 1, "wilmix78", "wilmix78", 1, 5, g);
// Query to list all 3000 records from datastorehg in format A1 A2
String qh2 = "SelectAll from datastorehg 4 to 3004 , 1 to 1 ?= A By 1 1 : {0} : {0} :{0}";
// Execute the SelectAll query
wdbaconn.WDBAQUERY(qh2);
<PRINTLN>("<BR>");
// Record start time using DateTime
DateTime aDate = DateTime.Now;
<PRINTLN>(aDate.ToString("HH:mm:ss"));
<PRINTLN>("<BR>");
// Convert query results into ArrayList format
<OJ7UTIL>.ArrayList ar = WDBALIB.WDBAQUERY(qh2, t);
// Print the data in A1 A2 format using <J7PRINT>
for (int i = 2; i < ar.size(); i += 2) {
<J7PRINT>(" " + ar.get(i).ToString());
<J7PRINT>(" " + ar.get(i + 1).ToString());
<PRINTLN>("<BR>");
}
<PRINTLN>("<BR>");
// Record end time using DateTime
DateTime aDate1 = DateTime.Now;
<PRINTLN>(aDate1.ToString("HH:mm:ss"));
}
}
}
```
---
## 🔎 Explanation of Program Steps
- **Security & Utility Packages:**
Loads required packages for secure database access, utility functions, and file handling.
- **File Path Access:**
Reads the database file path from `filepath.txt` using sequential file access.
- **Database Connection:**
Uses `WDBASQLS` to establish a connection with the datastore using credentials.
- **Query Execution:**
Runs a `SelectAll` query to fetch 3000 records from the `datastorehg` table.
- **Time Measurement:**
Captures the start and end time using `DateTime.Now` to calculate the time taken for listing.
- **Data Listing (A1 A2 Format):**
Iterates through the ArrayList results and prints them in pairs (`A1 A2`) using `<J7PRINT>`.
---
🌐 OUTPUT
=========================================================================================================
---
⚡📊 **DotWeb5.0 WNOSQL Program with OakJava7 Soweb Template, Display 12,000 Records only with in 3 seconds** 📊⚡
==========================================================================================================
## 📝 Question
**Question:**
Write a **WNOSQL program** to Display 12,000 records from the `datastorehg` table using the **OakJava7 Soweb template**.
- Display the results in the format **A1 A2**.
- Calculate the **time taken** to list all the data from `datastorehg`.
- Implement the solution using **DotWeb5.0**.
- Time should not exceed 3 seconds.
---
## 💻 Program
```dotweb5
<WEB>
<USE> Security; // Load security packages
<USE> <OJ7UTIL>; // Load utility packages
<USE> fx; // Load file packages
<WNOSQL> // Load WNOSQL packages for database connections
<PACK> Program8 {
<CLASS> Prog {
public void main() {
// Read the file path from filepath.txt sequentially
String fpath = fx.FileSequentialAccess.Read("filepath.txt");
// Pass the file path to WDBASQLS for database setup
String g = WDBASQL.WDBASQLS("datastores", "USEDATABASE", "dbpwds", fpath);
// Establish connection using WDBASQLS with user credentials
String t = WDBASQL.WDBASQLS("dbuser", "dbpwds", 1, "wilmix78", "wilmix78", 1, 5, g);
// Query to list all 3000 records from datastorehg in format A1 A2
String qh2 = "SelectAll from datastorehg 4 to 3004 , 1 to 1 ?= A By 1 1 : {0} : {0} :{0}";
// Execute the SelectAll query
wdbaconn.WDBAQUERY(qh2);
<PRINTLN>("<BR>");
// Record start time using DateTime
DateTime aDate = DateTime.Now;
<PRINTLN>(aDate.ToString("HH:mm:ss"));
<PRINTLN>("<BR>");
// Convert query results into ArrayList format
<OJ7UTIL>.ArrayList ar = WDBALIB.WDBAQUERY(qh2, t);
// Print the data in A1 A2 format using <J7PRINT>
for (int i = 2; i < ar.size(); i += 2) {
<J7PRINT>(" " + ar.get(i).ToString());
<J7PRINT>(" " + ar.get(i + 1).ToString());
<PRINTLN>("<BR>");
}
<PRINTLN>("<BR>");
<PRINTLN>("<BR>");
// Query to list all 3000 records from datastorehg in format A1 A2
String qh3 = "SelectAll from datastorehg 4 to 3004 , 1 to 1 ?= A By 1 1 : {0} : {0} :{0}";
// Execute the SelectAll query
wdbaconn.WDBAQUERY(qh3);
// Convert query results into ArrayList format
<OJ7UTIL>.ArrayList ar1 = WDBALIB.WDBAQUERY(qh3, t);
// Print the data in A1 A2 format using <J7PRINT>
for (int i = 2; i < ar1.size(); i += 2) {
<J7PRINT>(" " + ar1.get(i).ToString());
<J7PRINT>(" " + ar1.get(i + 1).ToString());
<PRINTLN>("<BR>");
}
<PRINTLN>("<BR>");
<PRINTLN>("<BR>");
// Query to list all 3000 records from datastorehg in format A1 A2
String qh4 = "SelectAll from datastorehg 4 to 3004 , 1 to 1 ?= A By 1 1 : {0} : {0} :{0}";
// Execute the SelectAll query
wdbaconn.WDBAQUERY(qh4);
// Convert query results into ArrayList format
<OJ7UTIL>.ArrayList ar2 = WDBALIB.WDBAQUERY(qh4, t);
// Print the data in A1 A2 format using <J7PRINT>
for (int i = 2; i < ar2.size(); i += 2) {
<J7PRINT>(" " + ar2.get(i).ToString());
<J7PRINT>(" " + ar2.get(i + 1).ToString());
<PRINTLN>("<BR>");
}
<PRINTLN>("<BR>");
<PRINTLN>("<BR>");
// Query to list all 3000 records from datastorehg in format A1 A2
String qh5 = "SelectAll from datastorehg 4 to 3004 , 1 to 1 ?= A By 1 1 : {0} : {0} :{0}";
// Execute the SelectAll query
wdbaconn.WDBAQUERY(qh5);
// Convert query results into ArrayList format
<OJ7UTIL>.ArrayList ar3 = WDBALIB.WDBAQUERY(qh3, t);
// Print the data in A1 A2 format using <J7PRINT>
for (int i = 2; i < ar3.size(); i += 2) {
<J7PRINT>(" " + ar3.get(i).ToString());
<J7PRINT>(" " + ar3.get(i + 1).ToString());
<PRINTLN>("<BR>");
}
<PRINTLN>("<BR>");
// Record end time using DateTime
DateTime aDate1 = DateTime.Now;
<PRINTLN>(aDate1.ToString("HH:mm:ss"));
}
}
}
```
---
## 🔎 Explanation of Program Steps
- **Security & Utility Packages:**
Loads required packages for secure database access, utility functions, and file handling.
- **File Path Access:**
Reads the database file path from `filepath.txt` using sequential file access.
- **Database Connection:**
Uses `WDBASQLS` to establish a connection with the datastore using credentials.
- **Query Execution:**
Runs a `SelectAll` query to fetch 12000 records from the `datastorehg` table batch by batch ...
- **Time Measurement:**
Captures the start and end time using `DateTime.Now` to calculate the time taken for listing.
- **Data Listing (A1 A2 Format):**
Iterates through the ArrayList results and prints them in pairs (`A1 A2`) using `<J7PRINT>`.
---**Display 12000 Records with in 3 seconds using the same logic.
Disadvantage of using this forloop repeated 4 times result not in best Time complexity
How will you solve it ? Is it possible?
Yes, that can only be solved using Oakjava7
We can see it briefly later ........
Note: Here in this example to display 12,000 records take only 2 seconds to display in a webpage.
🌐 OUTPUT
============================================================================================================
# 📑 Question: InvoiceBill Mini Project
## 🌐 Dotweb5.0 + AngularJS + OakJava7
### Question
**Design and implement a Single Page Application (SPA) for an Invoice Bill system using Dotweb5.0, AngularJS, and OakJava7.**
---
## 🎯 Requirements
1. **Frontend (AngularJS):**
- Create an `InvoiceBill.html` form that collects customer details, billing details, product details, and bank details.
- Use AngularJS `ng-model` for two-way data binding.
- Ensure that when the form is submitted, the invoice bill is displayed on the same page (SPA principle).
2. **Backend (OakJava7):**
- Write an `InvoiceBill.web` program that:
- Retrieves submitted form data using `Request.Query`.
- Applies business logic to calculate:
- Base amount (`qty × rate`)
- CGST (`rate1% of amount`)
- SGST (`rate2% of amount`)
- Total amount after tax.
- Dynamically generates HTML tables to display invoice details (customer, product, tax, and bank information).
- Redirects back to the same page to maintain SPA behavior.
3. **Database Integration (Dotweb5.0 + WNoSQL):**
- Connect to WNoSQL database using secure credentials.
- Split invoice data into two tables:
- **Invoicebill** → Customer and product details.
- **Invoicebill2** → Rate, discount, tax, and bank details.
- Insert collected data into respective tables using Dotweb5.0 query methods.
---
## 📘 Expected Output
- A **Single Page Application** where:
- The user enters invoice details in the AngularJS form.
- The OakJava7 backend processes the data, applies business logic, and stores it in WNoSQL tables.
- The invoice bill is displayed dynamically on the same page with formatted HTML tables.
- The system shows customer details, product details, tax calculations, and bank details.
---
## ✅ Deliverables
- **InvoiceBill.html** (AngularJS frontend form).
- **InvoiceBill.web** (OakJava7 backend with Dotweb5.0 integration).
- **Database schema and queries** for WNoSQL storage.
- **Documentation** explaining the workflow: frontend → backend → database → output.
---
---
# 📑 InvoiceBill Project Documentation
## 🌐 Single Page Application (SPA)
### 🔹 Definition of SPA
A **Single Page Application (SPA)** is a web application or website that interacts with the user
by dynamically rewriting parts of the current page instead of loading entire new pages from the server.
This approach improves speed, responsiveness, and user experience.
---
# 🧾 Frontend Program: AngularJS
## 🎯 Purpose
The frontend collects customer, billing, product, and bank details through a structured form. Once submitted, the data is processed and displayed dynamically on the same page, demonstrating the SPA principle.
## 💻 File: **InvoiceBill.html**
```html
<!DOCTYPE html>
<html>
<head>
<title>Invoice Bill Entry</title>
<!-- AngularJS Library -->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
</head>
<div ng-app="">
<body>
<!-- InvoiceBill Form -->
<form action="http://localhost:9000/InvoiceBill.jclass" method="post">
<table align="center" border="3" width="500" height="500" bgcolor="lightgreen">
<tr>
<h2><td><a href="#chapter1"><center>Enter Your Invoice Bill Customer Details</center></a></td></h2>
</tr>
<!-- Customer Details -->
<tr><td>Customer Address: <input type="text" name="CADDRESS" ng-model="caddress" /></td></tr>
<tr><td>Invoice Number: <input type="number" name="invoiceno" ng-model="invoiceno" /></td></tr>
<tr><td>Invoice Date: <input type="text" name="invoicedate" ng-model="invoicedate" /></td></tr>
<tr><td>Reverse Charge: <input type="text" name="reversecharge" ng-model="reversecharge" /></td></tr>
<tr><td>State: <input type="text" name="state" ng-model="state" /></td></tr>
<tr><td>Code: <input type="text" name="code" ng-model="code" /></td></tr>
<tr><td>Name: <input type="text" name="name" ng-model="name" /></td></tr>
<!-- Billing Details -->
<tr><td>Billing Address: <input type="text" name="BADDRESS" ng-model="BADDRESS" /></td></tr>
<tr><td>GSTIN: <input type="text" name="gstin" ng-model="gstin" /></td></tr>
<tr><td>State: <input type="text" name="state1" ng-model="state1" /></td></tr>
<tr><td>Code: <input type="text" name="code1" ng-model="code1" /></td></tr>
<tr><td>S.No: <input type="text" name="sno" ng-model="sno" /></td></tr>
<!-- Product Details -->
<tr><td>Product Description: <input type="text" name="productdescription" ng-model="productdescription" /></td></tr>
<tr><td>HSN Code: <input type="number" name="hsncode" ng-model="hsncode" /></td></tr>
<tr><td>Quantity: <input type="number" name="qty" ng-model="qty" /></td></tr>
<tr><td>Rate: <input type="number" name="rate" ng-model="rate" /></td></tr>
<tr><td>Discount: <input type="number" name="discount" ng-model="discount" /></td></tr>
<tr><td>Rate1: <input type="number" name="rate1" ng-model="rate1" /></td></tr>
<tr><td>Rate2: <input type="number" name="rate2" ng-model="rate2" /></td></tr>
<!-- Bank Details -->
<tr><td>Amount in Words: <input type="text" name="Amountinwords" ng-model="Amountinwords" /></td></tr>
<tr><td>Bank Name: <input type="text" name="bname" ng-model="bname" /></td></tr>
<tr><td>Bank Account: <input type="text" name="bankaccount" ng-model="bankaccount" /></td></tr>
<tr><td>Bank IFSC: <input type="text" name="bankifsc" ng-model="bankifsc" /></td></tr>
<!-- Submit Section -->
<tr><td><h2><a href="#chapter2">REGISTER</a></h2></td></tr>
<tr>
<td><input type="submit" name="ClickMe"></td>
<td><input type="reset" name="Clear"></td>
</tr>
</table>
</form>
</body>
</div>
</html>
```
---
# ⚙️ Backend Program: OakJava7 +Dotweb5.0+ WNoSQL
## 🎯 Purpose
The backend processes submitted data, applies business logic for invoice calculation,
stores data in **WNoSQL databases**, and renders the invoice bill in a formatted HTML page.
## 💻 File: **InvoiceBill.web**
---
# 📑 InvoiceBill Backend Program
## ⚙️ OakJava7 + WNoSQL +Dotweb5.0 Implementation
InvoiceBill.web
<JAVA>
// use Dotweb5 util packages and Oakjava7 security packages
<USE> <OJ7UTIL>;
<USE> Security;
<USE> fx;
// Use Wnosql packages
<WNOSQL>
<PACK> Program8
{
<CLASS> Prog
{
public void main()
{
// Design Invoice Bill form
HTML.displayhtml("Invoicebill.html");
// Add what are the fields you want for preparing Invoice bill
ArrayList arm1= new ArrayList();
arm1.add("CADDRESS");
arm1.add("invoiceno");
arm1.add("invoicedate");
arm1.add("reversecharge");
arm1.add("state");
arm1.add("code");
arm1.add("name");
arm1.add("BADDRESS");
arm1.add("gstin");
arm1.add("state1");
arm1.add("code1");
arm1.add("sno");
arm1.add("productdescription");
arm1.add("hsncode");
arm1.add("qty");
arm1.add("rate");
arm1.add("discount");
arm1.add("rate1");
arm1.add("rate2");
arm1.add("Amountinwords");
arm1.add("bname");
arm1.add("bankaccount");
arm1.add("bankifsc");
arm1.add("NOT");
<PRINTLN>("<HTML>");
<PRINTLN>("<head> <style>");
<PRINTLN>("table {");
<PRINTLN>(" width:100%;");
<PRINTLN>("}");
<PRINTLN>("table, th, td {");
<PRINTLN>("border: 1px solid black;");
<PRINTLN>(" border-collapse: collapse;");
<PRINTLN>("}");
<PRINTLN>("th, td {");
<PRINTLN>(" padding: 5px;");
<PRINTLN>(" text-align: left;");
<PRINTLN>("}");
<PRINTLN>("table#t01 tr:nth-child(even) {");
<PRINTLN>(" background-color: grey;");
<PRINTLN>("}");
<PRINTLN>("table#t01 tr:nth-child(odd) {");
<PRINTLN>("background-color:yellow;");
<PRINTLN>("}");
<PRINTLN>("table#t01 th {");
<PRINTLN>(" background-color: black;");
<PRINTLN>("color: white;");
<PRINTLN>("}");
<PRINTLN>("</style>");
<PRINTLN>("</head>");
<PRINTLN>("<BODY >");
<PRINTLN>("<form>");
// mention 23 fields in Request.Query method
ArrayList armg= Request.Query(arm1,"InvoiceBilloj7.dsn",23,1);
//Design a html page for submiting all the 23 fields data ...
string CADDRESS=armg.get(0).ToString();
string invoiceno=armg.get(1).ToString();
string invoicedate=armg.get(2).ToString();
string reversecharge=armg.get(3).ToString();
string state=armg.get(4).ToString();
string code=armg.get(5).ToString();
string name=armg.get(6).ToString();
string BADDRESS=armg.get(7).ToString();
string gstin=armg.get(8).ToString();
string state1=armg.get(9).ToString();
string code1=armg.get(10).ToString();
string sno=armg.get(11).ToString();
string productdescription=armg.get(12).ToString();
string hsncode=armg.get(13).ToString();
string qty=armg.get(14).ToString();
string rate=armg.get(15).ToString();
string discount=armg.get(16).ToString();
string rate1=armg.get(17).ToString();
string rate2=armg.get(18).ToString();
string Amountinwords=armg.get(19).ToString();
string bname=armg.get(20).ToString();
string bankaccount=armg.get(21).ToString();
string bankifsc=armg.get(22).ToString();
// Use OakJava7 Servlet to print the form in webpage
<PRINTLN>("<table id=t01 width=1027 height=210 border=1 bgcolor=#fff >");
<PRINTLN>(" <tr> ");
<PRINTLN>(" <td height=135><div align=center><strong><address> ");
<PRINTLN>(""+CADDRESS);
<PRINTLN>("</address></strong></div></p> <p align=right><strong>Triplicate for</strong></p>");
<PRINTLN>(" <p align=right><strong>Supplier</strong></p></td> ");
<PRINTLN>(" </tr> ");
<PRINTLN>("<tr> ");
<PRINTLN>(" <td><div align=center><span <CLASS>=style12>Tax Invoice</span></div></td>");
<PRINTLN>(" </tr> ");
<PRINTLN>("</table> ");
<PRINTLN>("<table id=t01 width=1027 border=1 bgcolor=#fff> ");
<PRINTLN>("<tr> ");
<PRINTLN>(" <td width=506><strong>Invoice No: </strong>"+invoiceno+"</td> ");
<PRINTLN>("<td width=503></td> ");
<PRINTLN>(" </tr> ");
<PRINTLN>(" <tr> ");
<PRINTLN>("<td><strong>Invoice date: </strong>"+invoicedate+"</td> ");
<PRINTLN>("<td> </td> ");
<PRINTLN>("</tr> ");
<PRINTLN>("</table> ");
<PRINTLN>("<table id=t01 width=1027 border=1 bgcolor=#fff> ");
<PRINTLN>("<tr> ");
<PRINTLN>("<td width=436><strong>Reverse Charge(Y/N):</strong>"+reversecharge+"</td> ");
<PRINTLN>(" <td width=63> </td> ");
<PRINTLN>(" <td width=505> </td> ");
<PRINTLN>("</tr> ");
<PRINTLN>("</table> ");
<PRINTLN>("<table id=t01 width=1027 border=1 bgcolor=#fff> ");
<PRINTLN>("<tr> ");
<PRINTLN>("<td width=337><strong>State:</strong>"+ state+"</td> ");
<PRINTLN>("<td width=94><strong>Code </strong></td> ");
<PRINTLN>(" <td width=63> "+code+"</td> ");
<PRINTLN>(" <td width=504> </td> ");
<PRINTLN>(" </tr> ");
<PRINTLN>("</table> ");
<PRINTLN>("<table id=t01 width=1027 border=1 bgcolor=#fff>");
<PRINTLN>("<tr> ");
<PRINTLN>("<td width=506><div align=center <CLASS>=style13>Bill to Party </div></td> ");
<PRINTLN>(" <td width=503><div align=center><span <CLASS>=style13>Ship to party </span></div></td> ");
<PRINTLN>(" </tr> ");
<PRINTLN>("</table> ");
<PRINTLN>("<table id=t01 width=1027 border=1 bgcolor=#fff> ");
<PRINTLN>("<tr> ");
<PRINTLN>("<td width=506><strong>Name:</strong>"+name+"</td> ");
<PRINTLN>(" <td width=505><strong>Name:</strong>"+name+"</td> ");
<PRINTLN>(" </tr> ");
<PRINTLN>("<tr> ");
<PRINTLN>("<td><strong>Address:</strong>"+ BADDRESS+"</td> ");
<PRINTLN>(" <td><strong>Address:</strong>"+ BADDRESS+"</td> ");
<PRINTLN>("</tr> ");
<PRINTLN>(" <tr> ");
<PRINTLN>(" <td><strong>GSTIN:</strong>"+gstin+"</td> ");
<PRINTLN>(" <td><strong>GSTIN:</strong>"+gstin+"</td> ");
<PRINTLN>(" </tr> ");
<PRINTLN>("</table> ");
<PRINTLN>("<table id=t01 width=1027 border=1 bgcolor=#fff> ");
<PRINTLN>("<tr> ");
<PRINTLN>(" <td width=340><strong>State:</strong>"+state1+"</td> ");
<PRINTLN>(" <td width=98><strong>Code:</strong></td> ");
<PRINTLN>(" <td width=54> "+code1+"</td> ");
<PRINTLN>(" <td width=380><strong>State:</strong>"+state1+"</td> ");
<PRINTLN>(" <td width=76><strong>Code:</strong></td> ");
<PRINTLN>(" <td width=39> "+code1+"</td> ");
<PRINTLN>(" </tr> ");
<PRINTLN>("</table> ");
<PRINTLN>("<table id=t01 width=1027 border=1 bgcolor=#fff> ");
<PRINTLN>("<tr> ");
<PRINTLN>(" <td width=24 height=68><span <CLASS>=style8>S.NO</span></td> ");
<PRINTLN>(" <td width=130> <div align=center <CLASS>=style7>Product Description </div></td> ");
<PRINTLN>(" <td width=41><p <CLASS>=style6>HSNCode</p> </td> ");
<PRINTLN>(" <td width=49><div align=center <CLASS>=style6>Qty</div></td> ");
<PRINTLN>("<td width=73><div align=center <CLASS>=style6>Rate</div></td> ");
<PRINTLN>(" <td width=97><div align=center <CLASS>=style6>Amt</div></td> ");
<PRINTLN>(" <td width=54><div align=center><span <CLASS>=style1><strong>Discount</strong></span></div></td> ");
<PRINTLN>(" <td width=75><span <CLASS>=style6>TaxableValue</span></td> ");
<PRINTLN>(" <td width=134><table id=t01 width=210 border=1> ");
<PRINTLN>(" <tr> ");
<PRINTLN>(" <td width=200><div align=center <CLASS>=style4>CGST</div></td> ");
<PRINTLN>(" </tr> ");
<PRINTLN>("<tr> ");
<PRINTLN>("<td><table id=t01 width=200 border=1 bgcolor=#fff> ");
<PRINTLN>(" <tr> ");
<PRINTLN>(" <td><div align=center <CLASS>=style7>Rate</div></td> ");
<PRINTLN>(" <td><span <CLASS>=style7>Amt</span></td> ");
<PRINTLN>(" </tr> ");
<PRINTLN>(" </table></td> ");
<PRINTLN>(" </tr> ");
<PRINTLN>(" </table></td> ");
<PRINTLN>("<td width=160><table id=t01 width=200 border=1> ");
<PRINTLN>(" <tr> ");
<PRINTLN>(" <td><div align=center <CLASS>=style4>SGST</div></td> ");
<PRINTLN>(" </tr> ");
<PRINTLN>(" <tr> ");
<PRINTLN>("<td><table id=t01 width=200 border=1 bgcolor=#fff> ");
<PRINTLN>(" <tr> ");
<PRINTLN>(" <td><div align=center <CLASS>=style6>Rate</div></td> ");
<PRINTLN>(" <td><span <CLASS>=style6>Amt</span></td> ");
<PRINTLN>("</tr> ");
<PRINTLN>(" </table></td> ");
<PRINTLN>("</tr> ");
<PRINTLN>(" </table></td> ");
<PRINTLN>(" <td width=110><div align=center <CLASS>=style4>TOTAL</div></td> ");
<PRINTLN>(" </tr> ");
<PRINTLN>("</table> ");
<PRINTLN>("<table id=t01 width=1027 border=1 bgcolor=#fff> ");
<PRINTLN>("<tr> ");
<PRINTLN>("<td align=right width=24><p> "+sno+"</p> ");
<PRINTLN>("<td align=right width=93> "+productdescription+"</td> ");
<PRINTLN>(" <td align=right width=54 > "+hsncode+"</td> ");
<PRINTLN>(" <td align=right width=38 > "+qty+"</td> ");
<PRINTLN>(" <td align=right width=50 > "+rate+"</td> ");
//Write the business logic for InvoiceBill
double amount =(Convert.ToDouble(qty)) * (Convert.ToDouble(rate));
double amount1= ((Convert.ToDouble(rate1)/100) * Convert.ToDouble(amount));
double amount2= ((Convert.ToDouble(rate2)/100) * Convert.ToDouble(amount));
<PRINTLN>(" <td align=right width=65 > "+amount+"</td> ");
<PRINTLN>(" <td align=right width=49 > "+discount+"</td> ");
<PRINTLN>(" <td align=right width=74 > "+amount+"</td> ");
<PRINTLN>("<td align=right width=85> "+rate1+"</td> ");
<PRINTLN>("<td align=right width=99> "+amount1+"</td> ");
<PRINTLN>(" <td align=right width=85 > "+rate2+"</td> ");
<PRINTLN>(" <td align=right width=85> "+amount2+"</td> ");
//Business logic
double totalamount= amount+amount1+amount2;
<PRINTLN>(" <td align=right width=85> "+totalamount+"</td> ");
<PRINTLN>(" </tr> ");
<PRINTLN>("</table> ");
<PRINTLN>("<table id=t01 width=1027 height=65 border=1 bgcolor=#fff> ");
<PRINTLN>("<tr> ");
<PRINTLN>("<td width=134><div align=center <CLASS>=style9><strong>TOTAL</strong></div></td> ");
<PRINTLN>(" <td width=47> </td> ");
<PRINTLN>(" <td width=37>"+qty+"</td> ");
<PRINTLN>(" <td width=51> </td> ");
<PRINTLN>(" <td width=74><div align=center>"+amount+"</div></td> ");
<PRINTLN>("<td width=65><div align=right>"+discount+"</div></td> ");
<PRINTLN>(" <td width=43><div align=right>"+amount+"</div></td> ");
<PRINTLN>("<td width=103> </td> ");
<PRINTLN>("<td width=101><div align=right>"+amount1+"</div></td> ");
<PRINTLN>(" <td width=205><div align=right>"+amount2+"</div></td> ");
<PRINTLN>(" <td width=95><div align=right>"+totalamount+"</div></td> ");
<PRINTLN>(" </tr> ");
<PRINTLN>("</table> ");
<PRINTLN>("<table id=t01 width=1027 border=1 bgcolor=#fff> ");
<PRINTLN>("<tr> ");
<PRINTLN>(" <td width=487><div align=center><strong>Total Invoice amount in words </strong></div></td> ");
<PRINTLN>("<td width=88 <CLASS>=style15><span <CLASS>=style21>Total Amount Before Tax: </span></td> ");
<PRINTLN>(" <td <CLASS>=style15> "+amount+"</td> ");
<PRINTLN>("</tr> ");
<PRINTLN>(" <tr> ");
// note Amountinwords default is NIL
<PRINTLN>("<td><div align=center><input type=text name=Amountinwords value =NIL > </div></td> ");
<PRINTLN>("<td><table id=t01 width=544 border=1 bgcolor=#fff> ");
<PRINTLN>("<tr> ");
<PRINTLN>(" <td width=420 <CLASS>=style15><strong>Add: CGST </strong></td> ");
<PRINTLN>(" <td width=88 <CLASS>=style15> "+amount1+"</td> ");
<PRINTLN>(" </tr> ");
<PRINTLN>(" <tr> ");
<PRINTLN>("<td <CLASS>=style15><strong>Add:SGST</strong></td> ");
<PRINTLN>(" <td <CLASS>=style15> "+amount2+"</td> ");
<PRINTLN>(" </tr> ");
<PRINTLN>(" <tr> ");
<PRINTLN>(" <td <CLASS>=style15><strong>Total Tax Amount: </strong></td> ");
<PRINTLN>(" <td <CLASS>=style15> "+(amount1+amount2)+"</td> ");
<PRINTLN>(" </tr> ");
<PRINTLN>(" <tr> ");
<PRINTLN>(" <td <CLASS>=style15><strong>Total Amount After Tax: </strong></td> ");
<PRINTLN>(" <td <CLASS>=style15> "+totalamount+"</td> ");
<PRINTLN>(" </tr> ");
<PRINTLN>(" <tr> ");
<PRINTLN>(" <td width=196><strong>GST on Reverse Charge </strong></td> ");
<PRINTLN>(" <td width=254> "+reversecharge+"</td>");
<PRINTLN>(" </tr> ");
<PRINTLN>(" </table></td> ");
<PRINTLN>(" </tr> ");
<PRINTLN>("</table> ");
<PRINTLN>("<table id=t01 width=1027 border=1 bgcolor=#fff> ");
<PRINTLN>("<table width=1027 border=1 bgcolor=#fff>");
<PRINTLN>("<tr>");
<PRINTLN>("<td width=294 height=203><table width=296 height=216 border=1 bgcolor=#fff>");
<PRINTLN>("<tr>");
<PRINTLN>(" <td width=238><div align=center><strong>Bank Details </strong></div></td>");
<PRINTLN>(" </tr>");
<PRINTLN>(" <tr>");
<PRINTLN>(" <td><strong>Name:</strong>"+bname+"</td>");
<PRINTLN>("</tr>");
<PRINTLN>("<tr>");
<PRINTLN>("<td><strong>Bank A/C: </strong>"+bankaccount+"</td>");
<PRINTLN>("</tr>");
<PRINTLN>("<tr>");
<PRINTLN>(" <td><strong>Bank IFSC: </strong>"+bankifsc+"</td>");
<PRINTLN>("</tr>");
<PRINTLN>("<tr>");
<PRINTLN>(" <td height=61> </td>");
<PRINTLN>("</tr>");
<PRINTLN>("</table></td>");
<PRINTLN>("<td width=163><table width=200 height=231 border=1 bgcolor=#fff>");
<PRINTLN>("<tr>");
<PRINTLN>(" <td height=121> </td>");
<PRINTLN>("</tr>");
<PRINTLN>("<tr>");
<PRINTLN>("<td height=102><div align=center class=style22>Common Seal </div></td>");
<PRINTLN>(" </tr>");
<PRINTLN>("</table></td>");
<PRINTLN>("<td width=551><table width=514 height=224 border=1 bgcolor=#fff>");
<PRINTLN>("<tr>");
<PRINTLN>(" <td><div align=center><em>Certified that the particulars given above are true and correct </em></div></td>");
<PRINTLN>("</tr>");
<PRINTLN>("<tr>");
<PRINTLN>("<td><div align=center><strong>For XXXXX (p) Ltd </strong></div>");
<PRINTLN>("<p> </p>");
<PRINTLN>("<p align=center class=style13>Authorised signatory </p></td>");
<PRINTLN>("</tr>");
<PRINTLN>("</table></td>");
<PRINTLN>("</tr>");
<PRINTLN>("</table>");
<PRINTLN>("<p> </p>");
<PRINTLN>("<p> </p>");
<PRINTLN>("<p> </p>");
<PRINTLN>("<p> </p>");
<PRINTLN>("<p> </p>");
<PRINTLN>("<p> </p>");
<PRINTLN>("</body>");
<PRINTLN>("</html>");
// path of wnosql db
String fpath=FileSequentialAccess.Read("filepath.txt");
//Mention the path where Invoice bill details are stored ....
String g = WDBASQL.WDBASQLS("datastores", "USEDATABASE", "dbpwds", fpath);
//Give Proper credentials like username ,password ,table...
String t = WDBASQL.WDBASQLS("dbuser", "dbpwds", 1, "wilmix78", "wilmix78", 1, 5, g);
//Divide the InvoiceBill table in to 2 tables ie) Invoicebill and other one is Invoicebill2
//Mentions the fields like CADDRESS ,etc to be created
String q = "CREATETABLE from Invoicebill 0 to 0 , 1 to 5 ?= 6639 By 6639 f(x) : {CADDRESS,INO,IDATE,Charge,State,code1,Name,Address,GSTIN,State,code2,sno,productdesc,hsncode,qty}: {} :{2,4}";
//Mentions the fields like rate ,etc to be created
String q1 ="CREATETABLE from Invoicebill2 0 to 0 , 1 to 5 ?= 6639 By 6639 f(x) : {rate,Amt,discount,Rate1,Amt1,Rate2,Amt2,total,ReverseCharge,Bankname,BankAccount,BankIFSC}: {} :{2,4}";
//Excecute the InvoiceTable querys
wdbaconn.WDBAQUERY(q);
wdbaconn.WDBAQUERY(q1);
Char c= ' ';
// Calculate the size of the InvoiceBill tables using Wnosql PLSQL methods
ArrayList datas1=WDBASQL.Query("TABLESIZE()","Invoicebill","0",null,27,"","", null,"",0,"","",c,null,t,1,5);
ArrayList datas11=WDBASQL.Query("TABLESIZE()","Invoicebill2","0",null,27,"","", null,"",0,"","",c,null,t,1,5);
// Make all data as string
String t1="";String t2="";
t1=CADDRESS+","+invoiceno+","+invoicedate+","+reversecharge+","+state+","+code+","+name+","+BADDRESS+","+gstin+","+state1+","+code1+","+sno+","+productdescription+","+hsncode+","+qty;
t2=rate+","+amount+","+discount+","+rate1+","+amount1+","+rate2+","+amount2+","+totalamount+","+reversecharge+","+bname+","+bankaccount+","+bankifsc;
// Insert all the t1 data into Invoicebill table
String s12 ="INSERTINTO from Invoicebill 0 to "+datas1.size()+" , 1 to 5 ?= A By 1 1 : {0} : {"+t1+"} : {0}";
//Excecute the InvoiceTable insert query
wdbaconn.WDBAQUERY(s12);
// Insert all the t1 data into Invoicebill table
String s121 ="INSERTINTO from Invoicebill2 0 to "+datas11.size()+" , 1 to 5 ?= A By 1 1 : {0} : {"+t2+"} : {0}";
//Excecute the InvoiceTable insert querys
wdbaconn.WDBAQUERY(s121);
}
}
}
# 📘 Explanation of Program
## 🔹 Step 1: Display Form
Loads the **InvoiceBill.html** form for user input.
## 🔹 Step 2: Collect Fields
Defines 23 fields required for invoice processing (customer, product, tax, bank details).
## 🔹 Step 3: Query Submitted Data
Retrieves submitted values using `Request.Query`.
## 🔹 Step 4: Business Logic
- Calculates **amount** = `qty × rate`.
- Calculates **CGST** and **SGST**.
- Computes **total amount after tax**.
## 🔹 Step 5: Render Invoice
Generates HTML tables dynamically using `<PRINTLN>` to display invoice details.
## 🔹 Step 6: Database Integration
- Connects to **WNoSQL database**.
- Splits data into two tables:
- **Invoicebill** → Customer and product details.
- **Invoicebill2** → Rate, discount, tax, and bank details.
- Inserts data into tables.
✅ This **InvoiceBill.web** clearly separates each stage of the backend workflow: **form display, data collection,
business logic, HTML rendering, database integration, and redirection**. It complements the AngularJS frontend to
deliver a complete SPA-based invoice management system.
### 🔹 Key Steps
1. **Display Form**
```Dotweb5.0
HTML.displayhtml("Invoicebill.html");
```
2. **Collect Fields**
- 23 fields are collected using `Request.Query`.
3. **Business Logic**
```Dotweb5.0
double amount = (Convert.ToDouble(qty)) * (Convert.ToDouble(rate));
double amount1 = ((Convert.ToDouble(rate1)/100) * Convert.ToDouble(amount));
double amount2 = ((Convert.ToDouble(rate2)/100) * Convert.ToDouble(amount));
double totalamount = amount + amount1 + amount2;
```
- Calculates base amount, CGST, SGST, and total.
4. **HTML Rendering**
- Uses `<PRINTLN>` to dynamically generate tables showing:
- Customer details
- Product details
- Tax details
- Bank details
- Certification and authorization
5. **Database Integration**
- Reads database path from `filepath.txt`.
- Connects to WNoSQL using credentials.
- Splits data into two tables:
- **Invoicebill** → Customer and product details.
- **Invoicebill2** → Rate, discount, tax, and bank details.
- Inserts data into tables using `INSERTINTO` queries.
# 📘 Combined Workflow
1. **Frontend (AngularJS)**
- Collects invoice details via form.
- Submits data to backend.
2. **Backend (OakJava7 + WNoSQL)**
- Processes data with business logic.
- Calculates amounts, discounts, CGST, SGST, and total.
- Stores structured data in WNoSQL tables.
- Dynamically generates formatted HTML invoice.
3. **Output**
- Displays invoice bill with customer, product, tax, and bank details.
- Provides certification and authorization section.
- Redirects to same page for seamless SPA experience.
---
# ✅ Summary
The **InvoiceBill SPA Project** demonstrates how a modern web application can integrate:
- **AngularJS frontend** for dynamic form handling.
- **OakJava7 backend** for business logic and HTML rendering.
- **WNoSQL database** for structured storage.
Together, they create a **complete invoice management system** that is fast, interactive, and user-friendly,
embodying the principles of a Single Page Application.
🌐 OUTPUT : Invoice Bill Forms and Invoice Bill for the Customer at Washington , USA
==============================================================================================================
## 🌐 DOTWEB5.0 WebApplication Advanced Concepts
====================================================
## 🌐 What is an OakJava7 /Dotweb5.0 Servlet?
An OakJava7/Dotweb5.0 Servlet is essentially a way of writing HTML code using the `<PRINTLN>` statement or by invoking HTML through the `HTML.displayhtml` method.
---
## 🌐 What is the Include Directive in OakJava7?
The Include directive is used to insert components such as forms, reports, login pages, or other elements into the same page. The package used for including pages is **ScrollLib**.
---
## 🌐 Question
**Write an OakJava7/Dotweb5.0 Servlet to invoke the Register and Login pages, and include a Piechart in the same page.**
This functionality is not available in most programming languages. However, it can be achieved using OakJava7/Dotweb5.0.
In this example, the input should contain two GUI components (a Register page and a Login page) along with a Piechart. When data is entered in the Register page and credentials are entered in the Login page, pressing the Submit button should display the Register page data and print the executable file name `J7value`, which contains the data.
---
### Example Code (OakJava7 /Dotweb5.0 Servlet)
## 💻 File: MultForm.web
```java
<WEB>
// Calling ScrollLib library which contains the include directive for OakJava7 Servlet
<USE> ScrollLib;
<PACK> Oakjava7array {
<CLASS> Program {
public void main() {
// Include Piechart7 chart
Java7request.include("Piechart7", 1, "exe");
// Registration page
HTML.displayhtml("MultiRegister.html");
// Login page
HTML.displayhtml("web5login.html");
}
}
}
```
---
## 💻 File: MultiRegister.html (Registration Page)
```html
<!DOCTYPE html>
<html lang="en">
<body>
<header>
<h1>Register for Dotweb5.0</h1>
</header>
<div class="form-box">
<h2>Create Your Account</h2>
<form class="modal-content" action="http://localhost:9000/MyDetail.soweb" method="post">
<div class="form-group">
<label for="name1">Full Name</label>
<input type="text" id="name1" name="name1" required>
</div>
<div class="form-group">
<label for="uname1">Username</label>
<input type="text" id="uname1" name="uname1" required>
</div>
<div class="form-group">
<label for="password1">Password</label>
<input type="password" id="password1" name="password1" required>
</div>
<div class="form-group">
<label for="state1">State</label>
<input type="text" id="state1" name="state1">
</div>
<div class="form-group">
<label for="country1">Country</label>
<input type="text" id="country1" name="country1">
</div>
</form>
</div>
</body>
</html>
```
---
## 💻 File: web5login.html (Login Page)
```html
<!DOCTYPE html>
<html>
<head>
<title>User Login</title>
</head>
<body onLoad="disableClick()" oncontextmenu="return false" background="https://picsum.photos/200/300/?random" bgcolor="gold">
<button onclick="document.getElementById('id01').style.display='block'" style="width:auto;">Sign Up</button>
<div id="id01" class="modal">
<span onclick="document.getElementById('id01').style.display='none'" class="close" title="Close Modal">×</span>
<div class="container">
<h2><a href="#chapter1">Enter your Details</a></h2>
<p><label> User Name: <input type="text" name="uname" size="25" /></label></p>
<p><label> Password: <input type="password" name="password" size="15" /></label></p>
<div class="clearfix">
<input type="submit" name="Click">
<input type="reset" name="Clear">
</div>
<div class="container" style="background-color:#f1f1f1">
<p align="center">Jemin Information Technology 2024 (C) All Rights Reserved</p>
</div>
</div>
</div>
<script>
var modal = document.getElementById('id01');
window.onclick = function(event) {
if (event.target == modal) {
modal.style.display = "none";
}
}
</script>
</body>
</html>
```
---
---
## 🌐 OakJava7/Dotweb5.0 Servlet with ScrollLib and J7Value12.exe
This example demonstrates how OakJava7/Dotweb5.0 can process form data, display it in a table, and include an executable (`J7Value12.exe`) to retrieve and display data from a WNoSQL database.
---
## 🌐 Explanation
1. **Libraries Used**
- `ScrollLib`: Provides the include directive.
- `Security`, `OJ7UTIL`, `j7security`: Utility and security packages for handling form data and queries.
2. **Process Flow**
- Collect form parameters into an `ArrayList`.
- Use `Request.Query` to map form data to database parameters.
- Display the results in an HTML table using `<PRINTLN>`.
- In the `finally` block, include the executable `J7Value12.exe` to display additional data.
---
## 💻 File: MyDetail.web
```Dotweb5
<WEB>
<USE> ScrollLib;
<USE> <OJ7UTIL>;
<PACK> SDpack {
<CLASS> statics {
public static void display() {
<TRY> {
// Collect form parameters
<OJ7UTIL>.ArrayList arm1 = new <OJ7UTIL>.ArrayList();
arm1.add("name1");
arm1.add("uname1");
arm1.add("password1");
arm1.add("state1");
arm1.add("country1");
arm1.add("uname");
arm1.add("password");
arm1.add("NOT");
// Start HTML output
<PRINTLN>("<!DOCTYPE html>");
<PRINTLN>("<body bgcolor='pink'>");
<PRINTLN>("<form>");
// Query form data from WNoSQL database
<OJ7UTIL>.ArrayList armg = Request.Query(arm1, "MyDetailj7.dsn", 7, 1);
// Display results in a table
<PRINTLN>("<table bgcolor='gold'>");
<PRINTLN>("<tr>");
<PRINTLN>("<th>Name</th>");
<PRINTLN>("<th>Username</th>");
<PRINTLN>("<th>Password</th>");
<PRINTLN>("<th>State</th>");
<PRINTLN>("<th>Country</th>");
<PRINTLN>("<th>Username</th>");
<PRINTLN>("<th>Password</th>");
<PRINTLN>("</tr>");
// Loop through form data
for (int i = 0; i < armg.size()-1; i += 6) {
<PRINTLN>("<tr>");
<PRINTLN>("<td>" + armg.get(i).ToString() + "</td>");
<PRINTLN>("<td>" + armg.get(i+1).ToString() + "</td>");
<PRINTLN>("<td>" + armg.get(i+2).ToString() + "</td>");
<PRINTLN>("<td>" + armg.get(i+3).ToString() + "</td>");
<PRINTLN>("<td>" + armg.get(i+4).ToString() + "</td>");
<PRINTLN>("<td>" + armg.get(i+5).ToString() + "</td>");
<PRINTLN>("<td>" + armg.get(i+6).ToString() + "</td>");
<PRINTLN>("</tr>");
}
<PRINTLN>("</table>");
<PRINTLN>("</form>");
<PRINTLN>("</html>");
<PRINTLN>("</body>");
}
<CATCH> (Exception e) {
// Handle exceptions
}
<Finally> {
<PRINTLN>("The Finally block is executed...");
// Include executable to display data
Java7request.include("J7Value12", 1, "exe");
}
}
public void main() {
display();
}
}
}
```
---
# ✅ Key Points
- **Form Handling:** Parameters are collected into an `ArrayList` and mapped using `Request.Query`.
- **Dynamic Output:** Data is printed into an HTML table using `<PRINTLN>`.
- **Executable Inclusion:** `Java7request.include("J7Value12", 1, "exe")` integrates external processing logic.
🌐 OUTPUT : Piechart ,Register page , Login Page
Next Page for MULTIFORM (The Combination of register page and Login page Outputs in Table Format) and Retrieval of Eno, Name ,Designation ,Salary from Wnosqldb with SoWeb Theme.
==============================================================================================================
## 🌐 Dotweb5.0 With CANVAS Animation With JQuery
===============================================================================================================
## 🌐 Question :Draw a House with Moving Moon Animation with HTML Canvas + Jquery + Dotweb5.0 :
## 💻 File: housemoon.html
<!DOCTYPE html>
<html>
<head>
<title>House with Moving Moon</title>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<style>
body { margin:0; background:#000; }
canvas { display:block; margin:auto; background:#001d3d; }
</style>
</head>
<body>
<canvas id="nightScene" width="800" height="500"></canvas>
<script>
$(document).ready(function() {
const canvas = document.getElementById("nightScene");
const ctx = canvas.getContext("2d");
let moonX = 50;
let moonY = 100;
function drawHouse() {
ctx.fillStyle = "#654321";
ctx.fillRect(300, 300, 200, 150);
ctx.fillStyle = "#8B0000";
ctx.beginPath();
ctx.moveTo(300, 300);
ctx.lineTo(400, 200);
ctx.lineTo(500, 300);
ctx.closePath();
ctx.fill();
ctx.fillStyle = "#222";
ctx.fillRect(380, 370, 40, 80);
ctx.fillStyle = "#87CEEB";
ctx.fillRect(320, 330, 40, 40);
ctx.fillRect(440, 330, 40, 40);
}
function drawMoon(x, y) {
ctx.fillStyle = "#fdfd96";
ctx.beginPath();
ctx.arc(x, y, 40, 0, Math.PI * 2);
ctx.fill();
}
function animate() {
ctx.clearRect(0, 0, canvas.width, canvas.height);
ctx.fillStyle = "white";
for (let i = 0; i < 50; i++) {
ctx.fillRect(Math.random() * canvas.width, Math.random() * canvas.height, 2, 2);
}
drawHouse();
drawMoon(moonX, moonY);
moonX += 1;
if (moonX > canvas.width + 40) {
moonX = -40;
}
requestAnimationFrame(animate);
}
animate();
});
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>House with Moving Moon</title>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<style>
body { margin:0; background:#000; }
canvas { display:block; margin:auto; background:#001d3d; }
</style>
</head>
<body>
<canvas id="nightScene" width="800" height="500"></canvas>
</body>
</html>
Declares HTML5 document type.
Loads jQuery for DOM readiness handling.
Defines a canvas element where all graphics are drawn.
Background colors simulate a night sky.
$(document).ready(function() {
const canvas = document.getElementById("nightScene");
const ctx = canvas.getContext("2d");
let moonX = 50;
let moonY = 100;
Ensures script runs only after DOM is fully loaded.
Retrieves canvas and sets up 2D drawing context.
Initializes moon position variables.
function drawHouse() {
// Base
ctx.fillStyle = "#654321";
ctx.fillRect(300, 300, 200, 150);
// Roof
ctx.fillStyle = "#8B0000";
ctx.beginPath();
ctx.moveTo(300, 300);
ctx.lineTo(400, 200);
ctx.lineTo(500, 300);
ctx.closePath();
ctx.fill();
// Door
ctx.fillStyle = "#222";
ctx.fillRect(380, 370, 40, 80);
// Windows
ctx.fillStyle = "#87CEEB";
ctx.fillRect(320, 330, 40, 40);
ctx.fillRect(440, 330, 40, 40);
}
Rectangles form the house body, door, and windows.
Path drawing creates a triangular roof.
Colors simulate wood, brick, and glass.
function drawMoon(x, y) {
ctx.fillStyle = "#fdfd96";
ctx.beginPath();
ctx.arc(x, y, 40, 0, Math.PI * 2);
ctx.fill();
}
Uses arc() to draw a circular moon.
Soft yellow color gives a glowing effect.
function animate() {
ctx.clearRect(0, 0, canvas.width, canvas.height);
// Stars
ctx.fillStyle = "white";
for (let i = 0; i < 50; i++) {
ctx.fillRect(Math.random() * canvas.width, Math.random() * canvas.height, 2, 2);
}
// House + Moon
drawHouse();
drawMoon(moonX, moonY);
// Move moon
moonX += 1;
if (moonX > canvas.width + 40) {
moonX = -40;
}
requestAnimationFrame(animate);
}
animate();
Clears canvas each frame.
Random stars simulate twinkling.
Draws house and moon.
Updates moon’s x position for smooth movement.
Uses requestAnimationFrame() for efficient animation.
In Dotweb5.0 documentation style, this example demonstrates:
Scenario-driven clarity: Each function has a clear role (house, moon, animation).
Decorated headings: Sections are visually distinct for HR/technical review.
Iterative workflow: Moon’s movement is updated frame by frame, showing modular design.
User empowerment: Easy to extend (add trees, gradient sky, glowing windows).
✅ Summary:
This program builds a night scene with a house and a moving moon using Canvas graphics controlled by jQuery. The animation loop ensures continuous motion, while modular functions keep the design maintainable—exactly the kind of robust, scenario-driven workflow Dotweb5.0 emphasizes.
Got it — let’s break down your Dotweb5.0 program step by step, in the same decorated, scenario-driven style we used earlier.
## 💻 File: housemoonanimation.web
<WEB>
<PACK> animation
{
<CLASS> moonhouse
{
public static void display()
{
HTML.displayhtml("housemoon.html");
}
public void main() {
display();
}
}
}
<WEB>
<PACK> animation
{
<CLASS> moonhouse
{
public static void display()
{
HTML.displayhtml("housemoon.html");
}
public void main()
{
display();
}
}
}
<WEB> → Declares this as a Dotweb5.0 web program.
<PACK> animation → Defines a package named animation.
<CLASS> moonhouse → Creates a class called moonhouse.
public static void display()
{
HTML.displayhtml("housemoon.html");
}
A static method that calls HTML.displayhtml().
This function loads and displays the HTML file housemoon.html (the one you wrote earlier with Canvas + jQuery).
In Dotweb5.0, HTML.displayhtml() is the bridge between backend logic and frontend rendering.
public void main()
{
display();
}
The entry point of the program.
Calls display() so that when the program runs, it immediately shows the house with moving moon animation.
Program starts → main() is invoked.
main() calls display().
display() loads housemoon.html.
The HTML file runs its Canvas + jQuery animation, showing the house and moon.
Separation of Concerns:
Dotweb5.0 class (moonhouse) handles program logic.
HTML file (housemoon.html) handles graphics and animation.
Scenario-driven clarity:
The Dotweb5.0 program acts as a launcher for the HTML animation.
Maintainability:
If you change the animation file, you don’t need to rewrite the Dotweb5.0 class — just point to the new HTML.
✅ Summary:
The Dotweb5.0 program moonhouse is essentially a wrapper that loads and displays the HTML animation file. The HTML file contains the Canvas + jQuery logic for drawing the house and animating the moon. Together, they demonstrate Dotweb5.0’s modular design: backend class triggers → frontend HTML renders → user sees the animated scene.
==============================================================================================================
🌐 OUTPUT : House with Animated Moon
=============================================================================================================
# Dotweb5.0 Licensing
- **Professional Edition**
© 2026 Jemin Information Technology / Wilmix Jemin J
Licensed under the GNU General Public License v3.0 (GPLv3).
Suitable for tutorials, documentation, and professional/educational use.