Skip to content

Commit

Permalink
- App: Secondary Facet
Browse files Browse the repository at this point in the history
  • Loading branch information
alegauss committed Nov 1, 2024
1 parent 60e16a1 commit 9a10c55
Show file tree
Hide file tree
Showing 11 changed files with 187 additions and 82 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@
@Getter
@Setter
public class TurSNSiteFilterQueryBean {
private List<String> hiddenItems;
private List<String> facetsInFilterQueries;
private List<String> items;
}
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ private TurSNSiteFieldExt saveSNSiteFieldExt(TurSNSite turSNSite, TurSNSiteField
.facetType(TurSNSiteFacetFieldEnum.DEFAULT)
.facetItemType(TurSNSiteFacetFieldEnum.DEFAULT)
.facetSort(TurSNSiteFacetFieldSortEnum.COUNT)
.secondaryFacet(false)
.hl(0)
.multiValued(turSNSiteField.getMultiValued())
.facetPosition(0)
Expand All @@ -220,6 +221,7 @@ private void addTurSNSiteFieldExt(TurSNFieldType turSNFieldType, TurSNSite turSN
.facetType(TurSNSiteFacetFieldEnum.DEFAULT)
.facetItemType(TurSNSiteFacetFieldEnum.DEFAULT)
.facetSort(TurSNSiteFacetFieldSortEnum.COUNT)
.secondaryFacet(false)
.hl(0)
.multiValued(1)
.facetPosition(0)
Expand Down Expand Up @@ -250,11 +252,12 @@ public TurSNSiteFieldExt turSNSiteFieldExtUpdate(@PathVariable String ignoredSnS
turSNSiteFieldExtEdit.setDescription(turSNSiteFieldExt.getDescription());
turSNSiteFieldExtEdit.setType(turSNSiteFieldExt.getType());
turSNSiteFieldExtEdit.setFacet(turSNSiteFieldExt.getFacet());
turSNSiteFieldExtEdit.setFacetLocales( getTurSNSiteFieldExtFacets(turSNSiteFieldExt));
turSNSiteFieldExtEdit.setFacetLocales(getTurSNSiteFieldExtFacets(turSNSiteFieldExt));
turSNSiteFieldExtEdit.setFacetRange(turSNSiteFieldExt.getFacetRange());
turSNSiteFieldExtEdit.setFacetSort(turSNSiteFieldExt.getFacetSort());
turSNSiteFieldExtEdit.setFacetType(turSNSiteFieldExt.getFacetType());
turSNSiteFieldExtEdit.setFacetItemType(turSNSiteFieldExt.getFacetItemType());
turSNSiteFieldExtEdit.setSecondaryFacet(turSNSiteFieldExt.getSecondaryFacet());
turSNSiteFieldExtEdit.setHl(turSNSiteFieldExt.getHl());
turSNSiteFieldExtEdit.setEnabled(turSNSiteFieldExt.getEnabled());
turSNSiteFieldExtEdit.setMlt(turSNSiteFieldExt.getMlt());
Expand Down Expand Up @@ -346,8 +349,7 @@ private TurSNSiteFieldExt createSEField(String snSiteId, TurSNSiteFieldExt turSN
turSNSiteFieldExt.setExternalId(turSNSiteField.getId());
if (turSNSiteFieldExt.getFacet() == 1) {
turSNSiteFieldExt.setFacetPosition(getFacetPositionIncrement());
}
else {
} else {
turSNSiteFieldExt.setFacetPosition(0);
}
this.turSNSiteFieldExtRepository.save(turSNSiteFieldExt);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public class TurSNSiteFieldExtDto {
private TurSEFieldType type;
private int multiValued;
private int facet;
private Boolean secondaryFacet;
private int hl;
private int mlt;
private int enabled;
Expand All @@ -77,6 +78,7 @@ public TurSNSiteFieldExtDto(TurSNSiteFieldExt turSNSiteFieldExt) {
this.type = turSNSiteFieldExt.getType();
this.multiValued = turSNSiteFieldExt.getMultiValued();
this.facet = turSNSiteFieldExt.getFacet();
this.secondaryFacet = turSNSiteFieldExt.getSecondaryFacet();
this.hl = turSNSiteFieldExt.getHl();
this.mlt = turSNSiteFieldExt.getMlt();
this.enabled = turSNSiteFieldExt.getEnabled();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ public class TurUser implements Serializable {

@Setter
private int enabled;


@Builder.Default
@ManyToMany
private Collection<TurGroup> turGroups = new HashSet<>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ public class TurSNSiteFieldExt implements Serializable {
private TurSNSiteFacetFieldSortEnum facetSort = TurSNSiteFacetFieldSortEnum.DEFAULT;
@Column
private Integer facetPosition;
@Column
private Boolean secondaryFacet;
@Column(nullable = false)
private TurSNFieldType snType;
@Column(nullable = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,18 @@

public interface TurSNSiteFieldExtRepository extends JpaRepository<TurSNSiteFieldExt, String> {

@Cacheable("turSNSiteFieldExtfindByTurSNSite")
@Cacheable("turSNSiteFieldExtFindByTurSNSite")
List<TurSNSiteFieldExt> findByTurSNSite(Sort sort, TurSNSite turSNSite);

@Cacheable("turSNSiteFieldExtfindByTurSNSiteAndEnabled")
@Cacheable("turSNSiteFieldExtFindByTurSNSiteAndEnabled")
List<TurSNSiteFieldExt> findByTurSNSiteAndEnabled(TurSNSite turSNSite, int enabled);

@Cacheable("turSNSiteFieldExtfindByTurSNSiteAndFacetAndEnabled")
@Cacheable("turSNSiteFieldExtFindByTurSNSiteAndFacetAndEnabled")
List<TurSNSiteFieldExt> findByTurSNSiteAndFacetAndEnabled(TurSNSite turSNSite, int facet, int enabled);

@Cacheable("turSNSiteFieldExtFindByTurSNSiteAndSecondaryFacetAndEnabled(")
List<TurSNSiteFieldExt> findByTurSNSiteAndSecondaryFacetAndEnabled(TurSNSite turSNSite, Boolean secondaryFacet, int enabled);

@Cacheable("findByTurSNSiteAndFacetAndEnabledOrderByFacetPosition")
List<TurSNSiteFieldExt> findByTurSNSiteAndFacetAndEnabledOrderByFacetPosition(TurSNSite turSNSite, int facet, int enabled);

Expand Down
Loading

0 comments on commit 9a10c55

Please sign in to comment.