Class ContributionModificationContextHandler

  • All Implemented Interfaces:
    ContributionOperationContextPropertyHandler

    @Technical
    @Service
    public class ContributionModificationContextHandler
    extends Object
    implements ContributionOperationContextPropertyHandler
    This class permits to handle a contribution modification context.

    A such context can give additional information to adopt different kind of behaviors. For example, it can indicates if the user modification is a minor one which permits the contribution services to adopt a different behavior against a normal one.

    Author:
    silveryocha
    • Constructor Detail

      • ContributionModificationContextHandler

        protected ContributionModificationContextHandler()
        Hidden constructor.
    • Method Detail

      • parseForProperty

        public void parseForProperty​(javax.servlet.http.HttpServletRequest request)
        Verifies from a request if it exists a contribution modification context.

        This context could give additional information to adopt a behavior or an other.

        Specified by:
        parseForProperty in interface ContributionOperationContextPropertyHandler
        Parameters:
        request - the current HTTP request.
      • setMinorModification

        public void setMinorModification()
        Forces the context by indicating a minor modification.

        This method permits to indicate a such context by bypassing an HTTP request decoding.

        The context is also registered into a thread cache, like it is done with the HTTP request decoding.

      • isMinorModification

        public Optional<Boolean> isMinorModification()
        Indicates from current request if the current user made a minor modification.
        Returns:
        either true if minor, false otherwise, or nothing if the handle hasn't parsed any request.