Web DBFORMS (continued)

zhaozj2021-02-16  50

Web DBFORMS (continued)

Advanced Features

Advanced feature

Fine-grained security

Precision safety mechanism

DBFORMS 'Security Model Builds on top of the Java Servlet Security Model, with its concept of users (Principals) and roles.

DBFORMS's security model is built on the Java Servlet security model, using the concept of users and roles.

DbForms provides fine-grained declarative definition of rights for data access and manipulation. DbForms can attach security constraints to each table defined in the XML configuration, telling DbForms which kind of database operations may be executed by which user groups.

DBForms provides strict and clear definitions for data access and operational permissions. DBFORMS can install a security constraint for each table defined in the XML configuration, telling DBForms which user groups can operate which databases.

Listing 4. Defining Privileges

SELECT = "a, b"

INSERT = "a"

Update = "a, b"

Delete = "a" />

The attributes of the element tell DbForms: ". Members of group A may select, insert, update and delete customers, and members of B may read and update customers" All other groups (for example, a group C) May Not Access this Table At ALL.

Element The properties of the element are: "Group A members can query, increase, update, and delete customers, B group members can read and update customers." Other group members (such as c groups) can't access This table.

File Uploads

File Upload

Managing Blob Fields Is A Very Easy Task When Using DBForms; First You Have To Tell DBFORMS About Blob-Fields in The XML Configuration File: Managing the blob field is a very simple thing; first, you have to tell in the XML configuration file DBFORMS about blod field information:

Listing 5. Defining FIELDS OF TYPE "BLOB"

The Configuration Code-Snippet Shown in Listing 5 Tells DBFORMS That The Fields Portrait_Pic and Story Are Blobs. As You Can See, Dbforms Allows More Than ONE Field in A Row To Be a Blob.

The configuration code segment indicated by Listing5 tells the DBForms photos and resumes ~ Save with the blob field. As you can see, DBFORMS allows multiple fields to be a BLOB type.

After Defining Our Blob-Powered Table, We would Want To Build A JSP for Managing The Blob Fields. For this purpose, a new custom tag is intenced:

After defining the BLOB table, we also have a JSP file to manage these BLOB fields. To do this, here is introduced into a new custom label:

Listing 6

IMPLEMENTING A FILE TAG

The attribute fieldname refers to the name of the field the file need for this element this is used..............

FieldName's attribute value is determined by the field name to be uploaded. (This element has other properties, not listed here)

This Custom Tag Gets Rendered AS A HTML Tag, AS Shown In Figure 6.

This tag is displayed as an HTML tag as shown in Figure 6.

Figure 6. The result Visible to the user.this HTML Element Enables Multipart-Enabled Browsers To Submit Files To The Server.

This HTML element allows you to support multipart's browsers to submit files to the server.

IF WEERE Using Blobs for Storing Images in A Database, We Could Write The Following JSP Code To Retrieve and Render Such A Field:

If we use blob in the database to save images, we can remove and display this field with the following JSP code:

Listing 7

Rendering images Using a bloburl

" Width = "100" height = "80" border = "0">

Special DBFORMS Feature: Diskbblobs

DBFORMS Features: Diskbblobs

There are situations where BLOBs are not an option: if the application uses a RDBMS or JDBC driver without BLOB support, if BLOB support is too slow or even buggy, or if the files should be accessible by other applications without using a database layer.

In some cases, you do not choose BLOBS: If the application uses a RDBMS or JDBC driver that does not support blob, if the BLOB speed is too slow or even a bug, or other programs do not use the database layer or access these files.

DbForms also manages uploads to a file system instead of a database. This is completely transparent to the JSP view developer! For uploading and retrieving file-system-stored objects, the same tags and attributes are used as for uploading and retrieving regular BLOBs.

DBFORMS management is uploaded to the file system instead of a database. This is completely transparent to the JSP view developer. To upload and retrieve objects saved as a file system, upload and retrieve the regular blobs using the same tag and properties.

The Only Difference Lies in The Definition of the Model, WHERE A Server Directory for Storing The Files Must Additionally BE Specified.

The only difference is that the server directory of the saved file must be specified in terms of the definition of the model.

Listing 8. Defining Fields of Type "Diskblob"

转载请注明原文地址:https://www.9cbs.com/read-25970.html

New Post(0)
CopyRight © 2020 All Rights Reserved
Processed: 0.042, SQL: 9