How to sync JSPWiki source code

Synchronizing the JSPWiki code is not as straigth forward as the Jetspeed synchronization as the layouts of the code bases differ dramatically. Main reason to have different layouts is that the main JSPWiki project uses an Ant based build system as we are using Maven.

What you need

You will definetly need a directory comparison tool. One such is Meld for Linux environment or DiffDaff for Windows environment.

You will also need the source code of both of the projects. You can get them by executing these commands:

svn co https://kplab.evtek.fi/svn/kplab/wp6/apps/trunk/portal/applications/jspwiki jspwiki-portal

cvs -d :pserver:anonymous@cvs.jspwiki.org:/p/cvs checkout JSPWiki

or use Eclipse and import the projects there. See the Eclipse page for more details how to do that.

Note that you will need atleast the command line tools for both Subversion and CVS. Optionally you can also use Eclipse and Subversion plugin (CVS support is built in in Eclipse). Using eclipse is somewhat recommend as it will help to upload the changes eventually to KP-Lab repository.

Where are the files?

To start the comparison you need to know where the same files are in the two different layouts. Here J means the original JSPWiki project and K means the KP-Lab version of it. You should be able to compare the files by differenting the folders next to these signs. The meld command assumes that you have the two projects within their own folder immediately under the one you are currently in and their names are jspwiki-portal and JSPWiki. If you have different names, replace these with the proper names and/or path.

Java sources

J src (two folders named org and com)
k src/main/java

Meld command meld JSPWiki/src jspwiki-portal/src/main/java

Java test sources

These are not really used, but its good to sync them anyway.

J tests (two folders named org and com)
k src/test/java

Meld command meld JSPWiki/tests jspwiki-portal/src/test/java

Web docs

These are mainly JSP pages.

J src/webdocs
k src/main/webapp (ignore WEB-INF)

Meld command meld JSPWiki/src/webdocs jspwiki-portal/src/main/webapp

WEB-INF

These are mainly JSP pages, but for others its a bit trickier.

J etc (ignore db, dtd, ini,jspwiki.jaas,jspwiki-container.policy, jstl-fmt.tld)
k src/main/webapp/WEB-INF (ignore lib, portlet.tld, portlet.xml, jetspeed-portlet.xml)

Meld command meld JSPWiki/etc jspwiki-portal/src/main/webapp/WEB-INF

You should also compare the J:jspwiki.properties.tmpl to K:jspwiki.properties for changes. You can do that either in Eclipse or with Meld.

NOTE: I'm not really sure do really we need the i18n folder here.

Resources

These are the ones that will go to WEB-INF/classes, but are not Java-files.

J etc (only oscache.properties and ini)
k src/main/resources (only oscache.properties and ini)

Meld command meld JSPWiki/etc jspwiki-portal/src/main/resources

J etc/i18n
k src/main/resources (ignore oscache.properties and ini)

Meld command meld JSPWiki/etc/i18n jspwiki-portal/src/main/resources

Version and changelog

This is really important so that we can keep track of where we are with the versions.

J . (only ChangeLog)
k . (only ChangeLog)

Meld command meld JSPWiki jspwiki-portal

JSP pages

This is not so clean as it should be. I think the Portlet* pages could be dropped fully and use the Wiki, Edit, Comment and so on pages instead. Well.. now its still this way.

So, in the KP-Lab code you will have in a folder src/main/webapp/WEB-INF files like Edit.jsp, Wiki.jsp and Comment.jsp like the matching command or actions you can use. Theres also similar pages starting with a prefix Portlet (e.g PortletEdit.jsp). These are the matching portlet versions of these pages. They are used (with a "really" intelleigent logic) from WikiPortlet.jsp, which is the start for all the portlet actions. In that file the included page is determined according to a request parameter context. So if _context is edit then page named PortletEdit.jsp will be used.

After the previous syncs you have to still sync between thse files. It is easiest to do in Eclipse or other IDE. So you just compare Edit.jsp to PortletEdit.jsp and do same for the rest.

Finally you can open the jspwiki-portal/ChangeLog and check the newest version number and date at the top line. Open jspwiki-portal/JSPWiki.version and update the version number and date you just checked.

All in one command

If you have Meld installed and have the projects checked out as instructed, you can use this command to execute the comparisons sequently.

meld JSPWiki/src jspwiki-portal/src/main/java &&
meld JSPWiki/tests jspwiki-portal/src/test/java &&
meld JSPWiki/src/webdocs jspwiki-portal/src/main/webapp &&
meld JSPWiki/etc jspwiki-portal/src/main/webapp/WEB-INF &&
meld JSPWiki/etc jspwiki-portal/src/main/resources &&
meld JSPWiki/etc/i18n jspwiki-portal/src/main/resources &&
meld JSPWiki jspwiki-portal

I've tested this once and it seemed to work quite nice.

Committing changes

Before committing TEST THE CHANGES so that everything looks to work as it should be. No need to do thorough testing, but simple view/edit procedure covers most of the issues.

Always use the synchronization perspective to to review the changes. If everything looks great and you see no conflicts, commit the changes.


Development WikiDevelopment

  Page Info My Prefs Log in
This page (revision-12) last changed on 18:24 25-Mar-2017 by LiisaBenmergui.
 

Referenced by
Category Developm...

JSPWiki v2.4.102
[RSS]