Skip to content

Commit

Permalink
Merge pull request #169 from CSCfi/CSCTTV-4052-jufo_class_code_frozen…
Browse files Browse the repository at this point in the history
…-dim_publication_channel_id_frozen

CSCTTV-4052  Add jufoCodeRecorded and jufoClassCodeRecorded
  • Loading branch information
sarkikos authored Nov 29, 2024
2 parents c2abead + d5dc0af commit 4f65517
Show file tree
Hide file tree
Showing 12 changed files with 166 additions and 82 deletions.
12 changes: 12 additions & 0 deletions aspnetcore/src/ApiModels/Publication/Publication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,18 @@ public class Publication
/// </summary>
public JufoClass? JufoClass { get; set; }

/// <summary>
/// Publication forum (recorded)
/// </summary>
public string? JufoCodeRecorded { get; set; }

/// <summary>
/// Publication forum classification (recorded)
///
/// http://uri.suomi.fi/codelist/research/julkaisufoorumiluokitus
/// </summary>
public JufoClass? jufoClassRecorded { get; set; }

/// <summary>
/// DOI
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,17 @@ public class GetPublicationsQueryParameters
public string? PublisherName { get; set; }

/// <summary>
/// The field jufocode contains text.
/// The field jufoCode contains text.
/// </summary>
/// <see cref="Publication.JufoCode"/>
public string? JufoCode { get; set; }

/// <summary>
/// The field jufoCodeRecorded contains text.
/// </summary>
/// <see cref="Publication.JufoCodeRecorded"/>
public string? JufoCodeRecorded { get; set; }

/// <summary>
/// The field doi is exactly equal to the text.
/// </summary>
Expand Down
170 changes: 91 additions & 79 deletions aspnetcore/src/DatabaseContext/ApiDbContext.cs

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions aspnetcore/src/DatabaseContext/Entities/DimPublication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ public partial class DimPublication

public int? DimPublicationId { get; set; }

public int JufoClassCodeFrozen { get; set; }

public int DimPublicationChannelIdFrozen { get; set; }

public virtual DimReferencedatum? ArticleTypeCodeNavigation { get; set; }

public virtual ICollection<DimLocallyReportedPubInfo> DimLocallyReportedPubInfos { get; set; } = new List<DimLocallyReportedPubInfo>();
Expand All @@ -131,6 +135,8 @@ public partial class DimPublication

public virtual DimPublicationChannel DimPublicationChannel { get; set; } = null!;

public virtual DimPublicationChannel DimPublicationChannelIdFrozenNavigation { get; set; } = null!;

public virtual DimPublication? DimPublicationNavigation { get; set; }

public virtual DimRegisteredDataSource DimRegisteredDataSource { get; set; } = null!;
Expand All @@ -143,6 +149,8 @@ public partial class DimPublication

public virtual ICollection<DimPublication> InverseDimPublicationNavigation { get; set; } = new List<DimPublication>();

public virtual DimReferencedatum JufoClassCodeFrozenNavigation { get; set; } = null!;

public virtual DimReferencedatum JufoClassNavigation { get; set; } = null!;

public virtual DimReferencedatum LanguageCodeNavigation { get; set; } = null!;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ public partial class DimPublicationChannel

public virtual ICollection<DimPid> DimPids { get; set; } = new List<DimPid>();

public virtual ICollection<DimPublication> DimPublications { get; set; } = new List<DimPublication>();
public virtual ICollection<DimPublication> DimPublicationDimPublicationChannelIdFrozenNavigations { get; set; } = new List<DimPublication>();

public virtual ICollection<DimPublication> DimPublicationDimPublicationChannels { get; set; } = new List<DimPublication>();

public virtual ICollection<DimResearchActivity> DimResearchActivities { get; set; } = new List<DimResearchActivity>();
}
2 changes: 2 additions & 0 deletions aspnetcore/src/DatabaseContext/Entities/DimReferencedatum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ public partial class DimReferencedatum

public virtual ICollection<DimPublication> DimPublicationArticleTypeCodeNavigations { get; set; } = new List<DimPublication>();

public virtual ICollection<DimPublication> DimPublicationJufoClassCodeFrozenNavigations { get; set; } = new List<DimPublication>();

public virtual ICollection<DimPublication> DimPublicationJufoClassNavigations { get; set; } = new List<DimPublication>();

public virtual ICollection<DimPublication> DimPublicationLanguageCodeNavigations { get; set; } = new List<DimPublication>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,13 @@ private static IEnumerable<Func<QueryContainerDescriptor<Publication>, QueryCont
t.Term(s => s.Field(f => f.JufoCode)
.Value(parameters.JufoCode)));
}

if (parameters.JufoCodeRecorded is not null)
{
filters.Add(t =>
t.Term(s => s.Field(f => f.JufoCodeRecorded)
.Value(parameters.JufoCodeRecorded)));
}

if (parameters.Doi is not null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public class PublicationSearchParameters

public string? JufoCode { get; set; }

public string? JufoCodeRecorded { get; set; }

public string? Doi { get; set; }

public string? Keywords { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion aspnetcore/src/Indexer/Indexer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
Expand Down
2 changes: 2 additions & 0 deletions aspnetcore/src/Repositories/Maps/PublicationProfile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ public PublicationProfile()
.ForMember(dst => dst.PublisherLocation, opt => opt.MapFrom(src => src.PublisherLocation))
.ForMember(dst => dst.JufoCode, opt => opt.MapFrom(src => src.DimPublicationChannel.JufoCode))
.ForMember(dst => dst.JufoClass, opt => opt.MapFrom(src => src.JufoClassNavigation))
.ForMember(dst => dst.JufoCodeRecorded, opt => opt.MapFrom(src => src.DimPublicationChannelIdFrozenNavigation.JufoCode))
.ForMember(dst => dst.JufoClassRecorded, opt => opt.MapFrom(src => src.JufoClassCodeFrozenNavigation))
.ForMember(dst => dst.Doi, opt => opt.MapFrom(src => src.Doi))
.ForMember(dst => dst.DoiHandle, opt => opt.MapFrom(src => src.DoiHandle))
.ForMember(dst => dst.FieldsOfScience, opt => opt.MapFrom(src => src.FactDimReferencedataFieldOfSciences.Select(f => f.DimReferencedata)))
Expand Down
10 changes: 10 additions & 0 deletions aspnetcore/src/Service.Models/Publication/Publication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,16 @@ public class Publication
/// </summary>
public ReferenceData? JufoClass { get; set; }

/// <summary>
/// Julkaisufoorumi (jäädytetty)
/// </summary>
public string? JufoCodeRecorded { get; set; }

/// <summary>
/// Julkaisufoorumitaso (jäädytetty)
/// </summary>
public ReferenceData? JufoClassRecorded { get; set; }

/// <summary>
/// Linkit
/// </summary>
Expand Down
21 changes: 21 additions & 0 deletions aspnetcore/test/Indexer.Tests/Maps/PublicationProfileTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,19 @@ private static DimPublication GetEntity()
ChannelNameAnylang = "channelNameAnylang",
PublisherNameText = "publisherNameText",
},
JufoClassCodeFrozenNavigation = new DimReferencedatum
{
CodeValue = "jufoClassCodeFrozen",
NameFi = "jufoClassCodeFrozenNameFi",
NameEn = "jufoClassCodeFrozenNameEn",
NameSv = "jufoClassCodeFrozenNameSv"
},
DimPublicationChannelIdFrozenNavigation = new()
{
JufoCode = "jufoCodeFrozen",
ChannelNameAnylang = "channelNameAnylang2",
PublisherNameText = "publisherNameText2",
},
PublisherOpenAccessCodeNavigation = new DimReferencedatum
{
CodeValue = "publisherOpenAccessCode",
Expand Down Expand Up @@ -495,6 +508,14 @@ private Publication GetModel()
NameEn = "jufoClassNameEn",
NameSv = "jufoClassNameSv"
},
JufoCodeRecorded = "jufoCodeFrozen",
JufoClassRecorded = new ReferenceData
{
Code = "jufoClassCodeFrozen",
NameFi = "jufoClassCodeFrozenNameFi",
NameEn = "jufoClassCodeFrozenNameEn",
NameSv = "jufoClassCodeFrozenNameSv"
},
Doi = "doi",
DoiHandle = "doiHandle",
Keywords = new List<Keyword>
Expand Down

0 comments on commit 4f65517

Please sign in to comment.