Interface TableCustomizerInterface

All Known Implementing Classes:
AbstractPostDeleteCustomizer, AbstractPostInsertCustomizer, AbstractPostQueryCustomizer, AbstractPostUpdateCustomizer, AbstractPreDeleteCustomizer, AbstractPreInsertCustomizer, AbstractPreUpdateCustomizer, ChildInserterPostInsertCustomizer, HelpContentPostInsertCustomizer, HelpContentPostUpdateCustomizer, HelpContentPreDeleteCustomizer, HelpContentPreUpdateCustomizer, ImportRecordPostQueryCustomizer, QuartzJobDataPostQueryCustomizer, SavedReportTableCustomizer, SavedViewTableCustomizer, ScheduledJobParameterTableCustomizer, ScheduledJobTableCustomizer, ScheduledReportTableCustomizer

public interface TableCustomizerInterface
Common interface used by all (core) TableCustomizer types (e.g., post-query, and {pre,post}-{insert,update,delete}. Note that the abstract-base classes for each action still exist, though have been back-ported to be implementors of this interface. The action classes will now expect this type, and call this type's methods.
  • Field Details

  • Method Details

    • postQuery

      default List<QRecord> postQuery(QueryOrGetInputInterface queryInput, List<QRecord> records) throws QException
      custom actions to run after a query (or get!) takes place.
      Throws:
      QException
    • preInsert

      default List<QRecord> preInsert(InsertInput insertInput, List<QRecord> records, boolean isPreview) throws QException
      custom actions before an insert takes place. It's important for implementations to be aware of the isPreview field, which is set to true when the code is running to give users advice, e.g., on a review screen - vs. being false when the action is ACTUALLY happening. So, if you're doing things like storing data, you don't want to do that if isPreview is true!! General implementation would be, to iterate over the records (the inputs to the insert action), and look at their values: - possibly adding Errors (`addError`) or Warnings (`addWarning`) to the records - possibly manipulating values (`setValue`) - possibly throwing an exception - if you really don't want the insert operation to continue. - doing "whatever else" you may want to do. - returning the list of records (can be the input list) that you want to go on to the backend implementation class.
      Throws:
      QException
    • whenToRunPreInsert

      default AbstractPreInsertCustomizer.WhenToRun whenToRunPreInsert(InsertInput insertInput, boolean isPreview)
    • postInsert

      default List<QRecord> postInsert(InsertInput insertInput, List<QRecord> records) throws QException
      custom actions after an insert takes place. General implementation would be, to iterate over the records (the outputs of the insert action), and look at their values: - possibly adding Errors (`addError`) or Warnings (`addWarning`) to the records - possibly throwing an exception - though doing so won't stop the update, and instead will just set a warning on all of the updated records... - doing "whatever else" you may want to do. - returning the list of records (can be the input list) that you want to go back to the caller.
      Throws:
      QException
    • preUpdate

      default List<QRecord> preUpdate(UpdateInput updateInput, List<QRecord> records, boolean isPreview, Optional<List<QRecord>> oldRecordList) throws QException
      custom actions before an update takes place. It's important for implementations to be aware of the isPreview field, which is set to true when the code is running to give users advice, e.g., on a review screen - vs. being false when the action is ACTUALLY happening. So, if you're doing things like storing data, you don't want to do that if isPreview is true!! General implementation would be, to iterate over the records (the inputs to the update action), and look at their values: - possibly adding Errors (`addError`) or Warnings (`addWarning`) to the records - possibly manipulating values (`setValue`) - possibly throwing an exception - if you really don't want the update operation to continue. - doing "whatever else" you may want to do. - returning the list of records (can be the input list) that you want to go on to the backend implementation class. Note, "old records" (e.g., with values freshly fetched from the backend) will be available (if the backend supports it)
      Throws:
      QException
    • postUpdate

      default List<QRecord> postUpdate(UpdateInput updateInput, List<QRecord> records, Optional<List<QRecord>> oldRecordList) throws QException
      custom actions after an update takes place. General implementation would be, to iterate over the records (the outputs of the update action), and look at their values: - possibly adding Errors (`addError`) or Warnings (`addWarning`) to the records? - possibly throwing an exception - though doing so won't stop the update, and instead will just set a warning on all of the updated records... - doing "whatever else" you may want to do. - returning the list of records (can be the input list) that you want to go back to the caller. Note, "old records" (e.g., with values freshly fetched from the backend) will be available (if the backend supports it).
      Throws:
      QException
    • preDelete

      default List<QRecord> preDelete(DeleteInput deleteInput, List<QRecord> records, boolean isPreview) throws QException
      Custom actions before a delete takes place. It's important for implementations to be aware of the isPreview param, which is set to true when the code is running to give users advice, e.g., on a review screen - vs. being false when the action is ACTUALLY happening. So, if you're doing things like storing data, you don't want to do that if isPreview is true!! General implementation would be, to iterate over the records (which the DeleteAction would look up based on the inputs to the delete action), and look at their values: - possibly adding Errors (`addError`) or Warnings (`addWarning`) to the records - possibly throwing an exception - if you really don't want the delete operation to continue. - doing "whatever else" you may want to do. - returning the list of records (can be the input list) - this is how errors and warnings are propagated to the DeleteAction. Note that any records with an error will NOT proceed to the backend's delete interface - but those with warnings will.
      Throws:
      QException
    • postDelete

      default List<QRecord> postDelete(DeleteInput deleteInput, List<QRecord> records) throws QException
      Custom actions after a delete takes place. General implementation would be, to iterate over the records (ones which didn't have a delete error), and look at their values: - possibly adding Errors (`addError`) or Warnings (`addWarning`) to the records? - possibly throwing an exception - though doing so won't stop the delete, and instead will just set a warning on all of the deleted records... - doing "whatever else" you may want to do. - returning the list of records (can be the input list) that you want to go back to the caller - this is how errors and warnings are propagated .
      Throws:
      QException
    • preInsertOrUpdate

      default List<QRecord> preInsertOrUpdate(AbstractActionInput input, List<QRecord> records, boolean isPreview, Optional<List<QRecord>> oldRecordList) throws QException
      Optional method to override in a customizer that does the same thing for both preInsert invalid input: '&' preUpdate.
      Throws:
      QException
    • postInsertOrUpdate

      default List<QRecord> postInsertOrUpdate(AbstractActionInput input, List<QRecord> records, Optional<List<QRecord>> oldRecordList) throws QException
      Optional method to override in a customizer that does the same thing for both postInsert invalid input: '&' postUpdate.
      Throws:
      QException
    • oldRecordListToMap

      default Optional<Map<Serializable,QRecord>> oldRecordListToMap(String primaryKeyField, Optional<List<QRecord>> oldRecordList)