Class EditMemberPhotoHandler

All Implemented Interfaces:
JcmsConstants, JaliosConstants

public class EditMemberPhotoHandler extends EditMemberHandler
This form handler processes Member photo.
Since:
jcms-9.0.0
Author:
Kevin Bransard
  • Field Details

    • UPLOAD_STEP

      public static final int UPLOAD_STEP
      See Also:
    • CROP_STEP

      public static final int CROP_STEP
      See Also:
    • 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 String MBRID_HTML_PARAM
      The parameter name used to transfert the id of the Member for which the photo is edited.
      See Also:
  • Constructor Details

    • EditMemberPhotoHandler

      public EditMemberPhotoHandler()
  • Method Details

    • processAction

      public boolean processAction() throws 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:
      IOException - IO Exception
    • getFormStepPrefixProp

      public String getFormStepPrefixProp()
      Overrides:
      getFormStepPrefixProp in class JcmsFormHandler
      Returns:
      the prefix prop for the steps
    • validateNext

      protected boolean validateNext() throws IOException
      Overrides:
      validateNext in class JcmsFormHandler
      Throws:
      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
    • getFormStepHiddenFields

      public String getFormStepHiddenFields()
      Overrides:
      getFormStepHiddenFields in class JcmsFormHandler
    • performFinish

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

      public 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(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(String x1)
    • setY1

      public void setY1(String y1)
    • setX2

      public void setX2(String x2)
    • setY2

      public void setY2(String y2)
    • setWidth

      public void setWidth(String width)
    • setHeight

      public void setHeight(String height)
    • setMbrId

      public void setMbrId(String mbrId)
    • setMember

      public void setMember(Member member)
    • getMember

      public Member getMember()
      Overrides:
      getMember in class EditMemberHandler
    • 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.