コード例 #1
0
  protected void deleteLayoutPrototypes(ActionRequest actionRequest) throws Exception {

    long[] layoutPrototypeIds =
        StringUtil.split(ParamUtil.getString(actionRequest, "layoutPrototypeIds"), 0L);

    for (long layoutPrototypeId : layoutPrototypeIds) {
      LayoutPrototypeServiceUtil.deleteLayoutPrototype(layoutPrototypeId);
    }
  }
コード例 #2
0
  protected void updateLayoutPrototype(ActionRequest actionRequest) throws Exception {

    long layoutPrototypeId = ParamUtil.getLong(actionRequest, "layoutPrototypeId");

    Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(actionRequest, "name");
    String description = ParamUtil.getString(actionRequest, "description");
    boolean active = ParamUtil.getBoolean(actionRequest, "active");

    if (layoutPrototypeId <= 0) {

      // Add layout prototoype

      LayoutPrototypeServiceUtil.addLayoutPrototype(nameMap, description, active);
    } else {

      // Update layout prototoype

      LayoutPrototypeServiceUtil.updateLayoutPrototype(
          layoutPrototypeId, nameMap, description, active);
    }
  }