Package hudson.util

Class FormApply

java.lang.Object
hudson.util.FormApply

public class FormApply extends Object
Server-side code related to the <f:apply> button.
Since:
1.453
Author:
Kohsuke Kawaguchi
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Corresponds to types declared in index.js
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.kohsuke.stapler.HttpResponses.HttpResponseException
    Deprecated.
    use showNotification(String, NotificationType) instead, which is CSP compatible version
    static boolean
    isApply(org.kohsuke.stapler.StaplerRequest req)
    Deprecated.
    static boolean
    isApply(org.kohsuke.stapler.StaplerRequest2 req)
    Is this submission from the "apply" button?
    static org.kohsuke.stapler.HttpResponses.HttpResponseException
    Generates the response for the asynchronous background form submission (AKA the Apply button), that will show a notification of certain type and with provided message.
    static org.kohsuke.stapler.HttpResponses.HttpResponseException
    success(String destination)
    Generates the response for the form submission in such a way that it handles the "apply" button correctly.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • FormApply

      public FormApply()
  • Method Details

    • success

      public static org.kohsuke.stapler.HttpResponses.HttpResponseException success(String destination)
      Generates the response for the form submission in such a way that it handles the "apply" button correctly.
      Parameters:
      destination - The page that the user will be taken to upon a successful submission (in case this is not via the "apply" button.)
    • isApply

      public static boolean isApply(org.kohsuke.stapler.StaplerRequest2 req)
      Is this submission from the "apply" button?
      Since:
      2.475
    • isApply

      @Deprecated public static boolean isApply(org.kohsuke.stapler.StaplerRequest req)
      Deprecated.
    • applyResponse

      @Deprecated public static org.kohsuke.stapler.HttpResponses.HttpResponseException applyResponse(String script)
      Deprecated.
      use showNotification(String, NotificationType) instead, which is CSP compatible version
      Generates the response for the asynchronous background form submission (AKA the Apply button.)

      When the response HTML includes a JavaScript function in a pre-determined name, that function gets executed. This method generates such a response from JavaScript text.

    • showNotification

      public static org.kohsuke.stapler.HttpResponses.HttpResponseException showNotification(String message, FormApply.NotificationType notificationType)
      Generates the response for the asynchronous background form submission (AKA the Apply button), that will show a notification of certain type and with provided message.
      Parameters:
      message - a message to display in the popup. Only plain text is supported.
      notificationType - type of notification. See FormApply.NotificationType for supported types. Defines the notification color and the icon that will be shown.
      Since:
      2.482