19 package org.turro.dossier.zul.dossier;
21 import java.util.Date;
22 import org.turro.action.queue.ConstraintKeys;
23 import org.turro.command.Command;
24 import org.turro.command.Context;
25 import org.turro.dossier.db.DossierPU;
26 import org.turro.dossier.dossier.DossierWrapper;
27 import org.turro.dossier.entity.DescriptorDefinition;
28 import org.turro.dossier.entity.DescriptorValue;
29 import org.turro.dossier.entity.Dossier;
30 import org.turro.dossier.entity.DossierType;
31 import org.turro.dossier.entity.Participant;
32 import org.turro.dossier.project.ChangePhaseNotification;
33 import org.turro.dossier.project.NewParticipantNotification;
34 import org.turro.dossier.zul.menu.DossierMenu;
35 import org.turro.elephant.context.Application;
36 import org.turro.i18n.I_;
37 import org.turro.jpa.composer.EntityComposer;
38 import org.turro.jpa.entity.DaoEntity;
39 import org.turro.mail.queue.QueueManager;
40 import org.turro.zkoss.dialog.SelectionDialog;
41 import org.turro.zkoss.text.WikiEditor;
42 import org.turro.zul.frame.Framework;
43 import org.zkoss.lang.Strings;
44 import org.zkoss.zk.ui.Component;
45 import org.zkoss.zk.ui.event.Event;
46 import org.zkoss.zk.ui.select.annotation.Listen;
47 import org.zkoss.zk.ui.select.annotation.Wire;
64 @Listen(
"onClick = #addIssue")
68 public Object execute(Context context) {
76 @Listen(
"onSelect = #descriptors")
78 if(
entity.getId() !=
null &&
entity.getId() > 0 && descriptors !=
null) {
84 entity.getDescriptors().add(dv);
111 @Listen(
"onChange = #wiki")
118 entity.getDescriptors().add(dv);
125 @Listen(
"onClick = #allParticipants")
129 entity.resetParticipants();
132 I_.
get(
"All participants"),
133 pg,
"90%",
"90%",
null);
145 entity.setPublishable(
true);
164 if(oldPhase !=
entity.getProject().getPhase()) {
165 entity.getProject().setChangePhase(
new Date());
169 if(!participant.isEmpty() && !Strings.isBlank(participant.getDiscriminator()) &&
170 (participant.getId() ==
null || participant.getId() == 0L)) {
175 return super.beforeSave();
192 if(
entity.getProject() !=
null) {
193 oldPhase =
entity.getProject().getPhase();
199 return !
entity.isEmpty() && (
entity.getId() ==
null ||
entity.getId() == 0) || super.shouldBeSaved();
static ConstraintKeys from(IContact contact)
void setValue(DescriptorValue descriptorValue)
DescriptorValue getValue()
void setText(String text)
void setWiki(String wiki)
void setDossier(Dossier dossier)
final void onSelectDescriptor(Event event)
DaoEntity getWrapperInstance(Component comp)
Dossier getEntityInstance(Long id)
String getAttributeName()
void setDossier(Dossier dossier)
void setAddToolbar(boolean addToolbar)
boolean isInRole(String role)
static Application getApplication()
static String get(String msg)
void subscribeDefaults(ConstraintKeys keys)
static void showComponent(Page page, String title, Component component, String width, String height, final Command command)
void setReadonly(boolean value)
void setImageFolder(String folder)
void setValue(String value)
void setFileFolder(String folder)
static Framework getCurrent()
void setSelectedLabel(String text)
void setSelectedTooltiptext(String text)