Skip to content
Snippets Groups Projects
Commit 8a7790ca authored by Marcel Nellesen's avatar Marcel Nellesen
Browse files

Merge branch 'Topic/1202-pidApiExtension' into 'Product/1116-pidApiExtension'

Topic/1202 pid api extension

See merge request !62
parents cfec38f4 db4f11b4
Branches Product/1116-pidApiExtension
Tags
3 merge requests!66Product/1116 pid api extension,!65Sprint/2021 01,!62Topic/1202 pid api extension
......@@ -9,8 +9,8 @@ using System.Reflection;
[assembly: AssemblyDescription("Action.Tests is a part of the CoScInE group.")]
[assembly: AssemblyCompany("IT Center, RWTH Aachen University")]
[assembly: AssemblyProduct("Action.Tests")]
[assembly: AssemblyVersion("1.17.0")]
[assembly: AssemblyFileVersion("1.17.0")]
[assembly: AssemblyInformationalVersion("1.17.0-topic-1163-admin0001")]
[assembly: AssemblyCopyright("2020 IT Center, RWTH Aachen University")]
[assembly: AssemblyVersion("1.18.0")]
[assembly: AssemblyFileVersion("1.18.0")]
[assembly: AssemblyInformationalVersion("1.18.0-topic-1202-pidap0007")]
[assembly: AssemblyCopyright("2021 IT Center, RWTH Aachen University")]
......@@ -9,6 +9,7 @@ namespace Coscine.Action.EventArgs
public IConfiguration Configuration { get; set; }
public User Requester { get; set; }
public Resource Resource { get; set; }
public Project Project { get; set; }
public JObject Placeholder { get; set; }
public bool SentCopy { get; set; }
......
......@@ -17,11 +17,32 @@ namespace Coscine.Action.Implementations.PID
{
["Args"] = new JObject() { ["placeholder"] = pidEventArgs.Placeholder }
};
NotificationBusUtil.SendAsync(pidEventArgs.Configuration, "pid_contact", NotificationBusUtil.GetAllOwnersForResourceId(pidEventArgs.Resource.Id), NotificationBusUtil.GetProjectId(pidEventArgs.Resource.Id).ToString(), args);
if(pidEventArgs.SentCopy)
var users = new JArray();
string projectID = "";
string action = "";
// contacting owner of resource
if (pidEventArgs.Resource != null)
{
users = NotificationBusUtil.GetAllOwnersForResourceId(pidEventArgs.Resource.Id);
projectID = NotificationBusUtil.GetProjectId(pidEventArgs.Resource.Id).ToString();
action = "pid_contact_resource";
}
// contacting owner of project
else if (pidEventArgs.Project != null)
{
users = NotificationBusUtil.GetAllOwnersForProjectId(pidEventArgs.Project.Id);
projectID = pidEventArgs.Project.Id.ToString();
action = "pid_contact_project";
}
NotificationBusUtil.SendAsync(pidEventArgs.Configuration, action, users, projectID, args);
if (pidEventArgs.SentCopy)
{
NotificationBusUtil.SendAsync(pidEventArgs.Configuration, "pid_contact_requester", NotificationBusUtil.GetUserList(pidEventArgs.Requester), NotificationBusUtil.GetProjectId(pidEventArgs.Resource.Id).ToString(), args);
NotificationBusUtil.SendAsync(pidEventArgs.Configuration, "pid_contact_requester", NotificationBusUtil.GetUserList(pidEventArgs.Requester), projectID, args);
}
}
}
}
......
......@@ -9,8 +9,8 @@ using System.Reflection;
[assembly: AssemblyDescription("Action is a part of the CoScInE group.")]
[assembly: AssemblyCompany("IT Center, RWTH Aachen University")]
[assembly: AssemblyProduct("Action")]
[assembly: AssemblyVersion("1.17.0")]
[assembly: AssemblyFileVersion("1.17.0")]
[assembly: AssemblyInformationalVersion("1.17.0-topic-1163-admin0001")]
[assembly: AssemblyCopyright("2020 IT Center, RWTH Aachen University")]
[assembly: AssemblyVersion("1.18.0")]
[assembly: AssemblyFileVersion("1.18.0")]
[assembly: AssemblyInformationalVersion("1.18.0-topic-1202-pidap0007")]
[assembly: AssemblyCopyright("2021 IT Center, RWTH Aachen University")]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment