19 package org.turro.queue.zul;
21 import java.util.Collection;
22 import java.util.List;
23 import org.turro.string.Strings;
24 import org.turro.action.Contacts;
25 import org.turro.action.queue.ConstraintKeys;
26 import org.turro.action.queue.NotificationCategory;
27 import org.turro.action.queue.QueuePeriod;
28 import org.turro.assistant.Assistant;
29 import org.turro.assistant.AssistantConstants;
30 import org.turro.assistant.AssistantDialog;
31 import org.turro.assistant.AssistantSet;
32 import org.turro.assistant.Assistants;
33 import org.turro.elephant.db.ElephantPU;
34 import org.turro.elephant.entities.db.QueueOptions;
35 import org.turro.elephant.util.Messages;
36 import org.turro.entities.Entities;
37 import org.turro.i18n.I_;
38 import org.turro.jpa.grid.RendererOnDemand;
39 import org.turro.mail.queue.QueueManager;
40 import org.turro.plugin.contacts.IContact;
41 import org.turro.zkoss.grid.PagingGrid;
42 import org.turro.zul.frame.Framework;
43 import org.zkoss.zk.ui.Component;
44 import org.zkoss.zk.ui.event.Event;
45 import org.zkoss.zk.ui.event.EventListener;
46 import org.zkoss.zk.ui.event.Events;
47 import org.zkoss.zul.Column;
48 import org.zkoss.zul.Columns;
49 import org.zkoss.zul.ListModelList;
50 import org.zkoss.zul.Row;
51 import org.zkoss.zul.Toolbarbutton;
62 this.notificationCategory = notificationCategory;
77 if(contacts !=
null && notificationCategory !=
null) {
78 for(Object c : contacts) {
91 if(Strings.isBlank(entityPath))
return;
109 notificationCategory.getNotification().subscribe(
110 notificationCategory.getIdCategory(), contact, notificationCategory.getDefaultPeriod());
118 if(notificationCategory !=
null) {
127 if(notificationCategory !=
null) {
136 if(notificationCategory !=
null) {
146 private void addRows() {
147 getRows(
true).getChildren().clear();
149 if(notificationCategory ==
null)
return;
153 protected void renderRow(
final Row row,
final QueueOptions qo) {
157 qpl.setMold(
"select");
159 qpl.setAttribute(
"options", qo);
161 row.appendChild(qpl);
162 Toolbarbutton del =
new Toolbarbutton();
163 del.setAttribute(
"options", qo);
164 del.setImage(
"/_zul/images/edit-delete.png");
166 row.appendChild(del);
170 Collection list =
new QueueManager().getSubcribers(notificationCategory.
getIdCategory());
172 setModel(
new ListModelList(list));
177 private void addColumns() {
179 cols.getChildren().clear();
181 cols.appendChild(
new Column(I_.get(
"Contact")));
182 cols.appendChild(
new Column(I_.get(
"Period"),
null,
"300px"));
183 cols.appendChild(
new Column(
null,
null,
"50px"));
187 public void onEvent(Event event)
throws Exception {
193 }
else if(event.getTarget() instanceof Toolbarbutton) {
194 Toolbarbutton del = (Toolbarbutton) event.getTarget();
static ConstraintKeys from(IContact contact)
IElephantNotification getNotification()
EnumSet< QueuePeriod > getAllowedPeriods()
boolean isValid(IContact contact)
boolean strongBond(ConstraintKeys keys)
QueuePeriod getDefaultPeriod()
static void load(Consumer< AssistantSet > consumer)
static void addAssistants(String role, AssistantSet list, Object data)
void setPeriod(QueuePeriod period)
static Messages confirmDeletion()
static Messages confirmProcess()
Messages add(String word)
static IElephantEntity getController(String path)
static String get(String msg)
QueueOptions configQueue(QueueOptions qo)
void removeOptions(String idCategory)
void addAssistantsByEntity()
void setNotificationCategory(NotificationCategory notificationCategory)
void addAttendeesByEntity(String entityPath, boolean deep)
void addContact(IContact contact)
void periodToAll(final QueuePeriod period)
void onEvent(Event event)
Columns getColumns(boolean create)
Rows getRows(boolean create)
void setRowCount(int rows)
static FrameClipboard getClipboard()
void subscribeIfNot(String idCategory, IContact contact, QueuePeriod period)
void subscribe(String idCategory, IContact contact, QueuePeriod period)