www.element4solution.com

e4s.html.editing
Interface AEP_EditingDataDescriptor_Intf

All Known Subinterfaces:
AEP_modifyCompany_Intf
All Known Implementing Classes:
AEP_EditingDataDescriptor, E4ModuleEditCompany.AEP_T_E4S_COMPANY_USER, E4ModuleFreefieldDefinition.aepFreeField

public interface AEP_EditingDataDescriptor_Intf

AEP - Application Exit Point during editing using E4EditingElement. A detailed description can be found at E4EditingElement. A default implementation exists at AEP_EditingDataDescriptor.

Since:
JDK 1.4
See Also:
E4EditingElement, E4EditingDataDescriptor

Field Summary
static char MODE_DELETE
          Delete Mode.
static char MODE_DISPLAY_FOR_DELETE
          Deprecated. Use MODE_DELETE instead
static char MODE_DUPLICATE
          Duplicate Mode.
static char MODE_INSERT
          Insert Mode
static char MODE_UPDATE
          Update Mode.
static java.lang.String PARAM_PREFIX_DUPLICATE
          A parameter prefix for hidden fields pointing out to the original values.
 
Method Summary
 void afterDelete(BODY body, E4Fieldset fieldset, E4DBConnection_Intf con)
          This function will be called after the SQL-DELETE statement to give a possibility to perform additional database related tasks.
 void afterDuplicate(BODY body, HIDDENFIELD[] originalValues, E4Fieldset fieldset, E4DBConnection_Intf con)
          This method will be called after duplication of a record, if enabled E4EditingDataDescriptor.enableDuplicate().
 void afterInsert(BODY body, E4Fieldset fieldset, E4DBConnection_Intf con)
          This function will be called after the SQL-INSERT statement to give a possibility to perform additional database related tasks.
 void afterUpdate(BODY body, E4Fieldset fieldset, E4DBConnection_Intf con)
          This function will be called after the SQL-UPDATE statement to give a possibility to perform additional database related tasks.
 boolean beforeDelete(E4Fieldset fieldset)
          This function will be called before SQL-DELETE given the possibility to chancel the delete process.
 boolean beforeDuplicate(E4Fieldset fieldset)
          This function will be called before SQL-INSERT for update given the possibility to chancel the insert on duplicate process.
 boolean beforeInsert(E4Fieldset fieldset)
          This function will be called before SQL-INSERT given the possibility to chancel the insert process.
 boolean beforeUpdate(E4Fieldset fieldset)
          This function will be called before SQL-UPDATE given the possibility to chancel the update process.
 boolean canDelete(E4DBSelect_Intf select)
          Check, if the record can be deleted (while displaying it in the listing table and offering the delete image).
 boolean canDuplicate(E4DBSelect_Intf select)
          Check, if the record can be duplicated.
 boolean canEdit(E4DBSelect_Intf select)
          Check, if the record can be edited (while displaying it in the listing table and offering the delete image).
 void createFieldset_Search(E4Fieldset fieldset)
          This function is called after the fieldset for search is created.
 void createFieldset(E4Fieldset fieldset, char mode)
          This function is called after the fieldset for insert, update or delete is created.
 E4DBReference[] modifyDeleteExecutionList(E4DBReference[] cols)
          Modify the list of tables/columns where master/detail deletion shall be performed.
 E4DBReference[] modifyDeleteIntegrityList(E4DBReference[] cols)
          Modify the list of tables/columns where integrity check shall be performed before a delete operation takes place.
 void pageEnd(BODY body, char mode, E4CgiParams params)
          This function is called initially, after page loading and fieldset added.
 boolean pageStart(BODY body, char mode, E4CgiParams params)
          This function is called initially, after page loading but before the fieldset is added.
 void setForm(FORM form)
           
 void setServlet(E4ServletImplementation_Intf servlet)
          The init method is called to handle the actual valid servlet to this AEP, it will be called before any of the other methods is involved.
 

Field Detail

MODE_UPDATE

static final char MODE_UPDATE
Update Mode.

See Also:
MODE_INSERT, MODE_DELETE, MODE_DUPLICATE, createFieldset(E4Fieldset, char), beforeUpdate(E4Fieldset), afterUpdate(BODY, E4Fieldset, E4DBConnection_Intf), Constant Field Values

MODE_INSERT

static final char MODE_INSERT
Insert Mode

See Also:
MODE_UPDATE, MODE_DELETE, MODE_DUPLICATE, createFieldset(E4Fieldset, char), beforeInsert(E4Fieldset), afterInsert(BODY, E4Fieldset, E4DBConnection_Intf), Constant Field Values

MODE_DELETE

static final char MODE_DELETE
Delete Mode.

See Also:
MODE_INSERT, MODE_UPDATE, MODE_DUPLICATE, createFieldset(E4Fieldset, char), beforeDelete(E4Fieldset), afterDelete(BODY, E4Fieldset, E4DBConnection_Intf), Constant Field Values

MODE_DISPLAY_FOR_DELETE

static final char MODE_DISPLAY_FOR_DELETE
Deprecated. Use MODE_DELETE instead
See Also:
Constant Field Values

MODE_DUPLICATE

static final char MODE_DUPLICATE
Duplicate Mode.

See Also:
MODE_INSERT, MODE_UPDATE, MODE_DELETE, createFieldset(E4Fieldset, char), E4EditingDataDescriptor.enableDuplicate(), afterDuplicate(e4s.html.BODY, e4s.html.input.extended.HIDDENFIELD[], e4s.html.input.extended.E4Fieldset, e4s.db.E4DBConnection_Intf), canDuplicate(e4s.db.E4DBSelect_Intf), #beforeDuplicate(e4s.html.E4Fieldset), Constant Field Values

PARAM_PREFIX_DUPLICATE

static final java.lang.String PARAM_PREFIX_DUPLICATE
A parameter prefix for hidden fields pointing out to the original values.

See Also:
AEP_EditingDataDescriptor.extractPresetField4Duplication(E4Fieldset, e4s.html.input.extended.E4InputFieldName_Intf), AEP_EditingDataDescriptor.extractPresetFields4Duplication(E4Fieldset), MODE_DUPLICATE, afterDuplicate(BODY, HIDDENFIELD[], E4Fieldset, E4DBConnection_Intf), Constant Field Values
Method Detail

setServlet

void setServlet(E4ServletImplementation_Intf servlet)
The init method is called to handle the actual valid servlet to this AEP, it will be called before any of the other methods is involved. It can be called more frequently.

Parameters:
servlet - the actual servlet

createFieldset

void createFieldset(E4Fieldset fieldset,
                    char mode)
                    throws java.lang.Exception
This function is called after the fieldset for insert, update or delete is created. The E4Fieldset parameter has been set at this point, but additionally you can modify it here before display starts.

Parameters:
fieldset - the values from the input form
mode - the update/display mode (MODE_INSERT, MODE_UPDATE or MODE_DELETE).
Throws:
java.lang.Exception
See Also:
e4s.html.editing.AEP_EditingDataDescriptor#createFieldset()

createFieldset_Search

void createFieldset_Search(E4Fieldset fieldset)
                           throws java.lang.Exception
This function is called after the fieldset for search is created. The E4Fieldset parameter has been set at this point, but additionally you can modify it here before display starts.

Parameters:
fieldset - the values from the input form
Throws:
java.lang.Exception

beforeInsert

boolean beforeInsert(E4Fieldset fieldset)
                     throws java.lang.Exception
This function will be called before SQL-INSERT given the possibility to chancel the insert process. At this time, all the fields in the E4Fieldset have set their values. Those values can be read out, and depending on that the insert process can be stopped by returning a value of false, which causes the form to still appear on the screen.

Parameters:
fieldset - the values from the input form
Returns:
true (which is the default value) to continue, false to abort
Throws:
java.lang.Exception
See Also:
e4s.html.editing.AEP_EditingDataDescriptorbeforeInsert, afterInsert(e4s.html.BODY, e4s.html.input.extended.E4Fieldset, e4s.db.E4DBConnection_Intf), beforeUpdate(e4s.html.input.extended.E4Fieldset), beforeDelete(e4s.html.input.extended.E4Fieldset), beforeDuplicate(e4s.html.input.extended.E4Fieldset)

beforeDuplicate

boolean beforeDuplicate(E4Fieldset fieldset)
                        throws java.lang.Exception
This function will be called before SQL-INSERT for update given the possibility to chancel the insert on duplicate process. At this time, all the fields in the E4Fieldset have set their values. Those values can be read out, and depending on that the insert process can be stopped by returning a value of false, which causes the form to still appear on the screen.

Parameters:
fieldset - the values from the input form
fieldset - the validated fieldset
Returns:
true (which is the default value) to continue, false to abort
Throws:
java.lang.Exception
See Also:
E4EditingDataDescriptor.enableDuplicate(), afterDuplicate(e4s.html.BODY, e4s.html.input.extended.HIDDENFIELD[], e4s.html.input.extended.E4Fieldset, e4s.db.E4DBConnection_Intf), canDuplicate(e4s.db.E4DBSelect_Intf), E4ModuleEditingHandling02.duplicateRecord, MODE_DUPLICATE, #beforeDelete(e4s.html.E4Fieldset), #beforeInsert(e4s.html.E4Fieldset), #beforeUpdate(e4s.html.E4Fieldset)

afterInsert

void afterInsert(BODY body,
                 E4Fieldset fieldset,
                 E4DBConnection_Intf con)
                 throws java.lang.Exception
This function will be called after the SQL-INSERT statement to give a possibility to perform additional database related tasks. At this time, all the fields in the E4Fieldset have set their values and the statement on SQL level has still been processed, but the transaction still remains open, this means that a rollback would be possible at this point. For all additional database tasks, use the transaction specified here. A default implementation can be found here: AEP_EditingDataDescriptor.afterInsert(BODY, E4Fieldset, E4DBConnection_Intf).

Parameters:
body - the related BODY element to provide additional output if required
con - the current database connection in transaction mode
fieldset - the values from the input form
Throws:
java.lang.Exception
See Also:
AEP_EditingDataDescriptor.afterInsert(e4s.html.BODY, e4s.html.input.extended.E4Fieldset, e4s.db.E4DBConnection_Intf), beforeInsert(e4s.html.input.extended.E4Fieldset), afterUpdate(e4s.html.BODY, e4s.html.input.extended.E4Fieldset, e4s.db.E4DBConnection_Intf), afterDelete(e4s.html.BODY, e4s.html.input.extended.E4Fieldset, e4s.db.E4DBConnection_Intf)

beforeUpdate

boolean beforeUpdate(E4Fieldset fieldset)
                     throws java.lang.Exception
This function will be called before SQL-UPDATE given the possibility to chancel the update process. At this time, all the fields in the E4Fieldset have set their values. Those values can be read out, and depending on that the update process can be stopped by returning a value of false, which causes to form to appear on the screen.

Parameters:
fieldset - the values from the input form
Returns:
true (which is the default value) to continue, false to abort
Throws:
java.lang.Exception
See Also:
e4s.html.editing.AEP_EditingDataDescriptorbeforeUpdate, afterUpdate(e4s.html.BODY, e4s.html.input.extended.E4Fieldset, e4s.db.E4DBConnection_Intf), beforeInsert(e4s.html.input.extended.E4Fieldset), beforeDelete(e4s.html.input.extended.E4Fieldset)

afterUpdate

void afterUpdate(BODY body,
                 E4Fieldset fieldset,
                 E4DBConnection_Intf con)
                 throws java.lang.Exception
This function will be called after the SQL-UPDATE statement to give a possibility to perform additional database related tasks. At this time, all the fields in the E4Fieldset have set their values and the statement on SQL level has still been processed, but the transaction still remains open, this means that a rollback would be possible at this point. For all additional database tasks, use the transaction specified here. A default implementation can be found here: AEP_EditingDataDescriptor.afterUpdate(BODY, E4Fieldset, E4DBConnection_Intf).

Parameters:
body - the related BODY element to provide additional output if required
con - the current database connection in transaction mode
fieldset - the values from the input form
Throws:
java.lang.Exception
See Also:
e4s.html.editing.AEP_EditingDataDescriptorafterUpdate, #beforeUpdate(), afterInsert(e4s.html.BODY, e4s.html.input.extended.E4Fieldset, e4s.db.E4DBConnection_Intf), afterDelete(e4s.html.BODY, e4s.html.input.extended.E4Fieldset, e4s.db.E4DBConnection_Intf)

beforeDelete

boolean beforeDelete(E4Fieldset fieldset)
                     throws java.lang.Exception
This function will be called before SQL-DELETE given the possibility to chancel the delete process. At this time, all the fields in the E4Fieldset have set their values. Those values can be read out, and depending on that the delete process can be stopped by returning a value of false, which causes to form to appear on the screen. This is not the point to add referential delete, this should be done in afterDelete(e4s.html.BODY, e4s.html.input.extended.E4Fieldset, e4s.db.E4DBConnection_Intf) if required.

Parameters:
fieldset - the values from the input form
Returns:
true (which is the default value) to continue, false to abort
Throws:
java.lang.Exception
See Also:
e4s.html.editing.AEP_EditingDataDescriptorbeforeDelete, afterDelete(BODY, E4Fieldset, E4DBConnection_Intf), beforeInsert(E4Fieldset), beforeUpdate(E4Fieldset), afterDuplicate(BODY, HIDDENFIELD[], E4Fieldset, E4DBConnection_Intf), canDelete(E4DBSelect_Intf)

afterDelete

void afterDelete(BODY body,
                 E4Fieldset fieldset,
                 E4DBConnection_Intf con)
                 throws java.lang.Exception
This function will be called after the SQL-DELETE statement to give a possibility to perform additional database related tasks. At this time, all the fields in the E4Fieldset have set their values and the statement on SQL level has still been processed, but the transaction still remains open, this means that a rollback would be possible at this point. For all additional database tasks, use the transaction specified here. A default implementation can be found here: {@link e4s.html.editing.AEP_EditingDataDescriptor#afterDelete(BODY, E4Fieldset, E4DBConnection_Intf)

Parameters:
body - the related BODY element to provide additional output if required
con - the current database connection in transaction mode
fieldset - the values from the input form
Throws:
java.lang.Exception
See Also:
AEP_EditingDataDescriptor.afterDelete(e4s.html.BODY, e4s.html.input.extended.E4Fieldset, e4s.db.E4DBConnection_Intf), canDelete(E4DBSelect_Intf), beforeDelete(E4Fieldset), afterUpdate(BODY, E4Fieldset, E4DBConnection_Intf), afterInsert(BODY, E4Fieldset, E4DBConnection_Intf), afterDuplicate(BODY, HIDDENFIELD[], E4Fieldset, E4DBConnection_Intf)

modifyDeleteIntegrityList

E4DBReference[] modifyDeleteIntegrityList(E4DBReference[] cols)
                                          throws java.lang.Exception
Modify the list of tables/columns where integrity check shall be performed before a delete operation takes place. When a datatype is defined using the data dictionary, it is known in which tables it is used (see the generated
public static E4DBTypeUsage[] getUsage()
functions in the user defined, generated datatypes. Additionally, there can be a defined reference in the data dictionary. When editing a table, it is known which field is the index field. So this is compared to the column list, a SQL select will be performed and if at least one such a value exists in the table, then deletion will be aborted and an error message is displayed. This mechanism also requires e4s.html.E4EditingDataDescriptor#setCheckReferencesOnDelete() set to true. In some cases, you want this feature and in some you don't. This interface function now enables to decide, which tables require integrity checking and which do not.

Parameters:
cols - an array with column definitions, might be null
Returns:
null, if you do not want any integrity checks to be performed or a list (array) of the references which you want to become checked. You can handle back the cols parameter (return cols;) in your implementation or you can strike out some entries by building a new vector.
Throws:
java.lang.Exception
See Also:
E4DBIntegrity.hasAnyData(e4s.db.E4DBTypeUsage[], e4s.db.E4DBTableName, e4s.application.E4ApplObj_Intf, e4s.util.E4String), E4DBReference.removeReference(e4s.db.E4DBReference[], e4s.db.E4DBTableName), E4DBReference.addUsage(e4s.db.E4DBReference[], e4s.db.E4DBReference), E4DBSelect_Intf.getReferenceLookup(e4s.db.E4DBColumnName), e4s.html.E4EditingDataDescriptor#getCheckReferencesOnDelete(), e4s.html.E4EditingDataDescriptor#setCheckReferencesOnDelete()

modifyDeleteExecutionList

E4DBReference[] modifyDeleteExecutionList(E4DBReference[] cols)
                                          throws java.lang.Exception
Modify the list of tables/columns where master/detail deletion shall be performed. When a datatype is defined using the data dictionary, it is known in which tables it is used (see the generated
public static E4DBTypeUsage[] getUsage()
functions in the user defined, generated datatypes. Additionally, there can be a defined reference in the data dictionary. When editing a table, it is known which field is the index field. So this is compared to the column list, a SQL select will be performed and if at least one such a value exists in the table, then deletion will be aborted and an error message is displayed. This mechanism also requires e4s.html.E4EditingDataDescriptor#setCheckReferencesOnDelete() set to true. In some cases, you want this feature and in some you don't. This interface function now enables to decide, which tables require integrity checking and which do not.

Parameters:
cols - an array with column definitions, might be null
Returns:
null, if you do not want any integrity checks to be performed or a list (array) of the references which you want to become checked. You can handle back the cols parameter (return cols;) in your implementation or you can strike out some entries by building a new vector.
Throws:
java.lang.Exception
See Also:
E4DBReference.removeReference(e4s.db.E4DBReference[], e4s.db.E4DBTableName), E4DBReference.addUsage(e4s.db.E4DBReference[], e4s.db.E4DBReference), E4DBSelect_Intf.getReferenceDelete(e4s.db.E4DBColumnName)

canDelete

boolean canDelete(E4DBSelect_Intf select)
                  throws java.lang.Exception
Check, if the record can be deleted (while displaying it in the listing table and offering the delete image). This is one stage before the whole input data will be displayed.

Parameters:
select - the selection interface representing the current record
Returns:
true if a delete can be processed, false to cancel the delete function
Throws:
java.lang.Exception
See Also:
canEdit(E4DBSelect_Intf), canDuplicate(E4DBSelect_Intf), AEP_EditingDataDescriptor.canDelete(E4DBSelect_Intf)

canEdit

boolean canEdit(E4DBSelect_Intf select)
                throws java.lang.Exception
Check, if the record can be edited (while displaying it in the listing table and offering the delete image). This is one stage before the whole input data will be displayed.

Parameters:
select - the selection interface representing the current record
Throws:
java.lang.Exception
See Also:
canDelete(E4DBSelect_Intf), canDuplicate(E4DBSelect_Intf), AEP_EditingDataDescriptor.canEdit(E4DBSelect_Intf)

canDuplicate

boolean canDuplicate(E4DBSelect_Intf select)
                     throws java.lang.Exception
Check, if the record can be duplicated.

Parameters:
select - the selection interface representing the current record
Returns:
true, if the record can be duplicated
Throws:
java.lang.Exception
See Also:
E4EditingDataDescriptor.enableDuplicate(), afterDuplicate(e4s.html.BODY, e4s.html.input.extended.HIDDENFIELD[], e4s.html.input.extended.E4Fieldset, e4s.db.E4DBConnection_Intf), beforeDuplicate(e4s.html.input.extended.E4Fieldset), E4ModuleEditingHandling02.duplicateRecord, E4Images.duplicate_1, MODE_DUPLICATE

pageStart

boolean pageStart(BODY body,
                  char mode,
                  E4CgiParams params)
                  throws java.lang.Exception
This function is called initially, after page loading but before the fieldset is added.

Parameters:
body - the BODY context for any additional outputs
mode - the update/display mode (MODE_INSERT, MODE_UPDATE or MODE_DELETE).
Returns:
true to continue or false to abort
Throws:
java.lang.Exception

pageEnd

void pageEnd(BODY body,
             char mode,
             E4CgiParams params)
             throws java.lang.Exception
This function is called initially, after page loading and fieldset added.

Parameters:
body - the BODY context for any additional outputs
mode - the update/display mode (MODE_INSERT, MODE_UPDATE or MODE_DELETE).
Throws:
java.lang.Exception

setForm

void setForm(FORM form)

afterDuplicate

void afterDuplicate(BODY body,
                    HIDDENFIELD[] originalValues,
                    E4Fieldset fieldset,
                    E4DBConnection_Intf con)
                    throws java.lang.Exception
This method will be called after duplication of a record, if enabled E4EditingDataDescriptor.enableDuplicate(). This is a good place, to copy (duplicate) related records if needed. A default implementation can be found here: AEP_EditingDataDescriptor.afterDuplicate(BODY, HIDDENFIELD[], E4Fieldset, E4DBConnection_Intf)

Parameters:
body - you can write out some informations for the user right here
originalValues - is an array of index fields that point out to the existing record (the copy-from-source), the order can be different AEP_EditingDataDescriptor.extractPresetField4Duplication(E4Fieldset, e4s.html.input.extended.E4InputFieldName_Intf), AEP_EditingDataDescriptor.extractPresetFields4Duplication(E4Fieldset).
fieldset - the validated fieldset with replaced index values on auto-increment fields, if applicable
con - the database connection (you should refer to it as this might be a transaction)
Throws:
java.lang.Exception
See Also:
E4EditingDataDescriptor.enableDuplicate(), afterDuplicate(e4s.html.BODY, e4s.html.input.extended.HIDDENFIELD[], e4s.html.input.extended.E4Fieldset, e4s.db.E4DBConnection_Intf), beforeDuplicate(e4s.html.input.extended.E4Fieldset), canDuplicate(e4s.db.E4DBSelect_Intf), E4ModuleEditingHandling02.duplicateRecord, MODE_DUPLICATE, PARAM_PREFIX_DUPLICATE

www.element4solution.com