Skip to content

Commit

Permalink
added data model, configuration, UI for calendar event templates. issue
Browse files Browse the repository at this point in the history
  • Loading branch information
j-dimension committed Aug 14, 2024
1 parent 742cd81 commit 2c9b00e
Show file tree
Hide file tree
Showing 36 changed files with 6,187 additions and 317 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -537,25 +537,23 @@
<Property name="text" type="java.lang.String" value="Kalender"/>
</Properties>
<SubComponents>
<MenuItem class="javax.swing.JMenuItem" name="mnuArchiveFileOptionsReviewReasons">
<MenuItem class="javax.swing.JMenuItem" name="mnuCalendarEntryTemplates">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/icons/schedule.png"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="com/jdimension/jlawyer/client/JKanzleiGUI.properties" key="menu.settings.cases.reviews" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
<Property name="text" type="java.lang.String" value="Ereignisvorlagen"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="mnuArchiveFileOptionsReviewReasonsActionPerformed"/>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="mnuCalendarEntryTemplatesActionPerformed"/>
</Events>
</MenuItem>
<MenuItem class="javax.swing.JMenuItem" name="mnuCalendarSetup">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/icons16/material/baseline_share_black_48dp.png"/>
</Property>
<Property name="text" type="java.lang.String" value="Kalender und Synchronisation konfigurieren"/>
<Property name="text" type="java.lang.String" value="Kalender und Synchronisation"/>
<Property name="actionCommand" type="java.lang.String" value="Kalender-Synchronisation"/>
</Properties>
<Events>
Expand Down
26 changes: 13 additions & 13 deletions j-lawyer-client/src/com/jdimension/jlawyer/client/JKanzleiGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -1134,7 +1134,7 @@ private void initComponents() {
mnuMappingTables = new javax.swing.JMenuItem();
mnuMappingEntries = new javax.swing.JMenuItem();
mnuCalendarOptions = new javax.swing.JMenu();
mnuArchiveFileOptionsReviewReasons = new javax.swing.JMenuItem();
mnuCalendarEntryTemplates = new javax.swing.JMenuItem();
mnuCalendarSetup = new javax.swing.JMenuItem();
mnuCalendarSyncNow = new javax.swing.JMenuItem();
mnuFinance = new javax.swing.JMenu();
Expand Down Expand Up @@ -1677,17 +1677,17 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
mnuCalendarOptions.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/package_system.png"))); // NOI18N
mnuCalendarOptions.setText("Kalender");

mnuArchiveFileOptionsReviewReasons.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/schedule.png"))); // NOI18N
mnuArchiveFileOptionsReviewReasons.setText(bundle.getString("menu.settings.cases.reviews")); // NOI18N
mnuArchiveFileOptionsReviewReasons.addActionListener(new java.awt.event.ActionListener() {
mnuCalendarEntryTemplates.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/schedule.png"))); // NOI18N
mnuCalendarEntryTemplates.setText("Ereignisvorlagen");
mnuCalendarEntryTemplates.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
mnuArchiveFileOptionsReviewReasonsActionPerformed(evt);
mnuCalendarEntryTemplatesActionPerformed(evt);
}
});
mnuCalendarOptions.add(mnuArchiveFileOptionsReviewReasons);
mnuCalendarOptions.add(mnuCalendarEntryTemplates);

mnuCalendarSetup.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons16/material/baseline_share_black_48dp.png"))); // NOI18N
mnuCalendarSetup.setText("Kalender und Synchronisation konfigurieren");
mnuCalendarSetup.setText("Kalender und Synchronisation");
mnuCalendarSetup.setActionCommand("Kalender-Synchronisation");
mnuCalendarSetup.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
Expand Down Expand Up @@ -2032,13 +2032,13 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
pack();
}// </editor-fold>//GEN-END:initComponents

private void mnuArchiveFileOptionsReviewReasonsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuArchiveFileOptionsReviewReasonsActionPerformed
OptionGroupConfigurationDialog dlg = new OptionGroupConfigurationDialog(this, true);
dlg.setTitle(java.util.ResourceBundle.getBundle("com/jdimension/jlawyer/client/JKanzleiGUI").getString("dialog.title.reviews"));
dlg.setOptionGroup(OptionConstants.OPTIONGROUP_REVIEWREASONS);
private void mnuCalendarEntryTemplatesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuCalendarEntryTemplatesActionPerformed

CalendarEntryTemplatesDialog dlg = new CalendarEntryTemplatesDialog(this, true);
FrameUtils.centerDialog(dlg, this);
dlg.setVisible(true);
}//GEN-LAST:event_mnuArchiveFileOptionsReviewReasonsActionPerformed

}//GEN-LAST:event_mnuCalendarEntryTemplatesActionPerformed

private void mnuArchiveFileOptionsDictateSignActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuArchiveFileOptionsDictateSignActionPerformed
OptionGroupConfigurationDialog dlg = new OptionGroupConfigurationDialog(this, true);
Expand Down Expand Up @@ -2848,7 +2848,6 @@ public static void main(String args[]) {
private javax.swing.JMenu mnuArchiveFileOptions;
private javax.swing.JMenuItem mnuArchiveFileOptionsCaseNumbering;
private javax.swing.JMenuItem mnuArchiveFileOptionsDictateSign;
private javax.swing.JMenuItem mnuArchiveFileOptionsReviewReasons;
private javax.swing.JMenuItem mnuArchiveFileOptionsSubjectFields;
private javax.swing.JMenuItem mnuArchiveFileTags;
private javax.swing.JMenuItem mnuAssistantConfigs;
Expand All @@ -2860,6 +2859,7 @@ public static void main(String args[]) {
private javax.swing.JMenuItem mnuBeaSettings;
private javax.swing.JMenuItem mnuBugReport;
private javax.swing.JMenu mnuCalculations;
private javax.swing.JMenuItem mnuCalendarEntryTemplates;
private javax.swing.JMenu mnuCalendarOptions;
private javax.swing.JMenuItem mnuCalendarSetup;
private javax.swing.JMenuItem mnuCalendarSyncNow;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ menu.settings.documents=Modul 'Dokumente'
menu.settings.cases.customfields=Eigene Felder (Akte)
menu.settings.cases.tags=Etiketten
menu.settings.cases.subjectfields=Sachgebiete
menu.settings.cases.reviews=Wiedervorlagegr\u00fcnde
menu.settings.cases.dictatesigns=Diktatzeichen
menu.settings.cases=Modul 'Akten'
menu.settings.addresses.customfields=Eigene Felder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ menu.settings.documents=Module 'Documents'
menu.settings.cases.customfields=Custom Fields
menu.settings.cases.tags=Tags
menu.settings.cases.subjectfields=Subject Fields
menu.settings.cases.reviews=Follow-Ups
menu.settings.cases.dictatesigns=Dictated By's
menu.settings.cases=Module 'Cases'
menu.settings.addresses.customfields=Custom Fields
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -820,14 +820,14 @@ public void run() {
subjectFieldDtos = mgmt.getOptionGroup(OptionConstants.OPTIONGROUP_SUBJECTFIELDS);
this.updateProgress(false, 9, 5, "");
updateStatus(java.util.ResourceBundle.getBundle("com/jdimension/jlawyer/client/SplashThread").getString("status.option.5"), true);
reviewReasonDtos = mgmt.getOptionGroup(OptionConstants.OPTIONGROUP_REVIEWREASONS);
settings.setCalendarEntryTemplates(locator.lookupCalendarServiceRemote().getCalendarEntryTemplates());
List<String> tagsInUse = afs.searchTagsInUse();
settings.setArchiveFileTagsInUse(tagsInUse);
List<String> docTagsInUse = afs.searchDocumentTagsInUse();
settings.setDocumentTagsInUse(docTagsInUse);
this.updateProgress(false, 9, 6, "");
updateStatus(java.util.ResourceBundle.getBundle("com/jdimension/jlawyer/client/SplashThread").getString("status.option.6"), true);

loginEnabledUsers = security.getUsersHavingRole(UserSettings.ROLE_LOGIN);
messagingEnabledUsers = security.getMessagingEnabledUsers();

Expand Down Expand Up @@ -872,7 +872,6 @@ public void run() {
settings.setComplimentaryCloseDtos(complimentaryCloseDtos);
settings.setSalutationDtos(salutationDtos);
settings.setDictateSignDtos(dictateSignDtos);
settings.setReviewReasonDtos(reviewReasonDtos);
settings.setSubjectFieldDtos(subjectFieldDtos);
settings.setArchiveFileTagDtos(afTagDtos);
settings.setAddressTagDtos(adrTagDtos);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -665,16 +665,13 @@

import com.jdimension.jlawyer.client.calendar.CalendarUtils;
import com.jdimension.jlawyer.client.components.MultiCalDialog;
import com.jdimension.jlawyer.client.configuration.OptionGroupListCellRenderer;
import com.jdimension.jlawyer.client.configuration.UserListCellRenderer;
import com.jdimension.jlawyer.client.mail.*;
import com.jdimension.jlawyer.client.editors.EditorsRegistry;
import com.jdimension.jlawyer.client.editors.documents.SearchAndAssignDialog;
import com.jdimension.jlawyer.client.editors.files.OptionsComboBoxModel;
import com.jdimension.jlawyer.client.editors.files.PartiesPanelEntry;
import com.jdimension.jlawyer.client.editors.files.PartiesSelectionListener;
import com.jdimension.jlawyer.client.events.EventBroker;
import com.jdimension.jlawyer.client.events.ReviewAddedEvent;
import com.jdimension.jlawyer.client.launcher.Launcher;
import com.jdimension.jlawyer.client.launcher.LauncherFactory;
import com.jdimension.jlawyer.client.launcher.ReadOnlyDocumentStore;
Expand All @@ -696,10 +693,10 @@
import com.jdimension.jlawyer.persistence.ArchiveFileAddressesBean;
import com.jdimension.jlawyer.persistence.ArchiveFileBean;
import com.jdimension.jlawyer.persistence.ArchiveFileReviewsBean;
import com.jdimension.jlawyer.persistence.CalendarEntryTemplate;
import com.jdimension.jlawyer.persistence.CalendarSetup;
import com.jdimension.jlawyer.persistence.CaseFolder;
import com.jdimension.jlawyer.persistence.PartyTypeBean;
import com.jdimension.jlawyer.services.CalendarServiceRemote;
import com.jdimension.jlawyer.services.JLawyerServiceLocator;
import com.jdimension.jlawyer.services.PartiesTriplet;
import java.awt.Color;
Expand Down Expand Up @@ -877,17 +874,7 @@ public SendBeaMessageDialog(java.awt.Frame parent, boolean modal) {
JOptionPane.showMessageDialog(this, "Fehler beim Ermitteln der Beteiligtentypen: " + ex.getMessage(), com.jdimension.jlawyer.client.utils.DesktopUtils.POPUP_TITLE_ERROR, JOptionPane.ERROR_MESSAGE);
}

this.cmbReviewReason.setRenderer(new OptionGroupListCellRenderer());
AppOptionGroupBean[] reviewReasons = settings.getReviewReasonDtos();
String[] reviewReasonItems = new String[reviewReasons.length + 1];
reviewReasonItems[0] = "";
for (int i = 0; i < reviewReasons.length; i++) {
AppOptionGroupBean aogb = (AppOptionGroupBean) reviewReasons[i];
reviewReasonItems[i + 1] = aogb.getValue();
}
StringUtils.sortIgnoreCase(reviewReasonItems);
OptionsComboBoxModel reviewReasonModel = new OptionsComboBoxModel(reviewReasonItems);
this.cmbReviewReason.setModel(reviewReasonModel);
CalendarUtils.populateCalendarEntryTemplatesDropdown(this.cmbReviewReason, true);
ComponentUtils.addAutoComplete(this.cmbReviewReason);

List<AppUserBean> allUsers = UserSettings.getInstance().getLoginEnabledUsers();
Expand Down Expand Up @@ -1956,27 +1943,17 @@ private void cmdSendActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST
reviewDto.setDone(false);
reviewDto.setBeginDate(d);
reviewDto.setAssignee(this.cmbReviewAssignee.getSelectedItem().toString());
reviewDto.setSummary(this.cmbReviewReason.getModel().getSelectedItem().toString());
reviewDto.setSummary(this.cmbReviewReason.getEditor().getItem().toString());
reviewDto.setCalendarSetup(this.calendarSelectionButton1.getSelectedSetup());

if (CalendarUtils.checkForConflicts(this, reviewDto)) {
EditorsRegistry.getInstance().updateStatus("Wiedervorlage/Frist wird gespeichert...");
try {
JLawyerServiceLocator locator = JLawyerServiceLocator.getInstance(settings.getLookupProperties());
CalendarServiceRemote calService = locator.lookupCalendarServiceRemote();

reviewDto = calService.addReview(this.contextArchiveFile.getId(), reviewDto);
EditorsRegistry.getInstance().updateStatus("Wiedervorlage/Frist gespeichert.", 5000);

CalendarUtils.getInstance().storeCalendarEntry(reviewDto, this.contextArchiveFile.getId(), (CalendarEntryTemplate) this.cmbReviewReason.getItemAt(this.cmbReviewReason.getSelectedIndex()));
} catch (Exception ex) {
log.error("Error adding review", ex);
JOptionPane.showMessageDialog(this, "Fehler beim Speichern der Wiedervorlage: " + ex.getMessage(), com.jdimension.jlawyer.client.utils.DesktopUtils.POPUP_TITLE_ERROR, JOptionPane.ERROR_MESSAGE);
EditorsRegistry.getInstance().clearStatus();
JOptionPane.showMessageDialog(this, "Fehler beim Speichern des Kalendereintrages: " + ex.getMessage(), com.jdimension.jlawyer.client.utils.DesktopUtils.POPUP_TITLE_ERROR, JOptionPane.ERROR_MESSAGE);
return;
}

EventBroker eb = EventBroker.getInstance();
eb.publishEvent(new ReviewAddedEvent(reviewDto));
}

}
Expand Down Expand Up @@ -2343,27 +2320,16 @@ private void cmdSaveDraftActionPerformed(java.awt.event.ActionEvent evt) {//GEN-
reviewDto.setDone(false);
reviewDto.setBeginDate(d);
reviewDto.setAssignee(this.cmbReviewAssignee.getSelectedItem().toString());
reviewDto.setSummary(this.cmbReviewReason.getModel().getSelectedItem().toString());
reviewDto.setSummary(this.cmbReviewReason.getEditor().getItem().toString());
reviewDto.setCalendarSetup(this.calendarSelectionButton1.getSelectedSetup());

if (CalendarUtils.checkForConflicts(this, reviewDto)) {
EditorsRegistry.getInstance().updateStatus("Wiedervorlage/Frist wird gespeichert...");
try {
JLawyerServiceLocator locator = JLawyerServiceLocator.getInstance(settings.getLookupProperties());
CalendarServiceRemote calService = locator.lookupCalendarServiceRemote();

reviewDto = calService.addReview(this.contextArchiveFile.getId(), reviewDto);
EditorsRegistry.getInstance().updateStatus("Wiedervorlage/Frist gespeichert.", 5000);

CalendarUtils.getInstance().storeCalendarEntry(reviewDto, this.contextArchiveFile.getId(), (CalendarEntryTemplate) this.cmbReviewReason.getItemAt(this.cmbReviewReason.getSelectedIndex()));
} catch (Exception ex) {
log.error("Error adding review", ex);
JOptionPane.showMessageDialog(this, "Fehler beim Speichern der Wiedervorlage: " + ex.getMessage(), com.jdimension.jlawyer.client.utils.DesktopUtils.POPUP_TITLE_ERROR, JOptionPane.ERROR_MESSAGE);
EditorsRegistry.getInstance().clearStatus();
return;
JOptionPane.showMessageDialog(this, "Fehler beim Speichern des Kalendereintrages: " + ex.getMessage(), com.jdimension.jlawyer.client.utils.DesktopUtils.POPUP_TITLE_ERROR, JOptionPane.ERROR_MESSAGE);
}

EventBroker eb = EventBroker.getInstance();
eb.publishEvent(new ReviewAddedEvent(reviewDto));
}

}
Expand Down
Loading

0 comments on commit 2c9b00e

Please sign in to comment.