Class ImportCatListHandler

  • All Implemented Interfaces:
    JcmsConstants, JaliosConstants

    public class ImportCatListHandler
    extends JcmsFormHandler
    Upload and parse a .txt file containing tree of categories to import in JCMS.
    Author:
    Olivier Dedieu
    • Field Detail

      • isPerformed

        protected boolean isPerformed
      • performImport

        protected boolean performImport
      • parentCat

        protected Category parentCat
      • pid

        protected java.lang.String pid
    • Constructor Detail

      • ImportCatListHandler

        public ImportCatListHandler()
    • Method Detail

      • doUpload

        public void doUpload​(javax.servlet.http.HttpServletRequest request)
                      throws java.io.IOException
        Performs upload task of for uploaded file named for the parameter "file". Then calls performImport() to import categories.
        Parameters:
        request - the HttpServletRequest
        Throws:
        java.io.IOException
      • validateFile

        public boolean validateFile​(java.io.File file,
                                    javax.servlet.http.HttpServletRequest request)
      • isPerformed

        public boolean isPerformed()
      • performImport

        protected boolean performImport​(java.io.File file,
                                        Category parent,
                                        javax.servlet.http.HttpServletRequest request)
        Parse and imports categories from the given file under the given parent category.
        Parameters:
        file - the categories file to parse
        parent - the parent category
        request - the HttpServletRequest
        Returns:
        boolean true if import has been correctly done
      • setPerformImport

        public void setPerformImport​(boolean performImport)
      • setPid

        public void setPid​(java.lang.String pid)
      • getPid

        public java.lang.String getPid()