Package com.liferay.portal.kernel.json

Examples of com.liferay.portal.kernel.json.JSONObject


      DDMTemplateLocalServiceUtil.deleteTemplates(groupId);

      DDMStructureLocalServiceUtil.deleteStructures(groupId);
    }

    JSONObject jsonObject = getJSONObject(fileName);

    if (jsonObject != null) {
      JSONArray assetsJSONArray = jsonObject.getJSONArray("assets");

      setupAssets(assetsJSONArray);
    }

    addDLFileEntries(_DL_DOCUMENTS_DIR_NAME);
View Full Code Here


  protected void setupSettings(String fileName) throws Exception {
    if (targetClassName.equals(Group.class.getName())) {
      return;
    }

    JSONObject jsonObject = getJSONObject(fileName);

    if (jsonObject == null) {
      return;
    }

    LayoutSetPrototype layoutSetPrototype =
      LayoutSetPrototypeLocalServiceUtil.getLayoutSetPrototype(
        getTargetClassPK());

    String layoutSetPrototypeSettings = jsonObject.getString(
      "layoutSetPrototypeSettings", StringPool.BLANK);

    layoutSetPrototype.setSettings(layoutSetPrototypeSettings);

    LayoutSetPrototypeLocalServiceUtil.updateLayoutSetPrototype(
View Full Code Here

      groupId, true, new ServiceContext());

    LayoutLocalServiceUtil.deleteLayouts(
      groupId, false, new ServiceContext());

    JSONObject jsonObject = getJSONObject(fileName);

    if (jsonObject == null) {
      return;
    }

    _defaultLayoutTemplateId = jsonObject.getString(
      "layoutTemplateId", StringPool.BLANK);

    updateLayoutSetThemeId(jsonObject);

    JSONArray layoutsJSONArray = jsonObject.getJSONArray("layouts");

    if (layoutsJSONArray != null) {
      addLayouts(
        false, LayoutConstants.DEFAULT_PARENT_LAYOUT_ID,
        layoutsJSONArray);
    }
    else {
      JSONArray publicPagesJSONArray = jsonObject.getJSONArray(
        "publicPages");

      if (publicPagesJSONArray != null) {
        addLayouts(
          false, LayoutConstants.DEFAULT_PARENT_LAYOUT_ID,
          publicPagesJSONArray);
      }

      JSONArray privatePagesJSONArray = jsonObject.getJSONArray(
        "privatePages");

      if (privatePagesJSONArray != null) {
        addLayouts(
          true, LayoutConstants.DEFAULT_PARENT_LAYOUT_ID,
View Full Code Here

    if (!(response instanceof JSONObject)) {
      return null;
    }

    JSONObject ipInfoJSON = (JSONObject)response;

    if (ipInfoJSON == null) {
      return null;
    }

    String city = GetterUtil.getString(ipInfoJSON.getString("city"));
    String countryName = GetterUtil.getString(
      ipInfoJSON.getString("countryName"));
    String countryCode = GetterUtil.getString(
      ipInfoJSON.getString("countryCode"));
    float latitude = GetterUtil.getFloat(ipInfoJSON.getString("latitude"));
    float longitude = GetterUtil.getFloat(
      ipInfoJSON.getString("longitude"));
    String postalCode = GetterUtil.getString(
      ipInfoJSON.getString("postalCode"));
    String region = GetterUtil.getString(ipInfoJSON.getString("region"));

    IPInfo ipInfo = new IPInfo();

    ipInfo.setCity(city);
    ipInfo.setCountryCode(countryCode);
View Full Code Here

TOP

Related Classes of com.liferay.portal.kernel.json.JSONObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.