Class PanelOutcomeReasonsDataCollectionTemplate

All Implemented Interfaces:
Serializable, overit.geocall.marks.MethodExposer, overit.geocall.marks.NameExposer, AjaxableComponent, Badgeable, Hideable, Identified, Tool, overit.geocall.ux.configurability.UIConfigurable, overit.geocall.ux.edm.ModelConfigurable

public class PanelOutcomeReasonsDataCollectionTemplate extends Panel
Panel which allows to select a set of a data collection template.
Since:
12.0
See Also:
GCApi:
controller
  • Field Details

  • Constructor Details

    • PanelOutcomeReasonsDataCollectionTemplate

      public PanelOutcomeReasonsDataCollectionTemplate()
  • Method Details

    • onOpen

      public void onOpen(Object o)
      Description copied from class: Container
      Method called when is executed the WindowManager.push(overit.geocall.basic.ui.Window, java.lang.Object) of the Window that contains the Container. It calls the onOpen(o) method of all the Container's childrens.
      If a page is opened through the process of a route, it is possible that the route was called with params to pass to the page.
      The route params could be passed specifying them like query string's param on the url, using commas or the '=' character, to separate the keys and the values. Valid syntaxs are: "&params=KEY1,VAL1,KEY2,VAL2" or "&params=KEY1=VAL1,KEY2=VAL2"
      In that case it is possible to retrieve those params via the WindowManager.getRouteParams() method that returns an HashGetter with the params passed as parameters.
      For example it's possible to retrieve and use the params in this way: HashGetter hg = getWM().getRouteParams();
      String val1 = hg.getString("key1",null);
      String val2 = hg.getString("key2",null);
      Overrides:
      onOpen in class Container
      Parameters:
      o - Object received from the caller
    • show

      public void show(Serializable obj)
      Description copied from class: Panel
      It shows (make visible with the pop-up effect) the panel
      Overrides:
      show in class Panel
      Parameters:
      obj - serializable object saved as a global variable of the panel
    • initComponent

      protected void initComponent()
      Initialize the UI components
    • loadData

      protected void loadData()
      Loads all the data required by the panel
    • initPanel

      protected void initPanel()
      Prepare the tables of Outcome Reasons and sets the editability of the panel
    • populateDBViews

      protected void populateDBViews(DBView selectedDBView, DBView availableDBView)
      Populates the selected and available DBViews based on the template outcome rule IDs.
      Parameters:
      selectedDBView - the DBView for selected outcome reasons
      availableDBView - the DBView for available outcome reasons
    • configureUIBasedOnReleaseStatus

      protected void configureUIBasedOnReleaseStatus()
      Configures the UI components (read-only status and visibility) based on the template release status.
    • loadOutcomeReasons

      protected List<BOOutcomeReason> loadOutcomeReasons() throws DAValidateException, DAException
      Throws:
      DAValidateException
      DAException
    • loadTemplateStructure

      protected BODataCollectionTemplateStructure loadTemplateStructure() throws DAValidateException, DAException
      Throws:
      DAValidateException
      DAException
    • loadOutcomeRules

      Throws:
      DAValidateException
      DAException
    • onSave

      public boolean onSave(UIMessage uim)
      Parameters:
      uim - the UIMessage
      Returns:
      true to break the responsibility chain, false otherwise.
    • buildInsertList

      protected List<BODataCollectionTemplateStructureOutcomeRule> buildInsertList(DBView selectedDBView)
      Builds the list of outcome rules to insert.
      Parameters:
      selectedDBView - the DBView containing selected outcome reasons
      Returns:
      the list of outcome rules to insert
    • buildUpdateList

      protected List<BODataCollectionTemplateStructureOutcomeRule> buildUpdateList(DBView selectedDBView)
      Builds the list of outcome rules to update.
      Parameters:
      selectedDBView - the DBView containing selected outcome reasons
      Returns:
      the list of outcome rules to update
    • buildDeleteList

      protected Set<Long> buildDeleteList(Set<Long> originalOutcomeRuleIds, Set<Long> selectedOutcomeRuleIds)
      Builds the set of outcome rule IDs to delete.
      Parameters:
      originalOutcomeRuleIds - the original outcome rule IDs
      selectedOutcomeRuleIds - the selected outcome rule IDs
      Returns:
      the set of outcome rule IDs to delete
    • isExistingRule

      protected boolean isExistingRule(Long outcomeRuleId)
      Checks if a rule already exists for the given outcome rule ID.
      Parameters:
      outcomeRuleId - the outcome rule ID
      Returns:
      true if the rule exists, false otherwise
    • createAlignInput

      protected DataCollectionTemplateStructureOutcomeRuleAlignInput createAlignInput(List<BODataCollectionTemplateStructureOutcomeRule> outcomeRulesToInsert, List<BODataCollectionTemplateStructureOutcomeRule> outcomeRulesToUpdate, Set<Long> outcomeReasonIdsToDelete)
      Creates the align input with the insert, update, and delete lists.
      Parameters:
      outcomeRulesToInsert - the list of rules to insert
      outcomeRulesToUpdate - the list of rules to update
      outcomeReasonIdsToDelete - the set of outcome reason IDs to delete
      Returns:
      the align input
    • launchAlignEvent

      protected void launchAlignEvent(DataCollectionTemplateStructureOutcomeRuleAlignInput alignInput) throws DAException, DAValidateException
      Launches the align event to persist the changes.
      Parameters:
      alignInput - the align input
      Throws:
      DAException - the DA exception
      DAValidateException - the DA validate exception
    • onSelectRequiredIfAutoGenerable

      public boolean onSelectRequiredIfAutoGenerable(UIMessage uim)
      UI event handler to update the "required if auto-generable" flag for selected outcome reasons.

      This method processes the user's selection of the required flag for each outcome reason in the selected table view and updates the DBView accordingly.

      Parameters:
      uim - the UIMessage containing the updated flag values
      Returns:
      true to break the responsibility chain, false otherwise.