Parameter

Jease uses different parameters which are stored within the database for its configuration. A parameter is a pair of key and value (both strings). Parameters can be created/edited by an administrator via CMS » System » Parameter.

Existing default parameters

JEASE_CMS_AUTHENTICATOR
Fully qualified class name of a class which extends jease.cms.service.Authenticator and overwrites the #identity()-method in order to provide custom authorizations. If this parameter is present (but it may be empty), non editors don't see the user-management tab.

JEASE_CMS_MAINTENANCE
If this parameter is not-empty, the CMS runs in maintenance mode. All users (besides administrators) will see the the message stored in the parameter and will be automatically logged out after their next action.

JEASE_CKEDITOR_PATH
Path or URL to a config file for CKEditor. The config file can be retrieved from the CMS, the web application directory or an external URL. The file should be a valid Javascript file. For a full list of configuration options see the excellent CKEditor Documentation.

CKEDITOR.editorConfig = function( config )
{
    config.language = 'de';
    config.uiColor = '#AADC6E';
};

JEASE_CONTENT_CUSTOMIZER
A dynamically compiled jfix.functor.Procedure<Content> which is applied to a content object before it is persisted to the database. This can be used to replace absolute urls with included domain with appropriate interal links with "magic" relocation prefix:

import jfix.functor.*;
import jease.cms.domain.*;

public class Customizer implements Procedure<Content> {

  public void execute(Content content) {
     content.replace("=\"http://www.jease.org/","=\"./~/");
  }
  
}

JEASE_DISCUSSION_PRESENTATION
Enter "thread" if you want a threaded view for discussions, otherwise a flat view is used.

JEASE_IMAGE_LIMIT
Enter a size (e.g. 1024) which is used to scale down bigger images. This way you can control the image size delivered to the client.

JEASE_PASSWORD_VALIDATOR
A dynamically compiled function which checks the validity of passwords.

import jease.cms.service.Passwords.*;

public class CustomPasswordValidator extends PasswordValidator {
  
 public Boolean evaluate(String password) {
    return password.contains("+") && password.length() >= 8;
 }
   
}

JEASE_RECAPTCHA_PUBLIC and JEASE_RECAPTCHA_PRIVATE
If you want to protect Discussions with a Captcha, you have to register your domain with Recaptcha at http://www.google.com/recaptcha and store the public and private key as parameter in Jease.

[revisions JEASE_REVISION_COUNT]
The total number of revisions Jease should keep for each content object.

[revisions JEASE_REVISION_DAYS]
The number of days in the past for which Jease should keep content revisions.

JEASE_SITE_DESIGN
The name or path of the default design. It should either be a simple name of a folder contained in /site/web which holds a Page.jsp which defines the overall layout of the site or an absolute path starting with a slash (/) to a Page.jsp. If the second option is used, Jease prevents the layout to be overriden by a Cookie parameter. If this parameter is not present at all, Jease doesn't show any "View"-buttons, so Jease can be used as a Document Management System (DMS) this way.

[error JEASE_SITE_ERROR]
The path to a resources stored in the CMS which is used as error-page for 404-errors.

[./~/blog/rewriter JEASE_SITE_REWRITER]
Code of Java class which implements jfix.functor.Function<String, String> and can be used to rewrite the resulting HTML for a page.

import jfix.functor.Function;

public class Rewriter implements Function<String, String> {

  public String evaluate(String input) {
    return input.replace("Jease", "Cheese");
  }

}

[mails JEASE_SMTP_PROPERTIES]
Default properties to configure JavaMail.

JEASE_TEMPLATE_RESOLVER
If you want to use a custom renderer for a content type (e.g. for a non-generic rendering of Items), you can use a dynamic template resolver which maps a content object to your custom renderer.

import jfix.functor.*;
import jease.cms.domain.*;

public class TemplateResolver implements Function<Content,String> {

   public String evaluate(Content content) {
      // Use a custom renderer for Items
      if (content instanceof Item) {
          return "/custom/domain/Item.jsp";
      }
      // Otherwise use the default render
      return jease.Registry.getView(content);
   }
}

JEASE_TIMER_TASK
A dynamically compiled script which extends Runnable and is executed every second. Useful to execute periodic tasks.

import java.util.*;
import jease.cms.service.*;  

public class TimerTask implements Runnable {
  private long tick;

  public void run() {   
    tick++;
    // Perform link check every 24 hours
    if(tick % (60 * 60 * 24) == 0) {
      Linkchecker.start();
    } 
  }
}

JEASE_UPLOAD_LIMIT
Number of bytes which limits the size of files which can be uploaded by users through the CMS.

JEASE_WIKI_LANGUAGE
Determines the dialect of the wiki renderer. Available options are: Confluence, MediaWiki, Textile, TracWiki, TWiki

JEASE_WIKI_LINKS
Determines the pattern for creating internal links. The default is "{0}". If you want to create a dedicated wiki-namespace with your custom resolution of ids, you can use "/wiki/{0}" or other patterns.

Using parameters in templates

If you want to make use of parameters in your templates, you can simply use the following code:

<%= jease.Registry.getParameter("YourParameter") %>

Last modified on 2013-03-28 by Maik Jablonski

Want to contribute?

1970-01-01

Do you want to contribute to Jease? Writing documentation is a good place to get started and will help to get people becoming more familiar with Jease. Any contribution is appreciated.