Class RemoteHelper

java.lang.Object
fr.becpg.repo.entity.remote.extractor.RemoteHelper

public class RemoteHelper extends Object

RemoteHelper class.

Version:
$Id: $Id
Author:
matthieu
  • Field Details

    • ISO_DAY_FORMATTER

      private static final DateTimeFormatter ISO_DAY_FORMATTER
      Constant ISO_DAY_FORMATTER
    • ISO_DAY_PATTERN

      private static final Pattern ISO_DAY_PATTERN
      Constant ISO_DAY_PATTERN
  • Constructor Details

    • RemoteHelper

      private RemoteHelper()

      Constructor for RemoteHelper.

  • Method Details

    • getPropName

      public static org.alfresco.service.namespace.QName getPropName(org.alfresco.service.namespace.QName type, EntityDictionaryService dictionaryService)

      getPropName.

      Parameters:
      type - a QName object.
      dictionaryService - a EntityDictionaryService object.
      Returns:
      a QName object.
    • isJSONValue

      public static boolean isJSONValue(org.alfresco.service.namespace.QName propType)

      isJSONValue.

      Parameters:
      propType - a QName object.
      Returns:
      a boolean.
    • isDayProperty

      public static boolean isDayProperty(org.alfresco.service.namespace.QName propType, EntityDictionaryService dictionaryService)

      States whether a property denotes a calendar day rather than an instant.

      Parameters:
      propType - a QName object.
      dictionaryService - a EntityDictionaryService object.
      Returns:
      a boolean.
    • formatDay

      public static String formatDay(Date value)
      Renders a d:date as the calendar day the repository displays.

      The repository holds a day as an instant and whoever writes it picks a time zone. Publishing that instant lets every reader re-interpret it in its own zone, which moves the day by one on a server ahead of UTC. A plain day carries no zone, so it cannot move.

      Parameters:
      value - a Date object.
      Returns:
      a String object.
    • parseDay

      public static Optional<Date> parseDay(String value)
      Reads back a calendar day, anchored at midnight in the time zone of this server.

      Anything else yields an empty result, so that the ISO instants written by earlier versions keep going through the standard Alfresco conversion.

      Parameters:
      value - a String object.
      Returns:
      a Optional object.