Amaliy misol bilan tanishuv
Ushbu amaliy misolda AppML yordamida Internet ilovalarini qanday yaratish ko‘rsatiladi.
I qism: Internetdagi fayllarga murojaat qilish
- TEXT (matnli) faylga murojaat qilish
- XML faylga murojaat qilish
- JSON faylga murojaat qilish
II qism: Internetdagi ma’lumotlar bazalariga murojaat qilish
- Ma’lumotlar bazasidagi ma’lumotlarni ro‘yxat ko‘rinishida chiqarish
- Ma’lumotlar bazasidagi ma’lumotlarni filtrlash
- Ma’lumotlar bazasidagi ma’lumotlarni tahrirlash
AppML brauzer va AppML server
Ushbu amaliy misolda AppML ham brauzerda (appml.js), ham serverda (appml.php) ishlaydi.
Biz https://www.w3schools.com manzilida joylashgan veb-serverdan foydalanamiz.
Barcha fayllar va ma’lumotlar bazalari serverda joylashgan.
Ushbu darslikning keyingi qismida brauzerda veb-serverni qanday simulyatsiya qilishni o‘rganasiz.
Matnli fayllar
Matnli fayllarga qanday murojaat qilishni ko‘rsatish uchun quyidagi kabi fayllardan foydalandik:
cd_catalog.txt
Empire Burlesque,Bob Dylan,USA,Columbia,10.90,1985
Hide your heart,Bonnie Tyler,UK,CBS Records,9.90,1988
Greatest Hits,Dolly Parton,USA,RCA,9.90,1982
Still got the blues,Gary Moore,UK,Virgin records,10.20,1990
.
.
O‘zingiz sinab ko‘ring »
XML fayllar
XML fayllarga qanday murojaat qilishni ko‘rsatish uchun quyidagi kabi fayldan foydalandik:
cd_catalog.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<CATALOG>
<CD>
<TITLE>Empire Burlesque</TITLE>
<ARTIST>Bob Dylan</ARTIST>
<COUNTRY>USA</COUNTRY>
<COMPANY>Columbia</COMPANY>
<PRICE>10.90</PRICE>
<PUBLISHED>1985</PUBLISHED>
</CD>
<CD>
<TITLE>Hide your heart</TITLE>
<ARTIST>Bonnie Tyler</ARTIST>
<COUNTRY>UK</COUNTRY>
<COMPANY>CBS Records</COMPANY>
<PRICE>9.90</PRICE>
<PUBLISHED>1988</PUBLISHED>
</CD>
.
.
O‘zingiz sinab ko‘ring »
JSON fayllar
JSON fayllarga qanday murojaat qilishni ko‘rsatish uchun quyidagi kabi fayllardan foydalandik:
cd_catalog.js
{
"cd" : [
{ "title" : "Empire Burlesque", "artist" : "Bob Dylan", "price" : "10.90" },
{ "title" : "Hide your heart", "artist" : "Bonnie Tyler", "price" : "9.90" },
{ "title" : "Greatest Hits", "artist" : "Dolly Parton", "price" : "9.90" },
{ "title" : "Still got the blues", "artist" : "Gary Moore", "price" : "10.20" },
.
.
O‘zingiz sinab ko‘ring »
Ma’lumotlar bazalari
Test ma’lumotlar bazamiz quyidagi kabi bir nechta jadvallardan iborat:
Customers
| Customer | Address | City | Country |
|---|---|---|---|
| Around the Horn | 120 Hanover Sq. | London | UK |
| Berglunds snabbkjøp | Berguvsvägen 8 | Luleå | Sweden |
| Blauer See Delikatessen | Forsterstr. 57 | Mannheim | Germany |
| Blondel père et fils | 24, place Kléber | Strasbourg | France |
| Bólido Comidas preparadas | C/ Araquil, 67 | Madrid | Spain |
| Bottom-Dollar Markets | 23 Tsawassen Blvd. | Tsawassen | Canada |
Suppliers
| Supplier | Address | City | Country |
|---|---|---|---|
| Exotic Liquid | 49 Gilbert St. | London | UK |
| New Orleans Cajun Delights | P.O. Box 78934 | New Orleans | USA |
| Grandma Kelly's Homestead | 707 Oxford Rd. | Ann Arbor | USA |
| Tokyo Traders | 9-8 SekimaiMusashino-shi | Tokyo | Japan |
| Cooperativa de Quesos 'Las Cabras' | Calle del Rosal 4 | Oviedo | Spain |
| Mayumi's | 92 Setsuko Chuo-ku | Osaka | Japan |
| Pavlova, Ltd. | 74 Rose St. Moonie Ponds | Melbourne | Australia |
| Specialty Biscuits, Ltd. | 29 King's Way | Manchester | UK |
| PB Kn ckebr d AB | Kaloadagatan 13 | G teborg | Sweden |
| Refrescos Americanas LTDA | Av. das Americanas 12.890 | S o Paulo | Brazil |
Products
| Product | Quantity Per Unit | Unit Price | Units In Stock |
|---|---|---|---|
| Chai | 10 boxes x 20 bags | 18 | 39 |
| Chang | 24 - 12 oz bottles | 19 | 17 |
| Aniseed Syrup | 12 - 550 ml bottles | 10 | 13 |
| Chai | 10 boxes x 20 bags | 18 | 39 |
| Chef Anton's Gumbo Mix | 36 boxes | 21 | 0 |
| Grandma's Boysenberry Spread | 12 - 8 oz jars | 25 | 120 |
| Uncle Bob's Organic Dried Pears | 12 - 1 lb pkgs. | 30 | 15 |
| Northwoods Cranberry Sauce | 12 - 12 oz jars | 40 | 6 |
| Mishi Kobe Niku | 18 - 500 g pkgs. | 97 | 29 |
| Ikura | 12 - 200 ml jars | 31 | 31 |
W3Schools Pathfinder
Yutuqlaringizni kuzating – bu bepul!
