Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Story/vspc 190 A user should be able to define the order spaces appear in the site menu of the public page #277

Open
wants to merge 86 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 67 commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
df573df
[VSPC-190] Added sorting functionality for space
glend17 Sep 30, 2021
89b4f23
[VSPC-190] added custom ordering layout page
glend17 Oct 1, 2021
cead54f
[VSPC-190] Changed the logic for custom order to input values given b…
glend17 Oct 5, 2021
2a4e021
[VSPC-190] Added custom order logic for spaces
glend17 Oct 6, 2021
1ac9e32
[VSPC-190] Added controller to adjust content order and front end cha…
glend17 Oct 7, 2021
bd2eeb0
[VSPC-190] Spaces custom order controller related changes
glend17 Oct 8, 2021
16fa151
[VSPC-190] Front-end changes
glend17 Oct 11, 2021
8a5f860
[VSPC-190] Front-end space list implementation and back end bug fixes
glend17 Oct 14, 2021
0af04b2
[VSPC-190] Added re-ordering of spaces
glend17 Oct 15, 2021
0f0fcdb
[VSPC-190] Space ordering option on staff page integrated to backend
glend17 Oct 18, 2021
04c4946
[VSPC-190] Dropdown will show current selected element
glend17 Oct 20, 2021
d1b6405
[VSPC-190] Unit test
glend17 Oct 20, 2021
2a4cdfc
[VSPC-190] Unit Test
glend17 Oct 21, 2021
e0a9a54
[VSPC-190] Unit tests
glend17 Oct 22, 2021
3aea6df
[VSPC-190] Cleanup
glend17 Oct 22, 2021
b94a0d0
[VSPC-190] Code documentation
glend17 Oct 22, 2021
d513eba
Update SpacesCustomOrderManagerTest.java
glend17 Oct 25, 2021
ac362db
Update SpaceController.java
glend17 Oct 25, 2021
87ec41c
Update SpacesCustomOrderingController.java
glend17 Oct 25, 2021
eec41be
[VSPC-190] Removing SpaceOrderTypeFrom as unused code
glend17 Oct 25, 2021
bc61545
[VSPC-190] Review Comment, reusing method getStartExhibition()
glend17 Jan 20, 2022
a585211
[VSPC-190] allowing scope for multiple custom order
glend17 Jan 26, 2022
fa48ecf
[VSPC-190] Added logic to support multiple custom orders
glend17 Jan 27, 2022
ad4271d
[VSPC-190] Space custom order changes
glend17 Jan 31, 2022
f546ebc
[VSPC-190] Custom order html pages
glend17 Feb 1, 2022
bf06c53
[VSPC-190] displaying the space orders
glend17 Feb 2, 2022
4d5ea90
[VSPC-190] enabled drag and drop for space ordering
glend17 Feb 3, 2022
137a2fc
[VSPC-190] staff side display custom order
glend17 Feb 7, 2022
5a5fc21
[VSPC-190] findBySpaceCustomOrderName
glend17 Feb 7, 2022
23f348d
[VSPC-190] List space orders
glend17 Feb 7, 2022
47cad20
[VSPC-190] bug on delete custom order
glend17 Feb 8, 2022
45dabaf
[VSPC-190] changes based on manual flow testing
glend17 Feb 9, 2022
306b76a
[VSPC-190] adding private field
glend17 Feb 9, 2022
300633d
[VSPC-190] code cleanup
glend17 Feb 9, 2022
60896b3
[VSPC-190] code cleanup
glend17 Feb 9, 2022
6e30a2f
[VSPC-190] adding unit tests
glend17 Feb 10, 2022
8ff419d
[VSPC-190] code cleanup
glend17 Feb 10, 2022
78bc28a
[VSPC-190] merge with develop branch
glend17 Apr 19, 2022
ba4e9a8
[VSPC-190] allowing space custom order with same name
glend17 Apr 19, 2022
006f921
[VSPC-190] allowing space custom order with same name
glend17 Apr 19, 2022
99862b8
[VSPC-190] Implemented PR review comments
tusanand Aug 15, 2022
b6770bd
Merge branch 'develop' of https://github.com/diging/virtual-spaces-2.…
tusanand Aug 15, 2022
733a33d
[VSPC-190] Added back updateSpaceOrderMode
tusanand Aug 15, 2022
8ff6c84
Merge branch 'develop' of https://github.com/diging/virtual-spaces-2.…
tusanand Aug 24, 2022
5d29c8c
Merge branch 'story/vspc-190' of https://github.com/diging/virtual-sp…
tusanand Aug 24, 2022
3181473
[VSPC-190] Implemented review comment related changes
tusanand Aug 30, 2022
10b44cf
[VSPC-190] Updated HTML for add new custom order page
tusanand Sep 2, 2022
479a02c
[VSPC-190] Modified UI for custom ordering page.
tusanand Sep 7, 2022
5296a30
[VSPC-190] Added back button to navigate on the add new custom order …
tusanand Sep 8, 2022
7e0a573
[VSPC-190] Updated UI for the individual custom order page
tusanand Sep 9, 2022
0dbc3b1
[VSPC-190] Modified backend code to update title and description toge…
tusanand Sep 12, 2022
2438591
[VSPC-190] Modified UI for edit page
tusanand Sep 13, 2022
5b7dac3
[VSPC-190] Modified the edit page
tusanand Sep 15, 2022
ab17dae
VSPC-190 Fixed indentation issue
tusanand Sep 15, 2022
2104cda
Merge branch 'develop' of https://github.com/diging/virtual-spaces-2.…
tusanand Sep 20, 2022
89c8711
[VSPC-190] PR review comments incorporated
tusanand Sep 27, 2022
f3eb69e
[VSPC-190] PR review comments incorporated
tusanand Sep 28, 2022
0703107
Merge branch 'develop' of https://github.com/diging/virtual-spaces-2.…
tusanand Oct 31, 2022
45b5bf6
[VSPC-190] Update function names and replaced loops with stream
tusanand Oct 31, 2022
6ab4060
Merge branch 'develop' of https://github.com/diging/virtual-spaces-2.…
tusanand Nov 18, 2022
0a9308f
[VSPC-190] Added test cases
tusanand Nov 23, 2022
00b2644
[VSPC-190] converted custom order save, edit and delete to HTML forms
tusanand Nov 30, 2022
a380c84
[VSPC-190] moved the request mapping to a new controller
tusanand Dec 6, 2022
d9cac62
Merge branch 'develop' of https://github.com/diging/virtual-spaces-2.…
tusanand Aug 16, 2023
981c87c
[VSPC-190] review comments
pkharge Sep 19, 2023
1f6e703
[VSPC-190] review comments
pkharge Sep 21, 2023
e3f9bca
Merge branch 'develop' into story/VSPC-190
pkharge Sep 21, 2023
d43e7b7
[story/VSPC-190] review comments
pkharge Oct 17, 2023
04b1064
[VSPC-190] test case fix
pkharge Oct 19, 2023
0f01276
Merge branch 'develop' into story/vspc-190
pooja-thalur Aug 8, 2024
f8a56c4
[VSPC-190] removed css for customlink
pooja-thalur Aug 8, 2024
ba010d7
[VSPC-190] addressed review comments
pooja-thalur Aug 9, 2024
5b42ecf
[VSPC-216] fixed dropdown
pooja-thalur Aug 10, 2024
1861299
[VSPC-190] fixed bug on saving custom order
pooja-thalur Aug 12, 2024
743dab4
[VSPC-190] addressed review comments
pooja-thalur Aug 12, 2024
48d75cb
[VSPC-190] addressed review comment
pooja-thalur Aug 13, 2024
53212f5
[VSPC-190] codefactor issue fixed
pooja-thalur Aug 14, 2024
9813163
[VSPC-190] addressed pr comments
pooja-thalur Aug 21, 2024
780df95
[VSPC-190] addressed pr comments
pooja-thalur Aug 23, 2024
341fec2
[VSPC-190] addressed review comments
pooja-thalur Aug 23, 2024
a073f66
[VSPC-190] code cleanup
pooja-thalur Aug 27, 2024
5344d3f
[VSPC-190] changed UI of edit page for custom ordering of spaces
pooja-thalur Aug 28, 2024
f252c4f
[VSPC-190] addressed review comments
pooja-thalur Oct 1, 2024
9b383fe
[VSPC-190] adding validation
pooja-thalur Oct 2, 2024
6635426
[VSPC-190] addressed review comments
pooja-thalur Oct 2, 2024
b5a0ff5
[VSPC-190] addressed review comments
pooja-thalur Oct 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions vspace/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,18 @@
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="test" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="target/generated-sources/annotations">
<attributes>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
</classpath>
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import edu.asu.diging.vspace.core.model.impl.Exhibition;
import edu.asu.diging.vspace.core.model.impl.SpaceStatus;
import edu.asu.diging.vspace.core.services.IExhibitionManager;
import edu.asu.diging.vspace.core.services.IExhibitionSpaceOrderUtility;
import edu.asu.diging.vspace.core.services.IModuleManager;
import edu.asu.diging.vspace.core.services.ISpaceManager;
import edu.asu.diging.vspace.web.exhibit.view.ExhibitionConstants;
Expand All @@ -49,6 +50,11 @@ public class ExhibitionDataAspect {
@Autowired
private AuthenticationFacade authFacade;


@Autowired
private IExhibitionSpaceOrderUtility exhibitionSpaceOrderUtility;


@After("execution(public * edu.asu.diging.vspace.web..*Controller.*(..))")
public void setExhibition(JoinPoint jp) {
Object[] args = jp.getArgs();
Expand All @@ -69,6 +75,7 @@ public void setExhibition(JoinPoint jp) {
* spaces with null space status
*/
publishedSpaces.addAll(spaceManager.getSpacesWithStatus(null));
publishedSpaces = spaceManager.sortPublishedSpacesByGivenOrder(publishedSpaces);
((Model) obj).addAttribute("publishedSpaces", publishedSpaces);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package edu.asu.diging.vspace.core.data;

import org.javers.spring.annotation.JaversSpringDataAuditable;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;

import edu.asu.diging.vspace.core.model.impl.SpacesCustomOrder;

@Repository
@JaversSpringDataAuditable
public interface SpacesCustomOrderRepository extends PagingAndSortingRepository<SpacesCustomOrder, String> {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package edu.asu.diging.vspace.core.model;

public enum ExhibitionSpaceOrderMode {
jdamerow marked this conversation as resolved.
Show resolved Hide resolved
ALPHABETICAL,
CREATION_DATE,
CUSTOM
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import java.util.List;

import edu.asu.diging.vspace.core.model.impl.SpacesCustomOrder;

public interface IExhibition extends IVSpaceElement {

/*
Expand Down Expand Up @@ -38,4 +40,12 @@ public interface IExhibition extends IVSpaceElement {

void setPreviewId(String previewId);

SpacesCustomOrder getSpacesCustomOrder();

void setSpacesCustomOrder(SpacesCustomOrder spacesCustomOrder);

void setSpaceOrderMode(ExhibitionSpaceOrderMode spaceOrderMode);

ExhibitionSpaceOrderMode getSpaceOrderMode();

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package edu.asu.diging.vspace.core.model;

import java.util.List;

public interface ISpacesCustomOrder extends IVSpaceElement {

public String getCustomOrderName();

public void setCustomOrderName(String customOrderName);

public List<ISpace> getCustomOrderedSpaces();

public void setCustomOrderedSpaces(List<ISpace> customOrderedSpaces);

}
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
package edu.asu.diging.vspace.core.model.impl;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Objects;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;

import edu.asu.diging.vspace.core.model.ExhibitionModes;
import edu.asu.diging.vspace.core.model.IContentBlock;
import edu.asu.diging.vspace.core.model.ExhibitionSpaceOrderMode;
import edu.asu.diging.vspace.core.model.IExhibition;
import edu.asu.diging.vspace.core.model.IExhibitionLanguage;
import edu.asu.diging.vspace.core.model.IExternalLink;
import edu.asu.diging.vspace.core.model.ISpace;

/**
Expand All @@ -47,6 +47,13 @@ public class Exhibition extends VSpaceElement implements IExhibition {

private String customMessage;

@Enumerated(EnumType.STRING)
private ExhibitionSpaceOrderMode spaceOrderMode;

@OneToOne(targetEntity = SpacesCustomOrder.class)
@JoinColumn(name = "Space_Custom_Order_Id", referencedColumnName = "id")
private SpacesCustomOrder spacesCustomOrder;

private boolean aboutPageConfigured;

@OneToMany(targetEntity = ExhibitionLanguage.class, mappedBy = "exhibition", cascade = CascadeType.ALL, orphanRemoval=true)
Expand Down Expand Up @@ -123,6 +130,26 @@ public void setCustomMessage(String customMessage) {
}

@Override
public ExhibitionSpaceOrderMode getSpaceOrderMode() {
return spaceOrderMode;
}

@Override
public void setSpaceOrderMode(ExhibitionSpaceOrderMode spaceOrderMode) {
this.spaceOrderMode = spaceOrderMode;
}

@Override
public SpacesCustomOrder getSpacesCustomOrder() {
return spacesCustomOrder;
}

@Override
public void setSpacesCustomOrder(SpacesCustomOrder spacesCustomOrder) {
this.spacesCustomOrder = spacesCustomOrder;
}


public boolean isAboutPageConfigured() {
return aboutPageConfigured;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
package edu.asu.diging.vspace.core.model.impl;


import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.OrderColumn;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;

import edu.asu.diging.vspace.core.model.ISpace;
import edu.asu.diging.vspace.core.model.ISpacesCustomOrder;

@Entity
@Inheritance(strategy = InheritanceType.JOINED)
public class SpacesCustomOrder extends VSpaceElement implements ISpacesCustomOrder {

@Id
@GeneratedValue(generator = "customorder_id_generator")
@GenericGenerator(name = "customorder_id_generator",
parameters = @Parameter(name = "prefix", value = "SPC"),
strategy = "edu.asu.diging.vspace.core.data.IdGenerator")
private String id;

@Column(nullable=false)
private String customOrderName;

@ManyToMany(targetEntity = Space.class)
@JoinTable(name = "spaces_custom_orders",
joinColumns = @JoinColumn(name = "SpacesCustomOrder_Id", referencedColumnName="id"),
inverseJoinColumns = @JoinColumn(name = "Space_Id", referencedColumnName="id"))
@OrderColumn
private List<ISpace> customOrderedSpaces;

@Override
public String getId() {
return id;
}

@Override
public void setId(String id) {
this.id = id;
}

public String getCustomOrderName() {
return customOrderName;
}

public void setCustomOrderName(String customOrderName) {
this.customOrderName = customOrderName;
}

public List<ISpace> getCustomOrderedSpaces() {
return customOrderedSpaces;
}

public void setCustomOrderedSpaces(List<ISpace> customOrderedSpaces) {
this.customOrderedSpaces = customOrderedSpaces;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.List;

import edu.asu.diging.vspace.core.model.ExhibitionSpaceOrderMode;
import edu.asu.diging.vspace.core.model.IExhibition;
import edu.asu.diging.vspace.core.model.impl.Exhibition;

Expand Down Expand Up @@ -33,6 +34,8 @@ public interface IExhibitionManager {
List<IExhibition> findAll();

IExhibition getStartExhibition();

IExhibition updateSpaceOrderMode(ExhibitionSpaceOrderMode mode);

void updateExhibitionLanguages(Exhibition exhibition, List<String> languages, String defaultLanguage);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package edu.asu.diging.vspace.core.services;

import java.util.List;

import edu.asu.diging.vspace.core.model.ExhibitionSpaceOrderMode;
import edu.asu.diging.vspace.core.model.ISpace;

public interface IExhibitionSpaceOrderUtility {

List<ISpace> sortSpaces(List<ISpace> publishedSpaces, ExhibitionSpaceOrderMode mode);

}
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,8 @@ public interface ISpaceManager {
Iterable<Space> addIncomingLinkInfoToSpaces(Iterable<Space> spaces);

Page<ISpace> findByNameOrDescription(Pageable requestedPage,String searchText);

List<ISpace> sortPublishedSpacesByGivenOrder(List<ISpace> publishedSpaces);

void addSpaceToCustomOrders(ISpace space);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package edu.asu.diging.vspace.core.services;

import java.util.List;

import edu.asu.diging.vspace.core.model.ISpace;
import edu.asu.diging.vspace.core.model.ISpacesCustomOrder;
import edu.asu.diging.vspace.core.model.impl.SpacesCustomOrder;

public interface ISpacesCustomOrderManager {

Iterable<SpacesCustomOrder> findAll();

void addSpaceToCustomOrders(ISpace space);

void save(Iterable<SpacesCustomOrder> spacesCustomOrder);

ISpacesCustomOrder get(String customSpaceOrderId);

void updateNameAndDescription(String spacesCustomOrderId, String title, String description);

void updateSpaces(String spacesCustomOrderId, List<String> spaceOrders);

ISpacesCustomOrder create(List<String> spaceOrders, String name, String description);

void setExhibitionSpacesCustomOrder(String customOrderId);

void delete(String id);

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import edu.asu.diging.vspace.core.data.ExhibitionRepository;
import edu.asu.diging.vspace.core.exception.LanguageListConfigurationNotFoundException;
import edu.asu.diging.vspace.core.factory.impl.ExhibitionFactory;
import edu.asu.diging.vspace.core.model.ExhibitionSpaceOrderMode;
import edu.asu.diging.vspace.core.model.IExhibition;
import edu.asu.diging.vspace.core.model.IExhibitionLanguage;
import edu.asu.diging.vspace.core.model.impl.Exhibition;
Expand Down Expand Up @@ -87,6 +88,7 @@ public IExhibition getStartExhibition() {
}
return null;
}


/**
* Updates the Exhibition with given list of languages. It fetches the language from exhibitionLanguageConfig using code.
Expand Down Expand Up @@ -144,5 +146,12 @@ private IExhibitionLanguage addExhibitionLanguage(Exhibition exhibition, Map lan

return exhibitionLanguage;
}

@Override
public IExhibition updateSpaceOrderMode(ExhibitionSpaceOrderMode mode) {
Exhibition exhibition = (Exhibition) getStartExhibition();
exhibition.setSpaceOrderMode(mode);
return exhibitRepo.save(exhibition);
}

}
Loading