• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Import Google JForum2 source to Eclipse

 
Ranch Hand
Posts: 41
10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
author & internet detective
Posts: 41967
911
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Would a screenshot fo your Eclipse directory structure help?
 
robert crowther
Ranch Hand
Posts: 41
10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
[Thumbnail for eclipse_tomcat_src_labeled.jpg]
Binary war ready to convert to compiled src
 
I’m tired of walking, and will rest for a minute and grow some wheels. This is the promise of this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic