Skip to content

Commit

Permalink
Merge pull request #292 from diging/develop
Browse files Browse the repository at this point in the history
prepare release
  • Loading branch information
jdamerow authored Apr 22, 2022
2 parents 5f1b8e2 + ea0e3cb commit d5f4e7c
Show file tree
Hide file tree
Showing 72 changed files with 2,369 additions and 327 deletions.
7 changes: 6 additions & 1 deletion vspace/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<spring.version>5.0.19.RELEASE</spring.version>
<spring-data.version>Kay-SR8</spring-data.version>
<spring-security-version>5.3.10.RELEASE</spring-security-version>
<thymeleaf.version>3.0.11.RELEASE</thymeleaf.version>
<thymeleaf.version>3.0.13.RELEASE</thymeleaf.version>
<javers.version>5.11.1</javers.version>
<simple-users-version>0.5</simple-users-version>
<admin.username>admin</admin.username>
Expand Down Expand Up @@ -358,6 +358,11 @@
<artifactId>tika-core</artifactId>
<version>1.22</version>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void setExhibition(JoinPoint jp) {
}
}

@Around("execution(public * edu.asu.diging.vspace.web.publicview..*Controller.*(..))")
@Around("execution(public * edu.asu.diging.vspace.web.exhibit..*Controller.*(..))")
public Object showExhibition(ProceedingJoinPoint jp) throws Throwable {
Object[] args = jp.getArgs();
MethodSignature signature = (MethodSignature) jp.getSignature();
Expand All @@ -88,7 +88,6 @@ public Object showExhibition(ProceedingJoinPoint jp) throws Throwable {
return redirectRequest(jp, spaceId, moduleId, indexOfModel, exhibition);
}


/**
* Based on exhibition mode, get the redirect page or pass control to controller.
* @param jp The joinpoint variable, used to fetch request parameters and proceed with the request.
Expand All @@ -109,6 +108,11 @@ private Object redirectRequest(ProceedingJoinPoint jp, String spaceId, String mo
String modeValue = exhibition.getCustomMessage().equals("") == false ? exhibition.getCustomMessage() : exhibitionMode.getValue();
((Model) args[modelIndex]).addAttribute("modeValue", modeValue);
}
if(exhibition.isAboutPageConfigured()) {
((Model) args[modelIndex]).addAttribute("aboutPageConfigured", true);
} else {
((Model) args[modelIndex]).addAttribute("aboutPageConfigured", false);
}
// If exhibition is set to maintenance, set the default message.
if(exhibitionMode.equals(ExhibitionModes.MAINTENANCE)) {
((Model) args[modelIndex]).addAttribute("modeValue", exhibitionMode.getValue());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
package edu.asu.diging.vspace.core.data;

import java.util.List;

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

import java.util.List;

import javax.transaction.Transactional;
import edu.asu.diging.vspace.core.model.impl.ContentBlock;

@Repository
Expand All @@ -18,5 +16,5 @@ public interface ContentBlockRepository extends PagingAndSortingRepository<Conte
@Query("SELECT max(contentOrder) FROM ContentBlock d WHERE d.slide.id = ?1")
public Integer findMaxContentOrder(String slideId);

public List<ContentBlock> findBySlide_IdAndContentOrderGreaterThan(String slideId,Integer contentOrder);
public List<ContentBlock> findBySlide_IdAndContentOrderGreaterThan(String slideId,Integer contentOrder);
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import edu.asu.diging.vspace.core.model.IModule;
import edu.asu.diging.vspace.core.model.impl.Module;
import edu.asu.diging.vspace.core.model.impl.ModuleStatus;

@Repository
@JaversSpringDataAuditable
Expand All @@ -21,4 +22,6 @@ Page<IModule> findDistinctByNameContainingOrDescriptionContaining(Pageable reque
String description);

List<Module> findAllByOrderByCreationDateDesc();

List<Module> findAllByModuleStatus(ModuleStatus moduleStatus);
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.springframework.stereotype.Repository;

import edu.asu.diging.vspace.core.model.ISpace;
import edu.asu.diging.vspace.core.model.ISpaceLink;
import edu.asu.diging.vspace.core.model.impl.SpaceLink;

@Repository
Expand All @@ -21,6 +22,8 @@ public interface SpaceLinkRepository extends PagingAndSortingRepository<SpaceLin
@Query("delete from SpaceLink where source_space_id = ?1")
void deleteBySourceSpaceId(String id);

void deleteBySourceSpaceIdIsNull();

@Modifying
@Query("delete from SpaceLink where target_space_id = ?1")
void deleteByTargetSpaceId(String id);
Expand All @@ -29,4 +32,8 @@ public interface SpaceLinkRepository extends PagingAndSortingRepository<SpaceLin
List<SpaceLink> getLinkedSpaces(String id);

List<SpaceLink> findByTargetSpace(ISpace space);

List<ISpaceLink> findBySourceSpaceIsNull();

Long countBySourceSpaceIsNull();
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ public interface SpaceLinkDisplayRepository extends PagingAndSortingRepository<S
@Modifying
@Query("delete from SpaceLinkDisplay d where d.link.id = ?1")
void deleteBySpaceLinkId(String spaceLinkId);

public void deleteByLink(ISpaceLink space);

public void deleteByLinkIn(List<ISpaceLink> spaceLinks);

}
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@ public interface IExhibition extends IVSpaceElement {

String getTitle();

boolean isAboutPageConfigured();

void setAboutPageConfigured(boolean aboutPageConfigured);

}
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.ModuleStatus;

public interface IModule extends IVSpaceElement {

List<ISlide> getSlides();
Expand All @@ -15,4 +17,8 @@ public interface IModule extends IVSpaceElement {
ISequence getStartSequence();

void setStartSequence(ISequence startSequence);

void setModuleStatus(ModuleStatus status);
ModuleStatus getModuleStatus();

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

public enum ExternalLinkDisplayMode {

NEWWINDOW("NEWWINDOW"),SAMEWINDOW("SAMEWINDOW");

private final String value;

private ExternalLinkDisplayMode(String value) {
this.value = value;
}

public String getValue() {
return value;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@ public interface ILinkDisplay extends IVSpaceElement {
void setImage(IVSImage image);

IVSImage getImage();

int getRotation();

void setRotation(int rotation);

DisplayType getType();

void setType(DisplayType type);

ExternalLinkDisplayMode getHowToOpen();

void setHowToOpen(ExternalLinkDisplayMode howToOpen);
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import edu.asu.diging.vspace.core.model.IVSImage;
import edu.asu.diging.vspace.core.model.display.DisplayType;
import edu.asu.diging.vspace.core.model.display.ExternalLinkDisplayMode;
import edu.asu.diging.vspace.core.model.display.ILinkDisplay;
import edu.asu.diging.vspace.core.model.impl.VSImage;
import edu.asu.diging.vspace.core.model.impl.VSpaceElement;
Expand All @@ -16,36 +17,47 @@ public abstract class LinkDisplay extends VSpaceElement implements ILinkDisplay
private float positionY;
private int rotation;
private DisplayType type;

@OneToOne(targetEntity=VSImage.class)
private ExternalLinkDisplayMode howToOpen;

@OneToOne(targetEntity = VSImage.class)
private IVSImage image;

/* (non-Javadoc)
/*
* (non-Javadoc)
*
* @see edu.asu.diging.vspace.core.model.display.impl.IDisplay#getPositionX()
*/
@Override
public float getPositionX() {
return positionX;
}

/* (non-Javadoc)
* @see edu.asu.diging.vspace.core.model.display.impl.IDisplay#setPositionX(float)
/*
* (non-Javadoc)
*
* @see
* edu.asu.diging.vspace.core.model.display.impl.IDisplay#setPositionX(float)
*/
@Override
public void setPositionX(float positionX) {
this.positionX = positionX;
}

/* (non-Javadoc)
/*
* (non-Javadoc)
*
* @see edu.asu.diging.vspace.core.model.display.impl.IDisplay#getPositionY()
*/
@Override
public float getPositionY() {
return positionY;
}

/* (non-Javadoc)
* @see edu.asu.diging.vspace.core.model.display.impl.IDisplay#setPositionY(float)
/*
* (non-Javadoc)
*
* @see
* edu.asu.diging.vspace.core.model.display.impl.IDisplay#setPositionY(float)
*/
@Override
public void setPositionY(float positionY) {
Expand All @@ -61,23 +73,27 @@ public IVSImage getImage() {
public void setImage(IVSImage image) {
this.image = image;
}

/* (non-Javadoc)

/*
* (non-Javadoc)
*
* @see edu.asu.diging.vspace.core.model.display.impl.IDisplay#getRotation()
*/
@Override
public int getRotation() {
return rotation;
}

/* (non-Javadoc)
/*
* (non-Javadoc)
*
* @see edu.asu.diging.vspace.core.model.display.impl.IDisplay#setRotation(int)
*/
@Override
public void setRotation(int rotation) {
this.rotation = rotation;
}

@Override
public DisplayType getType() {
return type;
Expand All @@ -87,4 +103,14 @@ public DisplayType getType() {
public void setType(DisplayType type) {
this.type = type;
}

@Override
public ExternalLinkDisplayMode getHowToOpen() {
return howToOpen;
}

@Override
public void setHowToOpen(ExternalLinkDisplayMode howToOpen) {
this.howToOpen = howToOpen;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
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 edu.asu.diging.vspace.core.model.IModuleLink;
Expand All @@ -23,6 +25,7 @@ public class ModuleLinkDisplay extends LinkDisplay implements IModuleLinkDisplay
private String id;

@OneToOne(targetEntity = ModuleLink.class)
@NotFound(action=NotFoundAction.IGNORE)
private IModuleLink link;

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
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 edu.asu.diging.vspace.core.model.ISpaceLink;
Expand All @@ -25,6 +27,7 @@ public class SpaceLinkDisplay extends LinkDisplay implements ISpaceLinkDisplay {
private DisplayType type;

@OneToOne(targetEntity = SpaceLink.class)
@NotFound(action=NotFoundAction.IGNORE)
private ISpaceLink link;

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ public class Exhibition extends VSpaceElement implements IExhibition {
private ExhibitionModes mode;

private String customMessage;

private boolean aboutPageConfigured;

/*
* (non-Javadoc)
Expand Down Expand Up @@ -103,5 +105,15 @@ public String getCustomMessage() {
public void setCustomMessage(String customMessage) {
this.customMessage = customMessage;
}

@Override
public boolean isAboutPageConfigured() {
return aboutPageConfigured;
}

@Override
public void setAboutPageConfigured(boolean aboutPageConfigured) {
this.aboutPageConfigured = aboutPageConfigured;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.Transient;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;
import org.commonmark.node.Node;
import org.commonmark.parser.Parser;
import org.commonmark.renderer.html.HtmlRenderer;

/**
* Model for Exhibition About Page
Expand Down Expand Up @@ -52,5 +56,17 @@ public String getAboutPageText() {
public void setAboutPageText(String aboutPageText) {
this.aboutPageText = aboutPageText;
}


/*
* (non-Javadoc)
*
* @see
* edu.asu.diging.vspace.core.model.impl.ITextBlock#htmlRenderedText()
*/
public String htmlRenderedText() {
Parser parser = Parser.builder().build();
Node document = parser.parse(aboutPageText);
HtmlRenderer renderer = HtmlRenderer.builder().build();
return renderer.render(document);
}
}
Loading

0 comments on commit d5f4e7c

Please sign in to comment.