Commit ea7b5de8 authored by Benedikt Heinrichs's avatar Benedikt Heinrichs
Browse files

Merge branch 'Topic/1159-rtdApi' into 'Product/1154-resourceTypeDefinition'

New: Included resource type definition

See merge request coscine/api/project!114
parents 94de2aff fc5783fb
......@@ -68,11 +68,11 @@
<Reference Include="Coscine.Configuration, Version=1.5.0.0, Culture=neutral, PublicKeyToken=ce3d7a32d7dc1e5a, processorArchitecture=MSIL">
<HintPath>..\packages\Coscine.Configuration.1.5.0\lib\net461\Coscine.Configuration.dll</HintPath>
</Reference>
<Reference Include="Coscine.Database, Version=1.26.0.0, Culture=neutral, PublicKeyToken=767d77427707b70a, processorArchitecture=MSIL">
<HintPath>..\packages\Coscine.Database.1.26.0\lib\net461\Coscine.Database.dll</HintPath>
<Reference Include="Coscine.Database, Version=1.27.0.0, Culture=neutral, PublicKeyToken=767d77427707b70a, processorArchitecture=MSIL">
<HintPath>..\packages\Coscine.Database.1.27.0-topic-1159-rtdap0005\lib\net461\Coscine.Database.dll</HintPath>
</Reference>
<Reference Include="Coscine.Database.T4, Version=1.26.0.0, Culture=neutral, PublicKeyToken=84b4c404a0696261, processorArchitecture=MSIL">
<HintPath>..\packages\Coscine.Database.1.26.0\lib\net461\Coscine.Database.T4.dll</HintPath>
<Reference Include="Coscine.Database.T4, Version=1.27.0.0, Culture=neutral, PublicKeyToken=84b4c404a0696261, processorArchitecture=MSIL">
<HintPath>..\packages\Coscine.Database.1.27.0-topic-1159-rtdap0005\lib\net461\Coscine.Database.T4.dll</HintPath>
</Reference>
<Reference Include="Coscine.Logging, Version=1.2.0.0, Culture=neutral, PublicKeyToken=e1ed402bc3f6525e, processorArchitecture=MSIL">
<HintPath>..\packages\Coscine.Logging.1.2.0\lib\net461\Coscine.Logging.dll</HintPath>
......@@ -80,6 +80,15 @@
<Reference Include="Coscine.ProxyApi, Version=1.3.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Coscine.ProxyApi.1.3.0\lib\net461\Coscine.ProxyApi.dll</HintPath>
</Reference>
<Reference Include="Coscine.ResourceConfiguration, Version=1.3.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Coscine.ResourceConfiguration.1.3.0-topic-1159-rtdap0010\lib\net461\Coscine.ResourceConfiguration.dll</HintPath>
</Reference>
<Reference Include="Coscine.ResourceLoader, Version=1.2.0.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\Coscine.ResourceLoader.1.2.0-topic-1159-rtdap0012\lib\net461\Coscine.ResourceLoader.dll</HintPath>
</Reference>
<Reference Include="Coscine.ResourceTypeBase, Version=1.4.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Coscine.ResourceTypeBase.1.4.0-topic-1159-rtdap0013\lib\net461\Coscine.ResourceTypeBase.dll</HintPath>
</Reference>
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll</HintPath>
</Reference>
......
......@@ -88,7 +88,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Coscine.Database" publicKeyToken="767d77427707b70a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.26.0.0" newVersion="1.26.0.0" />
<bindingRedirect oldVersion="0.0.0.0-1.27.0.0" newVersion="1.27.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.IdentityModel.Tokens.Jwt" publicKeyToken="31bf3856ad364e35" culture="neutral" />
......@@ -192,7 +192,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Coscine.Database.T4" publicKeyToken="84b4c404a0696261" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.26.0.0" newVersion="1.26.0.0" />
<bindingRedirect oldVersion="0.0.0.0-1.27.0.0" newVersion="1.27.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
......
......@@ -7,9 +7,12 @@
<package id="Coscine.Action" version="1.16.0" targetFramework="net472" />
<package id="Coscine.ApiCommons" version="1.10.0" targetFramework="net472" />
<package id="Coscine.Configuration" version="1.5.0" targetFramework="net472" />
<package id="Coscine.Database" version="1.26.0" targetFramework="net472" />
<package id="Coscine.Database" version="1.27.0-topic-1159-rtdap0005" targetFramework="net472" />
<package id="Coscine.Logging" version="1.2.0" targetFramework="net472" />
<package id="Coscine.ProxyApi" version="1.3.0" targetFramework="net472" />
<package id="Coscine.ResourceConfiguration" version="1.3.0-topic-1159-rtdap0010" targetFramework="net472" />
<package id="Coscine.ResourceLoader" version="1.2.0-topic-1159-rtdap0012" targetFramework="net472" />
<package id="Coscine.ResourceTypeBase" version="1.4.0-topic-1159-rtdap0013" targetFramework="net472" />
<package id="EntityFramework" version="6.4.4" targetFramework="net472" />
<package id="HtmlAgilityPack" version="1.8.2" targetFramework="net472" />
<package id="linq2db" version="3.1.1" targetFramework="net472" />
......
......@@ -91,7 +91,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Coscine.Database" publicKeyToken="767d77427707b70a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.26.0.0" newVersion="1.26.0.0" />
<bindingRedirect oldVersion="0.0.0.0-1.27.0.0" newVersion="1.27.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.IdentityModel.Tokens.Jwt" publicKeyToken="31bf3856ad364e35" culture="neutral" />
......@@ -191,7 +191,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Coscine.Database.T4" publicKeyToken="84b4c404a0696261" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.26.0.0" newVersion="1.26.0.0" />
<bindingRedirect oldVersion="0.0.0.0-1.27.0.0" newVersion="1.27.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
......
using Coscine.Action;
using Coscine.Action.EventArgs;
using Coscine.Database.Models;
using Coscine.Database.ReturnObjects;
using Coscine.ApiCommons;
using Coscine.ApiCommons.Factories;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Linq;
using Coscine.Configuration;
using Microsoft.AspNetCore.Authorization;
using Coscine.Database.DataModel;
using Coscine.Database.Models;
using Coscine.Database.ReturnObjects;
using Coscine.Database.Util;
using Coscine.Logging;
using Coscine.Metadata;
using Coscine.ResourceLoader;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json.Linq;
using Coscine.Database.DataModel;
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using Coscine.Metadata;
using System.Linq;
namespace Coscine.Api.Project.Controllers
{
......@@ -243,11 +242,16 @@ namespace Coscine.Api.Project.Controllers
if (isHard)
{
var projectResourceModel = new ProjectResourceModel();
ResourceModel resourceModel = new ResourceModel();
var resourceModel = new ResourceModel();
var resourceTypeModel = new ResourceTypeModel();
foreach (var projectResource in projectResourceModel.GetAllWhere((projectResource) => projectResource.ProjectId == project.Id))
{
var resource = resourceModel.GetById(projectResource.ResourceId);
var resourceTypeOptions = resourceModel.GetResourceTypeOptions(projectResource.ResourceId);
var resourceTypeDefinition = ResourceTypeFactory.CreateResourceTypeObject(resourceTypeModel.GetById(resource.TypeId).DisplayName, _configuration);
resourceTypeDefinition.DeleteResource(projectResource.ResourceId.ToString(), resourceTypeOptions);
projectResourceModel.Delete(projectResource);
resourceModel.Delete(resourceModel.GetById(projectResource.ResourceId));
resourceModel.Delete(resource);
}
var projectRoleModel = new ProjectRoleModel();
......
......@@ -61,11 +61,11 @@
<Reference Include="Coscine.Configuration, Version=1.5.0.0, Culture=neutral, PublicKeyToken=ce3d7a32d7dc1e5a, processorArchitecture=MSIL">
<HintPath>..\packages\Coscine.Configuration.1.5.0\lib\net461\Coscine.Configuration.dll</HintPath>
</Reference>
<Reference Include="Coscine.Database, Version=1.26.0.0, Culture=neutral, PublicKeyToken=767d77427707b70a, processorArchitecture=MSIL">
<HintPath>..\packages\Coscine.Database.1.26.0\lib\net461\Coscine.Database.dll</HintPath>
<Reference Include="Coscine.Database, Version=1.27.0.0, Culture=neutral, PublicKeyToken=767d77427707b70a, processorArchitecture=MSIL">
<HintPath>..\packages\Coscine.Database.1.27.0-topic-1159-rtdap0005\lib\net461\Coscine.Database.dll</HintPath>
</Reference>
<Reference Include="Coscine.Database.T4, Version=1.26.0.0, Culture=neutral, PublicKeyToken=84b4c404a0696261, processorArchitecture=MSIL">
<HintPath>..\packages\Coscine.Database.1.26.0\lib\net461\Coscine.Database.T4.dll</HintPath>
<Reference Include="Coscine.Database.T4, Version=1.27.0.0, Culture=neutral, PublicKeyToken=84b4c404a0696261, processorArchitecture=MSIL">
<HintPath>..\packages\Coscine.Database.1.27.0-topic-1159-rtdap0005\lib\net461\Coscine.Database.T4.dll</HintPath>
</Reference>
<Reference Include="Coscine.Logging, Version=1.2.0.0, Culture=neutral, PublicKeyToken=e1ed402bc3f6525e, processorArchitecture=MSIL">
<HintPath>..\packages\Coscine.Logging.1.2.0\lib\net461\Coscine.Logging.dll</HintPath>
......@@ -76,6 +76,15 @@
<Reference Include="Coscine.ProxyApi, Version=1.3.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Coscine.ProxyApi.1.3.0\lib\net461\Coscine.ProxyApi.dll</HintPath>
</Reference>
<Reference Include="Coscine.ResourceConfiguration, Version=1.3.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Coscine.ResourceConfiguration.1.3.0-topic-1159-rtdap0010\lib\net461\Coscine.ResourceConfiguration.dll</HintPath>
</Reference>
<Reference Include="Coscine.ResourceLoader, Version=1.2.0.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\Coscine.ResourceLoader.1.2.0-topic-1159-rtdap0012\lib\net461\Coscine.ResourceLoader.dll</HintPath>
</Reference>
<Reference Include="Coscine.ResourceTypeBase, Version=1.4.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Coscine.ResourceTypeBase.1.4.0-topic-1159-rtdap0013\lib\net461\Coscine.ResourceTypeBase.dll</HintPath>
</Reference>
<Reference Include="dotNetRDF, Version=2.5.0.0, Culture=neutral, PublicKeyToken=6055ffe4c97cc780, processorArchitecture=MSIL">
<HintPath>..\packages\dotNetRDF.2.5.0\lib\net40\dotNetRDF.dll</HintPath>
</Reference>
......
......@@ -7,10 +7,13 @@
<package id="Coscine.Action" version="1.16.0" targetFramework="net472" />
<package id="Coscine.ApiCommons" version="1.10.0" targetFramework="net472" />
<package id="Coscine.Configuration" version="1.5.0" targetFramework="net472" />
<package id="Coscine.Database" version="1.26.0" targetFramework="net472" />
<package id="Coscine.Database" version="1.27.0-topic-1159-rtdap0005" targetFramework="net472" />
<package id="Coscine.Logging" version="1.2.0" targetFramework="net472" />
<package id="Coscine.Metadata" version="1.4.0" targetFramework="net472" />
<package id="Coscine.ProxyApi" version="1.3.0" targetFramework="net472" />
<package id="Coscine.ResourceConfiguration" version="1.3.0-topic-1159-rtdap0010" targetFramework="net472" />
<package id="Coscine.ResourceLoader" version="1.2.0-topic-1159-rtdap0012" targetFramework="net472" />
<package id="Coscine.ResourceTypeBase" version="1.4.0-topic-1159-rtdap0013" targetFramework="net472" />
<package id="dotNetRDF" version="2.5.0" targetFramework="net472" />
<package id="dotNetRDF.Data.Virtuoso" version="2.5.0" targetFramework="net472" />
<package id="EntityFramework" version="6.4.4" targetFramework="net472" />
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment