19 package org.turro.dossier.zul.dossier;
21 import java.util.HashSet;
22 import org.turro.action.queue.ConstraintKeys;
23 import org.turro.attach.zul.control.AttachmentControl;
24 import org.turro.dossier.db.DossierPU;
25 import org.turro.dossier.dossier.CategoryCombobox;
26 import org.turro.dossier.dossier.CategoryWrapper;
27 import org.turro.dossier.entity.Category;
28 import org.turro.dossier.entity.CategoryParticipant;
29 import org.turro.dossier.entity.DescriptorDefinition;
30 import org.turro.dossier.entity.WorthDefinition;
31 import org.turro.dossier.search.CategoryResults;
32 import org.turro.elephant.util.Messages;
33 import org.turro.file.zul.control.FileControl;
34 import org.turro.mail.queue.QueueManager;
35 import org.zkoss.zk.ui.Component;
36 import org.zkoss.zk.ui.select.SelectorComposer;
37 import org.zkoss.zk.ui.select.annotation.Listen;
38 import org.zkoss.zk.ui.select.annotation.Wire;
39 import org.zkoss.zul.Checkbox;
40 import org.zkoss.zul.Include;
41 import org.zkoss.zul.Label;
42 import org.zkoss.zul.Textbox;
43 import org.zkoss.zul.Toolbarbutton;
54 private org.turro.dossier.dossier.CategoryTree categoryTree;
57 private Label identifier;
60 private Textbox description;
66 private Checkbox kbase;
69 private Checkbox ownprj;
71 @Wire(
"#participantGrid")
74 @Wire(
"#descriptorsGrid")
80 @Wire(
"#createCategory")
81 private Toolbarbutton createCategory;
83 @Wire(
"#saveCategory")
84 private Toolbarbutton saveCategory;
86 @Wire(
"#deleteCategory")
87 private Toolbarbutton deleteCategory;
96 private Include webContent;
98 @Listen(
"onSelect = #category")
100 category = categoryTree.getSelectedCategory();
101 if(category !=
null) {
102 identifier.setValue(category.
getId() +
"");
117 webContent.setAttribute(
"entity", categoryTree.getSelectedCategory());
118 webContent.invalidate();
119 saveCategory.setDisabled(
false);
120 deleteCategory.setDisabled(!(
new CategoryWrapper(category).canDelete()));
122 identifier.setValue(
null);
123 description.setValue(
null);
125 kbase.setChecked(
false);
126 ownprj.setChecked(
false);
136 webContent.setAttribute(
"entity",
null);
137 webContent.invalidate();
138 saveCategory.setDisabled(
true);
142 @Listen(
"onClick = #createCategory")
145 identifier.setValue(
"<auto>");
159 webContent.setAttribute(
"entity",
null);
160 webContent.invalidate();
161 saveCategory.setDisabled(
false);
162 deleteCategory.setDisabled(
true);
165 @Listen(
"onClick = #saveCategory")
176 p.setRole(p.getRole());
182 categoryTree.reloadContents();
188 @Listen(
"onClick = #deleteCategory")
190 final Category cat = categoryTree.getSelectedCategory();
194 categoryTree.reloadContents();
203 saveCategory.setDisabled(
true);
204 deleteCategory.setDisabled(
true);
static ConstraintKeys from(IContact contact)
void setLabel(String label)
void setEntity(Object entity)
void setPublicOnly(Boolean publicOnly)
static void convertUrls()
void setCategory(Category category)
Set< CategoryParticipant > getParticipants()
void setParticipants(Set< CategoryParticipant > participants)
void setOwnsProjects(boolean ownsProjects)
void setDescription(String description)
void setParent(Category parent)
boolean isKnowledgeBase()
void setWorths(Set< WorthDefinition > worths)
String getFullDescription()
void setKnowledgeBase(boolean knowledgeBase)
void setDescriptors(Set< DescriptorDefinition > descriptors)
static void saveCategory(Category category)
void setCategory(Category category)
void setCategory(Category category)
void setCategory(Category category)
static Messages confirmDeletion()
Messages add(String word)
void setEntity(Object entity)
void setLabel(String label)
void subscribeDefaults(ConstraintKeys keys)