Skip to content

Commit

Permalink
Merge pull request #122 from diging/develop
Browse files Browse the repository at this point in the history
prepare release
  • Loading branch information
jdamerow authored Jun 5, 2020
2 parents bd52591 + e021007 commit 381650e
Show file tree
Hide file tree
Showing 51 changed files with 2,797 additions and 584 deletions.
64 changes: 64 additions & 0 deletions checkstyle.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://checkstyle.sourceforge.net/dtds/configuration_1_3.dtd">

<!--
Checkstyle is highly configurable. Be sure to read the documentation at http://checkstyle.sf.net
-->

<module name = "Checker">
<property name="charset" value="UTF-8"/>
<property name="severity" value="warning"/>
<property name="fileExtensions" value="java, properties, xml"/>
<module name="TreeWalker">
<module name="OuterTypeFilename"/>
<module name="IllegalTokenText">
<property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/>
<property name="format" value="\\u00(09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)"/>
<property name="message" value="Consider using special escape sequence instead of octal value or Unicode escaped value."/>
</module>
<module name="AvoidEscapedUnicodeCharacters">
<property name="allowEscapesForControlCharacters" value="true"/>
<property name="allowByTailComment" value="true"/>
<property name="allowNonPrintableEscapes" value="true"/>
</module>
<module name="OneTopLevelClass"/>
<module name="NoLineWrap"/>
<module name="EmptyBlock">
<property name="option" value="TEXT"/>
<property name="tokens" value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/>
</module>
<module name="OneStatementPerLine"/>
<module name="MissingSwitchDefault"/>
<module name="NoFinalizer"/>
<module name="OverloadMethodsDeclarationOrder"/>
<module name="EmptyCatchBlock">
<property name="exceptionVariableName" value="expected|ignore"/>
</module>
<module name="UpperEll"/>

<!-- Rules from Sun's Java Style -->
<module name="IllegalImport"/>
<module name="EmptyStatement"/>
<module name="EqualsHashCode"/>
<module name="SimplifyBooleanReturn"/>
<module name="TodoComment">
<property name="format" value="(TODO)|(FIXME)"/>
<message key="todo.match" value="Resolve unexpected comment."/>
</module>

<!-- Custom -->
<module name="DefaultComesLast">
<property name="skipIfLastAndSharedWithCase" value="true"/>
</module>
<module name="Indentation">
<property name="basicOffset" value="4"/>
<property name="braceAdjustment" value="0"/>
<property name="caseIndent" value="4"/>
<property name="throwsIndent" value="4"/>
<property name="lineWrappingIndentation" value="4"/>
<property name="arrayInitIndent" value="4"/>
</module>
</module>
</module>
2 changes: 1 addition & 1 deletion vspace/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.10.3</version>
<version>2.9.10.4</version>
</dependency>

<!-- Javers -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package edu.asu.diging.vspace.core.aspects;

import java.util.List;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
Expand All @@ -9,6 +11,8 @@
import org.springframework.ui.Model;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;

import edu.asu.diging.vspace.core.model.ISpace;
import edu.asu.diging.vspace.core.model.impl.SpaceStatus;
import edu.asu.diging.vspace.core.services.IExhibitionManager;
import edu.asu.diging.vspace.core.services.ISpaceManager;

Expand All @@ -35,8 +39,13 @@ public void setExhibition(JoinPoint jp) {
if (!((Model) obj).containsAttribute("exhibition")) {
((Model) obj).addAttribute("exhibition", exhibitionManager.getStartExhibition());
}
if (!((Model) obj).containsAttribute("allSpaces")) {
((Model) obj).addAttribute("allSpaces", spaceManager.getAllSpaces());
if (!((Model) obj).containsAttribute("publishedSpaces")) {
List<ISpace> publishedSpaces=spaceManager.getSpacesWithStatus(SpaceStatus.PUBLISHED);
/* (non-Javadoc)
* Added to show spaces with null status and accommodate existing spaces with null space status
*/
publishedSpaces.addAll(spaceManager.getSpacesWithStatus(null));
((Model) obj).addAttribute("publishedSpaces", publishedSpaces);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@
@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);

@Query("SELECT d FROM Sequence d WHERE d.module.id = ?1 and d.id = ?2")
public Sequence findSequenceForModuleAndSequence(String moduleId, String sequenceId);

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;

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

@Repository
Expand All @@ -15,5 +16,8 @@ public interface SlideRepository extends PagingAndSortingRepository<Slide, Strin

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

@Query("SELECT d.sequence FROM Slide d WHERE d.id = ?1")
public List<Sequence> getSequencesForSlide(String slideId);

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@
import org.springframework.stereotype.Repository;

import edu.asu.diging.vspace.core.model.impl.Space;
import edu.asu.diging.vspace.core.model.impl.SpaceStatus;

@Repository
@JaversSpringDataAuditable
public interface SpaceRepository extends PagingAndSortingRepository<Space, String> {

List<Space> findTop5ByOrderByCreationDateDesc();

List<Space> findAllBySpaceStatus(SpaceStatus spaceStatus);

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

public class SlideDoesNotExistException extends Exception {

/**
*
*/
private static final long serialVersionUID = -6849852485214921351L;

public SlideDoesNotExistException() {
super();
}

public SlideDoesNotExistException(String message, Throwable cause, boolean enableSuppression,
boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
}

public SlideDoesNotExistException(String message, Throwable cause) {
super(message, cause);
}

public SlideDoesNotExistException(String message) {
super(message);
}

public SlideDoesNotExistException(Throwable cause) {
super(cause);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,39 @@

import java.time.OffsetDateTime;

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

public interface IVSpaceElement {

String getId();
String getId();

void setId(String id);

String getName();

void setId(String id);
void setName(String name);

String getName();
String getDescription();

void setName(String name);
void setDescription(String description);

String getDescription();
String getCreatedBy();

void setDescription(String description);
void setCreatedBy(String createdBy);

String getCreatedBy();
OffsetDateTime getCreationDate();

void setCreatedBy(String createdBy);
void setCreationDate(OffsetDateTime creationDate);

OffsetDateTime getCreationDate();
String getModifiedBy();

void setCreationDate(OffsetDateTime creationDate);
void setModifiedBy(String modifiedBy);

String getModifiedBy();
OffsetDateTime getModificationDate();

void setModifiedBy(String modifiedBy);
void setModificationDate(OffsetDateTime modificationDate);

OffsetDateTime getModificationDate();
SpaceStatus getSpaceStatus();

void setModificationDate(OffsetDateTime modificationDate);
void setSpaceStatus(SpaceStatus status);
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package edu.asu.diging.vspace.core.model;

import java.util.ArrayList;
import java.util.List;

public enum SortByField {
CREATION_DATE("creationDate");
CREATION_DATE("creationDate"), FILENAME("filename"), NAME("name"), CREATED_BY("createdBy");

private final String value;

Expand All @@ -12,4 +15,12 @@ private SortByField(String value) {
public String getValue() {
return value;
}

public static List<String> getAllValues() {
List<String> allValues = new ArrayList<>();
for(SortByField sbf : SortByField.values()) {
allValues.add(sbf.getValue());
}
return allValues;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public class Module extends VSpaceElement implements IModule {
@OneToMany(targetEntity = Sequence.class)
private List<ISequence> sequences;

@JsonIgnore
@OneToOne(targetEntity = Sequence.class)
private ISequence startSequence;

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

public enum SpaceStatus {
PUBLISHED,
UNPUBLISHED
}
Loading

0 comments on commit 381650e

Please sign in to comment.