java.lang.Object
fr.paris.lutece.plugins.termofservice.service.TOSService

public class TOSService extends Object
TOSService
  • Method Details

    • getUserAcceptedTOS

      public static Optional<UserAccepted> getUserAcceptedTOS(String strGuid)
      Retrieves the Terms of Service (TOS) accepted by the specified user.

      If the TOS publication feature is enabled, this method returns the acceptance record associated with the currently published TOS. Otherwise, it returns the user's general TOS acceptance record.

      Parameters:
      strGuid - the unique identifier of the user
      Returns:
      an Optional containing the UserAccepted object if the user has accepted the TOS, or an empty Optional if no record is found
    • getUserAcceptedPublishedTOS

      public static Optional<UserAccepted> getUserAcceptedPublishedTOS(String strGuid)
      Retrieves the Terms of Service (TOS) accepted by the specified user when the TOS publication feature is enabled.

      This method looks for the currently published TOS entry and returns the record of acceptance corresponding to that published version, if it exists.

      Parameters:
      strGuid - the guid
      Returns:
      an Optional containing the UserAccepted object if the user has accepted the published TOS, or an empty Optional if no record is found
    • getCurrentEntry

      public static Optional<Entry> getCurrentEntry()
      Retrieves the current Terms of Service (TOS) entry.

      If the TOS publication feature is enabled, this method returns the currently published entry. Otherwise, it returns the last available version.

      Returns:
      an Optional containing the current Entry if found, or an empty Optional otherwise