File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JForum and the fly likes Import Google JForum2 source to Eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JForum
Bookmark "Import Google JForum2 source to Eclipse" Watch "Import Google JForum2 source to Eclipse" New topic
Author

Import Google JForum2 source to Eclipse

robert crowther
Ranch Hand

Joined: Oct 19, 2013
Posts: 41
    
  10
Background
Since JForum3 is a major upgrade, a bugfix (and minor upgrade) of JForum has been posted in a Google-based svn repository,

https://code.google.com/p/jforum2/

The downloads, for several releases, have only been been binary distributions, that is to say, JForum code has been compiled to a .jar,

appBase > WEB-INF > jforum.x.x.x.jar

though users are free to build around the webApp structure.


I've found I could get a long way with this binary download. But for a couple of items, I would have been more than happy with binary and, in other circumstances, it would be all I needed. But what if I want to go for source? What do I have to do?

The svn download of trunk displays a structure I do not recognise in in the binary. It has a .war inside a .war. Also, it has a .pom file, so builds using Maven.

I'll leave others to explain, if they wish, why the nested structure, and what might be done with Maven...?

There is a double issue here, because the aim of this post is to import JForum into Eclipse. Maybe something can be done with the source code's Maven controls? But the best way I've found to get a binary JForum into Eclipse is to generate a .war then wholesale import. That will not work with this source code. Here's what I did...


Steps
Download both a binary and a source version of a chosen svn tag

binary
Use the published site download.

src
check tags,
svn list http://jforum2.googlecode.com/svn/

download
svn co http://jforum2.googlecode.com/svn/tags/v2.3.4


War up the binary, import into Eclipse
Navigate into the binary, then,

jar -cvf jforum-x.x.x.war *

(the name can be anything)

In Eclipse

File > import > Web > War File > Next ...

Browse for the war created earlier, and name the project, then "Finish"


Modify the new Eclipse project to work from source code
Remove this .jar from the library,

appBase > WEB-INF > jforum.x.x.x.jar


Now go into the downloaded source code, and copy the folder "net" (and all code contents) from inside source,

Downloads/jforum2.3.4.src/src/main/java/net

Using a filebrowser I pasted this into,

eclipse_workspace/someEclipseProjectName/src

Then refreshed in the Eclipse File Explorer. If you trust Eclipse's copy and paste, paste the folder straight in.


Follow the usual Eclipse/JForum manual setup
Maybe check /src is set as the build folder.
Do project > build, or set to automatic.
[Right click] Server > Add/Remove
Publish the new project.

It won't work yet. Run through the steps in,

https://code.google.com/p/jforum2/wiki/ManualInstallation

to set up a database, pre-populate the database, and set at least some basic config (now is an opportune time to change the big hash property).


Proof of accurate configuration,

http://localhost:8080/someEclipseProjectName

or

http://localhost:8080/someEclipseProjectName/forums/list.page


Notes
my version, 2.3.4, threw an exception. It was a one line fix. In,

src/net/jforum/context/RequestContext.java

Replace,

//Enumeration<Object> getParameterNames();
Enumeration<String> getParameterNames();


I don't want to publish this until others look at it.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30516
    
150

Would a screenshot fo your Eclipse directory structure help?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
robert crowther
Ranch Hand

Joined: Oct 19, 2013
Posts: 41
    
  10
Below is a screenshot of a .war wrapped *binary* imported into Eclipse. Some modifications can be seen already (the forum being constructed has users who can probably use the custom error pages, even if they are an overhead).



[eclipse_tomcat_src_labeled.jpg]

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Import Google JForum2 source to Eclipse