-
Notifications
You must be signed in to change notification settings - Fork 3
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
base: develop
Are you sure you want to change the base?
story/VSPC-242 #345
Changes from 60 commits
1f5cc4a
ff64e16
4ae81d8
0225cc2
29725e7
954d2fb
c165ac5
983cf14
ef6194e
b4e6a32
e079705
bc6c35a
a4106ee
800e222
91257f7
fe88ded
a5f4d2c
26406a0
93e1bae
726ca20
d49a364
158ac5a
3713c45
d14bdcb
89cae0d
bc9c564
62906bf
04f9c0a
598e51a
d5efaa7
4198951
73e38f6
bd001e0
3c7e352
49628c7
2a74b83
9b5d030
41a805a
c29fc77
d7b3078
6a720f1
4b68cbc
c1df0ad
9f6ac39
7d1817d
b580b60
0d0fcfe
20c23d9
2592d81
95d5b40
64df795
a2e534e
180eae7
79259ed
0a5c62f
99d41ec
7dd2a82
1888c1c
36c2f5e
b4bf072
9a3567a
fbb4f6e
5cb787e
5144ae0
204c91b
23b575a
13e9bd5
b12f048
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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); | ||
} |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. unnecessary? |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,5 +6,5 @@ | |
public interface IExternalLinkFactory { | ||
|
||
IExternalLink createExternalLink(String title, ISpace space); | ||
|
||
} |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package edu.asu.diging.vspace.core.model; | ||
|
||
public interface ILinkSlide<T extends IVSpaceElement> extends IVSpaceElement { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what are these images for? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i believe that these are for the ImageBlocks There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
---|---|---|
@@ -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() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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; | ||
|
@@ -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 { | ||
|
@@ -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; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this should not be needed. slides don't have images |
||
|
||
/* | ||
* (non-Javadoc) | ||
* | ||
|
@@ -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) | ||
* | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this needed in this class? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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; | ||
|
@@ -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; | ||
|
||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this used anywhere?
There was a problem hiding this comment.
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 usefindBySlide_Id
to get the list of External Links in the Slide controllers.There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
?There was a problem hiding this comment.
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.