Merge branch 'checklists' of ssh://git.dsv.su.se/git/scipro/personal/fn into develop
This commit is contained in:
commit
56d2501704
src/main
java/se/su/dsv/scipro
basepanels
checklists/panels
data
dao
interfaces
jpa
dataobjects
enums
project
webapp/css
@ -25,7 +25,9 @@ import se.su.dsv.scipro.message.pages.PrivateMessagesPage;
|
||||
import se.su.dsv.scipro.peer.pages.PeerReviewTemplatePage;
|
||||
import se.su.dsv.scipro.project.pages.FinalSeminarProjectListPage;
|
||||
import se.su.dsv.scipro.project.pages.ProjectOppositionPage;
|
||||
import se.su.dsv.scipro.project.pages.ProjectPartnerPage;
|
||||
import se.su.dsv.scipro.project.pages.ProjectStartPage;
|
||||
import se.su.dsv.scipro.project.pages.SelfCheckPage;
|
||||
import se.su.dsv.scipro.security.auth.MetaDataActionStrategy;
|
||||
import se.su.dsv.scipro.security.auth.roles.Roles;
|
||||
import se.su.dsv.scipro.supervisor.pages.SupervisorProjectsFinalSeminarPage;
|
||||
@ -55,6 +57,8 @@ public class MainMenuPanel extends Panel implements IWiQueryPlugin {
|
||||
projectMenuSubItems.add(new MenuItem(ProjectStartPage.MAIN_MENU_LABEL, ProjectStartPage.class));
|
||||
projectMenuSubItems.add(new MenuItem(ProjectOppositionPage.MAIN_MENU_LABEL, ProjectOppositionPage.class));
|
||||
projectMenuSubItems.add(new MenuItem(FinalSeminarProjectListPage.MAIN_MENU_LABEL, FinalSeminarProjectListPage.class));
|
||||
projectMenuSubItems.add(new MenuItem("Project Partner", ProjectPartnerPage.class));
|
||||
projectMenuSubItems.add(new MenuItem("Self Check", SelfCheckPage.class));
|
||||
MainMenuItem projectMenuItem = new MainMenuItem("projectMenuItem", ProjectStartPage.MAIN_MENU_LABEL, ProjectStartPage.class, containerClass, projectMenuSubItems);
|
||||
add(projectMenuItem);
|
||||
|
||||
|
@ -0,0 +1,21 @@
|
||||
<!DOCTYPE html>
|
||||
<html
|
||||
xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd">
|
||||
<head>
|
||||
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
|
||||
</head>
|
||||
<body>
|
||||
<wicket:panel>
|
||||
<div wicket:id="stateOfMindContainer">
|
||||
<form wicket:id="form">
|
||||
<table wicket:id="group">
|
||||
<tr wicket:id="persons">
|
||||
<td><input type="radio" wicket:id="radio" /></td>
|
||||
<td> <img wicket:id="image"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</wicket:panel>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,74 @@
|
||||
package se.su.dsv.scipro.checklists.panels;
|
||||
|
||||
import org.apache.wicket.AttributeModifier;
|
||||
import org.apache.wicket.ajax.AbstractDefaultAjaxBehavior;
|
||||
import org.apache.wicket.ajax.AjaxRequestTarget;
|
||||
import org.apache.wicket.markup.html.WebMarkupContainer;
|
||||
import org.apache.wicket.markup.html.WebPage;
|
||||
import org.apache.wicket.markup.html.basic.Label;
|
||||
import org.apache.wicket.markup.html.basic.MultiLineLabel;
|
||||
import org.apache.wicket.markup.html.form.Form;
|
||||
import org.apache.wicket.markup.html.form.Radio;
|
||||
import org.apache.wicket.markup.html.form.RadioGroup;
|
||||
import org.apache.wicket.markup.html.list.ListItem;
|
||||
import org.apache.wicket.markup.html.list.ListView;
|
||||
import org.apache.wicket.markup.html.panel.Panel;
|
||||
import org.apache.wicket.model.AbstractReadOnlyModel;
|
||||
import org.apache.wicket.model.Model;
|
||||
import org.apache.wicket.model.PropertyModel;
|
||||
import org.apache.wicket.spring.injection.annot.SpringBean;
|
||||
import org.odlabs.wiquery.ui.core.DefaultJsScopeUiEvent;
|
||||
import org.odlabs.wiquery.ui.slider.Slider;
|
||||
|
||||
import se.su.dsv.scipro.SciProSession;
|
||||
import se.su.dsv.scipro.data.dao.interfaces.ProjectDao;
|
||||
import se.su.dsv.scipro.data.dataobjects.Project;
|
||||
import se.su.dsv.scipro.data.enums.StateOfMind;
|
||||
import se.su.dsv.scipro.knol.resource.page.StaticImage;
|
||||
import edu.emory.mathcs.backport.java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author fnorbe@dsv.su.se
|
||||
*/
|
||||
|
||||
public class TrafficLightPanel extends Panel {
|
||||
|
||||
|
||||
private static final long serialVersionUID = 8862892008428526067L;
|
||||
|
||||
|
||||
public TrafficLightPanel(String id, WebPage parent) {
|
||||
super(id);
|
||||
WebMarkupContainer stateOfMindContainer = new WebMarkupContainer(
|
||||
"stateOfMindContainer");
|
||||
add(stateOfMindContainer);
|
||||
|
||||
Form<StateOfMind> f = new Form<StateOfMind>("form");
|
||||
stateOfMindContainer.add(f);
|
||||
RadioGroup<StateOfMind> group = new RadioGroup<StateOfMind>("group");
|
||||
f.add(group);
|
||||
|
||||
ListView<StateOfMind> persons = new ListView<StateOfMind>("persons",
|
||||
Arrays.asList(StateOfMind.values())) {
|
||||
protected void populateItem(ListItem<StateOfMind> item) {
|
||||
StateOfMind stateOfMind = item.getModelObject();
|
||||
item.add(new Radio<StateOfMind>("radio", item.getModel()));
|
||||
StaticImage image = null;
|
||||
if (stateOfMind.equals(StateOfMind.FINE)) {
|
||||
image = new StaticImage("image", new Model<String>(
|
||||
"images/icons/green_ball_32.png"));
|
||||
} else if (stateOfMind.equals(StateOfMind.NEEDHELP)) {
|
||||
image = new StaticImage("image", new Model<String>(
|
||||
"images/icons/red_ball_32.png"));
|
||||
} else if (stateOfMind.equals(StateOfMind.NEUTRAL)) {
|
||||
image = new StaticImage("image", new Model<String>(
|
||||
"images/icons/yellow_ball_32.png"));
|
||||
}
|
||||
item.add(image);
|
||||
};
|
||||
};
|
||||
group.add(persons);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,7 @@
|
||||
package se.su.dsv.scipro.data.dao.interfaces;
|
||||
|
||||
import se.su.dsv.scipro.data.dataobjects.CheckListAnswer;
|
||||
|
||||
public interface CheckListAnswerDao extends Dao<CheckListAnswer> {
|
||||
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
package se.su.dsv.scipro.data.dao.interfaces;
|
||||
|
||||
import se.su.dsv.scipro.data.dataobjects.CheckList;
|
||||
|
||||
public interface CheckListDao extends Dao<CheckList> {
|
||||
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
package se.su.dsv.scipro.data.dao.interfaces;
|
||||
|
||||
import se.su.dsv.scipro.data.dataobjects.CheckListQuestion;
|
||||
|
||||
public interface CheckListQuestionDao extends Dao<CheckListQuestion> {
|
||||
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
package se.su.dsv.scipro.data.dao.interfaces;
|
||||
|
||||
import se.su.dsv.scipro.data.dataobjects.CheckListTemplate;
|
||||
|
||||
|
||||
public interface CheckListTemplateDao extends Dao<CheckListTemplate> {
|
||||
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package se.su.dsv.scipro.data.dao.jpa;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import se.su.dsv.scipro.data.dao.interfaces.CheckListAnswerDao;
|
||||
import se.su.dsv.scipro.data.dao.interfaces.CheckListQuestionDao;
|
||||
import se.su.dsv.scipro.data.dataobjects.CheckListAnswer;
|
||||
import se.su.dsv.scipro.data.dataobjects.CheckListQuestion;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Fredrik Norberg - fnorbe@dsv.su.se
|
||||
*
|
||||
*/
|
||||
|
||||
@Repository("checkListAnswerDao")
|
||||
public class CheckListAnswerDaoJPAImp extends AbstractDaoJPAImp<CheckListAnswer>
|
||||
implements CheckListAnswerDao {
|
||||
|
||||
public CheckListAnswerDaoJPAImp() {
|
||||
super(CheckListAnswer.class);
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package se.su.dsv.scipro.data.dao.jpa;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import se.su.dsv.scipro.data.dao.interfaces.CheckListDao;
|
||||
import se.su.dsv.scipro.data.dataobjects.CheckList;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Fredrik Norberg - fnorbe@dsv.su.se
|
||||
*
|
||||
*/
|
||||
|
||||
@Repository("checkListDao")
|
||||
public class CheckListDaoJPAImp extends AbstractDaoJPAImp<CheckList>
|
||||
implements CheckListDao {
|
||||
|
||||
public CheckListDaoJPAImp() {
|
||||
super(CheckList.class);
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package se.su.dsv.scipro.data.dao.jpa;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import se.su.dsv.scipro.data.dao.interfaces.CheckListQuestionDao;
|
||||
import se.su.dsv.scipro.data.dataobjects.CheckListQuestion;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Fredrik Norberg - fnorbe@dsv.su.se
|
||||
*
|
||||
*/
|
||||
|
||||
@Repository("checkListQuestionDao")
|
||||
public class CheckListQuestionDaoJPAImp extends AbstractDaoJPAImp<CheckListQuestion>
|
||||
implements CheckListQuestionDao {
|
||||
|
||||
public CheckListQuestionDaoJPAImp() {
|
||||
super(CheckListQuestion.class);
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package se.su.dsv.scipro.data.dao.jpa;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import se.su.dsv.scipro.data.dao.interfaces.CheckListQuestionDao;
|
||||
import se.su.dsv.scipro.data.dao.interfaces.CheckListTemplateDao;
|
||||
import se.su.dsv.scipro.data.dataobjects.CheckListQuestion;
|
||||
import se.su.dsv.scipro.data.dataobjects.CheckListTemplate;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Fredrik Norberg - fnorbe@dsv.su.se
|
||||
*
|
||||
*/
|
||||
|
||||
@Repository("checkListTemplateDao")
|
||||
public class CheckListTemplateDaoJPAImp extends AbstractDaoJPAImp<CheckListTemplate>
|
||||
implements CheckListTemplateDao {
|
||||
|
||||
public CheckListTemplateDaoJPAImp() {
|
||||
super(CheckListTemplate.class);
|
||||
}
|
||||
}
|
140
src/main/java/se/su/dsv/scipro/data/dataobjects/CheckList.java
Normal file
140
src/main/java/se/su/dsv/scipro/data/dataobjects/CheckList.java
Normal file
@ -0,0 +1,140 @@
|
||||
package se.su.dsv.scipro.data.dataobjects;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.persistence.Cacheable;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import org.hibernate.annotations.Cache;
|
||||
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||
|
||||
/**
|
||||
|
||||
* @author Fredrik Norberg fnorbe@dsv.su.se
|
||||
*
|
||||
*/
|
||||
|
||||
@Entity
|
||||
@Table(name="checklist")
|
||||
@Cacheable(true)
|
||||
@Cache(usage= CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) //Hibernate
|
||||
public abstract class CheckList extends LazyDeletableDomainObject{
|
||||
|
||||
private static final long serialVersionUID = 2959377496669050427L;
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
private Long id;
|
||||
|
||||
@Column(nullable=false)
|
||||
private String name;
|
||||
|
||||
@ManyToOne(optional=false)
|
||||
private User creator;
|
||||
|
||||
@Column(nullable=false)
|
||||
private List<CheckListQuestion> questions;
|
||||
|
||||
@Column(nullable=false)
|
||||
private ProjectClass level;
|
||||
|
||||
public CheckList() {}
|
||||
|
||||
public CheckList(String name, User creator, ProjectClass level) {
|
||||
this.name = name;
|
||||
this.creator = creator;
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getname() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getName(final int characters) {
|
||||
String result = name;
|
||||
if(name.length() > characters)
|
||||
result = name.substring(0, characters)+"..";
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
public void setCreator(User creator) {
|
||||
this.creator = creator;
|
||||
}
|
||||
|
||||
public User getCreator() {
|
||||
return creator;
|
||||
}
|
||||
|
||||
public List<CheckListQuestion> getquestions(){
|
||||
return questions;
|
||||
}
|
||||
|
||||
public void setquestions(List<CheckListQuestion> questions){
|
||||
this.questions=questions;
|
||||
}
|
||||
|
||||
public void setLevel(ProjectClass level){
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
public ProjectClass getLevel(){
|
||||
return level;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int weight = 31;
|
||||
int result = 17;
|
||||
|
||||
result = weight * result + ((id == null) ? 0 : (int) (id ^ (id >>> 32)));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (obj instanceof CheckList){
|
||||
|
||||
CheckList other = (CheckList) obj;
|
||||
|
||||
if (id == null) {
|
||||
if (other.id != null)
|
||||
return false;
|
||||
} else if (!id.equals(other.id))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getname();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,106 @@
|
||||
package se.su.dsv.scipro.data.dataobjects;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.EnumType;
|
||||
import javax.persistence.Enumerated;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.TypedQuery;
|
||||
|
||||
import org.apache.wicket.markup.html.panel.Panel;
|
||||
|
||||
import se.su.dsv.scipro.data.enums.CheckListQuestionAnswer;
|
||||
import se.su.dsv.scipro.data.enums.EventStatus;
|
||||
import se.su.dsv.scipro.schedule.baseevent.panels.EventScheduleDetailsPanel;
|
||||
import se.su.dsv.scipro.util.IAjaxCallback;
|
||||
|
||||
/**
|
||||
* @author Fredrik Norberg fnorbe@dsv.su.se
|
||||
*
|
||||
*/
|
||||
@Entity
|
||||
@Table(name="checklist_answer")
|
||||
public class CheckListAnswer extends DomainObject{
|
||||
|
||||
private static final long serialVersionUID = 2959377496669050427L;
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
private Long id;
|
||||
|
||||
@Enumerated(EnumType.STRING)
|
||||
private CheckListQuestionAnswer answer;
|
||||
|
||||
@ManyToOne
|
||||
private User user;
|
||||
|
||||
|
||||
public CheckListAnswer() {}
|
||||
|
||||
public CheckListAnswer(User user, CheckListQuestionAnswer answer) {
|
||||
this.user = user;
|
||||
this.answer = answer;
|
||||
}
|
||||
|
||||
public CheckListQuestionAnswer getAnswer() {
|
||||
return answer;
|
||||
}
|
||||
|
||||
public void setAnswer(CheckListQuestionAnswer answer) {
|
||||
this.answer = answer;
|
||||
}
|
||||
|
||||
public User getUser() {
|
||||
return user;
|
||||
}
|
||||
|
||||
public void setUser(User user) {
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int weight = 31;
|
||||
int result = 17;
|
||||
|
||||
result = weight * result + ((id == null) ? 0 : (int) (id ^ (id >>> 32)));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (obj instanceof CheckListAnswer){
|
||||
|
||||
CheckListAnswer other = (CheckListAnswer) obj;
|
||||
|
||||
if (id == null) {
|
||||
if (other.id != null)
|
||||
return false;
|
||||
} else if (!id.equals(other.id))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,116 @@
|
||||
package se.su.dsv.scipro.data.dataobjects;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.persistence.Cacheable;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Lob;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import org.hibernate.annotations.Cache;
|
||||
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||
|
||||
/**
|
||||
* @author Fredrik Norberg - fnorbe@dsv.su.se
|
||||
*/
|
||||
|
||||
|
||||
@Entity
|
||||
@Table(name="checklist_question")
|
||||
@Cacheable(true)
|
||||
@Cache(usage= CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) //Hibernate
|
||||
public abstract class CheckListQuestion extends DomainObject
|
||||
implements Comparable<CheckListQuestion> {
|
||||
|
||||
private static final long serialVersionUID = 2959377496669050427L;
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
private Long id;
|
||||
|
||||
@Lob
|
||||
@Column(nullable=false)
|
||||
private String question;
|
||||
|
||||
@Column(nullable=false)
|
||||
private int questionNumber;
|
||||
|
||||
@OneToMany
|
||||
List<CheckListAnswer> answers;
|
||||
|
||||
public CheckListQuestion() {}
|
||||
|
||||
public CheckListQuestion(String question) {
|
||||
this.question = question;
|
||||
questionNumber = answers.size() + 1;
|
||||
}
|
||||
|
||||
public String getQuestion() {
|
||||
return question;
|
||||
}
|
||||
|
||||
public void setQuestion(String question) {
|
||||
this.question = question;
|
||||
}
|
||||
|
||||
public int getQuestionNumber() {
|
||||
return questionNumber;
|
||||
}
|
||||
|
||||
public void setQuestionNumber(int questionNumber) {
|
||||
this.questionNumber = questionNumber;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int weight = 31;
|
||||
int result = 17;
|
||||
|
||||
result = weight * result + ((id == null) ? 0 : (int) (id ^ (id >>> 32)));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (obj instanceof CheckListQuestion){
|
||||
|
||||
CheckListQuestion other = (CheckListQuestion) obj;
|
||||
|
||||
if (id == null) {
|
||||
if (other.id != null)
|
||||
return false;
|
||||
} else if (!id.equals(other.id))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getQuestion();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(CheckListQuestion other) {
|
||||
return questionNumber - other.questionNumber;
|
||||
}
|
||||
}
|
@ -0,0 +1,107 @@
|
||||
package se.su.dsv.scipro.data.dataobjects;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.ElementCollection;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Lob;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.Table;
|
||||
|
||||
/**
|
||||
* @author Fredrik Norberg - fnorbe@dsv.su.se
|
||||
*
|
||||
*/
|
||||
@Entity
|
||||
@Table(name="checklist_template")
|
||||
public class CheckListTemplate extends DomainObject {
|
||||
|
||||
private static final long serialVersionUID = 2959377496669050427L;
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
private Long id;
|
||||
|
||||
@Column(nullable=false)
|
||||
private String name;
|
||||
|
||||
@Lob
|
||||
@ElementCollection
|
||||
List<String> questions;
|
||||
|
||||
@ManyToOne(optional=false)
|
||||
private User creator;
|
||||
|
||||
public CheckListTemplate() {}
|
||||
|
||||
public CheckListTemplate(String name, User creator) {
|
||||
this.name = name;
|
||||
this.creator = creator;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public void setCreator(User creator) {
|
||||
this.creator = creator;
|
||||
}
|
||||
|
||||
public User getCreator() {
|
||||
return creator;
|
||||
}
|
||||
|
||||
public List<String> getQuestions(){
|
||||
return questions;
|
||||
}
|
||||
|
||||
public void setQuestions(List<String> questions){
|
||||
this.questions = questions;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int weight = 31;
|
||||
int result = 17;
|
||||
|
||||
result = weight * result + ((id == null) ? 0 : (int) (id ^ (id >>> 32)));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (obj instanceof CheckListTemplate){
|
||||
|
||||
CheckListTemplate other = (CheckListTemplate) obj;
|
||||
|
||||
if (id == null) {
|
||||
if (other.id != null)
|
||||
return false;
|
||||
} else if (!id.equals(other.id))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
package se.su.dsv.scipro.data.enums;
|
||||
|
||||
public enum CheckListQuestionAnswer {
|
||||
RED,
|
||||
GREEN,
|
||||
YELLOW
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
<!DOCTYPE html>
|
||||
<html
|
||||
xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd">
|
||||
<body>
|
||||
<wicket:extend>
|
||||
<div wicket:id="trafficLightPanel""></div>
|
||||
</wicket:extend>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,19 @@
|
||||
package se.su.dsv.scipro.project.pages;
|
||||
|
||||
import org.apache.wicket.PageParameters;
|
||||
|
||||
import se.su.dsv.scipro.checklists.panels.TrafficLightPanel;
|
||||
|
||||
/**
|
||||
* @author Fredrik Norberg - fnorbe@dsv.su.se
|
||||
*
|
||||
*/
|
||||
|
||||
public class SelfCheckPage extends ProjectPage {
|
||||
|
||||
public SelfCheckPage(PageParameters pp) {
|
||||
super(pp);
|
||||
add(new TrafficLightPanel("trafficLightPanel", this));
|
||||
}
|
||||
|
||||
}
|
@ -18,6 +18,7 @@ import se.su.dsv.scipro.project.pages.ProjectPage;
|
||||
import se.su.dsv.scipro.project.pages.ProjectPartnerPage;
|
||||
import se.su.dsv.scipro.project.pages.ProjectSchedulePlannerPage;
|
||||
import se.su.dsv.scipro.project.pages.ProjectStartPage;
|
||||
import se.su.dsv.scipro.project.pages.SelfCheckPage;
|
||||
import se.su.dsv.scipro.repository.panels.ProjectFilePanel;
|
||||
|
||||
/**
|
||||
@ -47,6 +48,7 @@ public class ProjectTabMenuPanel extends AbstractMenuPanel {
|
||||
itemList.add(new MenuItem("Peer review", ProjectPeerPortalPage.class));
|
||||
itemList.add(new MenuItem("All Final Seminars", FinalSeminarProjectListPage.class));
|
||||
itemList.add(new MenuItem("Conference", ProjectConferencePage.class));
|
||||
itemList.add(new MenuItem("Self Check", SelfCheckPage.class));
|
||||
} else {
|
||||
itemList.add(new MenuItem("No active project!", NoActiveProjectPage.class));
|
||||
itemList.add(new MenuItem("Project Partner", ProjectPartnerPage.class));
|
||||
|
@ -1053,3 +1053,7 @@ div.wicket-aa ul li.selected {
|
||||
font-size: 1.4em;
|
||||
font-style: strong;
|
||||
}
|
||||
|
||||
body {
|
||||
font: 0.8em/21px arial,sans-serif;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user