@@ -258,8 +258,9 @@ private JSONArray createDynamicUserFunctionalitiesMenu(List filteredMenuList, Lo
258258 // Create custom Menu elements (menu defined by the users)
259259
260260 menuUserList = createUserMenuElement (filteredMenuList , menuElem , locale , 1 , menuUserList );
261- if (menuUserList .length () > 0 )
261+ if (menuUserList .length () > 0 ) {
262262 tempFirstLevelMenuList .put (menuUserList .get (0 ));
263+ }
263264
264265 if (menuElem .getHasChildren ()) {
265266 List lstChildrenLev2 = menuElem .getLstChildren ();
@@ -273,9 +274,9 @@ private JSONArray createDynamicUserFunctionalitiesMenu(List filteredMenuList, Lo
273274 temp .put (ICON_CLS , menuElem .getIconCls ());
274275
275276 String text = "" ;
276- if (!menuElem .isAdminsMenu () || !menuElem .getName ().startsWith ("#" ))
277+ if (!menuElem .isAdminsMenu () || !menuElem .getName ().startsWith ("#" )) {
277278 text = menuElem .getName ();
278- else {
279+ } else {
279280 if (menuElem .getName ().startsWith ("#" )) {
280281 String titleCode = menuElem .getName ().substring (1 );
281282 text = msgBuild .getMessage (titleCode , locale );
@@ -410,25 +411,30 @@ private JSONArray createItemsArray(Locale locale, MessageBuilder messageBuilder,
410411 if (isAbleTo (reqFunc [i ], funcs )) {
411412 addElement = isGroupItemToAdd (itemSB );
412413 }
413- if (addElement )
414+ if (addElement ) {
414415 break ;
416+ }
415417 }
416418 }
417419
418- if (addElement )
420+ if (addElement ) {
419421 addElement &= isUserMenuAuthorized (menuType , itemSB );
422+ }
420423
421- if (addElement )
424+ if (addElement ) {
422425 addElement &= isUserMenuForNotAdmin (menuType , itemSB );
426+ }
423427
424- if (addElement )
428+ if (addElement ) {
425429 addElement &= isMenuForKnowageCurrentType (menuType , itemSB );
430+ }
426431
427432 if (addElement ) {
428433 JSONObject menu = createMenuNode (locale , messageBuilder , itemSB , menuType );
429434 items .put (menu );
430- if (menuType == MenuType .TECHNICAL_USER_FUNCTIONALITIES )
435+ if (menuType == MenuType .TECHNICAL_USER_FUNCTIONALITIES ) {
431436 technicalUserMenuIds .add (Integer .valueOf ((String ) itemSB .getAttribute (ID )));
437+ }
432438 }
433439 }
434440
@@ -466,11 +472,13 @@ private boolean isUserMenuAuthorized(MenuType menuType, SourceBean itemSB) throw
466472
467473 isAuthorized = associatedAuthRoles .stream ().anyMatch (x -> x .getSbiAuthorizations ().getName ().equals (lic ));
468474 }
469- if (isAuthorized )
475+ if (isAuthorized ) {
470476 break ;
477+ }
471478 }
472- if (isAuthorized )
479+ if (isAuthorized ) {
473480 break ;
481+ }
474482
475483 }
476484 }
@@ -530,14 +538,16 @@ private boolean isMenuForKnowageCurrentType(MenuType menuType, SourceBean itemSB
530538 if (menuType == MenuType .TECHNICAL_USER_FUNCTIONALITIES ) {
531539 if (technicalMenuCommunityOrEnterprise .containsKey (menuId )) {
532540 isToAdd = !isEnterpriseEdition ();
533- if (!isToAdd )
541+ if (!isToAdd ) {
534542 return false ;
543+ }
535544 }
536545
537546 if (technicalMenuCommunityOrEnterprise .containsValue (menuId )) {
538547 isToAdd = isEnterpriseEdition ();
539- if (!isToAdd )
548+ if (!isToAdd ) {
540549 return false ;
550+ }
541551 }
542552 }
543553 }
@@ -582,8 +592,9 @@ private boolean isGroupItemToAdd(SourceBean itemSB) {
582592 List <String > activeProducts = (List <String >) getActiveProductsMethod .invoke (productProfilerEE );
583593 for (String lic : requiredLicenses ) {
584594 isLicensed = activeProducts .contains (lic );
585- if (isLicensed )
595+ if (isLicensed ) {
586596 break ;
597+ }
587598 }
588599 } catch (Exception e ) {
589600 isLicensed = false ;
@@ -679,8 +690,9 @@ private JSONObject createMenuNode(Locale locale, MessageBuilder messageBuilder,
679690 for (Object objAttribute : containedAttributes ) {
680691 SourceBeanAttribute attribute = (SourceBeanAttribute ) objAttribute ;
681692
682- if (isAttributeToIgnore (attribute ))
693+ if (isAttributeToIgnore (attribute )) {
683694 continue ;
695+ }
684696 String value = String .valueOf (attribute .getValue ());
685697 String key = attribute .getKey ();
686698 if (!key .equals (ITEM ) && StringUtils .isNotBlank (value )) {
@@ -732,9 +744,9 @@ private JSONArray createUserMenuElement(List filteredMenuList, Menu childElem, L
732744 }
733745
734746 /* TEXT PROPERTY HANDLING */
735- if (!childElem .isAdminsMenu () || !childElem .getName ().startsWith ("#" ))
747+ if (!childElem .isAdminsMenu () || !childElem .getName ().startsWith ("#" )) {
736748 text = childElem .getName ();
737- else {
749+ } else {
738750 if (childElem .getName ().startsWith ("#" )) {
739751 String titleCode = childElem .getName ().substring (1 );
740752
@@ -772,9 +784,9 @@ private JSONArray createUserMenuElement(List filteredMenuList, Menu childElem, L
772784
773785 /* DESCR PROPERTY HANDLING */
774786 String descr = "" ;
775- if (!childElem .isAdminsMenu () || !childElem .getName ().startsWith ("#" ))
787+ if (!childElem .isAdminsMenu () || !childElem .getName ().startsWith ("#" )) {
776788 descr = childElem .getDescr ();
777- else if (childElem .getName ().startsWith ("#" )) {
789+ } else if (childElem .getName ().startsWith ("#" )) {
778790// String titleCode = childElem.getDescr().substring(1);
779791//
780792// try {
@@ -889,7 +901,7 @@ private void setPropertiesForFunctionalityMenu(Menu childElem, JSONObject temp2,
889901 }
890902
891903 private void setPropertiesForStaticMenu (Menu childElem , JSONObject temp2 , String path ) throws JSONException {
892- temp2 .put (TO , contextName + "/servlet/AdapterHTTP?ACTION_NAME=READ_HTML_FILE&MENU_ID =" + childElem .getMenuId ());
904+ temp2 .put (TO , "/html?id =" + childElem .getMenuId ());
893905 }
894906
895907 public IEngUserProfile getUserProfile () {
0 commit comments