Class MonthCloseBean<T extends MonthClose,​D extends java.lang.Comparable>

    • Field Detail

      • UI_INSERT_MC_SUBCLASS_PROPERTIES

        protected static final java.lang.String UI_INSERT_MC_SUBCLASS_PROPERTIES
        UI insert name for subclass properties
        See Also:
        Constant Field Values
    • Constructor Detail

      • MonthCloseBean

        public MonthCloseBean()
    • Method Detail

      • prepareEntity

        protected T prepareEntity​(T entity)
                           throws SystemException
        Description copied from class: EntityBackingBean
        Prepare the entity so that it can be usable. Called before refreshing property model and showing to user. Subclass should override this method to initialize property values if any.
        Overrides:
        prepareEntity in class EntityBackingBean<T extends MonthClose>
        Parameters:
        entity - the entity of this backing bean
        Returns:
        prepared entity
        Throws:
        BackingBeanException - throw if backingBean related error occurs
        SystemException - throw if any other error occurs
      • getEarliestTransactionDate

        protected abstract D getEarliestTransactionDate()
        Get the earliest transaction date for the module.
        Returns:
        earliest date
      • getEarliestTransactionLocalDateTime

        protected final java.time.LocalDateTime getEarliestTransactionLocalDateTime()
        Get the earliest transaction localDateTime for the module.
        Returns:
        earliest date
      • isHasDeletePermission

        protected boolean isHasDeletePermission​(PersistenceDataBackingBean<T> backingBean,
                                                T entity)
                                         throws SystemException
        Description copied from class: EntityBackingBean
        Whether current user has the delete permission on the entity under the condition that the user has delete permission by access control.
        Overrides:
        isHasDeletePermission in class EntityBackingBean<T extends MonthClose>
        Parameters:
        backingBean - backing bean that contains the entity.
        entity - entity to be deleted.
        Returns:
        true if user has delete permission, false otherwise
        Throws:
        SystemException - throw if an error occurs in evaluating access control
      • getDependentMonthCloseTypes

        protected java.lang.Class<? extends MonthClose>[] getDependentMonthCloseTypes()
        Dependency. Close dependent modules first before closing this module.
        Returns:
        month close types that need to be closed first.
      • validate

        public void validate()
                      throws SystemException
        Description copied from class: EntityBackingBean
        Validate the entity of backing bean. It is called before search, going to the verify mode, creating or saving changes of the entity in persistence.

        validate those properties whose validations are delayed(validation is skipped during model update).

        Validate normative Id and verify the uniqueness of primary key. For form bean properties, save the values in the form beans into the properties.

        In addition to value validation, it can be any logic. For example, calculate total, change the values of related entities.

        Overrides:
        validate in class EntityBackingBean<T extends MonthClose>
        Throws:
        InvalidValueException - throw if any property value is invalid
        SystemException - throw if any other error occurs
      • getEarliestUnclosedMonthDatePeriod

        public TemporalPeriod getEarliestUnclosedMonthDatePeriod​(boolean timestamp,
                                                                 MonthClose valueToInitialize)
        Get the earliest unclosed month after closed months.
        Parameters:
        timestamp - whether the date period is timestamp with hour and minute. If valueToInitialize is not null, timestamp should be false.
        valueToInitialize - if not null, initialize it as the earliest unclosed month.
        Returns:
        LocalDateTimePeriod if timestamp is true, or LocalDatePeriod instance otherwise
      • getEarliestUnclosedMonthDatePeriod

        public static <T extends MonthCloseTemporalPeriod getEarliestUnclosedMonthDatePeriod​(java.lang.Class<T> monthCloseType,
                                                                                               boolean timestamp)
        Get the earliest unclosed month after closed months.
        Parameters:
        monthCloseType - MonthClose type
        timestamp - whether the date period is timestamp with hour and minute.
        Returns:
        date period
      • getEarliestUnclosedMonthDatePeriod

        public static <T extends MonthClose> java.lang.String getEarliestUnclosedMonthDatePeriod​(java.lang.Class<T> monthCloseType,
                                                                                                 DataAccessUnit dataAccessUnit)
                                                                                          throws SystemException
        Get the first unclosed month after closed months that can be used as input such as 2010-M5.
        Parameters:
        monthCloseType - MonthClose type
        dataAccessUnit - the DataAccessUnit for accessing entities
        Returns:
        date period
        Throws:
        SystemException
      • validateUnclosedMonth

        public static <T extends MonthClose> void validateUnclosedMonth​(java.lang.String period,
                                                                        boolean earliestRequired,
                                                                        java.lang.Class<T> monthCloseType,
                                                                        DataAccessUnit dataAccessUnit)
                                                                 throws SystemException
        Validate the period that must be a month type and not closed, and check whether it is the earliest unclosed month if required.
        Parameters:
        period - the period to check such as 2012-M5.
        earliestRequired - whether the period must be the earliest unclosed month
        monthCloseType - monthClose type
        dataAccessUnit - the DataAccessUnit for accessing entities
        Throws:
        SystemException - throw if the period is not valid as requested.
      • isShowMonthCloseReportEnabled

        protected boolean isShowMonthCloseReportEnabled()
        Whether to show the reporting about the MonthClose?
        Returns:
        true to show it, false otherwise
      • getMonthCloseReportBeans

        protected java.util.List<MonthCloseBean.MonthCloseReportBean> getMonthCloseReportBeans​(T entity,
                                                                                               ContainerBean containerBean)
                                                                                        throws SystemException
        Get monthClose report beans. Subclass need to override this method to provide content that is a list of MonthCloseReportBean(s).
        Parameters:
        entity - MonthClose
        containerBean - the container bean of the returned MonthCloseReportBeans' wrapped beans.
        Returns:
        a list of MonthCloseReportBean(s)
        Throws:
        SystemException - throw if an error occurs