1.1.0 to 1.2.0 Migration
This module upgrade requires at least Broadleaf 4.0.0-GA
What's changed?
- Refactored Collections to Support Multi-Tenant
- Updated Advanced Offer Management through BLC Admin
- Added new module applicationContext reference files so that applicationContexts can be automatically pulled into web.xml
Migration
In your application's pom.xml, change the version for broadleaf-advanced-offer
to 1.2.0-GA
Application Context Registration
As of Broadleaf 4.0, each BLC module's application contexts do not need to be manually listed in your project's admin/web.xml
or site/web.xml
. Instead, the module's application context registration will be done automatically. See the Broadleaf 4.0 migration notes for further details.
Database Changes
Updated Load Script
load_advanced_offer_admin_security.sql
Note: if you are using Hibernate 'create' ddl you can add this file to the list of SQL import files in
development-shared.properties
in order to automatically import this\
------------------------
-- Offer Code Generation
------------------------
-- OCG - Entity Permissions
insert into BLC_ADMIN_PERMISSION (ADMIN_PERMISSION_ID, DESCRIPTION, NAME, PERMISSION_TYPE, IS_FRIENDLY) values (-14001, 'All Content Targeter', 'PERMISSION_ALL_OFFER_CODE_GEN', 'ALL', FALSE);
insert into BLC_ADMIN_PERMISSION (ADMIN_PERMISSION_ID, DESCRIPTION, NAME, PERMISSION_TYPE, IS_FRIENDLY) values (-14002, 'Read Content Targeter', 'PERMISSION_READ_OFFER_CODE_GEN', 'READ', FALSE);
insert into BLC_ADMIN_PERMISSION_ENTITY (ADMIN_PERMISSION_ENTITY_ID, CEILING_ENTITY, ADMIN_PERMISSION_ID) values (-14001, 'com.broadleafcommerce.advancedoffer.codes.domain.OfferCodeGenerationInfo', -14001);
insert into BLC_ADMIN_PERMISSION_ENTITY (ADMIN_PERMISSION_ENTITY_ID, CEILING_ENTITY, ADMIN_PERMISSION_ID) values (-14002, 'com.broadleafcommerce.advancedoffer.codes.domain.OfferCodeGenerationInfo', -14002);
-- OCG - Friendly Permissions
INSERT INTO BLC_ADMIN_PERMISSION (ADMIN_PERMISSION_ID, DESCRIPTION, NAME, PERMISSION_TYPE, IS_FRIENDLY) VALUES (-14101,'Generate Offer Codes','PERMISSION_OFFER_CODE_GENERATION', 'ALL', TRUE);
INSERT INTO BLC_ADMIN_PERMISSION (ADMIN_PERMISSION_ID, DESCRIPTION, NAME, PERMISSION_TYPE, IS_FRIENDLY) VALUES (-14102,'View Offer Code Generation Data','PERMISSION_OFFER_CODE_GENERATION', 'READ', TRUE);
-- OCG - Friendly Permission to Entity Permission Mappings (OCG + Offer)
INSERT INTO BLC_ADMIN_PERMISSION_XREF (ADMIN_PERMISSION_ID, CHILD_PERMISSION_ID) VALUES (-14101, -14001);
INSERT INTO BLC_ADMIN_PERMISSION_XREF (ADMIN_PERMISSION_ID, CHILD_PERMISSION_ID) VALUES (-14101, -10);
INSERT INTO BLC_ADMIN_PERMISSION_XREF (ADMIN_PERMISSION_ID, CHILD_PERMISSION_ID) VALUES (-14102, -14002);
INSERT INTO BLC_ADMIN_PERMISSION_XREF (ADMIN_PERMISSION_ID, CHILD_PERMISSION_ID) VALUES (-14102, -10);
-- OCG - Existing Offer screen can also see the related OCG items
INSERT INTO BLC_ADMIN_PERMISSION_ENTITY (ADMIN_PERMISSION_ENTITY_ID, CEILING_ENTITY, ADMIN_PERMISSION_ID) VALUES (-14101, 'com.broadleafcommerce.advancedoffer.codes.domain.OfferCodeGenerationInfo', -10);
INSERT INTO BLC_ADMIN_PERMISSION_ENTITY (ADMIN_PERMISSION_ENTITY_ID, CEILING_ENTITY, ADMIN_PERMISSION_ID) VALUES (-14102, 'com.broadleafcommerce.advancedoffer.codes.domain.OfferCodeGenerationInfo', -11);
-- OCG - New Menu Item For Generate Offer Codes
INSERT INTO BLC_ADMIN_SECTION (ADMIN_SECTION_ID, CEILING_ENTITY, ADMIN_MODULE_ID, NAME, SECTION_KEY, URL, USE_DEFAULT_HANDLER, DISPLAY_ORDER) VALUES (-14001, 'com.broadleafcommerce.advancedoffer.codes.domain.OfferCodeGenerationInfo', -8, 'Generate Codes', 'OfferCodeGenerator', '/offer-code-generation', TRUE, 2000);
-- Permissions to menu mapping
INSERT INTO BLC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-14001,-14101);
INSERT INTO BLC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-14001,-14102);
-- Site Admins and Catalog Managers can create codes
INSERT INTO BLC_ADMIN_ROLE_PERMISSION_XREF (ADMIN_ROLE_ID, ADMIN_PERMISSION_ID) VALUES (-1,-14101);
INSERT INTO BLC_ADMIN_ROLE_PERMISSION_XREF (ADMIN_ROLE_ID, ADMIN_PERMISSION_ID) VALUES (-2,-14101);