www.element4solution.com

e4s.html.editing
Class AEP_EditingDataDescriptor

java.lang.Object
  extended by e4s.util.E4Object
      extended by e4s.html.editing.AEP_EditingDataDescriptor
All Implemented Interfaces:
AEP_EditingDataDescriptor_Intf
Direct Known Subclasses:
E4ModuleEditCompany.AEP_T_E4S_COMPANY_USER, E4ModuleFreefieldDefinition.aepFreeField

public abstract class AEP_EditingDataDescriptor
extends E4Object
implements AEP_EditingDataDescriptor_Intf

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

Since:
JDK 1.4
See Also:
E4EditingElement, E4EditingDataDescriptor

Field Summary
 
Fields inherited from class e4s.util.E4Object
CRLF, E4S_CORE_SYSTEM_LANGUAGE, NBSP, NULLSTR, URL_ENCODING_CHARSET
 
Fields inherited from interface e4s.html.editing.AEP_EditingDataDescriptor_Intf
MODE_DELETE, MODE_DISPLAY_FOR_DELETE, MODE_DUPLICATE, MODE_INSERT, MODE_UPDATE, PARAM_PREFIX_DUPLICATE
 
Constructor Summary
AEP_EditingDataDescriptor()
           
 
Method Summary
 void afterDelete(BODY body, E4Fieldset fieldset, E4DBConnection_Intf con)
          This is the default implementation, doing no no additional output or stuff.
 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 is the default implementation, doing no no additional output or stuff.
 void afterUpdate(BODY body, E4Fieldset fieldset, E4DBConnection_Intf con)
          This is the default implementation, doing no no additional output or stuff.
 boolean beforeDelete(E4Fieldset fieldset)
          This is the default implementation, returning a value of true.
 boolean beforeDuplicate(E4Fieldset fieldset)
          This is the default implementation, returning a value of true.
 boolean beforeInsert(E4Fieldset fieldset)
          This is the default implementation, returning a value of true.
 boolean beforeUpdate(E4Fieldset fieldset)
          This is the default implementation, returning a value of true.
 boolean canDelete(E4DBSelect_Intf select)
          Default implementation, that does nothing.
 boolean canDuplicate(E4DBSelect_Intf select)
          Default implementation, that does nothing.
 boolean canEdit(E4DBSelect_Intf select)
          Default implementation, that does nothing.
 void createFieldset_Search(E4Fieldset fieldset)
          This is the default implementation which does no changes.
 void createFieldset(E4Fieldset fieldset, char mode)
          This is the default implementation which does no changes.
static java.lang.String extractPresetField4Duplication(E4Fieldset fieldset, E4InputFieldName_Intf fieldname)
          Extract a value for a field that is used to point out to the original value of a recordset.
static HIDDENFIELD[] extractPresetFields4Duplication(E4Fieldset fieldset)
          Extract hiddenfields pointing out to the original value of a recordset.
 E4DBReference[] modifyDeleteExecutionList(E4DBReference[] cols)
          Default implementation, returns the reference unchanged.
 E4DBReference[] modifyDeleteIntegrityList(E4DBReference[] cols)
          Default implementation, returns the reference unchanged.
 void pageEnd(BODY body, char mode, E4CgiParams params)
          Default implementation, that does nothing.
 boolean pageStart(BODY body, char mode, E4CgiParams params)
          Default implementation, that does nothing.
 void setForm(FORM dummy)
           
 void setServlet(E4ServletImplementation_Intf servlet)
          This is the default implementation which does nothing.
 
Methods inherited from class e4s.util.E4Object
_getSVNVersionString, Calendar, CName, CName, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelNone, E4LabelNone, E4LabelNone, E4LabelNone, E4LabelSys, E4LabelSys, e4sCopyright, e4sVersion, encode, encode, encode, encodeHtml, encodeHtml, encodeHtml, encodeURL, encodeURL, encodeURL, finalize, getLINE, getTRACE, getTRACE, getTRACE, getTRACE, getTRACE, getTRACE, getTraceMemory, HtmlEncode, HtmlEncode, HtmlEncode, isdecimal, isdigit, isnotok, isnotok, isnumeric, isok, isok, isok, isok, lastCallingFunction, lastCallingFunction, lastCallingFunction, lastCallingFunction, lastCallingStack, mkdirs, null2nbsp, null2nbsp, null2nbsp, ok, ok, ok, ok, outPrintln, setLogFile4Trace, setTraceMemory, STACKTRACE, toDebug, toDouble, toFloat, toFloat, toString, TRACE_CALLS, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, wait
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AEP_EditingDataDescriptor

public AEP_EditingDataDescriptor()
Method Detail

setServlet

public void setServlet(E4ServletImplementation_Intf servlet)
This is the default implementation which does nothing.

Specified by:
setServlet in interface AEP_EditingDataDescriptor_Intf
Parameters:
servlet - the actual servlet

createFieldset

public void createFieldset(E4Fieldset fieldset,
                           char mode)
                    throws java.lang.Exception
This is the default implementation which does no changes.

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

createFieldset_Search

public void createFieldset_Search(E4Fieldset fieldset)
                           throws java.lang.Exception
This is the default implementation which does no changes.

Specified by:
createFieldset_Search in interface AEP_EditingDataDescriptor_Intf
Parameters:
fieldset - the values from the input form
Throws:
java.lang.Exception

beforeInsert

public boolean beforeInsert(E4Fieldset fieldset)
                     throws java.lang.Exception
This is the default implementation, returning a value of true.

Specified by:
beforeInsert in interface AEP_EditingDataDescriptor_Intf
Parameters:
fieldset - the values from the input form
Returns:
true
Throws:
java.lang.Exception
See Also:
e4s.html.editing.AEP_EditingDataDescriptor_Intf#beforeInsert(), #afterInsert(), #beforeUpdate(), #beforeDelete()

beforeDuplicate

public boolean beforeDuplicate(E4Fieldset fieldset)
                        throws java.lang.Exception
This is the default implementation, returning a value of true.

Specified by:
beforeDuplicate in interface AEP_EditingDataDescriptor_Intf
Parameters:
fieldset - the values from the input form
Returns:
true
Throws:
java.lang.Exception
See Also:
e4s.html.editing.AEP_EditingDataDescriptor_Intf#beforeInsert(), #afterInsert(), #beforeUpdate(), #beforeDelete()

afterInsert

public void afterInsert(BODY body,
                        E4Fieldset fieldset,
                        E4DBConnection_Intf con)
                 throws java.lang.Exception
This is the default implementation, doing no no additional output or stuff.

Specified by:
afterInsert in interface AEP_EditingDataDescriptor_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_EditingDataDescriptor_Intf#afterInsert(), #beforeInsert(), #afterUpdate(), #afterDelete()

beforeUpdate

public boolean beforeUpdate(E4Fieldset fieldset)
                     throws java.lang.Exception
This is the default implementation, returning a value of true.

Specified by:
beforeUpdate in interface AEP_EditingDataDescriptor_Intf
Parameters:
fieldset - the values from the input form
Returns:
true
Throws:
java.lang.Exception
See Also:
e4s.html.editing.AEP_EditingDataDescriptor_Intf#beforeUpdate(), #afterUpdate(), #beforeInsert(), #beforeDelete()

afterUpdate

public void afterUpdate(BODY body,
                        E4Fieldset fieldset,
                        E4DBConnection_Intf con)
                 throws java.lang.Exception
This is the default implementation, doing no no additional output or stuff.

Specified by:
afterUpdate in interface AEP_EditingDataDescriptor_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_EditingDataDescriptor_Intf#afterUpdate(), #beforeUpdate(), #afterInsert(), #afterDelete()

beforeDelete

public boolean beforeDelete(E4Fieldset fieldset)
                     throws java.lang.Exception
This is the default implementation, returning a value of true.

Specified by:
beforeDelete in interface AEP_EditingDataDescriptor_Intf
Parameters:
fieldset - the values from the input form
Returns:
true
Throws:
java.lang.Exception
See Also:
e4s.html.editing.AEP_EditingDataDescriptor_Intf#beforeDelete(), #afterDelete(), #beforeInsert(), #beforeUpdate()

afterDelete

public void afterDelete(BODY body,
                        E4Fieldset fieldset,
                        E4DBConnection_Intf con)
                 throws java.lang.Exception
This is the default implementation, doing no no additional output or stuff.

Specified by:
afterDelete in interface AEP_EditingDataDescriptor_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_EditingDataDescriptor_Intf#afterDelete(), #beforeDelete(), #afterUpdate(), #afterInsert()

modifyDeleteIntegrityList

public E4DBReference[] modifyDeleteIntegrityList(E4DBReference[] cols)
                                          throws java.lang.Exception
Default implementation, returns the reference unchanged. 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.

Specified by:
modifyDeleteIntegrityList in interface AEP_EditingDataDescriptor_Intf
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

public E4DBReference[] modifyDeleteExecutionList(E4DBReference[] cols)
                                          throws java.lang.Exception
Default implementation, returns the reference unchanged. 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.

Specified by:
modifyDeleteExecutionList in interface AEP_EditingDataDescriptor_Intf
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

public boolean canDelete(E4DBSelect_Intf select)
                  throws java.lang.Exception
Default implementation, that does nothing. 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.

Specified by:
canDelete in interface AEP_EditingDataDescriptor_Intf
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:
#canDuplicate(e4.db.E4DBSelect_Intf), #canEdit(e4.db.E4DBSelect_Intf)

canEdit

public boolean canEdit(E4DBSelect_Intf select)
                throws java.lang.Exception
Default implementation, that does nothing. 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.

Specified by:
canEdit in interface AEP_EditingDataDescriptor_Intf
Parameters:
select - the selection interface representing the current record
Throws:
java.lang.Exception
See Also:
#canDelete(e4.db.E4DBSelect_Intf), #canDuplicate(e4.db.E4DBSelect_Intf)

canDuplicate

public boolean canDuplicate(E4DBSelect_Intf select)
                     throws java.lang.Exception
Default implementation, that does nothing. Check, if the record can be duplicated (while displaying it in the listing table and offering the delete image). This is one stage before the whole input data will be displayed.

Specified by:
canDuplicate in interface AEP_EditingDataDescriptor_Intf
Parameters:
select - the selection interface representing the current record
Returns:
true, if the record can be duplicated
Throws:
java.lang.Exception
See Also:
#canDelete(e4.db.E4DBSelect_Intf), #canEdit(e4.db.E4DBSelect_Intf)

pageStart

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

Specified by:
pageStart in interface AEP_EditingDataDescriptor_Intf
Parameters:
body - the BODY context for any additional outputs
mode - the update/display mode (AEP_EditingDataDescriptor_Intf.MODE_INSERT, AEP_EditingDataDescriptor_Intf.MODE_UPDATE or AEP_EditingDataDescriptor_Intf.MODE_DELETE).
Returns:
true
Throws:
java.lang.Exception

pageEnd

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

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

setForm

public void setForm(FORM dummy)
Specified by:
setForm in interface AEP_EditingDataDescriptor_Intf

afterDuplicate

public void afterDuplicate(BODY body,
                           HIDDENFIELD[] originalValues,
                           E4Fieldset fieldset,
                           E4DBConnection_Intf con)
                    throws java.lang.Exception
Description copied from interface: AEP_EditingDataDescriptor_Intf
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: afterDuplicate(BODY, HIDDENFIELD[], E4Fieldset, E4DBConnection_Intf)

Specified by:
afterDuplicate in interface AEP_EditingDataDescriptor_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 extractPresetField4Duplication(E4Fieldset, e4s.html.input.extended.E4InputFieldName_Intf), 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(), AEP_EditingDataDescriptor_Intf.afterDuplicate(e4s.html.BODY, e4s.html.input.extended.HIDDENFIELD[], e4s.html.input.extended.E4Fieldset, e4s.db.E4DBConnection_Intf), AEP_EditingDataDescriptor_Intf.beforeDuplicate(e4s.html.input.extended.E4Fieldset), AEP_EditingDataDescriptor_Intf.canDuplicate(e4s.db.E4DBSelect_Intf), E4ModuleEditingHandling02.duplicateRecord, AEP_EditingDataDescriptor_Intf.MODE_DUPLICATE, AEP_EditingDataDescriptor_Intf.PARAM_PREFIX_DUPLICATE

extractPresetField4Duplication

public static java.lang.String extractPresetField4Duplication(E4Fieldset fieldset,
                                                              E4InputFieldName_Intf fieldname)
Extract a value for a field that is used to point out to the original value of a recordset.

Parameters:
fieldset - the editing fieldset
fieldname - the name of a field (without AEP_EditingDataDescriptor_Intf.PARAM_PREFIX_DUPLICATE
Returns:
a value or null if not found
See Also:
AEP_EditingDataDescriptor_Intf.PARAM_PREFIX_DUPLICATE, extractPresetFields4Duplication(E4Fieldset), AEP_EditingDataDescriptor_Intf.afterDuplicate(BODY, HIDDENFIELD[], E4Fieldset, E4DBConnection_Intf)

extractPresetFields4Duplication

public static HIDDENFIELD[] extractPresetFields4Duplication(E4Fieldset fieldset)
Extract hiddenfields pointing out to the original value of a recordset.

Parameters:
fieldset - the editing fieldset
Returns:
an array o [unsorted] hiddenfields indicating the index of an editing element
See Also:
AEP_EditingDataDescriptor_Intf.PARAM_PREFIX_DUPLICATE, extractPresetField4Duplication(E4Fieldset, E4InputFieldName_Intf), AEP_EditingDataDescriptor_Intf.afterDuplicate(BODY, HIDDENFIELD[], E4Fieldset, E4DBConnection_Intf)

www.element4solution.com