Commit 61143b14 by Antti Tönkyrä

remove crew in favor of tags, rename messagelist->index

1 parent fd914ee5
...@@ -49,12 +49,12 @@ public class ActionLogBean implements ActionLogBeanLocal { ...@@ -49,12 +49,12 @@ public class ActionLogBean implements ActionLogBeanLocal {
// TODO Auto-generated constructor stub // TODO Auto-generated constructor stub
} }
@Override
@RolesAllowed(ContentPermission.S_MANAGE_ACTIONLOG) @RolesAllowed(ContentPermission.S_MANAGE_ACTIONLOG)
public void createActionLogEvent(String message, Role crew, boolean isTask) { public void createActionLogEvent(String message, boolean isTask) {
ArrayList<ActionLogMessageTag> almts = resolveTags(message); ArrayList<ActionLogMessageTag> almts = resolveTags(message);
ActionLogMessage alm = new ActionLogMessage(); ActionLogMessage alm = new ActionLogMessage();
alm.setCrew(crew);
if (isTask) { if (isTask) {
alm.setState(ActionLogMessageState.NEW); alm.setState(ActionLogMessageState.NEW);
} else { } else {
......
...@@ -34,6 +34,7 @@ public class BootstrapBean implements BootstrapBeanLocal { ...@@ -34,6 +34,7 @@ public class BootstrapBean implements BootstrapBeanLocal {
dbUpdates.add(new String[] { "DELETE FROM application_permissions WHERE application = 'MAP' and permission = 'RELEASE_PLACE'" }); dbUpdates.add(new String[] { "DELETE FROM application_permissions WHERE application = 'MAP' and permission = 'RELEASE_PLACE'" });
dbUpdates.add(new String[] { "ALTER TABLE site_page_content ADD COLUMN locale varchar(10)" }); dbUpdates.add(new String[] { "ALTER TABLE site_page_content ADD COLUMN locale varchar(10)" });
dbUpdates.add(new String[] { "ALTER TABLE products ALTER COLUMN vat TYPE NUMERIC(4,3)" }); dbUpdates.add(new String[] { "ALTER TABLE products ALTER COLUMN vat TYPE NUMERIC(4,3)" });
dbUpdates.add(new String[] { "ALTER TABLE actionlog_messages DROP COLUMN crew" });
} }
@EJB @EJB
......
...@@ -239,8 +239,8 @@ public class MenuBean implements MenuBeanLocal { ...@@ -239,8 +239,8 @@ public class MenuBean implements MenuBeanLocal {
MenuNavigation lognavi = adminevent.addPage(null, null); MenuNavigation lognavi = adminevent.addPage(null, null);
lognavi.setKey("topnavi.log"); lognavi.setKey("topnavi.log");
lognavi.addPage(menuitemfacade.findOrCreate("/actionlog/messagelist"), UserPermission.VIEW_ALL); lognavi.addPage(menuitemfacade.findOrCreate("/actionlog/index"), ContentPermission.MANAGE_ACTIONLOG);
lognavi.addPage(menuitemfacade.findOrCreate("/actionlog/taskview"), UserPermission.VIEW_ALL).setVisible(false); lognavi.addPage(menuitemfacade.findOrCreate("/actionlog/taskview"), ContentPermission.MANAGE_ACTIONLOG).setVisible(false);
MenuNavigation compoMenu = adminevent.addPage(null, null); MenuNavigation compoMenu = adminevent.addPage(null, null);
compoMenu.setKey("topnavi.compos"); compoMenu.setKey("topnavi.compos");
...@@ -473,8 +473,8 @@ public class MenuBean implements MenuBeanLocal { ...@@ -473,8 +473,8 @@ public class MenuBean implements MenuBeanLocal {
MenuNavigation lognavi = adminnavi.addPage(null, null); MenuNavigation lognavi = adminnavi.addPage(null, null);
lognavi.setKey("topnavi.log"); lognavi.setKey("topnavi.log");
lognavi.addPage(menuitemfacade.findOrCreate("/actionlog/messagelist"), UserPermission.VIEW_ALL); lognavi.addPage(menuitemfacade.findOrCreate("/actionlog/index"), ContentPermission.MANAGE_ACTIONLOG);
lognavi.addPage(menuitemfacade.findOrCreate("/actionlog/taskview"), UserPermission.VIEW_ALL).setVisible(false); lognavi.addPage(menuitemfacade.findOrCreate("/actionlog/taskview"), ContentPermission.MANAGE_ACTIONLOG).setVisible(false);
MenuNavigation foodnavi = adminnavi.addPage(null, null); MenuNavigation foodnavi = adminnavi.addPage(null, null);
foodnavi.setKey("topnavi.foodwave"); foodnavi.setKey("topnavi.foodwave");
......
...@@ -12,8 +12,8 @@ import fi.codecrew.moya.model.Role; ...@@ -12,8 +12,8 @@ import fi.codecrew.moya.model.Role;
public interface ActionLogBeanLocal { public interface ActionLogBeanLocal {
public List<ActionLogMessage> getAllActionLogEvents(); public List<ActionLogMessage> getAllActionLogEvents();
public List<Role> getAssignableRoles(); public List<Role> getAssignableRoles();
public void createActionLogEvent(String message, Role crew, boolean isTask);
public ActionLogMessage find(Integer id); public ActionLogMessage find(Integer id);
public List<ActionLogMessageResponse> getActionLogMessageResponses(ActionLogMessage id); public List<ActionLogMessageResponse> getActionLogMessageResponses(ActionLogMessage id);
public void addActionLogMessageResponse(ActionLogMessage alm, String message, ActionLogMessageState state); public void addActionLogMessageResponse(ActionLogMessage alm, String message, ActionLogMessageState state);
public void createActionLogEvent(String message, boolean isTask);
} }
...@@ -39,9 +39,6 @@ public class ActionLogMessage extends GenericEntity { ...@@ -39,9 +39,6 @@ public class ActionLogMessage extends GenericEntity {
@JoinColumn(name = "lan_event_id") @JoinColumn(name = "lan_event_id")
private LanEvent lanEvent; private LanEvent lanEvent;
@JoinColumn(name = "crew", nullable = false)
private Role crew;
@Column(name = "message", nullable = false) @Column(name = "message", nullable = false)
private String message; private String message;
...@@ -91,14 +88,6 @@ public class ActionLogMessage extends GenericEntity { ...@@ -91,14 +88,6 @@ public class ActionLogMessage extends GenericEntity {
this.user = user; this.user = user;
} }
public Role getCrew() {
return crew;
}
public void setCrew(Role crew) {
this.crew = crew;
}
public String getMessage() { public String getMessage() {
return message; return message;
} }
......
...@@ -97,11 +97,11 @@ ...@@ -97,11 +97,11 @@
</navigation-case> </navigation-case>
</navigation-rule> </navigation-rule>
<navigation-rule> <navigation-rule>
<display-name>actionlog/messagelist</display-name> <display-name>actionlog/index</display-name>
<from-view-id>/actionlog/messagelist.xhtml</from-view-id> <from-view-id>/actionlog/index.xhtml</from-view-id>
<navigation-case> <navigation-case>
<from-outcome>success</from-outcome> <from-outcome>success</from-outcome>
<to-view-id>/actionlog/messagelist.xhtml</to-view-id> <to-view-id>/actionlog/index.xhtml</to-view-id>
<redirect /> <redirect />
</navigation-case> </navigation-case>
</navigation-rule> </navigation-rule>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<h:body> <h:body>
<ui:composition template="#{sessionHandler.template}"> <ui:composition template="#{sessionHandler.template}">
<f:metadata> <f:metadata>
<!-- f:event type="preRenderView" listener="#{newsListView.initView}" /--> <f:event type="preRenderView" listener="#{actionLogMessageView.initView}" />
</f:metadata> </f:metadata>
<ui:define name="content"> <ui:define name="content">
<h:outputStylesheet library="style" name="templates/insomnia2/css/actionlog.css" /> <h:outputStylesheet library="style" name="templates/insomnia2/css/actionlog.css" />
...@@ -17,18 +17,11 @@ ...@@ -17,18 +17,11 @@
<h2>#{i18n['actionlog.create.header']}</h2> <h2>#{i18n['actionlog.create.header']}</h2>
<h:messages /> <h:messages />
<div class="row"> <div class="row">
<h3 class="actionlog_create_role">#{i18n['actionlog.create.role']}</h3>
<h3 class="actionlog_create_message">#{i18n['actionlog.create.message']}</h3> <h3 class="actionlog_create_message">#{i18n['actionlog.create.message']}</h3>
<h3 class="actionlog_create_istask">#{i18n['actionlog.create.taskradio']}</h3> <h3 class="actionlog_create_istask">#{i18n['actionlog.create.taskradio']}</h3>
</div> </div>
<div class="row"> <div class="row">
<div class="actionlog_create_role">
<h:selectOneMenu value="#{actionLogCreateView.role}" converter="#{roleConverter}">
<f:selectItems var="role" itemLabel="#{role.name}" value="#{actionLogCreateView.roles}" />
</h:selectOneMenu>
</div>
<div class="actionlog_create_message"> <div class="actionlog_create_message">
<h:inputText value="#{actionLogCreateView.message}" /> <h:inputText value="#{actionLogCreateView.message}" />
</div> </div>
...@@ -63,12 +56,6 @@ ...@@ -63,12 +56,6 @@
<h:outputText value="#{message.user.nick}" /> <h:outputText value="#{message.user.nick}" />
</p:column> </p:column>
<p:column> <p:column>
<f:facet name="header">
<h:outputText value="#{i18n['actionlog.crew']}" />
</f:facet>
<h:outputText value="#{message.crew.name}" />
</p:column>
<p:column>
<f:facet name="header"> <f:facet name="header">
<h:outputText value="#{i18n['actionlog.message']}" /> <h:outputText value="#{i18n['actionlog.message']}" />
...@@ -86,7 +73,7 @@ ...@@ -86,7 +73,7 @@
<h:link rendered="#{!empty message.state}" outcome="taskview"> <h:link rendered="#{!empty message.state}" outcome="taskview">
<f:param name="id" value="#{message.id}" /> <f:param name="id" value="#{message.id}" />
Näytä tehtävä Näytä tehtävä
</h:link> </h:link>
</p:column> </p:column>
</p:dataTable> </p:dataTable>
</h:form> </h:form>
......
...@@ -30,10 +30,6 @@ ...@@ -30,10 +30,6 @@
<td><h:outputText value="#{taskModificationView.message.user.nick}" /></td> <td><h:outputText value="#{taskModificationView.message.user.nick}" /></td>
</tr> </tr>
<tr> <tr>
<td><h:outputText class="taskHeader" value="#{i18n['actionlog.crew']}: " /></td>
<td><h:outputText value="#{taskModificationView.message.crew.name}" /></td>
</tr>
<tr>
<td><h:outputText class="taskHeader" value="#{i18n['actionlog.state']}: " /></td> <td><h:outputText class="taskHeader" value="#{i18n['actionlog.state']}: " /></td>
<td><h:outputText value="#{i18n[taskModificationView.message.state.key]}" /></td> <td><h:outputText value="#{i18n[taskModificationView.message.state.key]}" /></td>
</tr> </tr>
...@@ -45,7 +41,7 @@ ...@@ -45,7 +41,7 @@
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
<hr style="width: 90%;" /> <hr style="width: 90%;" />
<div> <div>
<h:form> <h:form>
<p:poll interval="1" update="messageresponsetable" onerror="location.reload();" /> <p:poll interval="1" update="messageresponsetable" onerror="location.reload();" />
......
...@@ -27,18 +27,6 @@ public class ActionLogCreateView extends GenericCDIView { ...@@ -27,18 +27,6 @@ public class ActionLogCreateView extends GenericCDIView {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public List<Role> getRoles() {
return actionLogBean.getAssignableRoles();
}
public Role getRole() {
return this.role;
}
public void setRole(Role role) {
this.role = role;
}
public String getMessage() { public String getMessage() {
return message; return message;
} }
...@@ -56,8 +44,7 @@ public class ActionLogCreateView extends GenericCDIView { ...@@ -56,8 +44,7 @@ public class ActionLogCreateView extends GenericCDIView {
} }
public String send() { public String send() {
actionLogBean.createActionLogEvent(message, task);
actionLogBean.createActionLogEvent(message, role, task);
return "success"; return "success";
} }
} }
package fi.codecrew.moya.web.cdiview.actionlog; package fi.codecrew.moya.web.cdiview.actionlog;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import javax.ejb.EJB; import javax.ejb.EJB;
...@@ -9,6 +10,7 @@ import javax.inject.Named; ...@@ -9,6 +10,7 @@ import javax.inject.Named;
import fi.codecrew.moya.beans.ActionLogBeanLocal; import fi.codecrew.moya.beans.ActionLogBeanLocal;
import fi.codecrew.moya.enums.apps.ContentPermission; import fi.codecrew.moya.enums.apps.ContentPermission;
import fi.codecrew.moya.model.ActionLogMessage; import fi.codecrew.moya.model.ActionLogMessage;
import fi.codecrew.moya.model.ActionLogMessageTag;
import fi.codecrew.moya.web.cdiview.GenericCDIView; import fi.codecrew.moya.web.cdiview.GenericCDIView;
@Named @Named
...@@ -17,10 +19,15 @@ public class ActionLogMessageView extends GenericCDIView { ...@@ -17,10 +19,15 @@ public class ActionLogMessageView extends GenericCDIView {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private boolean updateEnabled = true; private boolean updateEnabled = true;
private ArrayList<ActionLogMessageTag> selectedTags;
@EJB @EJB
private transient ActionLogBeanLocal actionLogBean; private transient ActionLogBeanLocal actionLogBean;
public void initView() {
super.requirePermissions(ContentPermission.MANAGE_ACTIONLOG);
}
public boolean getUpdateEnabled() { public boolean getUpdateEnabled() {
return updateEnabled; return updateEnabled;
} }
...@@ -30,9 +37,6 @@ public class ActionLogMessageView extends GenericCDIView { ...@@ -30,9 +37,6 @@ public class ActionLogMessageView extends GenericCDIView {
} }
public List<ActionLogMessage> getMessages() { public List<ActionLogMessage> getMessages() {
if (super.hasPermission(ContentPermission.MANAGE_ACTIONLOG)) { return actionLogBean.getAllActionLogEvents();
return actionLogBean.getAllActionLogEvents();
}
return null;
} }
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!