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-242 #345

Open
wants to merge 68 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 60 commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
1f5cc4a
[story/VSPC-242]UI changes
swetalina-prusty25 Aug 7, 2023
ff64e16
[story/VSPC-242]create external link ajax call
swetalina-prusty25 Aug 8, 2023
4ae81d8
[story/VSPC-242]external link alert UI
swetalina-prusty25 Aug 9, 2023
0225cc2
[story/VSPC-242]Javascript
swetalina-prusty25 Aug 10, 2023
29725e7
[story/VSPC-242] Edit external link
swetalina-prusty25 Aug 11, 2023
954d2fb
[story/VSPC-242] drawlink
swetalina-prusty25 Aug 14, 2023
c165ac5
[story/VSPC-242]Entity
swetalina-prusty25 Aug 15, 2023
983cf14
[story/VSPC-242]Entity
swetalina-prusty25 Aug 16, 2023
ef6194e
[story/VSPC-242]Factory Class
swetalina-prusty25 Aug 21, 2023
b4e6a32
[story/VSPC-242]Repo
swetalina-prusty25 Aug 22, 2023
e079705
[story/VSPC-214] create external link
swetalina-prusty25 Aug 23, 2023
bc6c35a
[story/VSPC-242] Controller
swetalina-prusty25 Aug 28, 2023
a4106ee
[story/VSPC-242] updated controller
swetalina-prusty25 Aug 29, 2023
800e222
[story/VSPC-242]create link
swetalina-prusty25 Aug 30, 2023
91257f7
[story/VSPC-242]Create and display link
swetalina-prusty25 Sep 5, 2023
fe88ded
[story/VSPC-242]Delete link
swetalina-prusty25 Sep 6, 2023
a5f4d2c
[story/VSPC-242]update and delete
swetalina-prusty25 Sep 7, 2023
26406a0
[story/VSPC-242]controller
swetalina-prusty25 Sep 11, 2023
93e1bae
[story/VSPC-242]set positions
swetalina-prusty25 Sep 13, 2023
726ca20
[story/VSPC-242] Java script
swetalina-prusty25 Sep 15, 2023
d49a364
[story/VSPC-242]Utility js functions
swetalina-prusty25 Sep 19, 2023
158ac5a
[story/VSPC-242]External link editable
swetalina-prusty25 Sep 20, 2023
3713c45
[story/VSPC-242] Text area function
swetalina-prusty25 Sep 22, 2023
d14bdcb
[story/VSPC-242]Buttons ajax call
swetalina-prusty25 Sep 26, 2023
89cae0d
[story/VSPC-242] Ajax method for create link
swetalina-prusty25 Sep 28, 2023
bc9c564
[story/VSPC-242]Ajax method for edit external link
swetalina-prusty25 Sep 29, 2023
62906bf
[story/VSPC-242] Delete button java script
swetalina-prusty25 Oct 3, 2023
04f9c0a
[story/VSPC-242] Delete and cancel button
swetalina-prusty25 Oct 4, 2023
598e51a
[story/VSPC-242] Fixing front end issue
swetalina-prusty25 Oct 6, 2023
d5efaa7
[story/VSPC-242] Alert issue fixed
swetalina-prusty25 Oct 10, 2023
4198951
[story/VSPC-242] Area for link working
swetalina-prusty25 Oct 12, 2023
73e38f6
[story/VSPC-242] model
swetalina-prusty25 Oct 13, 2023
bd001e0
[story/VSPC-242] External link storing
swetalina-prusty25 Oct 17, 2023
3c7e352
[story/VSPC-242] Manager methods
swetalina-prusty25 Oct 18, 2023
49628c7
[story/VSPC-242] modified entinty
swetalina-prusty25 Oct 20, 2023
2a74b83
[story/VSPC-242] Repository
swetalina-prusty25 Oct 24, 2023
9b5d030
[story/VSPC-242]Display factors
swetalina-prusty25 Oct 25, 2023
41a805a
[story/VSPC-242]Manager methods
swetalina-prusty25 Oct 27, 2023
c29fc77
[story/VSPC-242]Display id
swetalina-prusty25 Oct 31, 2023
d7b3078
[story/VSPC-242] Edit link
swetalina-prusty25 Nov 1, 2023
6a720f1
[story/VSPC-242] success
swetalina-prusty25 Nov 3, 2023
4b68cbc
[story/VSPC-242] Edit issue
swetalina-prusty25 Nov 7, 2023
c1df0ad
[story/VSPC-242]Unit test
swetalina-prusty25 Nov 8, 2023
9f6ac39
[story/VSPC-242]Created slide display manager
swetalina-prusty25 Nov 9, 2023
7d1817d
[VSPC-242]Test and Template issue
swetalina-prusty25 Nov 14, 2023
b580b60
[story/VSPC-242] Updated the entity
swetalina-prusty25 Nov 15, 2023
0d0fcfe
[story/VSPC-242] slide display
swetalina-prusty25 Nov 17, 2023
20c23d9
[story/VSPC-242]Slide Display entity
swetalina-prusty25 Nov 20, 2023
2592d81
[story/VSPC-242] factory
swetalina-prusty25 Nov 21, 2023
95d5b40
[story/VSPC-242]validation and store
swetalina-prusty25 Nov 22, 2023
64df795
[story/VSPC-242]test for factory and update
swetalina-prusty25 Nov 28, 2023
a2e534e
[story/VSPC-242]Update link test cases
swetalina-prusty25 Nov 30, 2023
180eae7
[story/VSPC-242]Delete testcase
swetalina-prusty25 Dec 1, 2023
79259ed
[story/VSPC-242]display api
swetalina-prusty25 Dec 4, 2023
0a5c62f
Merge branch 'develop' of https://github.com/diging/virtual-spaces-2.…
jophals Apr 17, 2024
99d41ec
[fixed creation, editing, and deletion of slide external links; clean…
jophals Jun 7, 2024
7dd2a82
[VSPC-242]Fixed code factor issues
jophals Jun 7, 2024
1888c1c
[VSPC-242] more CodeFactor indentation fixes
jophals Jun 10, 2024
36c2f5e
[VSPC-242] removed some unnecessary classes, methods, repositories, e…
jophals Jun 12, 2024
b4bf072
[VSPC-242] fixed findBySlide query
jophals Jun 13, 2024
9a3567a
[VSPC-242] fixed SlideExternalLink repo, unnecessary spacing, imports,
jophals Jun 14, 2024
fbb4f6e
made PR fixes; tried to restore some files to previous state
jophals Jul 18, 2024
5cb787e
Merge branch 'develop' into story/VSPC-242
jophals Oct 16, 2024
5144ae0
Executed suggested PR changes except the changes for
jophals Oct 30, 2024
204c91b
[VSPC-242] implemented additional PR change like DeleteLinkController
jophals Oct 31, 2024
23b575a
[VSPC-242] additional PR comment fixes
jophals Oct 31, 2024
13e9bd5
Merge branch 'story/VSPC-242' of https://github.com/diging/virtual-sp…
jophals Oct 31, 2024
b12f048
Merge branch 'develop' into story/VSPC-242
jophals Oct 31, 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
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ public interface ExternalLinkDisplayRepository extends PagingAndSortingRepositor

@Query("SELECT d FROM ExternalLinkDisplay d WHERE d.externalLink.space.id = ?1")
public List<IExternalLinkDisplay> findExternalLinkDisplaysForSpace(String spaceId);

public void deleteByExternalLink(IExternalLink link);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package edu.asu.diging.vspace.core.data;

import java.util.List;

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

import edu.asu.diging.vspace.core.model.IExternalLinkSlide;
import edu.asu.diging.vspace.core.model.impl.ExternalLinkSlide;

@Repository
@JaversSpringDataAuditable
public interface SlideExternalLinkRepository extends PagingAndSortingRepository<ExternalLinkSlide, String> {

public List<IExternalLinkSlide> findBySlide(String slideId);

public void deleteByExternalLink(IExternalLinkSlide link);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this used anywhere?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currently, I do not use deleteByExternalLink anywhere. It was added by Swetalina and included in her tests. I use findBySlide_Id to get the list of External Links in the Slide controllers.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can hardly see a use case, where this would be useful.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you talking about the repo as a whole or just deleteByExternalLink?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just deleteByExternalLink. I don't think we need this method.

}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unnecessary?

Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
public interface IExternalLinkFactory {

IExternalLink createExternalLink(String title, ISpace space);

}
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ public interface IExternalLink extends ILink<ExternalLinkValue> {
String getExternalLink();

void setExternalLink(String externalLink);

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

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

public interface IExternalLinkSlide extends ILinkSlide<ExternalLinkValue>{

ISlide getSlide();

void setSlide(ISlide slide);

String getExternalLink();

void setExternalLink(String externalLink);
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ public interface ILink<T extends IVSpaceElement> extends IVSpaceElement{
T getTarget();

void setTarget(T target);

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

public interface ILinkSlide<T extends IVSpaceElement> extends IVSpaceElement {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we'll introduce anymore links at this point, so this seems overly complicated. Just and external link class for slides is enough


ISlide getSlide();

void setSlide(ISlide slide);

T getTarget();

void setTarget(T target);
}
10 changes: 10 additions & 0 deletions vspace/src/main/java/edu/asu/diging/vspace/core/model/ISlide.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,14 @@ public interface ISlide extends IVSpaceElement {
IImageBlock getFirstImageBlock();

ITextBlock getFirstMatchedTextBlock(String searchTerm);

List<IExternalLinkSlide> getExternalLinks();

void setExternalLinks(List<IExternalLinkSlide> externalLinks);

IVSImage getImage();

void setImage(IVSImage image);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what are these images for?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i believe that these are for the ImageBlocks

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but why would that be needed here?



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

import edu.asu.diging.vspace.core.model.IExternalLinkSlide;

public interface ISlideExternalLinkDisplay extends ILinkDisplay {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed


String getId();

void setId(String id);

void setExternalLink(IExternalLinkSlide link);

IExternalLinkSlide getExternalLink();

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

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToOne;

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

import edu.asu.diging.vspace.core.model.IExternalLinkSlide;
import edu.asu.diging.vspace.core.model.display.DisplayType;
import edu.asu.diging.vspace.core.model.display.ISlideExternalLinkDisplay;
import edu.asu.diging.vspace.core.model.impl.ExternalLinkSlide;

@Entity
public class SlideExternalLinkDisplay extends LinkDisplay implements ISlideExternalLinkDisplay {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed


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

@OneToOne(targetEntity = ExternalLinkSlide.class)
private IExternalLinkSlide externalLink;

private DisplayType type;

/*
* (non-Javadoc)
*
* @see edu.asu.diging.vspace.core.model.display.impl.ISpaceLinkDisplay#getId()
*/
@Override
public String getId() {
return id;
}

/*
* (non-Javadoc)
*
* @see
* edu.asu.diging.vspace.core.model.display.impl.ISpaceLinkDisplay#setId(java.
* lang.String)
*/
@Override
public void setId(String id) {
this.id = id;
}

/*
* (non-Javadoc)
*
* @see edu.asu.diging.vspace.core.model.display.impl.IExternalLinkDisplay#
* getExternalLinkSlide()
*/
@Override
public IExternalLinkSlide getExternalLink() {
return externalLink;
}

/*
* (non-Javadoc)
*
* @see edu.asu.diging.vspace.core.model.display.impl.IExternalLinkDisplay#
* setExternalLink(IExternalLinkSlide)
*/
@Override
public void setExternalLink(IExternalLinkSlide externalLink) {
this.externalLink = externalLink;
}

/*
* (non-Javadoc)
*
* @see edu.asu.diging.vspace.core.model.display.impl.IExternalLinkDisplay#
* getType()
*/
@Override
public DisplayType getType() {
return type;
}

/*
* (non-Javadoc)
*
* @see edu.asu.diging.vspace.core.model.display.impl.IExternalLinkDisplay#
* setType(DisplayType)
*/
@Override
public void setType(DisplayType type) {
this.type = type;
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class ExternalLink extends VSpaceElement implements IExternalLink {
@ManyToOne(targetEntity=Space.class)
@JoinColumn(name="space_id", nullable=false)
private ISpace space;

private String externalLink;

/* (non-Javadoc)
Expand All @@ -43,10 +43,7 @@ public String getId() {
public void setId(String id) {
this.id = id;
}

/* (non-Javadoc)
* @see edu.asu.diging.vspace.core.model.impl.IExternalLink#getSpace()
*/

@Override
public ISpace getSpace() {
return space;
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 javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

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

import edu.asu.diging.vspace.core.model.IExternalLinkSlide;
import edu.asu.diging.vspace.core.model.ISlide;
@Entity
jdamerow marked this conversation as resolved.
Show resolved Hide resolved
public class ExternalLinkSlide extends VSpaceElement implements IExternalLinkSlide {

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

@ManyToOne(targetEntity=Slide.class)
@JoinColumn(name="slide_id", nullable=false)
private ISlide slide;

private String externalLink;

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

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

@Override
public ISlide getSlide() {
return slide;
}

@Override
public void setSlide(ISlide slide) {
this.slide = slide;
}

@Override
public String getExternalLink() {
return externalLink;
}

@Override
public void setExternalLink(String externalLink) {
this.externalLink = externalLink;
}

@Override
public ExternalLinkValue getTarget() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed. external links have a string field with the url they opint to. that's it.

return new ExternalLinkValue(this.externalLink);
}

@Override
public void setTarget(ExternalLinkValue target) {
this.externalLink = target.getValue();
}

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

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
Expand All @@ -12,18 +13,23 @@
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;

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

import com.fasterxml.jackson.annotation.JsonIgnore;

import edu.asu.diging.vspace.core.model.IContentBlock;
import edu.asu.diging.vspace.core.model.IExternalLinkSlide;
import edu.asu.diging.vspace.core.model.IImageBlock;
import edu.asu.diging.vspace.core.model.IModule;
import edu.asu.diging.vspace.core.model.ISequence;
import edu.asu.diging.vspace.core.model.ISlide;
import edu.asu.diging.vspace.core.model.ITextBlock;
import edu.asu.diging.vspace.core.model.IVSImage;

@Entity
public class Slide extends VSpaceElement implements ISlide {
Expand All @@ -45,6 +51,14 @@ public class Slide extends VSpaceElement implements ISlide {
@ManyToMany(mappedBy = "slides", targetEntity = Sequence.class)
private List<ISequence> sequence;

@JsonIgnore
@OneToMany(mappedBy = "slide", targetEntity = ExternalLinkSlide.class, cascade = CascadeType.ALL)
private List<IExternalLinkSlide> externalLinks;

@OneToOne(targetEntity = VSImage.class)
@NotFound(action = NotFoundAction.IGNORE)
private IVSImage image;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should not be needed. slides don't have images


/*
* (non-Javadoc)
*
Expand Down Expand Up @@ -86,6 +100,38 @@ public void setModule(IModule module) {
this.module = module;
}

/*
* (non-Javadoc)
*
* @see edu.asu.diging.vspace.core.model.impl.ISlide#getExternalLinks()
*/
@Override
public List<IExternalLinkSlide> getExternalLinks() {
if (externalLinks == null) {
externalLinks = new ArrayList<IExternalLinkSlide>();
}
return externalLinks;
}

/*
* (non-Javadoc)
*
* @see edu.asu.diging.vspace.core.model.impl.ISlide#setExternalLinks(java.util.
* List)
*/
@Override
public void setExternalLinks(List<IExternalLinkSlide> externalLinks) {
this.externalLinks = externalLinks;
}

public IVSImage getImage() {
return image;
}

public void setImage(IVSImage image) {
this.image = image;
}

/*
* (non-Javadoc)
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import edu.asu.diging.vspace.core.exception.ImageCouldNotBeStoredException;
import edu.asu.diging.vspace.core.exception.LinkDoesNotExistsException;
import edu.asu.diging.vspace.core.exception.SlideDoesNotExistException;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this needed in this class?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

import edu.asu.diging.vspace.core.exception.SpaceDoesNotExistException;
import edu.asu.diging.vspace.core.model.IExternalLink;
import edu.asu.diging.vspace.core.model.display.DisplayType;
Expand All @@ -19,4 +20,6 @@ IExternalLinkDisplay updateLink(String title, String id, float positionX, float
String linkLabel, String linkId, String linkDisplayId, DisplayType displayType, byte[] linkImage,
String imageFilename,ExternalLinkDisplayMode howToOpen)
throws SpaceDoesNotExistException, LinkDoesNotExistsException, ImageCouldNotBeStoredException;


}
Loading