Skip to content

Commit

Permalink
Merge pull request #102 from diging/develop
Browse files Browse the repository at this point in the history
prepare release
  • Loading branch information
jdamerow authored Mar 6, 2020
2 parents af2e84d + b219b16 commit 9ba6a21
Show file tree
Hide file tree
Showing 60 changed files with 3,115 additions and 472 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
/.DS_Store
vspace/.factorypath
vspace/.project
vspace/.classpath
14 changes: 13 additions & 1 deletion vspace/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
Expand All @@ -34,5 +35,16 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="target/generated-sources/annotations">
<attributes>
<attribute name="optional" 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"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
</classpath>
1 change: 1 addition & 0 deletions vspace/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
/Users/
/.settings/
.DS_Store

6 changes: 3 additions & 3 deletions vspace/.project
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<name>org.springframework.ide.eclipse.core.springbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.springframework.ide.eclipse.core.springbuilder</name>
<name>org.springframework.ide.eclipse.boot.validation.springbootbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.springframework.ide.eclipse.boot.validation.springbootbuilder</name>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
Expand Down
4 changes: 2 additions & 2 deletions vspace/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.8</version>
<version>2.9.10.3</version>
</dependency>

<!-- Javers -->
Expand Down Expand Up @@ -305,7 +305,7 @@
<dependency>
<groupId>org.apache.tika</groupId>
<artifactId>tika-core</artifactId>
<version>1.20</version>
<version>1.22</version>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public PersistenceExceptionTranslationPostProcessor exceptionTranslation() {
Properties additionalProperties() {
Properties properties = new Properties();
properties.setProperty("hibernate.hbm2ddl.auto", "update");
properties.setProperty("hibernate.dialect", "org.hibernate.dialect.MySQL5Dialect");
properties.setProperty("hibernate.dialect", "org.hibernate.dialect.MySQL57Dialect");
properties.setProperty("hibernate.show_sql", "false");
return properties;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ protected void configure(HttpSecurity http) throws Exception {
http.formLogin()
.loginPage("/login")
.loginProcessingUrl("/login")
.failureUrl("/?error=bad_credentials")
.failureUrl("/login?error=bad_credentials")
// Configures the logout function
.and()
.csrf()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package edu.asu.diging.vspace.core.data;

import java.util.List;

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

Expand All @@ -9,5 +12,8 @@
@Repository
@JaversSpringDataAuditable
public interface SequenceRepository extends PagingAndSortingRepository<Sequence, String> {


@Query("SELECT d FROM Sequence d WHERE d.module.id = ?1")
public List<Sequence> findSequencesForModule(String moduleId);

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@
import java.util.List;

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

import edu.asu.diging.vspace.core.model.impl.Module;
import edu.asu.diging.vspace.core.model.impl.Slide;

@Repository
@JaversSpringDataAuditable
public interface SlideRepository extends PagingAndSortingRepository<Slide, String> {

public List<Slide> findByModule(Module module);
@Query("SELECT d FROM Slide d WHERE d.module.id = ?1")
public List<Slide> findSlidesForModule(String moduleId);

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

public class BlockDoesNotExistException extends Exception {

/**
*
*/
private static final long serialVersionUID = 1658241674303041454L;

public BlockDoesNotExistException() {
super();
// TODO Auto-generated constructor stub
}

public BlockDoesNotExistException(String message, Throwable cause, boolean enableSuppression,
boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
// TODO Auto-generated constructor stub
}

public BlockDoesNotExistException(String message, Throwable cause) {
super(message, cause);
// TODO Auto-generated constructor stub
}

public BlockDoesNotExistException(String message) {
super(message);
// TODO Auto-generated constructor stub
}

public BlockDoesNotExistException(Throwable cause) {
super(cause);
// TODO Auto-generated constructor stub
}







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

import java.util.List;

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.web.staff.forms.SequenceForm;

public interface ISequenceFactory {

ISequence createSequence(IModule module, SequenceForm sequenceForm, List<ISlide> slides);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package edu.asu.diging.vspace.core.factory.impl;

import java.util.List;

import org.springframework.stereotype.Service;

import edu.asu.diging.vspace.core.factory.ISequenceFactory;
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.impl.Sequence;
import edu.asu.diging.vspace.web.staff.forms.SequenceForm;

@Service
public class SequenceFactory implements ISequenceFactory{
/*
* (non-Javadoc)
*
* @see
* edu.asu.diging.vspace.core.factory.impl.IImageFactory#createImage(java.lang.
* String, java.lang.String)
*/
@Override
public ISequence createSequence(IModule module, SequenceForm sequenceForm, List<ISlide> slides) {
ISequence sequence = new Sequence();
sequence.setName(sequenceForm.getName());
sequence.setDescription(sequenceForm.getDescription());
sequence.setSlides(slides);
sequence.setModule(module);
return sequence;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

public interface ISequence extends IVSpaceElement {

void setModule(IModule module);

IModule getModule();

List<ISlide> getSlides();

void setSlides(List<ISlide> slides);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import java.util.List;

public interface ISlide extends IVSpaceElement {

void setModule(IModule module);

IModule getModule();
Expand All @@ -12,5 +12,4 @@ public interface ISlide extends IVSpaceElement {

List<IContentBlock> getContents();


}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.OneToOne;
import javax.persistence.ManyToOne;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;
Expand All @@ -24,7 +24,7 @@ public class ContentBlock extends VSpaceElement implements IContentBlock {
strategy = "edu.asu.diging.vspace.core.data.IdGenerator")
private String id;

@OneToOne(targetEntity = Slide.class)
@ManyToOne(targetEntity = Slide.class)
private ISlide slide;

private Integer contentOrder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

@Entity
public class ImageBlock extends ContentBlock implements IImageBlock {
@OneToOne(targetEntity=VSImage.class)

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

/*
Expand All @@ -25,11 +25,13 @@ public IVSImage getImage() {
/*
* (non-Javadoc)
*
* @see edu.asu.diging.vspace.core.model.impl.ITextBlock#setImage(edu.asu.diging.vspace.
* core.model.IVSImage)
* @see
* edu.asu.diging.vspace.core.model.impl.ITextBlock#setImage(edu.asu.diging.
* vspace. core.model.IVSImage)
*/
@Override
public void setImage(IVSImage image) {
this.image = image;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;

import com.fasterxml.jackson.annotation.JsonIgnore;

import edu.asu.diging.vspace.core.model.IModule;
import edu.asu.diging.vspace.core.model.ISequence;
import edu.asu.diging.vspace.core.model.ISlide;
Expand All @@ -25,6 +27,8 @@ public class Module extends VSpaceElement implements IModule {
strategy = "edu.asu.diging.vspace.core.data.IdGenerator")
private String id;

//-------- @JsonIgnore used as this Slide will be returned in a controller
@JsonIgnore
@OneToMany(targetEntity = Slide.class, mappedBy = "module")
private List<ISlide> slides;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,16 @@
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.OneToOne;
import javax.persistence.OrderColumn;

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

import edu.asu.diging.vspace.core.model.IModule;
import edu.asu.diging.vspace.core.model.ISequence;
import edu.asu.diging.vspace.core.model.ISlide;

Expand All @@ -22,18 +27,25 @@ public class Sequence extends VSpaceElement implements ISequence {
parameters = @Parameter(name = "prefix", value = "SEQ"),
strategy = "edu.asu.diging.vspace.core.data.IdGenerator")
private String id;

@OneToOne(targetEntity = Module.class)
private IModule module;

@OneToMany(targetEntity = Slide.class)
@ManyToMany(targetEntity = Slide.class)
@JoinTable(name="Sequence_Slides",
joinColumns = @JoinColumn(name = "Sequence_Id", referencedColumnName="id"),
inverseJoinColumns = @JoinColumn(name = "Slide_Id", referencedColumnName="id"))
@OrderColumn(name="slide_order")
private List<ISlide> slides;

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

/*
Expand Down Expand Up @@ -66,4 +78,19 @@ public List<ISlide> getSlides() {
public void setSlides(List<ISlide> slides) {
this.slides = slides;
}

/* (non-Javadoc)
* @see edu.asu.diging.vspace.core.model.impl.ISequence#getModule()
*/
public IModule getModule() {
return module;
}

/* (non-Javadoc)
* @see edu.asu.diging.vspace.core.model.impl.ISequence#setModule(edu.asu.diging.vspace.
* core.model.IModule)
*/
public void setModule(IModule module) {
this.module = module;
}
}
Loading

0 comments on commit 9ba6a21

Please sign in to comment.