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 71 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 68 commits
Commits
Show all changes
71 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
293df7a
[VSPC-242] implemented PR changes: fixed naming issue with link
jophals Dec 13, 2024
f0a0aa3
Merge branch 'story/VSPC-242' of https://github.com/diging/virtual-sp…
jophals Dec 13, 2024
9d24363
[story/VSPC-242] link controller name fix
jophals Dec 13, 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
@@ -0,0 +1,17 @@
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_Id(String slideId);
}
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 @@ -7,4 +7,4 @@ public interface IExternalLinkFactory {

IExternalLink createExternalLink(String title, ISpace space);

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ public interface IExternalLink extends ILink<ExternalLinkValue> {

void setExternalLink(String externalLink);

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

public interface IExternalLinkSlide{

String getId();

void setId(String id);

ISlide getSlide();

void setSlide(ISlide slide);

String getExternalLink();

void setExternalLink(String externalLink);

String getLabel();

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

void setTarget(T target);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,8 @@ public interface ISlide extends IVSpaceElement {
IImageBlock getFirstImageBlock();

ITextBlock getFirstMatchedTextBlock(String searchTerm);

List<IExternalLinkSlide> getExternalLinks();

void setExternalLinks(List<IExternalLinkSlide> externalLinks);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
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;

private String label;

@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 String getLabel() {
return label;
}

@Override
public void setLabel(String label) {
this.label = label;
}
}
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 @@ -19,6 +20,7 @@
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;
Expand All @@ -45,6 +47,10 @@ 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;

/*
* (non-Javadoc)
*
Expand Down Expand Up @@ -86,6 +92,30 @@ 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;
}

/*
* (non-Javadoc)
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,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;


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

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

public interface ISlideExternalLinkManager {

IExternalLinkSlide getLink(String externalLinkID);

IExternalLinkSlide createExternalLink(String title, String url, String slideId);

IExternalLinkSlide updateExternalLink(String title, String url, String id);

void deleteLink(String linkId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import edu.asu.diging.vspace.core.model.ISlide;
import edu.asu.diging.vspace.core.model.display.SlideType;
import edu.asu.diging.vspace.core.model.impl.Sequence;
import edu.asu.diging.vspace.core.model.impl.Slide;
import edu.asu.diging.vspace.web.staff.forms.SlideForm;

public interface ISlideManager {
Expand All @@ -20,7 +19,7 @@ public interface ISlideManager {

ISlide createSlide(IModule module, SlideForm slideForm, SlideType type);

void updateSlide(Slide slide);
ISlide updateSlide(ISlide slide);

IBranchingPoint createBranchingPoint(IModule module, SlideForm slideForm, SlideType type);

Expand All @@ -32,5 +31,5 @@ public interface ISlideManager {

List<Sequence> getSlideSequences(String slideId, String moduleId);

Page<ISlide> findByNameOrDescription(Pageable requestedPage,String searchText);
Page<ISlide> findByNameOrDescription(Pageable requestedPage,String searchText);
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,11 @@

import edu.asu.diging.vspace.core.data.ExternalLinkDisplayRepository;
import edu.asu.diging.vspace.core.data.ExternalLinkRepository;
import edu.asu.diging.vspace.core.data.ImageRepository;
import edu.asu.diging.vspace.core.exception.ImageCouldNotBeStoredException;
import edu.asu.diging.vspace.core.exception.LinkDoesNotExistsException;
import edu.asu.diging.vspace.core.exception.SpaceDoesNotExistException;
import edu.asu.diging.vspace.core.factory.IExternalLinkDisplayFactory;
import edu.asu.diging.vspace.core.factory.IExternalLinkFactory;
import edu.asu.diging.vspace.core.factory.IImageFactory;
import edu.asu.diging.vspace.core.file.IStorageEngine;
import edu.asu.diging.vspace.core.model.IExternalLink;
import edu.asu.diging.vspace.core.model.ISpace;
import edu.asu.diging.vspace.core.model.display.DisplayType;
Expand All @@ -36,7 +33,7 @@ public class ExternalLinkManager extends LinkManager<IExternalLink, ExternalLink

@Autowired
private ISpaceManager spaceManager;

@Autowired
private ExternalLinkRepository externalLinkRepo;

Expand All @@ -49,15 +46,6 @@ public class ExternalLinkManager extends LinkManager<IExternalLink, ExternalLink
@Autowired
private IExternalLinkDisplayFactory externalLinkDisplayFactory;

@Autowired
private IImageFactory imageFactory;

@Autowired
private ImageRepository imageRepo;

@Autowired
private IStorageEngine storage;

@Override
public List<IExternalLinkDisplay> getLinkDisplays(String spaceId) {
return externalLinkDisplayRepo.findExternalLinkDisplaysForSpace(spaceId);
Expand Down Expand Up @@ -158,4 +146,4 @@ public IExternalLinkDisplay updateLink(String title, String id, float positionX,
return externalLinkDisplay;
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public abstract class LinkManager<L extends ILink<T>, T extends IVSpaceElement,

@Autowired
private ISpaceManager spaceManager;

@Autowired
private IImageFactory imageFactory;

Expand All @@ -51,7 +51,7 @@ public U createLink(String title, String id, float positionX, float positionY, i
return updateLinkAndDisplay(link, displayLink);

}

@Override
public U updateLink(String title, String id, float positionX, float positionY, int rotation, String linkedId,
String linkLabel, String linkId, String linkDisplayId, DisplayType displayType, byte[] linkImage,
Expand Down Expand Up @@ -90,7 +90,7 @@ public void deleteLink(String linkId) {
protected abstract L getLink(String linkId);

protected abstract L createLinkObject(String title, String id);

protected abstract T getTarget(String linkedId);

protected abstract U createDisplayLink(L link);
Expand All @@ -101,7 +101,7 @@ protected void validateSpace(String id) throws SpaceDoesNotExistException {
throw new SpaceDoesNotExistException();
}
}

protected void setDisplayProperties(ILinkDisplay linkDisplay, String id, float positionX, float positionY,
int rotation, DisplayType displayType, byte[] linkImage, String imageFilename)
throws ImageCouldNotBeStoredException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import java.util.List;
import java.util.Optional;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
Expand All @@ -22,8 +21,8 @@
import edu.asu.diging.vspace.core.model.ISequence;
import edu.asu.diging.vspace.core.model.ISlide;
import edu.asu.diging.vspace.core.model.impl.Module;
import edu.asu.diging.vspace.core.model.impl.ModuleLink;
import edu.asu.diging.vspace.core.services.IModuleManager;
import edu.asu.diging.vspace.core.services.ISlideManager;

@Transactional
@Service
Expand All @@ -43,7 +42,7 @@ public class ModuleManager implements IModuleManager {
private SequenceRepository sequenceRepo;

@Autowired
private SlideManager slideManager;
private ISlideManager slideManager;

@Autowired
private ModuleLinkDisplayRepository moduleLinkDisplayRepo;
Expand Down
Loading