Page 1 of 1

RuleIdentifier in AdminPresentationFieldMap

Posted: Mon Apr 21, 2014 2:06 am
by nanix84
Hi guys,

I would like to have a custom rule for the ruleIdentifier. How would I do that?
Is there a documentation for this?

Thanks

Re: RuleIdentifier in AdminPresentationFieldMap

Posted: Tue Apr 22, 2014 12:19 pm
by phillipuniverse
You're going to need to be more specific on what you're trying to do.

Re: RuleIdentifier in AdminPresentationFieldMap

Posted: Tue Apr 22, 2014 9:18 pm
by nanix84
Sorry for not being clear, here's what I have so far.

Code: Select all

    @ManyToMany(targetEntity = StructuredContentRuleImpl.class, cascade = {CascadeType.ALL})
    @JoinTable(name = "BLC_SC_RULE_MAP", inverseJoinColumns = @JoinColumn(name = "SC_RULE_ID", referencedColumnName = "SC_RULE_ID"))
    @Cascade(value={org.hibernate.annotations.CascadeType.ALL, org.hibernate.annotations.CascadeType.DELETE_ORPHAN})
    @MapKeyColumn(name = "MAP_KEY", nullable = false)
    @AdminPresentationMapFields(
        mapDisplayFields = {
            @AdminPresentationMapField(
                fieldName = RuleIdentifier.CUSTOMER_FIELD_KEY,
                fieldPresentation = @AdminPresentation(fieldType = SupportedFieldType.RULE_SIMPLE, order = 1,
                    tab = Presentation.Tab.Name.Rules, tabOrder = Presentation.Tab.Order.Rules,
                    group = Presentation.Group.Name.General, groupOrder = Presentation.Group.Order.General,
                    ruleIdentifier = RuleIdentifier.CUSTOMER, friendlyName = "Generic_TCCustomer_Rule")
            ),
            @AdminPresentationMapField(
                fieldName = RuleIdentifier.[b]MY CUSTOM FIELD NAME[/b],
                fieldPresentation = @AdminPresentation(fieldType = SupportedFieldType.RULE_SIMPLE, order = 2,
                    tab = Presentation.Tab.Name.Rules, tabOrder = Presentation.Tab.Order.Rules,
                    group = Presentation.Group.Name.General, groupOrder = Presentation.Group.Order.General,
                    ruleIdentifier = RuleIdentifier.[b]MY ENTITY CONTEXT[/b], friendlyName = "Generic_MyOwnEntity_Rule")
            )
        }
    )
    Map<String, StructuredContentRule> structuredContentMatchRules = new HashMap<String, StructuredContentRule>();

I need to create a rule matching based on my newly created entity fields

And im also confused on how I can implement the rule matching.. for example the customer fields
And how to create StructuredContent Processors. Im currently looking at the StructuredContentCartRuleProcessor