Commit eff35ee1 by Tuomas Riihimäki

Compostuff

 * Fix creation functions
 * Refactor minor views to one file
 * Add 'hidden' boolean to compo
1 parent 7ee4efc0
......@@ -57,6 +57,9 @@ public class BootstrapBean implements BootstrapBeanLocal {
"delete from menu_navigation where item_id in (select id from menuitem where url in ( '/actionlog/messagelist'))",
"delete from menuitem where url in ('/actionlog/messagelist')",
});
dbUpdates.add(new String[] {
"alter table compos add hidden boolean default false not null"
});
}
......
......@@ -59,6 +59,7 @@ public class VotingBean implements VotingBeanLocal {
voteFacade.create(v);
}
@RolesAllowed(CompoPermission.S_MANAGE)
public void createCompo(Compo c) {
c.setEvent(eventBean.getCurrentEvent());
compoFacade.create(c);
......@@ -73,15 +74,15 @@ public class VotingBean implements VotingBeanLocal {
c.getCompoEntries().add(compoEntry);
compoFacade.flush();
compoEntryFile.setEntriesId(compoEntry);
compoEntry.getFiles().add(compoEntryFile);
// compoEntry.getFiles().add(compoEntryFile);
}
public Compo getCompoById(Integer compoId) {
return compoFacade.find(compoId);
}
public List<Compo> getCompoList() {
return compoFacade.getList();
public List<Compo> getCompoList(boolean showHidden) {
return compoFacade.getList(showHidden);
}
@Override
......@@ -129,16 +130,17 @@ public class VotingBean implements VotingBeanLocal {
return compoEntryFacade.find(entryId);
}
@Override
public CompoEntry findEntryWithFiles(Integer entryId) {
CompoEntry ret = compoEntryFacade.find(entryId);
logger.debug("Found files {}", ret.getFiles().size());
return ret;
}
// @Override
// public CompoEntry findEntryWithFiles(Integer entryId) {
// CompoEntry ret = compoEntryFacade.find(entryId);
// // logger.debug("Found files {}", ret.getFiles().size());
//
// return ret;
//
// }
@Override
@RolesAllowed(CompoPermission.S_MANAGE)
public CompoEntry saveSort(CompoEntry e) {
CompoEntry entry = compoEntryFacade.find(e.getId());
entry.setSort(e.getSort());
......@@ -177,4 +179,15 @@ public class VotingBean implements VotingBeanLocal {
return voteEntity;
}
@Override
@RolesAllowed(CompoPermission.S_MANAGE)
public Compo saveCompo(Compo compo) {
return compoFacade.merge(compo);
}
@Override
public void create(CompoEntryFile cef) {
compoEntryFileFacade.create(cef);
}
}
package fi.codecrew.moya.facade;
import java.util.ArrayList;
import java.util.List;
import javax.ejb.EJB;
......@@ -7,11 +8,12 @@ import javax.ejb.LocalBean;
import javax.ejb.Stateless;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root;
import fi.codecrew.moya.model.Compo_;
import fi.codecrew.moya.beans.EventBeanLocal;
import fi.codecrew.moya.model.Compo;
import fi.codecrew.moya.model.Compo_;
@Stateless
@LocalBean
......@@ -23,11 +25,17 @@ public class CompoFacade extends IntegerPkGenericFacade<Compo> {
super(Compo.class);
}
public List<Compo> getList() {
public List<Compo> getList(boolean showHidden) {
CriteriaBuilder cb = getEm().getCriteriaBuilder();
CriteriaQuery<Compo> cq = cb.createQuery(Compo.class);
Root<Compo> root = cq.from(Compo.class);
cq.where(cb.equal(root.get(Compo_.event), eventbean.getCurrentEvent()));
ArrayList<Predicate> preds = new ArrayList<>();
preds.add(cb.equal(root.get(Compo_.event), eventbean.getCurrentEvent()));
if (!showHidden) {
preds.add(cb.isFalse(root.get(Compo_.hidden)));
}
cq.where(preds.toArray(new Predicate[preds.size()]));
cq.orderBy(cb.desc(root.get(Compo_.startTime)));
List<Compo> ret = getEm().createQuery(cq).getResultList();
return ret;
......
......@@ -15,7 +15,7 @@ public interface VotingBeanLocal {
public void addEntry(CompoEntry compoEntry, CompoEntryFile compoEntryFile);
public List<Compo> getCompoList();
public List<Compo> getCompoList(boolean showHidden);
public Compo getCompoById(Integer compoId);
......@@ -33,6 +33,10 @@ public interface VotingBeanLocal {
public Vote saveVote(CompoEntry entry, Integer vote);
public CompoEntry findEntryWithFiles(Integer entryId);
//public CompoEntry findEntryWithFiles(Integer entryId);
public Compo saveCompo(Compo compo);
public void create(CompoEntryFile cef);
}
......@@ -31,200 +31,212 @@ import org.eclipse.persistence.annotations.OptimisticLockingType;
@Table(name = "compos")
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class Compo extends GenericEntity {
private static final long serialVersionUID = 2L;
/**
* Name of the competition.
*/
@Column(name = "compo_name", nullable = false)
private String name;
public static final String EVENT_ID_COLUMN = "event_id";
@ManyToOne()
@JoinColumn(name = EVENT_ID_COLUMN, nullable = false)
private LanEvent event;
/**
* Start time of the competition Submitting entries should be disabled after
* this time.
*/
@Column(name = "compo_start")
@Temporal(TemporalType.TIMESTAMP)
private Date startTime;
@Column(name = "compo_end")
@Temporal(TemporalType.TIMESTAMP)
private Date endTime;
/**
* When the voting should start
*
* @see {@link #holdVoting}
*/
@Column(name = "vote_start")
@Temporal(TemporalType.TIMESTAMP)
private Date voteStart;
@Column(name = "vote_end")
@Temporal(TemporalType.TIMESTAMP)
private Date voteEnd;
@Column(name = "submit_start")
@Temporal(TemporalType.TIMESTAMP)
private Date submitStart;
@Column(name = "submit_end")
@Temporal(TemporalType.TIMESTAMP)
private Date submitEnd;
@Lob
@Column(name = "description")
private String description;
@Column(name = "max_participant_count")
private int maxParticipantCount;
/**
* If ( for some unimaginable reason ) compo is delayed hold voting can be
* used to postpone the start of the voting from the time specified in
* {@link #voteStart}
*/
@Column(name = "hold_voting", nullable = false)
private boolean holdVoting = true;
/**
* Entries submitted to participate this compo.
*/
@OneToMany(cascade = CascadeType.ALL, mappedBy = "compo")
@OrderBy("sort")
private List<CompoEntry> compoEntries;
public Compo(String compoName, boolean holdVoting) {
this();
this.name = compoName;
this.holdVoting = holdVoting;
}
public boolean isSubmit()
{
Calendar now = Calendar.getInstance();
return now.after(getSubmitStart()) && now.before(getSubmitEnd());
}
public boolean isVote()
{
Calendar now = Calendar.getInstance();
return !getHoldVoting() &&
now.after(getVoteStart()) &&
now.before(getVoteEnd());
}
public Compo() {
super();
}
public String getName() {
return name;
}
public void setName(String compoName) {
this.name = compoName;
}
public Date getStartTime() {
return startTime;
}
public void setStartTime(Date compoStart) {
this.startTime = compoStart;
}
public Date getVoteStart() {
return voteStart;
}
public void setVoteStart(Date voteStart) {
this.voteStart = voteStart;
}
public Date getVoteEnd() {
return voteEnd;
}
public void setVoteEnd(Date voteEnd) {
this.voteEnd = voteEnd;
}
public Date getSubmitStart() {
return submitStart;
}
public void setSubmitStart(Date submitStart) {
this.submitStart = submitStart;
}
public Date getSubmitEnd() {
return submitEnd;
}
public void setSubmitEnd(Date submitEnd) {
this.submitEnd = submitEnd;
}
public boolean getHoldVoting() {
return holdVoting;
}
public void setHoldVoting(boolean holdVoting) {
this.holdVoting = holdVoting;
}
public List<CompoEntry> getCompoEntries() {
return compoEntries;
}
public void setCompoEntries(List<CompoEntry> compoEntryList) {
this.compoEntries = compoEntryList;
}
public void setDescription(String description) {
this.description = description;
}
public String getDescription() {
return description;
}
/**
* @return the maxParticipantCount
*/
public int getMaxParticipantCount() {
return maxParticipantCount;
}
/**
* @param maxParticipantCount
* the maxParticipantCount to set
*/
public void setMaxParticipantCount(int maxParticipantCount) {
this.maxParticipantCount = maxParticipantCount;
}
public LanEvent getEvent() {
return event;
}
public void setEvent(LanEvent event) {
this.event = event;
}
public Date getEndTime() {
return endTime;
}
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
private static final long serialVersionUID = 2L;
/**
* Name of the competition.
*/
@Column(name = "compo_name", nullable = false)
private String name;
public static final String EVENT_ID_COLUMN = "event_id";
@ManyToOne()
@JoinColumn(name = EVENT_ID_COLUMN, nullable = false)
private LanEvent event;
/**
* Start time of the competition Submitting entries should be disabled after
* this time.
*/
@Column(name = "compo_start")
@Temporal(TemporalType.TIMESTAMP)
private Date startTime;
@Column(name = "compo_end")
@Temporal(TemporalType.TIMESTAMP)
private Date endTime;
/**
* When the voting should start
*
* @see {@link #holdVoting}
*/
@Column(name = "vote_start")
@Temporal(TemporalType.TIMESTAMP)
private Date voteStart;
@Column(name = "vote_end")
@Temporal(TemporalType.TIMESTAMP)
private Date voteEnd;
@Column(name = "submit_start")
@Temporal(TemporalType.TIMESTAMP)
private Date submitStart;
@Column(name = "submit_end")
@Temporal(TemporalType.TIMESTAMP)
private Date submitEnd;
@Lob
@Column(name = "description")
private String description;
@Column(name = "max_participant_count")
private int maxParticipantCount;
/**
* If ( for some unimaginable reason ) compo is delayed hold voting can be
* used to postpone the start of the voting from the time specified in
* {@link #voteStart}
*/
@Column(name = "hold_voting", nullable = false)
private boolean holdVoting = false;
@Column(name = "hidden", nullable = false)
private boolean hidden = false;
public boolean isHidden() {
return hidden;
}
public void setHidden(boolean hidden) {
this.hidden = hidden;
}
/**
* Entries submitted to participate this compo.
*/
@OneToMany(cascade = CascadeType.ALL, mappedBy = "compo")
@OrderBy("sort")
private List<CompoEntry> compoEntries;
public Compo(String compoName, boolean holdVoting) {
this();
this.name = compoName;
this.holdVoting = holdVoting;
}
public boolean isSubmit()
{
Calendar now = Calendar.getInstance();
return now.after(getSubmitStart()) && now.before(getSubmitEnd());
}
public boolean isVote()
{
Calendar now = Calendar.getInstance();
return !getHoldVoting() &&
now.after(getVoteStart()) &&
now.before(getVoteEnd());
}
public Compo() {
super();
}
public String getName() {
return name;
}
public void setName(String compoName) {
this.name = compoName;
}
public Date getStartTime() {
return startTime;
}
public void setStartTime(Date compoStart) {
this.startTime = compoStart;
}
public Date getVoteStart() {
return voteStart;
}
public void setVoteStart(Date voteStart) {
this.voteStart = voteStart;
}
public Date getVoteEnd() {
return voteEnd;
}
public void setVoteEnd(Date voteEnd) {
this.voteEnd = voteEnd;
}
public Date getSubmitStart() {
return submitStart;
}
public void setSubmitStart(Date submitStart) {
this.submitStart = submitStart;
}
public Date getSubmitEnd() {
return submitEnd;
}
public void setSubmitEnd(Date submitEnd) {
this.submitEnd = submitEnd;
}
public boolean getHoldVoting() {
return holdVoting;
}
public void setHoldVoting(boolean holdVoting) {
this.holdVoting = holdVoting;
}
public List<CompoEntry> getCompoEntries() {
return compoEntries;
}
public void setCompoEntries(List<CompoEntry> compoEntryList) {
this.compoEntries = compoEntryList;
}
public void setDescription(String description) {
this.description = description;
}
public String getDescription() {
return description;
}
/**
* @return the maxParticipantCount
*/
public int getMaxParticipantCount() {
return maxParticipantCount;
}
/**
* @param maxParticipantCount
* the maxParticipantCount to set
*/
public void setMaxParticipantCount(int maxParticipantCount) {
this.maxParticipantCount = maxParticipantCount;
}
public LanEvent getEvent() {
return event;
}
public void setEvent(LanEvent event) {
this.event = event;
}
public Date getEndTime() {
return endTime;
}
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
}
......@@ -11,7 +11,6 @@ import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
......@@ -23,7 +22,6 @@ import javax.persistence.TemporalType;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
import org.eclipse.persistence.annotations.PrivateOwned;
/**
*
......@@ -32,170 +30,155 @@ import org.eclipse.persistence.annotations.PrivateOwned;
@Table(name = "compo_entries")
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class CompoEntry extends GenericEntity {
private static final long serialVersionUID = 2L;
private static final long serialVersionUID = 2L;
@JoinColumn(name = "compo_id", referencedColumnName = "id", nullable = false)
@ManyToOne(optional = false)
private Compo compo;
@JoinColumn(name = "compo_id", referencedColumnName = "id", nullable = false)
@ManyToOne(optional = false)
private Compo compo;
@Column(name = "entry_created", nullable = false)
@Temporal(TemporalType.TIMESTAMP)
private Calendar created = Calendar.getInstance();
@Column(name = "entry_created", nullable = false)
@Temporal(TemporalType.TIMESTAMP)
private Calendar created = Calendar.getInstance();
@Column(name = "title", nullable = false)
private String title = "";
@Column(name = "author")
private String author = "";
@Lob
@Column(name = "notes")
private String notes = "";
@Lob
@Column(name = "screen_message")
private String screenMessage = "";
@Column(name = "sort")
private Integer sort = 10;
@Column(name = "title", nullable = false)
private String title = "";
@Column(name = "author")
private String author = "";
@Lob
@Column(name = "notes")
private String notes = "";
@Lob
@Column(name = "screen_message")
private String screenMessage = "";
@Column(name = "sort")
private Integer sort = 10;
@Column(name = "final_position")
private Integer finalPosition;
@JoinColumn(name = "current_file_id", referencedColumnName = CompoEntryFile.ID_COLUMN)
@OneToOne
private CompoEntryFile currentFile;
@OneToMany(mappedBy = "compoEntry")
private List<Vote> votes;
@PrivateOwned
@OneToMany(cascade = CascadeType.ALL, mappedBy = "entry", fetch = FetchType.LAZY)
private List<CompoEntryFile> files;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "entry")
private List<CompoEntryParticipant> participants;
@JoinColumn(name = "creator_eventuser_id", referencedColumnName = EventUser.ID_COLUMN, nullable = false)
@ManyToOne
private EventUser creator;
public Integer getVotetotal()
{
int votetotal = 0;
for (Vote v : getVotes()) {
votetotal += v.getScore();
}
return votetotal;
}
public CompoEntry() {
super();
}
public Calendar getCreated() {
return created;
}
public void setCreated(Calendar entryCreated) {
this.created = entryCreated;
}
public String getNotes() {
return notes;
}
public void setNotes(String notes) {
this.notes = notes;
}
public String getScreenMessage() {
return screenMessage;
}
public void setScreenMessage(String screenMessage) {
this.screenMessage = screenMessage;
}
public Integer getSort() {
return sort;
}
public void setSort(Integer sort) {
this.sort = sort;
}
public List<Vote> getVotes() {
return votes;
}
public void setVotes(List<Vote> voteList) {
this.votes = voteList;
}
public List<CompoEntryFile> getFiles() {
return files;
}
public void setFiles(List<CompoEntryFile> compoEntryFileList) {
this.files = compoEntryFileList;
}
public List<CompoEntryParticipant> getParticipants() {
return participants;
}
public void setParticipants(
List<CompoEntryParticipant> compoEntryParticipantList) {
this.participants = compoEntryParticipantList;
}
public Compo getCompo() {
return compo;
}
public void setCompo(Compo composId) {
this.compo = composId;
}
public EventUser getCreator() {
return creator;
}
public void setCreator(EventUser creator) {
this.creator = creator;
}
public void setFinalPosition(Integer finalPosition) {
this.finalPosition = finalPosition;
}
public Integer getFinalPosition() {
return finalPosition;
}
public void setCurrentFile(CompoEntryFile currentFile) {
this.currentFile = currentFile;
}
public CompoEntryFile getCurrentFile() {
return currentFile;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
@Column(name = "final_position")
private Integer finalPosition;
@JoinColumn(name = "current_file_id", referencedColumnName = CompoEntryFile.ID_COLUMN)
@OneToOne
private CompoEntryFile currentFile;
@OneToMany(mappedBy = "compoEntry")
private List<Vote> votes;
//
// @PrivateOwned
// @OneToMany(cascade = CascadeType.ALL, mappedBy = "entry", fetch =
// FetchType.LAZY)
// private List<CompoEntryFile> files;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "entry")
private List<CompoEntryParticipant> participants;
@JoinColumn(name = "creator_eventuser_id", referencedColumnName = EventUser.ID_COLUMN, nullable = false)
@ManyToOne
private EventUser creator;
public Integer getVotetotal()
{
int votetotal = 0;
for (Vote v : getVotes()) {
votetotal += v.getScore();
}
return votetotal;
}
public CompoEntry() {
super();
}
public Calendar getCreated() {
return created;
}
public void setCreated(Calendar entryCreated) {
this.created = entryCreated;
}
public String getNotes() {
return notes;
}
public void setNotes(String notes) {
this.notes = notes;
}
public String getScreenMessage() {
return screenMessage;
}
public void setScreenMessage(String screenMessage) {
this.screenMessage = screenMessage;
}
public Integer getSort() {
return sort;
}
public void setSort(Integer sort) {
this.sort = sort;
}
public List<Vote> getVotes() {
return votes;
}
public void setVotes(List<Vote> voteList) {
this.votes = voteList;
}
public List<CompoEntryParticipant> getParticipants() {
return participants;
}
public void setParticipants(
List<CompoEntryParticipant> compoEntryParticipantList) {
this.participants = compoEntryParticipantList;
}
public Compo getCompo() {
return compo;
}
public void setCompo(Compo composId) {
this.compo = composId;
}
public EventUser getCreator() {
return creator;
}
public void setCreator(EventUser creator) {
this.creator = creator;
}
public void setFinalPosition(Integer finalPosition) {
this.finalPosition = finalPosition;
}
public Integer getFinalPosition() {
return finalPosition;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
}
......@@ -5,10 +5,14 @@
package fi.codecrew.moya.model;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Calendar;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
......@@ -16,8 +20,11 @@ import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.apache.commons.codec.binary.Hex;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
......@@ -26,94 +33,110 @@ import org.eclipse.persistence.annotations.OptimisticLockingType;
@Table(name = "compo_entry_files")
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class CompoEntryFile extends GenericEntity {
private static final long serialVersionUID = 1L;
@Column(name = "mime_type")
private String mimeType;
@Column(name = "file_name")
private String fileName;
@Lob
@Column(name = "description")
private String description;
@Column(name = "hash")
private String hash;
@Lob
@Column(name = "file_data")
private byte[] fileData;
@Column(name = "uploaded", nullable = false)
@Temporal(TemporalType.TIMESTAMP)
private Calendar uploaded = Calendar.getInstance();
@JoinColumn(name = "entry_id", referencedColumnName = "id", nullable = false, updatable = false)
@ManyToOne(optional = false)
private CompoEntry entry;
public CompoEntryFile() {
super();
}
public CompoEntryFile(CompoEntry entry) {
this.entry = entry;
}
public String getMimeType() {
return mimeType;
}
public void setMimeType(String mimeType) {
this.mimeType = mimeType;
}
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getHash() {
return hash;
}
public void setHash(String hash) {
this.hash = hash;
}
public byte[] getFileData() {
return fileData;
}
public void setFileData(byte[] fileData) {
this.fileData = fileData;
}
public Calendar getUploaded() {
return uploaded;
}
public void setUploaded(Calendar uploaded) {
this.uploaded = uploaded;
}
public CompoEntry getEntriesId() {
return entry;
}
public void setEntriesId(CompoEntry entriesId) {
this.entry = entriesId;
}
private static final long serialVersionUID = 1L;
@Column(name = "mime_type")
private String mimeType;
@Column(name = "file_name")
private String fileName;
@Lob
@Column(name = "description")
private String description;
@Column(name = "hash", updatable = false)
private String hash;
@Lob
@Column(name = "file_data", updatable = false)
@Basic(fetch = FetchType.LAZY)
private byte[] fileData;
@Column(name = "uploaded", nullable = false)
@Temporal(TemporalType.TIMESTAMP)
private Calendar uploaded = Calendar.getInstance();
@JoinColumn(name = "entry_id", referencedColumnName = "id", nullable = false, updatable = false)
@ManyToOne(optional = false)
private CompoEntry entry;
private static final Logger logger = LoggerFactory.getLogger(CompoEntryFile.class);
public CompoEntryFile() {
super();
}
public CompoEntryFile(CompoEntry entry) {
this.entry = entry;
}
public String getMimeType() {
return mimeType;
}
public void setMimeType(String mimeType) {
this.mimeType = mimeType;
}
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getHash() {
return hash;
}
public void setHash(String hash) {
this.hash = hash;
}
public byte[] getFileData() {
return fileData;
}
public void setFileData(byte[] fileData) {
this.fileData = fileData;
this.hash = getShaChecksum(fileData);
}
public Calendar getUploaded() {
return uploaded;
}
public void setUploaded(Calendar uploaded) {
this.uploaded = uploaded;
}
public CompoEntry getEntriesId() {
return entry;
}
public void setEntriesId(CompoEntry entriesId) {
this.entry = entriesId;
}
public static String getShaChecksum(byte[] data)
{
String ret = "ERROR CALCULATING CHECKSUM!";
try {
MessageDigest algo = MessageDigest.getInstance("SHA");
algo.update(data);
ret = new String(Hex.encodeHex(algo.digest())).toLowerCase();
} catch (NoSuchAlgorithmException e) {
logger.warn("Error calculating checksum", e);
}
return ret;
}
}
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:composite="http://java.sun.com/jsf/composite"
xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:tools="http://java.sun.com/jsf/composite/tools" xmlns:p="http://primefaces.org/ui">
<composite:interface>
<composite:attribute name="commitValue" required="true" />
<composite:attribute name="commitAction" method-signature="java.lang.String action()" required="true" />
</composite:interface>
<composite:implementation>
<h:form>
<h:panelGrid columns="3">
<h:outputLabel value="#{i18n['voting.create.name']}:" for="name" />
<h:inputText value="#{compoMgmtView.compo.name}" id="name" />
<h:message for="name" />
<h:outputLabel value="#{i18n['voting.create.description']}:" for="desc" />
<h:inputText value="#{compoMgmtView.compo.description}" id="desc" />
<h:message for="desc" />
<h:outputLabel value="#{i18n['voting.create.maxParticipants']}:" for="maxPar" />
<h:inputText value="#{compoMgmtView.compo.maxParticipantCount}" id="maxPar" />
<h:message for="maxPar" />
<h:outputLabel value="#{i18n['voting.create.holdVoting']}:" for="holdVoting" />
<h:selectBooleanCheckbox value="#{compoMgmtView.compo.holdVoting}" id="holdVoting" />
<h:message for="holdVoting" />
<h:outputLabel value="#{i18n['voting.create.hidden']}:" for="hidden" />
<h:selectBooleanCheckbox value="#{compoMgmtView.compo.hidden}" id="hidden" />
<h:message for="hidden" />
<h:outputLabel value="#{i18n['voting.create.compoStart']}:" for="cStart" />
<p:calendar validator="#{votingDateValidator.saveCStart}" value="#{compoMgmtView.compo.startTime}" pattern="dd/MM/yyyy HH:mm" id="cStart" />
<h:message for="cStart" />
<h:outputLabel value="#{i18n['voting.create.compoEnd']}:" for="cEnd" />
<p:calendar validator="#{votingDateValidator.validateCompo}" value="#{compoMgmtView.compo.endTime}" pattern="dd/MM/yyyy HH:mm" id="cEnd" />
<h:message for="cEnd" />
<h:outputLabel value="#{i18n['voting.create.voteStart']}:" for="vStart" />
<p:calendar validator="#{votingDateValidator.saveVStart}" value="#{compoMgmtView.compo.voteStart}" pattern="dd/MM/yyyy HH:mm" id="vStart" />
<h:message for="vStart" />
<h:outputLabel value="#{i18n['voting.create.voteEnd']}:" for="vEnd" />
<p:calendar validator="#{votingDateValidator.validateVote}" value="#{compoMgmtView.compo.voteEnd}" pattern="dd/MM/yyyy HH:mm" id="vEnd" />
<h:message for="vEnd" />
<h:outputLabel value="#{i18n['voting.create.submitStart']}:" for="sStart" />
<p:calendar validator="#{votingDateValidator.saveSStart}" value="#{compoMgmtView.compo.submitStart}" pattern="dd/MM/yyyy HH:mm" id="sStart" />
<h:message for="sStart" />
<h:outputLabel value="#{i18n['voting.create.submitEnd']}:" for="sEnd" />
<p:calendar validator="#{votingDateValidator.validateSubmit}" value="#{compoMgmtView.compo.submitEnd}" pattern="dd/MM/yyyy HH:mm" id="sEnd" />
<h:message for="sEnd" />
<h:commandButton action="#{cc.attrs.commitAction}" id="commitbutton" value="#{cc.attrs.commitValue}" />
</h:panelGrid>
</h:form>
</composite:implementation>
</html>
......@@ -7,7 +7,7 @@
<h:body>
<ui:composition template="#{sessionHandler.template}">
<f:metadata>
<f:event type="preRenderView" listener="#{compoView.initListView()}" />
<f:event type="preRenderView" listener="#{compoView.initAdminListView()}" />
</f:metadata>
<ui:define name="content">
<h:outputStylesheet library="style" name="insomnia2/css/actionlog.css" />
......@@ -15,13 +15,10 @@
<p>#{i18n['voting.allcompos.description']}</p>
<h:form>
<h:dataTable styleClass="bordertable" rowClasses="roweven,rowodd" id="compolisttable" value="#{compoView.compos}" var="compo">
<h:column>
<f:facet name="header">
<h:outputText value="#{i18n['voting.allcompos.name']}" />
</f:facet>
<p:dataTable styleClass="bordertable" rowClasses="roweven,rowodd" id="compolisttable" value="#{compoView.compos}" var="compo">
<p:column headerText="#{i18n['voting.allcompos.name']}">
<h:outputText value="#{compo.name}" />
</h:column>
</p:column>
<!-- <h:column rendered="#{compoView.curEntries}"> -->
<!-- <f:facet name="header"> -->
......@@ -35,45 +32,42 @@
<!-- </f:facet> -->
<!-- <h:outputText value="#{compo.maxParticipantCount}" /> -->
<!-- </h:column> -->
<h:column>
<f:facet name="header">
<h:outputText value="#{i18n['voting.allcompos.startTime']}" />
</f:facet>
<p:column headerText="#{i18n['voting.allcompos.startTime']}">
<h:outputText value="#{compo.startTime.time}">
<f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
<f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
</h:outputText>
</h:column>
</p:column>
<h:column>
<f:facet name="header">
<h:outputText value="#{i18n['voting.allcompos.voteEnd']}" />
</f:facet>
<p:column headerText="#{i18n['voting.allcompos.voteEnd']}">
<h:outputText value="#{compo.voteEnd.time}">
<f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
<f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
</h:outputText>
</h:column>
</p:column>
<h:column>
<f:facet name="header">
<h:outputText value="#{i18n['voting.allcompos.submitEnd']}" />
</f:facet>
<p:column headerText="#{i18n['voting.allcompos.submitEnd']}">
<h:outputText value="#{compo.submitEnd.time}">
<f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
<f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
</h:outputText>
</h:column>
<h:column>
</p:column>
<p:column headerText="#{i18n['voting.allcompos.holdVoting']}">
<h:outputText value="#{compo.holdVoting}" />
</p:column>
<p:column headerText="#{i18n['voting.allcompos.hidden']}">
<h:outputText value="#{compo.hidden}" />
</p:column>
<p:column>
<h:commandButton rendered="#{compo.vote or compoView.manage}" action="#{compoView.startVote()}" value="#{i18n['voting.compo.vote']}" />
</h:column>
<h:column>
</p:column>
<p:column>
<h:commandButton rendered="#{compo.submit or compoView.manage}" action="#{compoView.submitEntry()}" value="#{i18n['voting.compo.submit']}" />
</h:column>
<h:column rendered="#{compoView.manage}">
</p:column>
<p:column rendered="#{compoView.manage}">
<h:link outcome="details" value="#{i18n['compo.edit']}">
<f:param name="compoId" value="#{compo.id}" />
</h:link>
</h:column>
</h:dataTable>
</p:column>
</p:dataTable>
</h:form>
</ui:define>
......
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html" xmlns:users="http://java.sun.com/jsf/composite/cditools/user"
xmlns:tools="http://java.sun.com/jsf/composite/cditools" xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html"
xmlns:tools="http://java.sun.com/jsf/composite/cditools" xmlns:compo="http://java.sun.com/jsf/composite/cditools/compo" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui">
<h:body>
<ui:composition template="#{sessionHandler.template}">
<f:metadata>
<f:event type="preRenderView" listener="#{votingCreateView.initCreate}" />
<f:event type="preRenderView" listener="#{compoMgmtView.initCreate}" />
</f:metadata>
<ui:define name="content">
<!-- <h:outputStylesheet library="style" name="insomnia2/css/actionlog.css" /> -->
<h1>#{i18n['voting.create.header']}</h1>
<p>#{i18n['voting.create.description']}</p>
<div>
<h:form>
<h:panelGrid columns="3">
<h:outputLabel value="#{i18n['voting.create.name']}:" for="name"/>
<h:inputText value="#{votingCreateView.compo.name}" id="name" />
<h:message for="name" />
<h:outputLabel value="#{i18n['voting.create.description']}:" for="desc"/>
<h:inputText value="#{votingCreateView.compo.description}" id="desc" />
<h:message for="desc" />
<compo:editCompo commitAction="#{compoMgmtView.createCompo}" commitValue="#{i18n['voting.create.createButton']}" />
<h:outputLabel value="#{i18n['voting.create.maxParticipants']}:" for="maxPar" />
<h:inputText value="#{votingCreateView.compo.maxParticipantCount}" id="maxPar" />
<h:message for="maxPar" />
<h:outputLabel value="#{i18n['voting.create.compoStart']}:" for="cStart" />
<p:calendar validator="#{votingDateValidator.saveCStart}" value="#{votingCreateView.compo.startTime}" pattern="dd/MM/yyyy HH:mm" id="cStart" />
<h:message for="cStart" />
<h:outputLabel value="#{i18n['voting.create.compoEnd']}:" for="cEnd"/>
<p:calendar validator="#{votingDateValidator.validateCompo}" value="#{votingCreateView.compo.endTime}" pattern="dd/MM/yyyy HH:mm" id="cEnd" />
<h:message for="cEnd" />
<h:outputLabel value="#{i18n['voting.create.voteStart']}:" for="vStart" />
<p:calendar validator="#{votingDateValidator.saveVStart}" value="#{votingCreateView.compo.voteStart}" pattern="dd/MM/yyyy HH:mm" id="vStart" />
<h:message for="vStart" />
<h:outputLabel value="#{i18n['voting.create.voteEnd']}:" for="vEnd" />
<p:calendar validator="#{votingDateValidator.validateVote}" value="#{votingCreateView.compo.voteEnd}" pattern="dd/MM/yyyy HH:mm" id="vEnd" />
<h:message for="vEnd" />
<h:outputLabel value="#{i18n['voting.create.submitStart']}:" for="sStart" />
<p:calendar validator="#{votingDateValidator.saveSStart}" value="#{votingCreateView.compo.submitStart}" pattern="dd/MM/yyyy HH:mm" id="sStart" />
<h:message for="sStart" />
<h:outputLabel value="#{i18n['voting.create.submitEnd']}:" for="sEnd" />
<p:calendar validator="#{votingDateValidator.validateSubmit}" value="#{votingCreateView.compo.submitEnd}" pattern="dd/MM/yyyy HH:mm" id="sEnd" />
<h:message for="sEnd" />
<h:commandButton action="#{votingCreateView.create}" value="#{i18n['voting.create.createButton']}" />
</h:panelGrid>
</h:form>
</div>
<div class="clearfix"></div>
</ui:define>
</ui:composition>
</h:body>
......
......@@ -2,23 +2,26 @@
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:users="http://java.sun.com/jsf/composite/cditools/user"
xmlns:tools="http://java.sun.com/jsf/composite/cditools" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui">
xmlns:compo="http://java.sun.com/jsf/composite/cditools/compo" xmlns:tools="http://java.sun.com/jsf/composite/cditools" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui">
<h:body>
<ui:composition template="#{sessionHandler.template}">
<f:metadata>
<f:viewParam name="compoId" value="#{votingDetailsView.compoId}" />
<!-- <f:viewParam name="compoId" value="#{votingDetailsView.compoId2}" /> -->
<f:event type="preRenderView" listener="#{votingDetailsView.initView}" />
<f:viewParam name="compoId" value="#{compoMgmtView.compoId}" />
<!-- <f:viewParam name="compoId" value="#{compoMgmtView.compoId2}" /> -->
<f:event type="preRenderView" listener="#{compoMgmtView.initView}" />
</f:metadata>
<ui:define name="content">
<!-- <h:outputStylesheet library="style" name="insomnia2/css/actionlog.css" /> -->
<h1>Compo: #{votingDetailsView.compo.name}</h1>
<h1>Compo: #{compoMgmtView.compo.name}</h1>
<p>Infoa compon entryistä</p>
<compo:editCompo commitAction="#{compoMgmtView.saveCompo}" commitValue="#{i18n['voting.create.saveCompo']}" />
<h2>#{i18n['compoMgmtView.compo.entries']}</h2>
<h:form>
<h:dataTable styleClass="bordertable" rowClasses="roweven,rowodd" id="compolisttable" value="#{votingDetailsView.entries}" var="entry">
<h:dataTable styleClass="bordertable" rowClasses="roweven,rowodd" id="compolisttable" value="#{compoMgmtView.entries}" var="entry">
<h:column>
<f:facet name="header">
<h:outputText value="Title" />
......@@ -77,7 +80,7 @@
</h:column>
</h:dataTable>
<h:commandButton action="#{votingDetailsView.saveSort}" value="#{i18n['compo.savesort']}" />
<h:commandButton action="#{compoMgmtView.saveSort}" value="#{i18n['compo.savesort']}" />
</h:form>
......
......@@ -57,15 +57,25 @@
<h2>
<h:outputText value="#{i18n['compofile.download.header']}" />
</h2>
<h:selectOneRadio layout="pageDirection" value="#{compoFileDownloadView.file}" converter="#{compoFileConverter}">
<f:selectItems var="fi" value="#{compoFileDownloadView.files}" itemLabel="#{fi.fileName} / #{fi.uploaded.time}" />
</h:selectOneRadio>
<h:commandButton value="#{i18n['compofile.download']}">
<p:fileDownload value="#{compoFileDownloadView.dlfile}" />
</h:commandButton>
<p:dataTable value="#{compoFileDownloadView.files}" var="fi">
<p:column headerText="#{i18n['compofile.fileName']}">
<h:outputText value="#{fi.fileName}" />
</p:column>
<p:column headerText="#{i18n['compofile.uploadTime']}">
<h:outputText value="#{fi.uploaded.time}">
<f:convertDateTime pattern="#{sessionHandler.shortDatetimeFormat}" />
</h:outputText>
</p:column>
<p:column headerText="#{i18n['compofile.shaChecksum']}">
<h:outputText value="#{fi.hash}" />
</p:column>
<p:column>
<p:commandButton ajax="false" value="#{i18n['compofile.download']}" actionListener="#{compoFileDownloadView.selectDownloadedFile}">
<p:fileDownload value="#{compoFileDownloadView.dlfile}" />
</p:commandButton>
</p:column>
</p:dataTable>
</h:form>
<!-- Ilmoittautuminen otettu vastaan.-->
</ui:fragment>
</ui:define>
......
......@@ -218,14 +218,19 @@ checkout.return.successMessage = Payment confirmed. Your products have been paid
code.inputfield = Give readercode
compo.edit = Edit compo
compo.saveVotes = Save votes
compo.savesort = Save order
compo.votesSaved = Votes saved
compo.edit = Edit compo
compo.saveVotes = Save votes
compo.savesort = Save order
compo.votesSaved = Votes saved
compoMgmtView.compo.entries = Entries
compofile.download = Download
compofile.download.header = Download file
compofile.fileName = Filename
compofile.shaChecksum = SHA checksum
compofile.upload = Upload file
compofile.uploadTime = Upload time
content.showContentEditLinks = Show content edit links
......@@ -1297,6 +1302,8 @@ voting.allcompos.descri = Description
voting.allcompos.description = List of all compos and theirs information.
voting.allcompos.endTime = End time
voting.allcompos.header = All compos
voting.allcompos.hidden = Hidden
voting.allcompos.holdVoting = Hold voting
voting.allcompos.maxParts = Max participants
voting.allcompos.name = Name
voting.allcompos.startTime = Start time
......@@ -1322,8 +1329,11 @@ voting.create.createButton = Create
voting.create.dateValidatorEndDate = End time before start time.
voting.create.description = Description
voting.create.header = Create compo
voting.create.hidden = Hidden
voting.create.holdVoting = Hold voting
voting.create.maxParticipants = Max participants
voting.create.name = Name
voting.create.saveCompo = Save compo
voting.create.submitEnd = Submit close
voting.create.submitStart = Submit start
voting.create.voteEnd = Voting close
......
......@@ -220,14 +220,19 @@ checkout.return.successMessage = Maksu vahvistettu. Tuotteet on maksettu. Voit s
code.inputfield = Sy\u00F6t\u00E4 viivakoodi
compo.edit = Muokkaa compoa
compo.saveVotes = Tallenna \u00E4\u00E4net
compo.savesort = Tallenna j\u00E4rjestys
compo.votesSaved = \u00C4\u00E4net tallennettu
compo.edit = Muokkaa compoa
compo.saveVotes = Tallenna \u00E4\u00E4net
compo.savesort = Tallenna j\u00E4rjestys
compo.votesSaved = \u00C4\u00E4net tallennettu
compofile.download = lataa
compoMgmtView.compo.entries = Entryt
compofile.download = Lataa
compofile.download.header = Lataa tiedosto
compofile.fileName = Tiedoston nimi
compofile.shaChecksum = SHA tarkistesumma
compofile.upload = L\u00E4het\u00E4 tiedosto
compofile.uploadTime = Tallennusaika
content.showContentEditLinks = N\u00E4yt\u00E4 sis\u00E4ll\u00F6nmuokkauslinkit
......@@ -1278,6 +1283,8 @@ voting.allcompos.descri = Kuvaus
voting.allcompos.description = Compojen informaatiot.
voting.allcompos.endTime = Lopetusaika
voting.allcompos.header = Kaikki compot
voting.allcompos.hidden = Piilotettu
voting.allcompos.holdVoting = Hold voting
voting.allcompos.maxParts = Max osallistujam\u00E4\u00E4r\u00E4
voting.allcompos.name = Nimi
voting.allcompos.startTime = Aloitusaika
......@@ -1303,8 +1310,11 @@ voting.create.createButton = Luo
voting.create.dateValidatorEndDate = Loppumisaika ennen alkua.
voting.create.description = Kuvaus
voting.create.header = Compon luonti
voting.create.hidden = Piilotettu
voting.create.holdVoting = Hold voting
voting.create.maxParticipants = Max osallistujat
voting.create.name = Nimi
voting.create.saveCompo = Tallenna
voting.create.submitEnd = Submit kiinni
voting.create.submitStart = Submit auki
voting.create.voteEnd = \u00C4\u00E4nestys kiinni
......
......@@ -46,6 +46,12 @@ public class CompoFileDownloadView extends GenericCDIView {
return file;
}
public void selectDownloadedFile()
{
file = files.getRowData();
dlfile = new DefaultStreamedContent(new ByteArrayInputStream(file.getFileData()), file.getMimeType(), file.getFileName());
}
public void setFile(CompoEntryFile file) {
this.file = file;
if (file != null)
......
package fi.codecrew.moya.web.cdiview.voting;
import java.util.Date;
import javax.ejb.EJB;
import javax.enterprise.context.ConversationScoped;
import javax.faces.model.ListDataModel;
......@@ -16,7 +18,7 @@ import fi.codecrew.moya.web.cdiview.GenericCDIView;
@Named
@ConversationScoped
public class VotingDetailsView extends GenericCDIView {
public class CompoMgmtView extends GenericCDIView {
/**
*
......@@ -34,12 +36,40 @@ public class VotingDetailsView extends GenericCDIView {
private transient ListDataModel<CompoEntry> entries;
@SuppressWarnings("unused")
private static final Logger logger = LoggerFactory.getLogger(VotingDetailsView.class);
private static final Logger logger = LoggerFactory.getLogger(CompoMgmtView.class);
public Integer getCompoId() {
return compoId;
}
public void initCreate()
{
if (super.requirePermissions(fi.codecrew.moya.enums.apps.CompoPermission.MANAGE) && compo == null)
{
compo = new Compo();
Date now = new Date();
compo.setStartTime(now);
compo.setEndTime(now);
compo.setSubmitStart(now);
compo.setSubmitEnd(now);
compo.setVoteStart(now);
compo.setVoteEnd(now);
super.beginConversation();
}
}
public String createCompo() {
votingBean.createCompo(compo);
return "details";
}
public String saveCompo()
{
compo = votingBean.saveCompo(compo);
return null;
}
public String saveSort()
{
for (CompoEntry e : entries)
......
package fi.codecrew.moya.web.cdiview.voting;
import java.io.IOException;
import java.util.ArrayList;
import javax.ejb.EJB;
import javax.enterprise.context.ConversationScoped;
......@@ -155,8 +154,10 @@ public class CompoView extends GenericCDIView {
byte[] contents = null;
if (file.getContents() != null) {
contents = file.getContents();
logger.info("Got file contents from .confents()");
} else {
contents = new byte[(int) file.getSize()];
logger.info("Read {} bytes from stream in file {}", file.getSize(), file.getFileName());
try {
file.getInputstream().read(contents);
} catch (IOException e) {
......@@ -176,21 +177,31 @@ public class CompoView extends GenericCDIView {
logger.info("Got file name {} length {}", getUploadedFile().getFileName(), cef.getFileData().length);
cef.setFileName(getUploadedFile().getFileName());
cef.setMimeType(getUploadedFile().getContentType());
if (getEntry().getFiles() == null) {
getEntry().setFiles(new ArrayList<CompoEntryFile>());
}
getEntry().getFiles().add(cef);
getEntry().setCurrentFile(cef);
setEntry(votbean.saveEntry(getEntry()));
// getEntry().setCurrentFile(cef);
votbean.create(cef);
return null;
}
public void initAdminListView() {
if (requirePermissions(CompoPermission.MANAGE) && compolist == null) {
compolist = new ListDataModel<Compo>(votbean.getCompoList(true));
setManage(hasPermission(CompoPermission.MANAGE));
logger.info("Permission to view full compo listing.");
super.beginConversation();
}
else {
logger.info("Not enough rights to view full compo listing.");
}
}
public void initListView() {
if (requirePermissions(CompoPermission.VIEW_COMPOS) && compolist == null) {
compolist = new ListDataModel<Compo>(votbean.getCompoList());
compolist = new ListDataModel<Compo>(votbean.getCompoList(false));
setManage(hasPermission(CompoPermission.MANAGE));
logger.info("Permission to view full compo listing.");
super.beginConversation();
......
package fi.codecrew.moya.web.cdiview.voting;
import javax.ejb.EJB;
import javax.enterprise.context.ConversationScoped;
import javax.inject.Named;
import fi.codecrew.moya.beans.VotingBeanLocal;
import fi.codecrew.moya.model.Compo;
import fi.codecrew.moya.web.cdiview.GenericCDIView;
@Named
@ConversationScoped
public class VotingCreateView extends GenericCDIView {
/**
*
*/
private static final long serialVersionUID = 4677679766671547462L;
@EJB
private transient VotingBeanLocal votbean;
private Compo compo;
public void initCreate()
{
if (super.requirePermissions(fi.codecrew.moya.enums.apps.CompoPermission.MANAGE) && compo == null)
{
compo = new Compo();
super.beginConversation();
}
}
public String create() {
votbean.createCompo(compo);
return "success";
}
public Compo getCompo() {
return compo;
}
public void setCompo(Compo compo) {
this.compo = compo;
}
}
......@@ -8,7 +8,6 @@ import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.validator.ValidatorException;
import javax.inject.Inject;
import javax.inject.Named;
import org.slf4j.Logger;
......@@ -21,10 +20,7 @@ import fi.codecrew.moya.utilities.I18n;
public class VotingDateValidator implements Serializable {
private static final long serialVersionUID = 8006543114365700277L;
@Inject
private VotingCreateView view;
@SuppressWarnings("unused")
private static final Logger logger = LoggerFactory.getLogger(VotingDateValidator.class);
......@@ -75,12 +71,4 @@ public class VotingDateValidator implements Serializable {
throw new ValidatorException(msg);
}
public VotingCreateView getView() {
return view;
}
public void setView(VotingCreateView view) {
this.view = view;
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!