Class StructuredContentRuleImpl
java.lang.Object
org.broadleafcommerce.cms.structure.domain.StructuredContentRuleImpl
- All Implemented Interfaces:
Serializable
,StructuredContentRule
,MultiTenantCloneable<StructuredContentRule>
,ProfileEntity
,SimpleRule
@Entity
public class StructuredContentRuleImpl
extends Object
implements StructuredContentRule, ProfileEntity
- Author:
- jfischer
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionBuilds a copy of this content rule.<G extends StructuredContentRule>
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
-
StructuredContentRuleImpl
public StructuredContentRuleImpl()
-
-
Method Details
-
getId
Description copied from interface:StructuredContentRule
Gets the primary key.- Specified by:
getId
in interfaceStructuredContentRule
- Returns:
- the primary key
-
setId
Description copied from interface:StructuredContentRule
Sets the primary key.- Specified by:
setId
in interfaceStructuredContentRule
- Parameters:
id
- the new 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:StructuredContentRule
Builds a copy of this content rule. Used by the content management system when an item is edited.- Specified by:
cloneEntity
in interfaceStructuredContentRule
- Returns:
- a copy of this rule
-
createOrRetrieveCopyInstance
public <G extends StructuredContentRule> 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<StructuredContentRule>
- 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
-