Class PageRuleImpl
java.lang.Object
org.broadleafcommerce.cms.page.domain.PageRuleImpl
- All Implemented Interfaces:
Serializable
,PageRule
,MultiTenantCloneable<PageRule>
,ProfileEntity
,SimpleRule
- Author:
- bpolster
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionBuilds a copy of this content rule.<G extends PageRule>
CreateResponse<G>Clone this entity for the purpose of multiple tenancy.boolean
getId()
Gets the primary key.The rule in the form of an MVEL expressionint
hashCode()
void
Sets the primary key.void
setMatchRule
(String matchRule) Sets the match rule used to test this item.
-
Field Details
-
id
-
matchRule
-
-
Constructor Details
-
PageRuleImpl
public PageRuleImpl()
-
-
Method Details
-
getId
Description copied from interface:PageRule
Gets the primary key. -
setId
Description copied from interface:PageRule
Sets the primary key. -
getMatchRule
Description copied from interface:SimpleRule
The rule in the form of an MVEL expression- Specified by:
getMatchRule
in interfaceSimpleRule
- Returns:
- the rule as an MVEL string
-
setMatchRule
Description copied from interface:SimpleRule
Sets the match rule used to test this item.- Specified by:
setMatchRule
in interfaceSimpleRule
- Parameters:
matchRule
- the rule as an MVEL string
-
hashCode
public int hashCode() -
equals
-
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 interfacePageRule
- 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();
Support should also be added for @Embeddable classes that contribute fields (collections or basic) to a cloneable entity://copy extended field values on myClone here
return createResponse; }
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 interfaceMultiTenantCloneable<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
-