Class EditMemberPhotoHandler

  • All Implemented Interfaces:
    JcmsConstants, JaliosConstants

    public class EditMemberPhotoHandler
    extends EditMemberHandler
    This form handler processes Member photo.
    Since:
    jcms-9.0.0
    Version:
    $Revision: 133355 $
    Author:
    Kevin Bransard
    • Field Detail

      • opExisting

        protected boolean opExisting
      • useCurrentMemberPhoto

        protected boolean useCurrentMemberPhoto
      • x1

        protected int x1
      • y1

        protected int y1
      • x2

        protected int x2
      • y2

        protected int y2
      • width

        protected int width
      • height

        protected int height
      • member

        protected Member member
      • MBRID_HTML_PARAM

        protected static final java.lang.String MBRID_HTML_PARAM
        The parameter name used to transfert the id of the Member for which the photo is edited.
        See Also:
        Constant Field Values
    • Constructor Detail

      • EditMemberPhotoHandler

        public EditMemberPhotoHandler()
    • Method Detail

      • processAction

        public boolean processAction()
                              throws java.io.IOException
        Description copied from class: JcmsFormHandler
        Method to be implemented to check/validate action to be performed and process them.

        Default implementation is to return false. No need to call super method.

        This method may NOT be invoked at all if security validation are not met.

        You must ensure your handler and JSP can work properly without any code invoked in this method.

        Overrides:
        processAction in class EditMemberHandler
        Returns:
        false if no redirection is needed, true otherwise
        Throws:
        java.io.IOException - IO Exception
      • validateNext

        protected boolean validateNext()
                                throws java.io.IOException
        Overrides:
        validateNext in class JcmsFormHandler
        Throws:
        java.io.IOException
      • getFormStepCount

        public int getFormStepCount()
        Description copied from class: JcmsFormHandler
        Retrieve the total number of steps used for edition when invoking this form handler.

        The default implementation of this method is to return 1, corresponding to one step (which means only 1 screen being displayed).

        You can provide a custom FormHandler to override this behavior.

        See jcore/doSteps.jspf for use of this method.

        Overrides:
        getFormStepCount in class JcmsFormHandler
        Returns:
        the total number of steps in this formhandler
      • showPreviousButton

        public boolean showPreviousButton()
        Description copied from class: JcmsFormHandler
        Check if the "Previous" button should be displayed in step modal form.

        The default implementation of this method is to return true if the current step (as returned by JcmsFormHandler.getFormStep() is higher than 0.

        You can provide a custom FormHandler to override this behavior.

        See jcore/doStepButtons.jspf for use of this method.

        Overrides:
        showPreviousButton in class JcmsFormHandler
        Returns:
        true to display the "Previous" button, false to hide it
      • performFinish

        protected boolean performFinish()
                                 throws java.io.IOException
        Overrides:
        performFinish in class JcmsFormHandler
        Throws:
        java.io.IOException
      • getWorkFile

        public java.io.File getWorkFile()
        Retrieve the File instance of the current photo being edited.

        ALWAYS return a temporary file which can be safely deleted.

        Returns:
        a File instance or null if work file was not properly initalized
      • setOpExisting

        public void setOpExisting​(java.lang.String opExisting)
      • setUseCurrentMemberPhoto

        public void setUseCurrentMemberPhoto​(boolean useCurrentMemberPhoto)
      • useCurrentMemberPhoto

        public boolean useCurrentMemberPhoto()
        Returns:
        true if user has asked to use his existing photo
      • getAvailableX1

        public int getAvailableX1()
      • getAvailableY1

        public int getAvailableY1()
      • getAvailableX2

        public int getAvailableX2()
      • getAvailableY2

        public int getAvailableY2()
      • getAvailableWidth

        public int getAvailableWidth()
      • getAvailableHeight

        public int getAvailableHeight()
      • setX1

        public void setX1​(java.lang.String x1)
      • setY1

        public void setY1​(java.lang.String y1)
      • setX2

        public void setX2​(java.lang.String x2)
      • setY2

        public void setY2​(java.lang.String y2)
      • setWidth

        public void setWidth​(java.lang.String width)
      • setHeight

        public void setHeight​(java.lang.String height)
      • setMbrId

        public void setMbrId​(java.lang.String mbrId)
      • setMember

        public void setMember​(Member member)
      • canEdit

        public static boolean canEdit​(Member me,
                                      Member other,
                                      Workspace workspace)
        Return true if a given member can edit the profile info of a given member.
        Parameters:
        me - the Member who updates the photo
        other - the Member who's photo will be updated
        workspace - the current Workspace
        Returns:
        true if a given member can edit the profile info of a given member.