22
33import lombok .Getter ;
44
5- import static com .sdl .webapp .common .api .model .mvcdata .DefaultsMvcData .CoreAreaConstants .CORE_AREA_NAME ;
6- import static com .sdl .webapp .common .api .model .mvcdata .DefaultsMvcData .CoreAreaConstants .ENTITY_ACTION_NAME ;
7- import static com .sdl .webapp .common .api .model .mvcdata .DefaultsMvcData .CoreAreaConstants .ENTITY_CONTROLLER_NAME ;
8- import static com .sdl .webapp .common .api .model .mvcdata .DefaultsMvcData .CoreAreaConstants .ERROR_ACTION_NAME ;
9- import static com .sdl .webapp .common .api .model .mvcdata .DefaultsMvcData .CoreAreaConstants .ERROR_CONTROLLER_NAME ;
10- import static com .sdl .webapp .common .api .model .mvcdata .DefaultsMvcData .CoreAreaConstants .PAGE_ACTION_NAME ;
11- import static com .sdl .webapp .common .api .model .mvcdata .DefaultsMvcData .CoreAreaConstants .PAGE_CONTROLLER_NAME ;
12- import static com .sdl .webapp .common .api .model .mvcdata .DefaultsMvcData .CoreAreaConstants .REGION_ACTION_NAME ;
13- import static com .sdl .webapp .common .api .model .mvcdata .DefaultsMvcData .CoreAreaConstants .REGION_CONTROLLER_NAME ;
14- import static com .sdl .webapp .common .api .model .mvcdata .DefaultsMvcData .CoreAreaConstants .SHARED_AREA_NAME ;
5+ import static com .sdl .webapp .common .controller .ControllerUtils .FRAMEWORK_CONTROLLER_MAPPING ;
6+ import static com .sdl .webapp .common .util .InitializationUtils .getConfiguration ;
157
168@ Getter
17- /**
18- * <p>DefaultsMvcData class.</p>
19- */
209public enum DefaultsMvcData {
2110
22- CORE_ENTITY ("Core" , CORE_AREA_NAME , ENTITY_CONTROLLER_NAME , ENTITY_ACTION_NAME ),
11+ CORE_ENTITY (FRAMEWORK_CONTROLLER_MAPPING , getDefaultAreaName (), "Entity" , "Entity" ),
2312
24- CORE_PAGE ("Core" , CORE_AREA_NAME , PAGE_CONTROLLER_NAME , PAGE_ACTION_NAME ),
13+ CORE_PAGE (FRAMEWORK_CONTROLLER_MAPPING , getDefaultAreaName (), "Page" , "Page" ),
2514
26- CORE_REGION ("Core" , CORE_AREA_NAME , REGION_CONTROLLER_NAME , REGION_ACTION_NAME ),
15+ CORE_REGION (FRAMEWORK_CONTROLLER_MAPPING , getDefaultAreaName (), "Region" , "Region" ),
2716
28- ERROR_ENTITY ("Shared" , SHARED_AREA_NAME , ERROR_CONTROLLER_NAME , ERROR_ACTION_NAME );
17+ ERROR_ENTITY ("Shared" , "Shared" , "Error" , "Entity" );
2918
3019 private String controllerAreaName ;
20+
3121 private String controllerName ;
22+
3223 private String actionName ;
24+
3325 private String areaName ;
3426
3527 DefaultsMvcData (String controllerAreaName , String areaName , String controllerName , String actionName ) {
@@ -39,28 +31,50 @@ public enum DefaultsMvcData {
3931 this .actionName = actionName ;
4032 }
4133
42- public interface CoreAreaConstants {
43- String CORE_AREA_NAME = "Core" ;
44-
45- String SHARED_AREA_NAME = "Shared" ;
46-
47- String PAGE_CONTROLLER_NAME = "Page" ;
48- String PAGE_ACTION_NAME = "Page" ;
4934
50- String REGION_CONTROLLER_NAME = "Region" ;
51- String REGION_ACTION_NAME = "Region" ;
35+ /**
36+ * Returns the pre-configured area name with defaults to {@code Core}.
37+ *
38+ * @return pre-configured area name or default name
39+ */
40+ public static String getDefaultAreaName () {
41+ return getConfiguration ("dxa.web.default.area.name" , "Core" );
42+ }
5243
53- String ENTITY_CONTROLLER_NAME = "Entity" ;
54- String ENTITY_ACTION_NAME = "Entity" ;
44+ /**
45+ * Returns the pre-configured region name with defaults to {@code Main}.
46+ *
47+ * @return pre-configured region name or default name
48+ */
49+ public static String getDefaultRegionName () {
50+ return getConfiguration ("dxa.web.default.region.name" , "Main" );
51+ }
5552
56- String LIST_CONTROLLER_NAME = "List" ;
57- String LIST_ACTION_NAME = "List" ;
53+ /**
54+ * Returns the pre-configured controller name with defaults to {@code Entity}.
55+ *
56+ * @return pre-configured controller name or default name
57+ */
58+ public static String getDefaultControllerName () {
59+ return getConfiguration ("dxa.web.default.controller.name" , "Entity" );
60+ }
5861
59- String ERROR_CONTROLLER_NAME = "Error" ;
60- String ERROR_ACTION_NAME = "Entity" ;
62+ /**
63+ * Returns the pre-configured controller area name with defaults to {@code Core}.
64+ *
65+ * @return pre-configured controller area name or default name
66+ */
67+ public static String getDefaultControllerAreaName () {
68+ return getConfiguration ("dxa.web.default.controller.area.name" , "Core" );
69+ }
6170
62- String NAVIGATION_CONTROLLER_NAME = "Navigation" ;
63- String NAVIGATION_ACTION_NAME = "Navigation" ;
64- String SITEMAP_ACTION_NAME = "SiteMap" ;
71+ /**
72+ * Returns the pre-configured action name with defaults to {@code Entity}.
73+ *
74+ * @return pre-configured action name or default name
75+ */
76+ public static String getDefaultActionName () {
77+ return getConfiguration ("dxa.web.default.action.name" , "Entity" );
6578 }
79+
6680}
0 commit comments