Commit 9b45362c by Juho Juopperi

orgroles and forgotten IUser in action---responses

1 parent 83ec3abc
......@@ -17,7 +17,6 @@ import org.eclipse.persistence.annotations.OptimisticLockingType;
import fi.insomnia.bortal.enums.ActionLogMessageState;
@Entity
@Table(name = "actionlog_message_responses")
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
......@@ -25,17 +24,17 @@ public class ActionLogMessageResponse extends GenericEntity {
@Column(name = "time", nullable = false)
@Temporal(TemporalType.TIMESTAMP)
private Date time = new Date();
@JoinColumn(name = "user_id")
private IUser user;
private EventUser user;
@Column(name = "message", nullable = false)
private String message;
@Column(name = "state_change", nullable = true)
@Enumerated(EnumType.STRING)
private ActionLogMessageState stateChange;
@JoinColumn(name = "actionlog_message_id", referencedColumnName = "id")
@ManyToOne(optional = false)
private ActionLogMessage actionLogMessage;
......@@ -48,11 +47,11 @@ public class ActionLogMessageResponse extends GenericEntity {
this.time = time;
}
public IUser getUser() {
public EventUser getUser() {
return user;
}
public void setUser(IUser user) {
public void setUser(EventUser user) {
this.user = user;
}
......@@ -71,11 +70,11 @@ public class ActionLogMessageResponse extends GenericEntity {
public void setStateChange(ActionLogMessageState stateChange) {
this.stateChange = stateChange;
}
public ActionLogMessage getActionLogMessage() {
return actionLogMessage;
}
public void setActionLogMessage(ActionLogMessage message) {
this.actionLogMessage = message;
}
......
<!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:f="http://java.sun.com/jsf/core"
xmlns:orgrole="http://java.sun.com/jsf/composite/cditools/orgrole"
xmlns:c="http://java.sun.com/jsp/jstl/core">
<ui:composition
template="/layout/#{sessionHandler.layout}/template.xhtml">
<ui:param name="thispage" value="page.orgRole.create" />
<f:metadata>
<f:event type="preRenderView"
listener="#{orgRoleView.initForCreate()}" />
</f:metadata>
<ui:define name="content">
<orgrole:create />
</ui:define>
</ui:composition>
</html>
\ No newline at end of file
<?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:orgrole="http://java.sun.com/jsf/composite/tools/orgrole">
<composite:interface>
</composite:interface>
<composite:implementation>
<h:form>
<ui:include src="form.xhtml" />
<h:commandButton id="createorgrole" value="#{i18n['orgrole.create']}"
action="#{orgRoleView.create()}" />
</h:form>
</composite:implementation>
</html>
<?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">
<ui:composition>
<h:panelGrid columns="2">
<h:outputText value="#{i18n['orgrole.name']}" />
<h:inputText value="#{orgRoleView.orgRole.name}" />
<h:outputText value="#{i18n['orgrole.parents']}" />
<h:selectManyCheckbox converter="#{roleConverter}"
layout="pageDirection" id="roleparents"
value="#{roleView.role.parents}">
<f:selectItems var="par" itemLabel="#{par.name}"
value="#{roleView.possibleParents}" />
</h:selectManyCheckbox>
<h:outputLabel value="#{i18n['role.cardtemplate']}" />
<h:selectOneMenu converter="#{cardTemplateConverter}"
value="#{roleView.role.cardTemplate}">
<f:selectItems var="role" itemLabel="#{role.name}"
value="#{cardView.templatesWithNull}" />
</h:selectOneMenu>
</h:panelGrid>
</ui:composition>
</html>
......@@ -21,4 +21,9 @@ public class OrgRoleView extends GenericCDIView {
requirePermissions(permbean.hasPermission(UserPermission.READ_ORGROLES));
}
public void initForCreate() {
requirePermissions(permbean
.hasPermission(UserPermission.WRITE_ORGROLES));
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!