Interface EntityBean

    • Field Detail

      • PROPERTY_CHOICE

        static final java.lang.String PROPERTY_CHOICE
        choice property name
        Since:
        5.14
        See Also:
        Constant Field Values
    • Method Detail

      • isCreating

        boolean isCreating()
        Is this entity bean creating an entity?
        Returns:
        true for creating entity, false otherwise
        Since:
        5.13
      • getFormBean

        default PersistenceDataBean getFormBean​(java.lang.String formBeanProperty)
        Get enclosed form bean.
        Parameters:
        formBeanProperty - formBean property name
        Returns:
        PersistenceDataBean instance
        Throws:
        java.lang.IllegalArgumentException - throw if the formBean is not found
      • getFormBean

        PersistenceDataBean getFormBean​(java.lang.String formBeanProperty,
                                        boolean errorIfNotFound)
        Get enclosed form bean.
        Parameters:
        formBeanProperty - formBean property name
        errorIfNotFound - whether to throw exception if the formBean is not found
        Returns:
        PersistenceDataBean instance. return null if errorIfNotFound is false and the formBean is not found
        Throws:
        java.lang.IllegalArgumentException - throw if errorIfNotFound is true and the formBean is not found
        Since:
        5.14
      • getEntityProperty

        default EntityProperty getEntityProperty​(java.lang.String name)
        Get the property with the name.
        Parameters:
        name - property name
        Returns:
        EntityProperty instance
        Throws:
        java.lang.IllegalArgumentException - throw if the property is not found
      • getEntityProperty

        EntityProperty getEntityProperty​(java.lang.String name,
                                         boolean errorIfNotFound)
        Get the property with the name.
        Parameters:
        name - property name
        Returns:
        EntityProperty instance. return null if errorIfNotFound is false and the property is not found.
        Throws:
        java.lang.IllegalArgumentException - throw if errorIfNotFound is true and the property is not found
        Since:
        5.14
      • getChoiceProperty

        default EntityProperty getChoiceProperty​(boolean errorIfNotFound)
        Get the choice property for EntityChoiceSupportBean.
        Returns:
        choice EntityProperty. return null if errorIfNotFound is false and the property is not found.
        Throws:
        java.lang.IllegalArgumentException - throw if errorIfNotFound is true and the property is not found
        Since:
        5.14
      • getEntityCaptchaProperty

        default EntityProperty getEntityCaptchaProperty​(boolean errorIfNotFound)
        Get the captcha property.
        Parameters:
        errorIfNotFound - whether to throw exception if not found
        Returns:
        EntityProperty instance. return null if errorIfNotFound is false and the property is not found
        Throws:
        java.lang.IllegalArgumentException - throw if errorIfNotFound is true and the property is not found
        Since:
        5.13
      • getAttributeProperty

        default EntityProperty getAttributeProperty​(java.lang.String attrName,
                                                    boolean errorIfNotFound)
        Get the attribute property (user-defined property) with the name.
        Parameters:
        attrName - attribute name
        errorIfNotFound - whether to throw exception if not found
        Returns:
        EntityProperty instance. return null if errorIfNotFound is false and the property is not found
        Throws:
        java.lang.IllegalArgumentException - throw if errorIfNotFound is true and the property is not found
        Since:
        5.17
      • isLogin

        boolean isLogin()
        Is this bean a login bean?
        Returns:
        true for login bean, false otherwise
      • waitUntilPropertyVisible

        EntityProperty waitUntilPropertyVisible​(java.lang.String propertyName)
        Wait until the property becomes visible. Refresh this bean if it is stale.
        Parameters:
        propertyName - property name
        Returns:
        the visible property
      • waitUntilStale

        default EntityBean waitUntilStale​(boolean refresh)
        Description copied from interface: Component
        Wait until this component is detached from page.
        Specified by:
        waitUntilStale in interface Component
        Parameters:
        refresh - whether to refresh and attach this component to page after detached
        Returns:
        this component itself
      • create

        default EntityBean create​(boolean hidden)
        Create entity by click "Create" menu node.
        Parameters:
        hidden - whether this bean is hidden after entity is created. If hidden, this bean will not be usable.
        Returns:
        the created EntityBean in view mode
      • create

        EntityBean create​(boolean expectedSuccess,
                          boolean hidden,
                          ParameterizedMessage errorMessage,
                          boolean wait)
        Create entity by click "Create" menu node.
        Parameters:
        expectedSuccess - expected success or failure
        hidden - whether this bean is hidden after entity is successfully created. If hidden, this bean will not be usable.
        errorMessage - the error message for expected failure (expectedSuccess is false)
        wait - whether to wait for condition staleness(hidden=false) or absence(hidden=true). If false, a waitUntil should be called after this method.
        Returns:
        the created EntityBean in view mode
        Since:
        5.20
      • createAndContinue

        EntityBean createAndContinue()
        Create entity and then show a new EntityBean for creating a new entity.
        Returns:
        an EntityBean in creating entity mode
        Since:
        5.13
      • createChildHierarchy

        default EntityBean createChildHierarchy()
        Create child hierarchy entity if this bean is a Hierarchy entity bean.
        Returns:
        the entity bean for creating child hierarchy
        Since:
        5.17
      • applyChange

        EntityBean applyChange​(boolean hidden)
        Save changes by clicking "ApplyChange" menu node.
        Parameters:
        hidden - whether this bean is hidden after entity is saved to persistence. If hidden, this bean will not be usable.
        Returns:
        the saved EntityBean in view mode
      • cancelChange

        EntityBean cancelChange​(boolean hidden)
        Cancel changes by clicking "CancelChange" menu node.
        Parameters:
        hidden - whether this bean is hidden after changes are cancelled If hidden, this bean will not be usable.
        Returns:
        the EntityBean in view mode after changes are cancelled.
        Since:
        5.13
      • edit

        EntityBean edit()
        Make this bean in editing mode by clicking "Edit" menu node.
        Returns:
        this EntityBean in edit mode
      • delete

        void delete​(java.lang.String entityType,
                    java.lang.String entityName)
        Delete entity by clicking "Delete" menu node. entityType/entityName as the parameter value of delete confirm alert message.
        Parameters:
        entityType - entity type (not localized)
        entityName - entity name (localized)
      • delete

        void delete​(boolean confirmAlert,
                    boolean showSuccessMessage,
                    java.lang.String entityTypeAndName)
        Delete entity by clicking "Delete" menu node.
        Parameters:
        confirmAlert - whether confirming deletion alert will be shown
        showSuccessMessage - whether a successful message will be shown after deletion
        entityTypeAndName - the parameter value of confirm alert message and success message
        Since:
        5.20
      • goBackToListView

        default void goBackToListView()
        Go back to the entity list view from which this bean is navigated from.
        Since:
        5.17
      • selectAsValueOf

        default void selectAsValueOf​(EntityProperty entityProperty)
        Select the entity of this EntityBean as the value of the property. This bean is shown in the input dialog of the property. This method will wait until the input dialog is closed.
        Parameters:
        entityProperty - an EntityProperty
      • selectFormDesign

        EntityBean selectFormDesign​(java.lang.String formId)
        Select form design.
        Parameters:
        formId - the formId of the form design to be selected
        Returns:
        refreshed EntityBean with the new form design
      • selectFormDesign

        EntityBean selectFormDesign​(java.lang.String formId,
                                    java.lang.StringBuffer currentFormIdBuffer)
        Select form design.
        Parameters:
        formId - the formId of the form design to be selected
        currentFormIdBuffer - if not null, return the formId of current formDesign before change
        Returns:
        refreshed EntityBean with the new form design
        Since:
        5.14
      • createOrUpdateFormDesignFooter

        EntityBean createOrUpdateFormDesignFooter​(boolean showBarcode,
                                                  java.lang.String footerContent)
        Create or update the formDesign footer for the entityType of this EntityBean and current user locale. After it is created/updated, new entity view will be verified.
        Parameters:
        showBarcode - whether to show barcode
        footerContent - footer content HTML
        Returns:
        refreshed entityBean with the new footer
        Since:
        5.20
      • getPropertyTabView

        TabView getPropertyTabView()
        Get property tab view.
        Returns:
        TabView instance
      • getEntityProperties

        java.util.List<java.lang.String> getEntityProperties()
        Get the list of entity properties.
        Returns:
        property names
        Since:
        5.14
      • print

        void print​(boolean openPrintDialog)
        Print this bean. Show this bean in print view and optionally open platform print dialog.
        Parameters:
        openPrintDialog - whether to open platform print dialog
        Since:
        5.14
      • batchPrint

        void batchPrint​(int expectedPages,
                        int expectedEntities,
                        boolean openPrintDialog)
        Batch print: click printView if this bean is a batch print query form bean.
        Parameters:
        expectedPages - expected total number of pages to print
        expectedEntities - expected total number of entities to print
        openPrintDialog - whether to open platform print dialog
        Since:
        5.16
      • batchPrint

        default void batchPrint​(int expectedPages,
                                int expectedEntities)
        Batch print: click printView if this bean is a batch print query form bean. Whether to open platform print dialog can be configured in test.properties, default is false.
        Parameters:
        expectedPages - expected total number of pages to print
        expectedEntities - expected total number of entities to print
        Since:
        5.16
        See Also:
        Configurations.isPrintViewOpenPrintDialog()
      • getPayUtil

        PayUtil getPayUtil()
        Get payment util for payment processing.
        Returns:
        PayUtil instance
        Since:
        5.13
      • assertEquals

        default void assertEquals​(java.lang.String property,
                                  java.lang.Comparable expectedValue)
        Assert that the property value is the expected value.
        Parameters:
        property - property name
        expectedValue - expected property value
        Since:
        5.16
      • assertMatches

        default void assertMatches​(java.lang.String property,
                                   java.lang.String regularExpression)
        Assert that the property value matches the regular expression.
        Parameters:
        property - property name
        regularExpression - the regular expression to match property value
        Since:
        5.16
      • assertContains

        default void assertContains​(java.lang.String property,
                                    java.lang.String text)
        Assert that the property value contains the specified text.
        Parameters:
        property - property name
        Since:
        5.16
      • assertEquals

        default void assertEquals​(java.lang.String property,
                                  java.lang.Number expectedValue,
                                  java.text.NumberFormat numberFormat)
        Assert that the property value is the expected value.
        Parameters:
        property - property name
        expectedValue - expected property value
        numberFormat - the NumberFormat to format property value as string for comparison
        Since:
        5.16
      • assertEqualsAnother

        default void assertEqualsAnother​(java.lang.String property1,
                                         java.lang.String property2)
        Assert that one property value is equal to another property value.
        Parameters:
        property1 - property name
        property2 - the other property name to compare value with
        Since:
        5.16
      • assertPropertyNotFound

        default void assertPropertyNotFound​(java.lang.String property)
        Assert that the property is not found in this bean.
        Parameters:
        property - property name
        Since:
        5.16
      • assertPropertyFound

        default void assertPropertyFound​(java.lang.String property)
        Assert that the property is found in this bean.
        Parameters:
        property - property name
        Since:
        5.16
      • assertNotNull

        default void assertNotNull​(java.lang.String property)
        Assert that the property value is not null (not empty string)
        Parameters:
        property - property name
        Since:
        5.16
      • assertNull

        default void assertNull​(java.lang.String property)
        Assert that the property value is null (empty string)
        Parameters:
        property - property name
        Since:
        5.16
      • groupBy

        default void groupBy​(java.lang.String... properties)
        Group by the properties for query bean.
        Parameters:
        properties - a list of property names (can be name path)
        Since:
        5.20
      • orderBy

        default void orderBy​(EntityBean.OrderBy... orderByList)
        Order by for query bean.
        Parameters:
        orderByList - a list of orderBy(s)
        Since:
        5.20
      • setPageSizeForQueryResults

        default void setPageSizeForQueryResults​(int pageSize)
        Set the pageSize of the query results if this bean is a query bean.
        Since:
        5.20
      • search

        default EntityListBean search()
        Search for query bean.
        Returns:
        entity list bean as query results.
        Since:
        5.20