Skip to content

Commit

Permalink
Revert "LPS-199722 Inline"
Browse files Browse the repository at this point in the history
This reverts commit b56dd7d.
  • Loading branch information
brianchandotcom committed Nov 2, 2023
1 parent 7ce6459 commit cc05f4d
Showing 1 changed file with 17 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
*/
public class LayoutStructure {

public static LayoutStructure of(String layoutStructure) throws Exception {
public static LayoutStructure of(String layoutStructure) {
if (Validator.isNull(layoutStructure)) {
return new LayoutStructure();
}
Expand Down Expand Up @@ -105,14 +105,26 @@ public static LayoutStructure of(String layoutStructure) throws Exception {
deletedLayoutStructureItem);
});

List<LayoutStructureRule> layoutStructureRules = new ArrayList<>();

JSONArray layoutStructureRulesJSONArray =
layoutStructureJSONObject.getJSONArray("pageRules");

if (!JSONUtil.isEmpty(layoutStructureRulesJSONArray)) {
for (int i = 0; i < layoutStructureRulesJSONArray.length();
i++) {

layoutStructureRules.add(
LayoutStructureRule.of(
layoutStructureRulesJSONArray.getJSONObject(i)));
}
}

return new LayoutStructure(
collectionStyledLayoutStructureItems, deletedItemIds,
deletedLayoutStructureItems, deletedPortletIds,
formStyledLayoutStructureItems, fragmentLayoutStructureItems,
layoutStructureItems,
JSONUtil.toList(
layoutStructureJSONObject.getJSONArray("pageRules"),
jsonObject -> LayoutStructureRule.of(jsonObject)),
layoutStructureItems, layoutStructureRules,
rootItemsJSONObject.getString("main"));
}
catch (JSONException jsonException) {
Expand Down

0 comments on commit cc05f4d

Please sign in to comment.