How to convert a simple CMS background management system example to a version in different background languages such as Java and Php. If you are waiting for a ride, we will not continue the development process today. let's talk about background language issues that are commonly concerned. I have been learning ExtJS, and I have always stressed that the central idea of learning is to take a bus between interfaces and wait for a while. today, I will not continue to worry about the development process. let's talk about background language issues that are commonly concerned.
After learning Ext JS, I have always stressed that the central idea of learning is "separation of interfaces and data ". As long as you master this idea and have a deep understanding of the operation process of Ext JS, you will not be troubled by the background language usage. It can be said that as long as the idea is clear, it is easy to migrate an Ext JS project to different background language platforms. The following is a simple example.
If you put down the language burden and insist on reading the article in this example, you will feel that the combination of the client script file and the background language file has only one, that is, the homepage index. cshtml. If all the Scripts in this file are extracted, basically Ext JS has nothing to do with the development language platform. copy the Scripts directory to any language platform project, can be used directly. The address is basically changed. If Ext. Direct is used, this is more thorough, and there is basically no need to make any changes, and there is a corresponding method for the background language. If you know this, it's easy to do.
For example, if you want to change this example to a Java version, if the Java architecture does not support authentication, split the homepage into two files, one dedicated for login, one is the page to jump to after login. this method is estimated to be familiar with Web development.
In Ext JS, there are three main data submission methods:
1. table submission in single form. Although this method is also submitted in Ajax mode, there is no difference between the background processing and basic form submission forms. Therefore, the background data processing method is, no difficulty, you know! Don't you understand? This ...... Make up HTML knowledge. The best example is the submission of the logon window. you can try to practice in a language you are familiar.
2. submit in Ajax format. The example here is the password reset during user login. although the data format is not fixed, the submit parameter is defined by yourself or the project, the data processing method in the background is not much different from the data submitted in the form.
3. Store data synchronization submission method. as long as Writer is defined and the same data submission method is used, the background data processing method is basically the same. For example, for adding, editing, and deleting operations in user management, the submitted data must be extracted from the data keyword, then, you need to convert the submitted data to a JSON Array using the parse method of the JSON object on the server side, and then extract the specific data object for processing. For Java processing, see section 1.2.6. In other languages, you can find the corresponding JSON library for processing.
In Ext JS, the data return format is also basically fixed. in the example, the current return format is two:
1. form error message:
{
Success: true or false,
Errors :{
Field1: "error message ",
Field2: "error message ",
...
}
}
2. Other data
{
Success: true or false,
Total: total data,
Data: [...],
Msg: "error message"
}
In the example, both Store synchronization and Ajax data submission use 2nd data return formats, which are basically common.
Clear the Ext JS data submission format and return format to know how to extract and return data. As long as the data is returned in a correct format, Ext JS can run normally without any background language impact. As for what languages and databases are used in the background, there is no problem. these are the technologies that developers have mastered, and the rest is to return data based on the format. Therefore, it is not difficult to modify this example.
For example, to display user data, no matter what structure the data table is, after you extract the data from the database, you can organize the data to be returned based on format 2. You said you don't know how to extract data from the database? This ...... I cannot teach this either.
To add a user, extract the data according to the submitted format, and then add the data to the database by adding the data in your database. 2, return the successfully added or failed information to the client. The basic steps for editing and deleting are the same.
As for permission control, various languages have their own methods. The simplest is to verify the headers of each operation method. if the verification finds that the permission does not meet the permission requirements, then, a success value is returned based on data return format 2, and the Msg information is "you are not authorized to access.
After the data processing method is clear, the rest is to make the data submission address of each Ext JS operation correspond to the method in the server. this is based on Web development and is not too difficult.
The above roughly introduces how to change this example to different language versions. if you have any questions, please leave a message to me and discuss the development methods of different languages. If you are interested in changing this example to a different language version, you are welcome to contact the author to change this example to an example of a different language version for your learning.
Bytes. Learning Ext JS, I have always stressed that the central idea of learning is interface and...