@Override
  public Group disableTrash(Group group) {
    UnicodeProperties typeSettingsProperties = group.getParentLiveGroupTypeSettingsProperties();

    typeSettingsProperties.setProperty("trashEnabled", StringPool.FALSE);

    group.setTypeSettingsProperties(typeSettingsProperties);

    return GroupLocalServiceUtil.updateGroup(group);
  }
Beispiel #2
0
  @Override
  public boolean isTrashEnabled(Group group) {
    boolean companyTrashEnabled =
        PrefsPropsUtil.getBoolean(group.getCompanyId(), PropsKeys.TRASH_ENABLED);

    if (!companyTrashEnabled) {
      return false;
    }

    UnicodeProperties typeSettingsProperties = group.getParentLiveGroupTypeSettingsProperties();

    return GetterUtil.getBoolean(typeSettingsProperties.getProperty("trashEnabled"), true);
  }
Beispiel #3
0
  @Override
  public int getMaxAge(Group group) {
    int trashEntriesMaxAge =
        PrefsPropsUtil.getInteger(
            group.getCompanyId(),
            PropsKeys.TRASH_ENTRIES_MAX_AGE,
            PropsValues.TRASH_ENTRIES_MAX_AGE);

    UnicodeProperties typeSettingsProperties = group.getParentLiveGroupTypeSettingsProperties();

    return GetterUtil.getInteger(
        typeSettingsProperties.getProperty("trashEntriesMaxAge"), trashEntriesMaxAge);
  }
Beispiel #4
0
  public boolean isTrashEnabled(long groupId) throws PortalException, SystemException {

    Group group = GroupLocalServiceUtil.getGroup(groupId);

    UnicodeProperties typeSettingsProperties = group.getParentLiveGroupTypeSettingsProperties();

    boolean companyTrashEnabled =
        PrefsPropsUtil.getBoolean(group.getCompanyId(), PropsKeys.TRASH_ENABLED);

    if (!companyTrashEnabled) {
      return false;
    }

    return GetterUtil.getBoolean(typeSettingsProperties.getProperty("trashEnabled"), true);
  }
  @Override
  public UnicodeProperties getParentLiveGroupTypeSettingsProperties() {
    try {
      if (isLayout()) {
        Group parentGroup = GroupLocalServiceUtil.getGroup(getParentGroupId());

        return parentGroup.getParentLiveGroupTypeSettingsProperties();
      }

      if (isStagingGroup()) {
        Group liveGroup = getLiveGroup();

        return liveGroup.getTypeSettingsProperties();
      }
    } catch (Exception e) {
    }

    return getTypeSettingsProperties();
  }