Project 'andrew.cornell/nfa-pruning-analysis' was moved to 'katherine.cornell/nfa-pruning-analysis'. Please update any links and bookmarks that may still have the old path.
Select Git revision
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
ProjectController.cs 31.54 KiB
using Coscine.Action;
using Coscine.Action.EventArgs;
using Coscine.Action.Utils;
using Coscine.Api.Project.ParameterObjects;
using Coscine.ApiCommons;
using Coscine.Configuration;
using Coscine.Database.DataModel;
using Coscine.Database.Models;
using Coscine.Database.ReturnObjects;
using Coscine.Database.Util;
using Coscine.Logging;
using Coscine.Metadata;
using Coscine.ResourceTypes;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
namespace Coscine.Api.Project.Controllers
{
/// <summary>
/// This controller represents the actions which can be taken with a project object.
/// </summary>
[Authorize]
public class ProjectController : Controller
{
private readonly Authenticator _authenticator;
private readonly ProjectModel _projectModel;
private readonly IConfiguration _configuration;
private readonly Emitter _emitter;
private readonly ActivatedFeaturesModel _activatedFeaturesModel;
private readonly ProjectRoleModel _projectRoleModel;
private readonly ProjectQuotaModel _projectQuotaModel;
private readonly ResourceTypeModel _resourceTypeModel;
private readonly CoscineLogger _coscineLogger;
private readonly VisibilityModel _visibilityModel;
private readonly InvitationModel _invitationModel;
private readonly RoleModel _roleModel;
private readonly UserModel _userModel;
private readonly RdfStoreConnector _rdfStoreConnector;
/// <summary>
/// ProjectController constructor
/// </summary>
/// <param name="logger">Logger</param>
public ProjectController(ILogger<ProjectController> logger)
{
_authenticator = new Authenticator(this, Program.Configuration);
_configuration = Program.Configuration;
_projectModel = new ProjectModel();
_emitter = new Emitter(_configuration);
_activatedFeaturesModel = new ActivatedFeaturesModel();
_projectRoleModel = new ProjectRoleModel();
_resourceTypeModel = new ResourceTypeModel();
_projectQuotaModel = new ProjectQuotaModel();
_coscineLogger = new CoscineLogger(logger);
_visibilityModel = new VisibilityModel();
_rdfStoreConnector = new RdfStoreConnector(Program.Configuration.GetString("coscine/local/virtuoso/additional/url"));
_invitationModel = new InvitationModel();
_roleModel = new RoleModel();
_userModel = new UserModel();
}
/// <summary>
/// Returns all available projects (including sub projects)
/// </summary>
/// <returns>OK</returns>