Class PageRuleImpl

java.lang.Object
org.broadleafcommerce.cms.page.domain.PageRuleImpl
All Implemented Interfaces:
Serializable, PageRule, MultiTenantCloneable<PageRule>, ProfileEntity, SimpleRule

@Entity public class PageRuleImpl extends Object implements PageRule, ProfileEntity
Author:
bpolster
See Also:
  • Field Details

    • id

      protected Long id
    • matchRule

      protected String matchRule
  • Constructor Details

    • PageRuleImpl

      public PageRuleImpl()
  • Method Details

    • getId

      public Long getId()
      Description copied from interface: PageRule
      Gets the primary key.
      Specified by:
      getId in interface PageRule
      Returns:
      the primary key
    • setId

      public void setId(Long id)
      Description copied from interface: PageRule
      Sets the primary key.
      Specified by:
      setId in interface PageRule
      Parameters:
      id - the new primary key
    • getMatchRule

      public String getMatchRule()
      Description copied from interface: SimpleRule
      The rule in the form of an MVEL expression
      Specified by:
      getMatchRule in interface SimpleRule
      Returns:
      the rule as an MVEL string
    • setMatchRule

      public void setMatchRule(String matchRule)
      Description copied from interface: SimpleRule
      Sets the match rule used to test this item.
      Specified by:
      setMatchRule in interface SimpleRule
      Parameters:
      matchRule - the rule as an MVEL string
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • cloneEntity

      public PageRule cloneEntity()
      Description copied from interface: PageRule
      Builds a copy of this content rule. Used by the content management system when an item is edited.
      Specified by:
      cloneEntity in interface PageRule
      Returns:
      a copy of this rule
    • createOrRetrieveCopyInstance

      public <G extends PageRule> CreateResponse<G> createOrRetrieveCopyInstance(MultiTenantCopyContext context) throws CloneNotSupportedException
      Description copied from interface: MultiTenantCloneable
      Clone this entity for the purpose of multiple tenancy. Note, extending classes should follow this pattern:

      public CreateResponse<MyClass> createOrRetrieveCopyInstance(MultiTenantCopyContext context) throws CloneNotSupportedException { CreateResponse<MyClass> createResponse = super.createOrRetrieveCopyInstance(context); if (createResponse.isAlreadyPopulated()) { return createResponse; } MyClass myClone = createResponse.getClone();

      //copy extended field values on myClone here

      return createResponse; }

      Support should also be added for @Embeddable classes that contribute fields (collections or basic) to a cloneable entity:

      public CreateResponse<G extends MyClass> createOrRetrieveCopyInstance(MultiTenantCopyContext context) throws CloneNotSupportedException { CreateResponse createResponse = context.createOrRetrieveCopyInstance(this); MyClass myClone = createResponse.getClone();

      //copy extended field values on myClone here

      return createResponse; }

      Specified by:
      createOrRetrieveCopyInstance in interface MultiTenantCloneable<PageRule>
      Parameters:
      context - a context object providing persistence and library functionality for copying entities
      Returns:
      the resulting copy container, possibly already persisted
      Throws:
      CloneNotSupportedException - if there's a problem detected with the cloning configuration