Interface FormComponent


  • @ProviderType
    public interface FormComponent
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      Form getForm​(org.apache.sling.api.SlingHttpServletRequest request)
      Get the data from the HTTP Request and move into the Map-based Form abstraction
      String getFormName()  
      void onFailure​(Form form, org.apache.sling.api.SlingHttpServletRequest request, org.apache.sling.api.SlingHttpServletResponse response)
      Handle unsuccessful form submission.
      void onSuccess​(Form form, org.apache.sling.api.SlingHttpServletRequest request, org.apache.sling.api.SlingHttpServletResponse response)
      Handle successful form submission.
      boolean save​(Form form)
      Save the data to the underlying data store; implementation specific.
      Form validate​(Form form)
      Validate the provided form data.
    • Method Detail

      • getFormName

        String getFormName()
        Returns:
      • getForm

        Form getForm​(org.apache.sling.api.SlingHttpServletRequest request)
        Get the data from the HTTP Request and move into the Map-based Form abstraction
        Parameters:
        request -
        Returns:
      • validate

        Form validate​(Form form)
        Validate the provided form data. Create any Error records on the form itself.
        Parameters:
        form -
        Returns:
      • save

        boolean save​(Form form)
        Save the data to the underlying data store; implementation specific. This could be CRX or external data store.
        Parameters:
        form -
        Returns:
      • onSuccess

        void onSuccess​(Form form,
                       org.apache.sling.api.SlingHttpServletRequest request,
                       org.apache.sling.api.SlingHttpServletResponse response)
                throws Exception
        Handle successful form submission. Typically includes a 302 redirect to a Success page.
        Parameters:
        form -
        request -
        response -
        Throws:
        Exception
      • onFailure

        void onFailure​(Form form,
                       org.apache.sling.api.SlingHttpServletRequest request,
                       org.apache.sling.api.SlingHttpServletResponse response)
                throws Exception
        Handle unsuccessful form submission. Typically includes a 302 redirect back to self.
        Parameters:
        form -
        request -
        response -
        Throws:
        Exception