Commit 5af2a9e5 by Juho Salli

compo detailssivu purkkaversio

1 parent 5846c929
......@@ -72,4 +72,6 @@ public class VotingBean implements VotingBeanLocal {
public List<Compo> getCompoList() {
return compoFacade.getList();
}
}
......@@ -10,11 +10,12 @@
<ui:composition template="/layout/#{sessionHandler.layout}/template.xhtml">
<f:metadata>
<f:viewParam name="compoId" value="#{votingCompoAddEntryView.compoId}"></f:viewParam>
<f:event type="preRenderView" listener="#{votingCompoAddEntryView.initView()}" />
</f:metadata>
<ui:define name="content">
<!-- <h:outputStylesheet library="style" name="insomnia2/css/actionlog.css" /> -->
<h1>#{i18n['voting.compoentryadd.title']}</h1>
<p>#{i18n['voting.compoentryadd.description']}</p>
<p>#{i18n['voting.compoentryadd.description']} #{votingCompoAddEntryView.compoName}</p>
<h:form enctype="multipart/form-data">
<h:panelGrid columns="3">
......
......@@ -25,7 +25,11 @@
<f:facet name="header">
<h:outputText value="#{i18n['voting.allcompos.name']}" />
</f:facet>
<h:outputText value="#{compo.name}" />
<h:link outcome="details">
<f:param name="compoId" value="#{compo.id}" />
#{compo.name}
</h:link>
<!-- <h:outputText value="#{compo.name}" /> -->
</h:column>
<h:column>
<f:facet name="header">
......
......@@ -9,15 +9,49 @@
<h:body>
<ui:composition template="/layout/#{sessionHandler.layout}/template.xhtml">
<f:metadata>
<!-- f:event type="preRenderView" listener="#{newsListView.initView}" /-->
<f:viewParam name="compoId" value="#{votingDetailsView.compoId}" />
<!-- <f:viewParam name="compoId" value="#{votingDetailsView.compoId2}" /> -->
<f:event type="preRenderView" listener="#{votingDetailsView.initView}" />
</f:metadata>
<ui:define name="content">
<!-- <h:outputStylesheet library="style" name="insomnia2/css/actionlog.css" /> -->
<h1>#{i18n['voting.details.header']} (KOMPON NIMI)</h1>
<p>Compo#{i18n['voting.details.description']}</p>
<h1>Compo: #{votingDetailsView.compoName}</h1>
<p>Infoa compon entryistä</p>
<div class="clearfix"></div>
<div id="actionlog">
<h:dataTable styleClass="bordertable" rowClasses="roweven,rowodd" id="compolisttable" value="#{votingDetailsView.entries}" var="entry">
<h:column>
<f:facet name="header">
<h:outputText value="nimi" />
</f:facet>
<h:outputText value="#{entry.name}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="notes" />
</f:facet>
<h:outputText value="#{entry.notes}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="screenmessage" />
</f:facet>
<h:outputText value="#{entry.screenMessage}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="creator" />
</f:facet>
<h:outputText value="#{entry.creator.user.wholeName}" />
</h:column>
</h:dataTable>
</div>
</ui:define>
</ui:composition>
......
......@@ -27,6 +27,7 @@ public class VotingCompoAddEntryView {
private UploadedFile uploadedFile;
private Integer compoId;
private String compoName;
public Integer getCompoId() {
return compoId;
......@@ -68,6 +69,14 @@ public class VotingCompoAddEntryView {
this.name = name;
}
public String getCompoName() {
return compoName;
}
public void setCompoName(String compoName) {
this.compoName = compoName;
}
public void send() {
CompoEntry compoEntry = new CompoEntry();
compoEntry.setName(name);
......@@ -79,4 +88,8 @@ public class VotingCompoAddEntryView {
cef.setFileName(uploadedFile.getFileName());
votingBean.addEntry(compoEntry, cef);
}
public void initView() {
compoName = votingBean.getCompoById(compoId).getName();
}
}
package fi.insomnia.bortal.web.cdiview.voting;
import javax.faces.bean.RequestScoped;
import java.util.List;
import javax.ejb.EJB;
import javax.enterprise.context.RequestScoped;
import javax.inject.Named;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fi.insomnia.bortal.beans.VotingBeanLocal;
import fi.insomnia.bortal.web.cdiview.GenericCDIView;
import fi.insomnia.bortal.model.Compo;
import fi.insomnia.bortal.model.CompoEntry;
@Named
@RequestScoped
public class VotingDetailsView extends GenericCDIView {
......@@ -13,5 +24,59 @@ public class VotingDetailsView extends GenericCDIView {
*
*/
private static final long serialVersionUID = -8373473936336396427L;
@EJB
private VotingBeanLocal votingBean;
private Integer compoId;
private Integer compoId2;
private String compoName;
private Compo compo;
private static final Logger logger = LoggerFactory.getLogger(VotingDetailsView.class);
public Integer getCompoId() {
return compoId;
}
public void setCompoId(Integer compoId) {
this.compoId = compoId;
}
public List<CompoEntry> getEntries(){
//return votingBean.getCompoById(compoId).getCompoEntries();
compo = votingBean.getCompoById(compoId);
logger.info("compoId " + compoId);
if(compo == null) {
return null;
}
return compo.getCompoEntries();
}
public void initView() {
compoName = votingBean.getCompoById(compoId).getName();
}
public Integer getCompoId2() {
return compoId2;
}
public void setCompoId2(Integer compoId2) {
this.compoId2 = compoId2;
}
public String getCompoName() {
return compoName;
}
public void setCompoName(String compoName) {
this.compoName = compoName;
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!