Original article: http://www.mojoportal.com/setupandupgradeforcustomfeatures.aspx
How to install, configure, and upgrade third-party modules
With mojoportal, you can install, configure, and upgrade third-party modules.
The mojoportal installation system provides you with the following services:
1: run the database script file to create or modify database tables or other database objects for your program
2: When the installation module arrives at the site, the installation system can set the required parameters for your module in the database or for your module.
3: for initial installation, you can create a page at will and install the module on the new page.
One important thing you cannot do when installing the system is to copy your files. You can use xcopy to deploy your files. Use xcopy to copy the required files to the corresponding folder. In this process, do not overwrite existing files. For example, the web folder already exists. config and default. aspx file. If your module also contains these two files, you should adjust the structure of your module and put the files in the subfolders.
The structure is as follows:
Web
Bin
Yourwebpageandcontrolsfolder
Setup
Applications
Your application name
Featuredefinitions
Schemainstallscripts
Firebirdsql
MSSQL
MySQL
Pgsql
SQLite
Schemaupgradescripts
Firebirdsql
MSSQL
MySQL
Pgsql
SQLite
Providerconfig
Indexbuilders
Do not have spaces in the middle of "your application name". I suggest you use lower-case letters, and cannot conflict with other program names. Your module may not need to configure all types of databases. For example, if you only want to configure the MSSQL database, you can leave other folders empty. Of course, if you want to sell your module, you may configure all types of database J. mojoportal source code to contain some codesmith templates, which can be used to generate different data layers. I used these templates when developing the mojo module.
These configuration files are text files named after the version number and with the config extension. For example, when you develop a new module, you may have created the first script in the schemainstallscripts/MSSQL folder named 0.0.0.1.config. the script contains the table creation, all the Code required for the stored procedure.
After several days, you can add some small functions. You need to add a column on the data table and change some stored procedures. Then you need to create a file in the schemaupgradescripts/MSSQL folder, the name can be 0.0.0.2.config, and all the SQL code is put in it.
To run these scripts, you only need to access webroot/Setup/default. on the ASPX page, the installation system traverses the response folders of each module in the setup file. If a new version is found, the script code in the new version is run and the new version number is recorded in the mp_schemaversion table, record each script to the mp_schemascripthistory table.
You can use the specified code to copy and install system files to the main program in the Build Events event of the program.
Featuredefinitions Folder:
The configuration file contains the module configuration information and module parameter configuration. You should give your module A unique guid, which is used to find the parameter configuration of a specific module, to ensure that all the parameter configurations have been completed, you can add the parameter configurations of the module at any time, and then visit the installation page (Setup/default. aspx), so that the new parameter configuration will be added to your module.
Providerconfig/indexbuilders Folder:
Put the configuration file here into your implemented indexbuilderproviders to ensure that the content of your module can be queried.
Initialcontent Folder:
Define the page created during installation and add it to the relevant module. The configuration file is put here. This is a simple XML file. You can take a look at the included examples to create your page.