• Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Major Major
    • core

      Use-cases:

      • Modify columns on the View creation (JENKINS-17384)
      • Send notifications on view configuration changes
      • onCreated()
      • onCopy()
      • ondeleted()
      • ...

          [JENKINS-23140] Add the "ViewListener" extension point

          Daniel Beck added a comment - - edited

          Actually, that first one should probably not be in here. Listener is more passive recipient of information. jglick also mentioned in JENKINS-21224 that I'm doing it wrong by trying to change things from a listener.

          Also, the rationale isn't clear why this needs to be configured in an extension point. Is there a need to get more flexibility than to specify which columns should be added by default?

          Also, how would multiple Listeners interact wrt to column selection?

          Daniel Beck added a comment - - edited Actually, that first one should probably not be in here. Listener is more passive recipient of information. jglick also mentioned in JENKINS-21224 that I'm doing it wrong by trying to change things from a listener. Also, the rationale isn't clear why this needs to be configured in an extension point. Is there a need to get more flexibility than to specify which columns should be added by default? Also, how would multiple Listeners interact wrt to column selection?

          Oleg Nenashev added a comment -

          Regarding the JENKINS-17384...
          It's just a top-level use-case.
          Listener should not provide callbacks to manage columns directly. It should just notify implementations that something has changed in Views.
          1) User creates a new view
          2) ViewListener fires the onCreated(View view) event
          3) The "DefaultColumnsViewListener" from a plugin catches the event, alters the configuration and then saves the view
          4) Other ViewListeners do other actions

          Actually, such approach is not required for JENKINS-17378, but it could be used for more complex cases

          Oleg Nenashev added a comment - Regarding the JENKINS-17384 ... It's just a top-level use-case. Listener should not provide callbacks to manage columns directly. It should just notify implementations that something has changed in Views. 1) User creates a new view 2) ViewListener fires the onCreated(View view) event 3) The "DefaultColumnsViewListener" from a plugin catches the event, alters the configuration and then saves the view 4) Other ViewListeners do other actions Actually, such approach is not required for JENKINS-17378 , but it could be used for more complex cases

            Unassigned Unassigned
            oleg_nenashev Oleg Nenashev
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: