Upgrade Guide

Before performing an upgrade, make a backup of your database directory.

An upgrade to 2.0 is only supported from 1.9.x. An upgrade from any earlier version may work, but it is not recommended.

Please note: Jease 2.0 is bundled with db4o 8.0, so after upgrading you can't revert to Jease 1.9.x which is bundled with db4o 7.12.

Template Update

The request attributes "Page.Root", "Page.Title" and "Page.BasePath" are removed from 2.0, so you have to change your templates accordingly:

Replace
<%= request.getAttribute("Page.Title")%> 
with
<%=Navigations.getPageTitle(content)%>

Replace
<%=request.getAttribute("Page.Root") %>
with
<%=request.getContextPath() %>/
(note the slash at the end)

Right after
<%@include file="/site/service/Jquery.jsp"%>
add
<%@include file="/site/service/Rewrite.jsp"%>

Add
<%=request.getContextPath() %>
before any call to
<%=content.getPath()%>
For example:
<%=request.getContextPath() %><%=tab.getPath()%>

Right after
<% pageContext.include((String) request.getAttribute("Page.Template")); %>
add
<div style="clear: both"></div>

If you're unsure, just have a look at the new templates.

Content Update

In order to make the transparent relocation work on an existing database, you'll need to run the following Script via the CMS. Therefore create a Script with id=relocate.jsp and a non-empty title and copy/paste the code below into it. Then click "View" to run the Script.

The Script searches all content objects for the start of internal absolute links (/) and replaces them with the relocatable form (/)

If you've used a non-empty root id, please add the root id to the search pattern below, e.g. content.replace("=\"/yourRootId/", "=\"" + "." + "/~/");

Please note: the Script worked fine for me (and should work fine in most cases), but don't blame me if something goes wrong. Please test it on a backup of your database before. If you are unsure how to upgrade or need any further assistance, please let me know.

<%@page import="jfix.db4o.*,jease.cmf.service.*,jease.cms.domain.*"%>
<%
  // Search and replace internal links with relocatable prefix
  for(Content content : Database.query(Content.class)) {
     if(content.getFulltext().indexOf("=\"/") != -1) {
        content.replace("=\"/", "=\"" + "." + "/~/");
        Database.save(content);
     }
  }
  // Clear root id
  Nodes.getRoot().setId("");
  Database.save(Nodes.getRoot());
  out.println("Upgrade performed");
%>

Last modified on 2011-08-19 by Maik Jablonski

Download Jease

You can download the latest binary release bundle here.