2.8. Using Modeshape as the JCR
ModeShape is a Java Content Repository (JCR) that can be used in place of Apache Jackrabbit and has been included as a technical preview in JBoss Enterprise BRMS 5.2 and 5.3.
The following requirements must be met before ModeShape can be installed:
- The BRMS standalone package has been downloaded and installed, refer to the JBoss Enterprise BRMS Getting Started Guide for further instructions.
- Apache Ant is installed. Refer to the appendix at the back of this guide for directions.
- A supported database server is required for production deployment. Refer to https://access.redhat.com/knowledge/articles/119933 for a complete list of supported database servers.
- The database instance that will be used has already been created.
- A database user with permissions to change the database exists.
- The JDBC driver JAR file for the database is in the
lib/directory of the server configuration.
Procedure 2.6. Configure ModeShape
- Run the ant installer from the ModeShape directory and specify the server profile ModeShape will be installed to.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Add the user accounts
adminandmailman, and assign the roles specified below. The default configuration uses text files to store the usernames, passwords, and assigned roles. The directions here assume that the authorization configuration has not been changed. If it has been changed, then add the users according to that configuration.- Open the file
PROFILE/conf/props/brms-users.propertiesin a text editor and add the usersadminandmailmanto this file as a new line with the syntax:username=password.admin=s3kr3t5 mailman=53cur3m@1l
admin=s3kr3t5 mailman=53cur3m@1lCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Assign the roles specified below to the two users by opening the
PROFILE/conf/props/brms-roles.propertiesfile in a text editor and adding a new line for each user with the syntaxusername=role1, role2, role3.Theadminuser must be assigned the roles ofJBossAdmin,HttpInvoker,user, andadmin.Themailmanuser must be assigned the roles ofJBossAdmin,readwrite.admin=JBossAdmin, HttpInvoker, user, admin mailman=JBossAdmin, readwrite
admin=JBossAdmin, HttpInvoker, user, admin mailman=JBossAdmin, readwriteCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Optionally, the passwords can be stored in encoded form instead of plain text. To do this run the following command in the application server directory (
jboss-asorjboss-as-web) to create the encoded form of the password, replacing PASSWORD with the chosen password.java -cp client/jboss-logging-spi.jar:lib/jbosssx.jar org.jboss.resource.security.SecureIdentityLoginModule PASSWORD
[localhost]$ java -cp client/jboss-logging-spi.jar:lib/jbosssx.jar org.jboss.resource.security.SecureIdentityLoginModule PASSWORD Encoded password: 5f78dc15b9a559cbdf8592078de921bcCopy to Clipboard Copied! Toggle word wrap Toggle overflow Then replace the passwords stored inPROFILE/conf/props/brms-users.propertieswith the encoded versions.
- The default configuration for Modeshape uses a database that is not suitable or supported in production environments. Before deploying into a production environment, this configuration must be changed to a supported database server.The default Modeshape repository configuration uses a JNDI data source —
ModeShapeBRMSRepo— for data storage which is configured in thePROFILE/deploy/modeshape-brms-store-ds.xmlfile. Edit this file to change the data source configuration from Hypersonic to the database of your choice. This file is a standard JBoss data source configuration file.Refer to the Datasource Configuration chapter of the Application server documentation for details to configure JBoss data sources. - Edit the
jboss-brms.war/WEB-INF/components.xmlfile to remove the Apache Jackrabbit configuration and add the ModeShape configuration.To remove the Apache Jackrabbit configuration, comment out the following section:Copy to Clipboard Copied! Toggle word wrap Toggle overflow The ModeShape configuration is commented out in the default configuration. Uncomment the configuration as shown below:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - ModeShape requires two user accounts to exist,
adminandmailman. The passwords for these accounts must be specified in the ModeShape configuration from the previous step.<key>org.drools.repository.secure.passwords</key><value>false</value> <key>org.drools.repository.admin.password</key><value>password</value> <key>org.drools.repository.mailman.password</key><value>password</value>
<key>org.drools.repository.secure.passwords</key><value>false</value> <key>org.drools.repository.admin.password</key><value>password</value> <key>org.drools.repository.mailman.password</key><value>password</value>Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Restart the server.