public static JSONObject toJSONObject(AssetTag model) {
    JSONObject jsonObject = JSONFactoryUtil.createJSONObject();

    jsonObject.put("tagId", model.getTagId());
    jsonObject.put("groupId", model.getGroupId());
    jsonObject.put("companyId", model.getCompanyId());
    jsonObject.put("userId", model.getUserId());
    jsonObject.put("userName", model.getUserName());

    Date createDate = model.getCreateDate();

    String createDateJSON = StringPool.BLANK;

    if (createDate != null) {
      createDateJSON = String.valueOf(createDate.getTime());
    }

    jsonObject.put("createDate", createDateJSON);

    Date modifiedDate = model.getModifiedDate();

    String modifiedDateJSON = StringPool.BLANK;

    if (modifiedDate != null) {
      modifiedDateJSON = String.valueOf(modifiedDate.getTime());
    }

    jsonObject.put("modifiedDate", modifiedDateJSON);
    jsonObject.put("name", model.getName());
    jsonObject.put("assetCount", model.getAssetCount());

    return jsonObject;
  }
Пример #2
0
  @Override
  public void addTagResources(AssetTag tag, String[] groupPermissions, String[] guestPermissions)
      throws PortalException, SystemException {

    resourceLocalService.addModelResources(
        tag.getCompanyId(),
        tag.getGroupId(),
        tag.getUserId(),
        AssetTag.class.getName(),
        tag.getTagId(),
        groupPermissions,
        guestPermissions);
  }
Пример #3
0
  @Override
  public void addTagResources(
      AssetTag tag, boolean addGroupPermissions, boolean addGuestPermissions)
      throws PortalException, SystemException {

    resourceLocalService.addResources(
        tag.getCompanyId(),
        tag.getGroupId(),
        tag.getUserId(),
        AssetTag.class.getName(),
        tag.getTagId(),
        false,
        addGroupPermissions,
        addGuestPermissions);
  }