DevGuide When to use

From ADempiere
Revision as of 10:53, 26 July 2009 by Ivanceras (Talk) (Application Dictionary)

Jump to: navigation, search
This Wiki is read-only for reference purposes to avoid broken links.

Application Dictionary

  • Add new fields, tabs or even windows without business logic (see NewWindow, Virtual_Colums)
  • Change/add validation rules for fields
  • Change/set default values for fields
  • Change/set read only logic for fields
  • Change/set visibility logic for fields
  • Change/set mandatory logic for fields
  • Change the layout (field order) of tabs
  • Translate or rename GUI elements
  • You may find this useful about Application Dictionary

Callout

A callout is a java method that is executed after a field value is changed.

  • Data entry consequences like calculate totals that need direct feedback at the GUI

If you do calculations in callouts you have to repeat them in the related PO classes (using model validator) to allow the access via a different UI like HTML interface

  • Not for data validation - use dynamic validation (AD) instead
  • Define in Table Column, if you need more than one to the same column, define separated them by ;
  • see Callout and Tutorials#FAQ also

Process

A process is a java class that extends org.compiere.process.SvrProcess. It is linked to a button in the ADempiere client and executed when the user hits this button or to a menu entry. It has two methods prepare() - to check process parameters - and doIt() - to do the work.

  • For complex logic that may take some time

Validators

Define in your Client the field ModelValidationClasses with your validation classes. They must implement org.compiere.model.ModelValidator. Look at example MyValidator. The main methods are modelChange which is called after PO.beforeSave/PO.beforeDelete and docValidate which is called as first step of DocAction.prepareIt.

  • For business logic like validation - all kind of logic you would otherwise put direct into the mentioned methods

Custom Forms

A custom form is a swing window that is not generated from the AD. It has to implement the org.compiere.apps.form.FormPanel interface. If you use custom forms you have to rebuild their logic for other GUI (HTML, WebServices...)

  • For complex GUI windows where the AD generated standard windows are not flexible enough

Core Class Changes

Don't do this if you are not sure that you really need it :)

  • GUI enhancements