コード例 #1
0
  @Override
  public List<AssetVocabulary> deleteVocabularies(
      long[] vocabularyIds, ServiceContext serviceContext) throws PortalException {

    List<AssetVocabulary> failedVocabularies = new ArrayList<>();

    for (long vocabularyId : vocabularyIds) {
      try {
        AssetVocabularyPermission.check(getPermissionChecker(), vocabularyId, ActionKeys.DELETE);

        assetVocabularyLocalService.deleteVocabulary(vocabularyId);
      } catch (PortalException pe) {
        if (serviceContext == null) {
          return null;
        }

        if (serviceContext.isFailOnPortalException()) {
          throw pe;
        }

        AssetVocabulary vocabulary = assetVocabularyPersistence.fetchByPrimaryKey(vocabularyId);

        if (vocabulary == null) {
          vocabulary = assetVocabularyPersistence.create(vocabularyId);
        }

        failedVocabularies.add(vocabulary);
      }
    }

    return failedVocabularies;
  }
コード例 #2
0
  @Override
  public AssetVocabulary getVocabulary(long vocabularyId) throws PortalException {

    AssetVocabularyPermission.check(getPermissionChecker(), vocabularyId, ActionKeys.VIEW);

    return assetVocabularyLocalService.getVocabulary(vocabularyId);
  }
コード例 #3
0
  @Override
  public AssetVocabulary updateVocabulary(
      long vocabularyId,
      String title,
      Map<Locale, String> titleMap,
      Map<Locale, String> descriptionMap,
      String settings,
      ServiceContext serviceContext)
      throws PortalException {

    AssetVocabularyPermission.check(getPermissionChecker(), vocabularyId, ActionKeys.UPDATE);

    return assetVocabularyLocalService.updateVocabulary(
        vocabularyId, title, titleMap, descriptionMap, settings, serviceContext);
  }
コード例 #4
0
  @Override
  public void deleteVocabulary(long vocabularyId) throws PortalException {
    AssetVocabularyPermission.check(getPermissionChecker(), vocabularyId, ActionKeys.DELETE);

    assetVocabularyLocalService.deleteVocabulary(vocabularyId);
  }