コード例 #1
0
  public AssetCategory moveCategory(
      long categoryId, long parentCategoryId, long vocabularyId, ServiceContext serviceContext)
      throws PortalException, SystemException {

    AssetCategoryPermission.check(getPermissionChecker(), categoryId, ActionKeys.UPDATE);

    return assetCategoryLocalService.moveCategory(
        categoryId, parentCategoryId, vocabularyId, serviceContext);
  }
コード例 #2
0
  public void deleteCategories(long[] categoryIds) throws PortalException, SystemException {

    PermissionChecker permissionChecker = getPermissionChecker();

    for (long categoryId : categoryIds) {
      AssetCategory category = assetCategoryPersistence.fetchByPrimaryKey(categoryId);

      if (category == null) {
        continue;
      }

      AssetCategoryPermission.check(permissionChecker, categoryId, ActionKeys.DELETE);

      assetCategoryLocalService.deleteCategory(category);
    }
  }
コード例 #3
0
  public AssetCategory updateCategory(
      long categoryId,
      long parentCategoryId,
      Map<Locale, String> titleMap,
      Map<Locale, String> descriptionMap,
      long vocabularyId,
      String[] categoryProperties,
      ServiceContext serviceContext)
      throws PortalException, SystemException {

    AssetCategoryPermission.check(getPermissionChecker(), categoryId, ActionKeys.UPDATE);

    return assetCategoryLocalService.updateCategory(
        getUserId(),
        categoryId,
        parentCategoryId,
        titleMap,
        descriptionMap,
        vocabularyId,
        categoryProperties,
        serviceContext);
  }
コード例 #4
0
  public AssetCategory addCategory(
      long parentCategoryId,
      Map<Locale, String> titleMap,
      Map<Locale, String> descriptionMap,
      long vocabularyId,
      String[] categoryProperties,
      ServiceContext serviceContext)
      throws PortalException, SystemException {

    AssetCategoryPermission.check(
        getPermissionChecker(),
        serviceContext.getScopeGroupId(),
        parentCategoryId,
        ActionKeys.ADD_CATEGORY);

    return assetCategoryLocalService.addCategory(
        getUserId(),
        parentCategoryId,
        titleMap,
        descriptionMap,
        vocabularyId,
        categoryProperties,
        serviceContext);
  }
コード例 #5
0
  public void deleteCategory(long categoryId) throws PortalException, SystemException {

    AssetCategoryPermission.check(getPermissionChecker(), categoryId, ActionKeys.DELETE);

    assetCategoryLocalService.deleteCategory(categoryId);
  }
コード例 #6
0
  public AssetCategory getCategory(long categoryId) throws PortalException, SystemException {

    AssetCategoryPermission.check(getPermissionChecker(), categoryId, ActionKeys.VIEW);

    return assetCategoryLocalService.getCategory(categoryId);
  }