Jetspeed 2 将文件数据初始化到数据库的实现方法
[sql] view plaincopy Jetspeed2版本2.2.2 数据库MYSQL 文件:pages/* 首先,不得不说,jetspeed2 的文件转数据库挺折磨人的,在网上收集的各种资料,均告失败: http://www.360doc.com/content/10/0310/20/972665_18281206.shtml http://www.360doc.com/con
[sql] view plaincopy
- Jetspeed2 版本 2.2.2
- 数据库 MYSQL
- 文件:pages/*
首先,不得不说,jetspeed2 的文件转数据库挺折磨人的,在网上收集的各种资料,均告失败:
http://www.360doc.com/content/10/0310/20/972665_18281206.shtml
http://www.360doc.com/content/08/0128/11/27906_1010273.shtml
http://portals.apache.org/jetspeed-1/psml_db.html
在Jetspeed2.2.2中,已经取代了DatabasePsmlManagerService,改为PageSerializerImpl;而且,在jetspeed2.2.2中,采用admin的方式登录,并在网站管理中,import是无效的,会报出Index Unique错误。
现在,介绍将pages下面的所有文件导入到数据库(初始化)的实现方法
1,所有在导入过程中不允许出现中文字样(文件目录,*psml文件内容,link等)
2,建立文件夹Jetspeed-Data-Files
3,文件夹中包含两部分内容,j2-data.xml,pages文件夹
j2-data.xml文件通过jetspeed2.2.2安装文件的 export jetspeed portal database 功能获取,或者用源码包中的j2-seed.xml替代;
pages文件夹,即为使用文件存储页面数据的文件夹,效果图如下:
4,运行jetspeed2.2.2的安装文件
[python] view plaincopy
- java -jar E:\jetspeed2.2.2\jetspeed-installer-2.2.2.jar
6,选择Jetspeed-Data-Files目录:
7,在数据库导入过程中,jetspeed会生成一些临时文件,包括数据库配置,jar包等等,在这里指定临时文件位置,(默认可忽略)
8,默认需要512m内存供给数据库导入功能,可以设置更大
9,选择数据库类型
10,填写数据库配置,及jdbc链接的jar包位置
11,一切准备就绪,开始导入了
12,日志分析
a,安装数据库导入时必备的功能性文件
[plain] view plaincopy
- antinstaller.jarE:\jetspeed2.2.2\jetspeed-installer-2.2.2.jar
- setupInstallation:
- [echo] Starting the installation
- [echo] Deleting all content from the installation target directory
- [echo] Installing Jetspeed-2.2.2 Enterprise Portal
- [unzip] Expanding: E:\jetspeed2.2.2\jetspeed-installer-2.2.2.jar into C:\Users\DB~1\AppData\Local\Temp\Jetspeed-2.2.2
- [unzip] Expanding: C:\Users\DBLIUE~1\AppData\Local\Temp\Jetspeed-2.2.2\database.zip into C:\Users\DB~1\AppData\Local\Temp\Jetspeed-2.2.2
- [unzip] Expanding: C:\Users\DB~1\AppData\Local\Temp\Jetspeed-2.2.2\tomcat-portal.zip into C:\Users\DB~1\AppData\Local\Temp\Jetspeed-2.2.2
- [echo] Setting up the database configuration
- [copy] Copying 1 file to C:\Users\DB~1\AppData\Local\Temp\Jetspeed-2.2.2\lib
- [move] Moving 1 file to C:\Users\DB~1\AppData\Local\Temp\Jetspeed-2.2.2\database
[plain] view plaincopy
- importPortalDB:
- [echo] Import all data into Jetspeed database
- checkDerby:
- importDB:
- importData:
- [echo] Import Jetspeed database from C:\Apache\Jetspeed-Data-Files/j2-data.xml
- [java] creating clients, mediatypes and mimetypes
- [java] creating principals and permissions
- [java] creating permissions
- [java] creating profiling rules and user profiling rules
- [java] creating entities
- [java] creating SSO sites, principals, and security domains
c,开始导入pages下面的数据
[plain] view plaincopy
- importPrefs:
- importPages:
- [echo] Import Jetspeed database pages from C:\Apache\Jetspeed-Data-Files/pages directory
- [java] Starting complete import of folder: / (overwriting folders: true, pages: true)
- [java] overwriting folder /
- [java] processing new page /css-demo.psml
- [java] processing new page /default-page.psml
- [java] processing new page /jetspeed.psml
- [java] processing new page /minimal-default-page.psml
- [java] processing new page /my-account.psml
- [java] processing new page /p002.psml
- ... ...
d,导入成功
[plain] view plaincopy
- [java] Import finished: processed 80 folder(s), 120 page(s), 24 link(s).
- [echo] Import Jetspeed database complete!
- [echo] Deleting temporary installation target directory
- [delete] Deleting directory C:\Users\DBLIUE~1\AppData\Local\Temp\Jetspeed-2.2.2
- importdb:
- BUILD SUCCESSFUL
- Total time: 2 minutes 40 seconds
1:文件和文件夹的内容中尽量不好包含中文,进入数据库很可能是乱码,尤其在windows系统中
2:在导入过程中,可能会出现错误,尽量找到错误原因重新导入即可,jetspeed2.2.2再导入时会首先删除数据库中的数据确保数据一致性
14,数据库字段修改
在插入时,遇到字段过长数值越界报错,内容如下,出现在fragment表,LAYOUT_SIZES字段,原字段长度 varchar (20),建议改长些。
[sql] view plaincopy
- "white-space:pre"> 338px,808px;float:left;margin-top:5px;,20px

InnoDBBufferPool reduces disk I/O by caching data and indexing pages, improving database performance. Its working principle includes: 1. Data reading: Read data from BufferPool; 2. Data writing: After modifying the data, write to BufferPool and refresh it to disk regularly; 3. Cache management: Use the LRU algorithm to manage cache pages; 4. Reading mechanism: Load adjacent data pages in advance. By sizing the BufferPool and using multiple instances, database performance can be optimized.

Compared with other programming languages, MySQL is mainly used to store and manage data, while other languages such as Python, Java, and C are used for logical processing and application development. MySQL is known for its high performance, scalability and cross-platform support, suitable for data management needs, while other languages have advantages in their respective fields such as data analytics, enterprise applications, and system programming.

MySQL is worth learning because it is a powerful open source database management system suitable for data storage, management and analysis. 1) MySQL is a relational database that uses SQL to operate data and is suitable for structured data management. 2) The SQL language is the key to interacting with MySQL and supports CRUD operations. 3) The working principle of MySQL includes client/server architecture, storage engine and query optimizer. 4) Basic usage includes creating databases and tables, and advanced usage involves joining tables using JOIN. 5) Common errors include syntax errors and permission issues, and debugging skills include checking syntax and using EXPLAIN commands. 6) Performance optimization involves the use of indexes, optimization of SQL statements and regular maintenance of databases.

MySQL is suitable for beginners to learn database skills. 1. Install MySQL server and client tools. 2. Understand basic SQL queries, such as SELECT. 3. Master data operations: create tables, insert, update, and delete data. 4. Learn advanced skills: subquery and window functions. 5. Debugging and optimization: Check syntax, use indexes, avoid SELECT*, and use LIMIT.

MySQL efficiently manages structured data through table structure and SQL query, and implements inter-table relationships through foreign keys. 1. Define the data format and type when creating a table. 2. Use foreign keys to establish relationships between tables. 3. Improve performance through indexing and query optimization. 4. Regularly backup and monitor databases to ensure data security and performance optimization.

MySQL is an open source relational database management system that is widely used in Web development. Its key features include: 1. Supports multiple storage engines, such as InnoDB and MyISAM, suitable for different scenarios; 2. Provides master-slave replication functions to facilitate load balancing and data backup; 3. Improve query efficiency through query optimization and index use.

SQL is used to interact with MySQL database to realize data addition, deletion, modification, inspection and database design. 1) SQL performs data operations through SELECT, INSERT, UPDATE, DELETE statements; 2) Use CREATE, ALTER, DROP statements for database design and management; 3) Complex queries and data analysis are implemented through SQL to improve business decision-making efficiency.

The basic operations of MySQL include creating databases, tables, and using SQL to perform CRUD operations on data. 1. Create a database: CREATEDATABASEmy_first_db; 2. Create a table: CREATETABLEbooks(idINTAUTO_INCREMENTPRIMARYKEY, titleVARCHAR(100)NOTNULL, authorVARCHAR(100)NOTNULL, published_yearINT); 3. Insert data: INSERTINTObooks(title, author, published_year)VA


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

SublimeText3 Linux new version
SublimeText3 Linux latest version

SublimeText3 Mac version
God-level code editing software (SublimeText3)

SublimeText3 English version
Recommended: Win version, supports code prompts!

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.