Class FormMailAction

java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
sk.iway.iwcm.form.FormMailAction
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class FormMailAction extends javax.servlet.http.HttpServlet
univerzalne poslanie mailu
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
    static final String
    Description of the Field
    static final String
    Description of the Field
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    attFile(IwcmFile formFile, javax.mail.Multipart mp, String emailEncoding)
    Description of the Method
    static String
     
    static String
    createAbsolutePath(String htmlCode, javax.servlet.http.HttpServletRequest request)
    Vytvori absolutne cesty v zadanom HTML kode
    protected static void
    execute(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
    Zaslanie formularu z www stranky, nastavuje sa to cez:

    Kam sa to presmeruje po submite

    Dokumentu s predlohou formularu (fieldy su nahradene !meno_fieldu!)

    Prijemcovia mailu oddeleny ciarkou
    ak je nastavene toto, ulozi sa formular do databazy


    Subject mailu

    Zoznam fieldov ktore sa poslu a ulozia do DB

    Field ktory urcuje ktory field je email

    Field ktory urcuje ktory field je meno

    Zaciatok tela mailu

    formMailSendUserInfoDocId - docId stranky, ktorej text sa posle emailom odosielatelovi formularu (jeho email je v poli email) overwriteOldForms - ak je nastavene na true a je prihlaseny pouzivatel tak sa predtym vyplneny formular prepise novym allowOnlyOneSubmit - ak je nastavene na true a je prihlaseny pouzivatel a uz vyplnil formular, nezapise sa znova do DB a formfail sa nastavi na formIsAllreadySubmitted
    static javax.servlet.http.HttpServletRequest
    fillRequestWithDatabaseOptions(String formName, javax.servlet.http.HttpServletRequest request, List<sk.iway.upload.UploadedFile> excelFile)
     
    static String
    Vrati orezany HTML kod (ak obsahuje CROP_START a CROP_END)
    static String
    Vrati prvy email so zoznamu (email1@domena.sk,email2@domena.sk vrati email1@domena.sk)
    static boolean
    hasInterceptorFailed(String beforePostReturnParams)
    Overi ci interceptor padol
    static String
    saveForm(javax.servlet.http.HttpServletRequest request, Map<String,List<sk.iway.upload.UploadedFile>> formFilesTable, List<sk.iway.upload.UploadedFile> formFiles, net.sourceforge.stripes.action.ActionBeanContext context)
     
    static String
    saveFormAsPdf(String htmlData, int formId, javax.servlet.http.HttpServletRequest request)
    Ulozi formular ako pdfko
    static void
    sendUserInfo(int sendUserInfoDocId, int formId, String email, List<IwcmFile> attachs, Map<String,List<sk.iway.upload.UploadedFile>> formFilesTable, javax.servlet.http.HttpServletRequest request)
    Odoslanie notifikacie na email navstevnika, ktory ho vyplnil, zadane v poli formMailSendUserInfoDocId

    Methods inherited from class javax.servlet.http.HttpServlet

    doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service

    Methods inherited from class javax.servlet.GenericServlet

    destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log

    Methods inherited from class java.lang.Object

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

  • Constructor Details

    • FormMailAction

      public FormMailAction()
  • Method Details

    • execute

      protected static void execute(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, javax.servlet.ServletException
      Zaslanie formularu z www stranky, nastavuje sa to cez:

      Kam sa to presmeruje po submite

      Dokumentu s predlohou formularu (fieldy su nahradene !meno_fieldu!)

      Prijemcovia mailu oddeleny ciarkou
      ak je nastavene toto, ulozi sa formular do databazy


      Subject mailu

      Zoznam fieldov ktore sa poslu a ulozia do DB

      Field ktory urcuje ktory field je email

      Field ktory urcuje ktory field je meno

      Zaciatok tela mailu

      formMailSendUserInfoDocId - docId stranky, ktorej text sa posle emailom odosielatelovi formularu (jeho email je v poli email) overwriteOldForms - ak je nastavene na true a je prihlaseny pouzivatel tak sa predtym vyplneny formular prepise novym allowOnlyOneSubmit - ak je nastavene na true a je prihlaseny pouzivatel a uz vyplnil formular, nezapise sa znova do DB a formfail sa nastavi na formIsAllreadySubmitted
      Parameters:
      request - Description of the Parameter
      response - Description of the Parameter
      Throws:
      IOException - Description of the Exception
      javax.servlet.ServletException - Description of the Exception
    • fillRequestWithDatabaseOptions

      public static javax.servlet.http.HttpServletRequest fillRequestWithDatabaseOptions(String formName, javax.servlet.http.HttpServletRequest request, List<sk.iway.upload.UploadedFile> excelFile)
    • saveForm

      public static String saveForm(javax.servlet.http.HttpServletRequest request, Map<String,List<sk.iway.upload.UploadedFile>> formFilesTable, List<sk.iway.upload.UploadedFile> formFiles, net.sourceforge.stripes.action.ActionBeanContext context)
    • hasInterceptorFailed

      public static boolean hasInterceptorFailed(String beforePostReturnParams)
      Overi ci interceptor padol
      Parameters:
      beforePostReturnParams -
      Returns:
      true ak interceptor obsahuje string fail
    • attFile

      public static void attFile(IwcmFile formFile, javax.mail.Multipart mp, String emailEncoding)
      Description of the Method
      Parameters:
      formFile - Description of the Parameter
      mp - Description of the Parameter
    • getCroppedHTML

      public static String getCroppedHTML(String data)
      Vrati orezany HTML kod (ak obsahuje CROP_START a CROP_END)
      Parameters:
      data - - html kod
      Returns:
    • saveFormAsPdf

      public static String saveFormAsPdf(String htmlData, int formId, javax.servlet.http.HttpServletRequest request)
      Ulozi formular ako pdfko
      Parameters:
      htmlData -
    • createAbsolutePath

      public static String createAbsolutePath(String htmlCode, javax.servlet.http.HttpServletRequest request)
      Vytvori absolutne cesty v zadanom HTML kode
      Parameters:
      htmlCode - - HTML kod
      Returns:
    • checkEmailCssVersion

      public static String checkEmailCssVersion(String cssLink)
    • getFirstEmail

      public static String getFirstEmail(String emails)
      Vrati prvy email so zoznamu (email1@domena.sk,email2@domena.sk vrati email1@domena.sk)
      Parameters:
      emails -
      Returns:
    • sendUserInfo

      public static void sendUserInfo(int sendUserInfoDocId, int formId, String email, List<IwcmFile> attachs, Map<String,List<sk.iway.upload.UploadedFile>> formFilesTable, javax.servlet.http.HttpServletRequest request)
      Odoslanie notifikacie na email navstevnika, ktory ho vyplnil, zadane v poli formMailSendUserInfoDocId
      Parameters:
      sendUserInfoDocId -
      formId -
      email -
      attachs -
      request -