Commit 293e3917 by Juho Salli

Merge branch 'master' of dev.insomnia.fi:/data/bortal

2 parents f1794f6a cb952870
...@@ -71,6 +71,7 @@ public class ActionLogBean implements ActionLogBeanLocal { ...@@ -71,6 +71,7 @@ public class ActionLogBean implements ActionLogBeanLocal {
@RolesAllowed(ContentPermission.S_MANAGE_ACTIONLOG) @RolesAllowed(ContentPermission.S_MANAGE_ACTIONLOG)
public void addActionLogMessageResponse(ActionLogMessage alm, String message, ActionLogMessageState state) { public void addActionLogMessageResponse(ActionLogMessage alm, String message, ActionLogMessageState state) {
if (alm.getState() != state && state != null) { if (alm.getState() != state && state != null) {
alm = actionLogFacade.merge(alm);
alm.setState(state); alm.setState(state);
} }
......
...@@ -63,10 +63,6 @@ public class VotingBean implements VotingBeanLocal { ...@@ -63,10 +63,6 @@ public class VotingBean implements VotingBeanLocal {
compoFacade.flush(); compoFacade.flush();
compoEntryFile.setEntriesId(compoEntry); compoEntryFile.setEntriesId(compoEntry);
compoEntry.getFiles().add(compoEntryFile); compoEntry.getFiles().add(compoEntryFile);
//compoEntry = compoEntryFacade.merge(compoEntry);
//compoEntryFile.setEntriesId(compoEntry);
//compoEntry.getFiles().add(compoEntryFile);
} }
public Compo getCompoById(Integer compoId) { public Compo getCompoById(Integer compoId) {
......
...@@ -17,7 +17,6 @@ import org.eclipse.persistence.annotations.OptimisticLockingType; ...@@ -17,7 +17,6 @@ import org.eclipse.persistence.annotations.OptimisticLockingType;
import fi.insomnia.bortal.enums.ActionLogMessageState; import fi.insomnia.bortal.enums.ActionLogMessageState;
@Entity @Entity
@Table(name = "actionlog_message_responses") @Table(name = "actionlog_message_responses")
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS) @OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
...@@ -25,17 +24,17 @@ public class ActionLogMessageResponse extends GenericEntity { ...@@ -25,17 +24,17 @@ public class ActionLogMessageResponse extends GenericEntity {
@Column(name = "time", nullable = false) @Column(name = "time", nullable = false)
@Temporal(TemporalType.TIMESTAMP) @Temporal(TemporalType.TIMESTAMP)
private Date time = new Date(); private Date time = new Date();
@JoinColumn(name = "user_id") @JoinColumn(name = "user_id")
private IUser user; private EventUser user;
@Column(name = "message", nullable = false) @Column(name = "message", nullable = false)
private String message; private String message;
@Column(name = "state_change", nullable = true) @Column(name = "state_change", nullable = true)
@Enumerated(EnumType.STRING) @Enumerated(EnumType.STRING)
private ActionLogMessageState stateChange; private ActionLogMessageState stateChange;
@JoinColumn(name = "actionlog_message_id", referencedColumnName = "id") @JoinColumn(name = "actionlog_message_id", referencedColumnName = "id")
@ManyToOne(optional = false) @ManyToOne(optional = false)
private ActionLogMessage actionLogMessage; private ActionLogMessage actionLogMessage;
...@@ -48,11 +47,11 @@ public class ActionLogMessageResponse extends GenericEntity { ...@@ -48,11 +47,11 @@ public class ActionLogMessageResponse extends GenericEntity {
this.time = time; this.time = time;
} }
public IUser getUser() { public EventUser getUser() {
return user; return user;
} }
public void setUser(IUser user) { public void setUser(EventUser user) {
this.user = user; this.user = user;
} }
...@@ -71,11 +70,11 @@ public class ActionLogMessageResponse extends GenericEntity { ...@@ -71,11 +70,11 @@ public class ActionLogMessageResponse extends GenericEntity {
public void setStateChange(ActionLogMessageState stateChange) { public void setStateChange(ActionLogMessageState stateChange) {
this.stateChange = stateChange; this.stateChange = stateChange;
} }
public ActionLogMessage getActionLogMessage() { public ActionLogMessage getActionLogMessage() {
return actionLogMessage; return actionLogMessage;
} }
public void setActionLogMessage(ActionLogMessage message) { public void setActionLogMessage(ActionLogMessage message) {
this.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 { ...@@ -21,4 +21,9 @@ public class OrgRoleView extends GenericCDIView {
requirePermissions(permbean.hasPermission(UserPermission.READ_ORGROLES)); 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!