[opencms-dev] setting up mvnforum in the same context of opencms 6alpha 2

??? shiys at langhua.cn
Sun Oct 31 14:19:15 CET 2004


Hi Arash,

Great work! Your description is every clear, I have only one question on the last step: link the two user tables to each other. Could you tell me how to do it? Do you make the user integration in DB?

TIA,

Shi Yusen/Langhua

-----????-----
???: Arash Kaffamanesh [mailto:kaffamanesh at dmu-world.de]
????: 2004?10?31? 6:41
???: opencms-dev at opencms.org
??: [opencms-dev] setting up mvnforum in the same context of opencms 6alpha 2


#### A short introduction to setting up mvnforum ####
#### in the same context of opencms 6 alpha 2  ####

I assume you have opencms 6 alpha or other future releases in place and have

http://localhost:8080/opencms/opencms as your standard installation URI and 

would like to run mvnforum inside opencms, for instance from:

http://localhost:8080/opencms/forum

Furthermore you would like to use the same Database "opencms" and install the mvnforum

db-tables into it, so that they could be linked together for e.g. using the same user 

management or integrate some parts of the mvnforum application into your opencms templates.

#### Bevor doing anything please backup your current OpenCMS installation ####

The following Installation has been tested on windows and SuSE Linux Enterprise Server 9 (sles9) with following apps:

JDK version:    1.4.2_06    
Servlet engine:  Apache Tomcat\5.0.19   
XML Parser:   Xerces-J 2.6.1
OpenCMS :  Alpha 2
Database:   MySQL 4.x

O.K. lets go:

1. after downloading the source of mvnForum 1.0.0 RC3_01(Update 1)from:

http://www.mvnforum.com/mvnforumweb/index.jsp

extract the source to e.g: c:\mvnforum-1.0.0-rc3-src  

2. Database Installation:

create the mvnforum db-tables in your opencms database. For doing that,
run mvnForum_mysql.sql script over opencms database as root or opencmsuser

/$> mysql -uroot -Dopencms < C:\mvnforum-1.0.0-rc3-src\mvnforum\sql\mvnForum_mysql.sql -p

you will be asked for root user password, possibly you can install the db with opencmsuser
account (use -uopencmsuser instead -uroot)

3. change the property settings of C:\mvnforum-1.0.0-rc3-src\mvnforum\build.properties
as follow:

changes:

deploy.localhost=c:/tomcat5/webapps ### set your own tomcat path with / "be aware "\" doesn't work on windows !!!"

app.name=opencms

sqldriver.jar=mysql-connector-java-3.0.14-production-bin.jar  ### or future releases

4. change property settings for:

C:\mvnforum-1.0.0-rc3-src\mvnforum\properties\mvnforum.xml

change url_patterns:

    <url_pattern>/forumadmin</url_pattern>
    </adminmoduleconfig>
    <usermoduleconfig>
        <url_pattern>/forum</url_pattern>
    </usermoduleconfig>
    <mvnforumconfig>
    
   
change mvnforumhome to:

c:\tomcat5\webapps\opencms\WEB-INF\mvnForumHome


3. change property settings for:

C:\mvnforum-1.0.0-rc3-src\myvietnam\properties\mvncore.xml

        <driver_class_name>com.mysql.jdbc.Driver</driver_class_name>
        <database_url>jdbc:mysql://<ServerName>/opencms?useUnicode=true&characterEncoding=utf-8</database_url>
        <database_user>opencmsuser</database_user>
        <database_password>secret</database_password>   ### be aware of <database_password/> !!! ####
        <max_connection>500</max_connection>
        <max_time_to_wait>2000</max_time_to_wait>
        <minutes_between_refresh>30</minutes_between_refresh>
        
        
        ### change according to your needs
 
 <mailoptions>
        <mail_server>localhost</mail_server>
        <default_mail_from>webmaster at localhost</default_mail_from>
        <username/>
        <password/>
        <port>25</port>
     </mailoptions>
 
     
     <paramoptions>
        <context_path>/opencms</context_path>
        <server_path>http://<ServerName>:8080</server_path>
     </paramoptions>
     
 4. change C:\mvnforum-1.0.0-rc3-src/mvnforum/srcweb/WEB-INF/web.xml like this:

<servlet-mapping>
    <servlet-name>ForumAdminServlet</servlet-name>
    <url-pattern>/forumadmin/*</url-pattern>
  </servlet-mapping>
  
  <servlet-mapping>
    <servlet-name>ForumUserServlet</servlet-name>
    <url-pattern>/forum/*</url-pattern>
  </servlet-mapping>
  
  4. backup / rename your opencms web.xml to web.opencms.xml
  
  5. run ant to deploy mvnforum in to opencms 
  
  C:\mvnforum-1.0.0-rc3-src\mvnforum> ant deploy-localhost
  
  6. register mvnforum servlet into opencms web.xml as follow
  
  rename web.xml (thats now mvnforum web.xml) to web.mvnforum.xml
  
  rename web.opencms.xml back to web.xml and copy the following section to web.xml below opencms </taglib>
  
  
  
   ---- copy this section to opencms web.xml between </taglib> and </web-app>  ----
  
   ----  mvnforum web.xml section -----
  
  <filter>
    <filter-name>CompressionFilter</filter-name>
    <filter-class>net.myvietnam.mvncore.servlet.filter.CompressionFilter</filter-class>
    <init-param>
      <param-name>compressionThreshold</param-name>
      <param-value>128</param-value>
    </init-param>
  </filter>

  <filter-mapping>
    <filter-name>CompressionFilter</filter-name>
    <url-pattern>/mvnforum___/*</url-pattern>
  </filter-mapping>
  <filter-mapping>
    <filter-name>CompressionFilter</filter-name>
    <url-pattern>/mvnforumadmin___/*</url-pattern>
  </filter-mapping>

  <listener>
    <listener-class>com.mvnforum.MVNForumContextListener</listener-class>
  </listener>
    
  <servlet>
    <servlet-name>ForumAdminServlet</servlet-name>
    <servlet-class>com.mvnforum.admin.ForumAdminServlet</servlet-class>
  </servlet>
  <servlet>
    <servlet-name>ForumUserServlet</servlet-name>
    <servlet-class>com.mvnforum.user.ForumUserServlet</servlet-class>
  </servlet>

  <!-- Action Servlet Configuration -->
  <!-- comment out for the next RC3_dev release
  <servlet>
    <servlet-name>action</servlet-name>
    <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
    <init-param>
      <param-name>config</param-name>
      <param-value>/WEB-INF/struts-config.xml</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet>
  -->

  <!-- Action Servlet Mapping -->
  <servlet-mapping>
    <servlet-name>ForumAdminServlet</servlet-name>
    <url-pattern>/forumadmin/*</url-pattern>
  </servlet-mapping>

  <!-- comment out for the next RC3_dev release
  <servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>/mvnforum/index*</url-pattern>
  </servlet-mapping>
  -->

  <servlet-mapping>
    <servlet-name>ForumUserServlet</servlet-name>
    <url-pattern>/forum/*</url-pattern>
  </servlet-mapping>

  <taglib>
    <taglib-uri>http://jsptags.com/tags/navigation/pager</taglib-uri>
    <taglib-location>/WEB-INF/pager-taglib.tld</taglib-location>
  </taglib>
  
  
  ----  End of mvnforum web.xml section -----
 .......
  
 </web-app>
 
 
 7. restart tomcat
 
 8. Test the installation:

 http://localhost:8080/opencms/forum/index
 http://localhost:8080/opencms/forumadmin/index
 
 have fun!
 
 
 P.S:
 
 additional settings can / must be done to mvnforum.xml and mvncore.xml for production use
 (under WEB-INF/classes directory)for mailserver settings or <max_attachment_size>1MB</max_attachment_size>
 
 
 Now you can upload mvnvorum.jar into the classes folder of your opencms module and should be able to integrate
 /forum/index or other mvnforum pages into your application, if necessary.
 
 
 ------------------
 Nice to have:
 ------------------
 
 link opencms user tables and mvnforum member tables to each other, so that your opencms users
 don't have to register to mvnforum (or use your own authentication services).

 Best Regards
 Arash
 


More information about the opencms-dev mailing list