Skip to content

Commit

Permalink
support for message priorities. close #1796
Browse files Browse the repository at this point in the history
  • Loading branch information
j-dimension committed Dec 11, 2023
1 parent 22c6050 commit efe01e7
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1263,14 +1263,14 @@ public Message sendAndRetrieveMessage(Message msg, String senderSafeId, String r
return sentMessage;
}

public String saveMessageToDrafts(Message msg, String senderSafeId, String recipientSafeId, BeaListItem authority) throws BeaWrapperException {
public String saveMessageToDrafts(Message msg, String senderSafeId, String recipientSafeId, BeaListItem authority, BeaListItem priority) throws BeaWrapperException {
this.checkValidBeaClient();
Folder draftsFolder = this.wrapper.getDraftsFolder(senderSafeId);
if (draftsFolder != null) {
if (this.folderOverviewCache.containsKey(draftsFolder.getId()))
this.folderOverviewCache.remove(draftsFolder.getId());
}
return this.wrapper.saveMessageToDrafts(msg, senderSafeId, recipientSafeId, authority);
return this.wrapper.saveMessageToDrafts(msg, senderSafeId, recipientSafeId, authority, priority);
}

public Message sendEebConfirmation(Message incomingMessage, String senderSafeId, String recipientSafeId, Date abgabeDate) throws BeaWrapperException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,7 @@ public class SaveBeaMessageAction extends ProgressableAction {
private List<BeaAttachmentMetadata> attachments = null;
private boolean readReceipt = false;
private BeaListItem authority = null;
private BeaListItem priority = null;
private Identity to = null;
private String subject = "";
private String body = "";
Expand All @@ -714,7 +715,7 @@ public class SaveBeaMessageAction extends ProgressableAction {

private CaseFolder folder = null;

public SaveBeaMessageAction(ProgressIndicator i, JDialog cleanAfter, String fromSafeId, List<BeaAttachmentMetadata> attachmentMetadata, AppUserBean cu, boolean readReceipt, BeaListItem authority, Identity to, String subject, String body, String documentTag, String azSender, String azRecipient) {
public SaveBeaMessageAction(ProgressIndicator i, JDialog cleanAfter, String fromSafeId, List<BeaAttachmentMetadata> attachmentMetadata, AppUserBean cu, boolean readReceipt, BeaListItem authority, Identity to, String subject, String body, String documentTag, String azSender, String azRecipient, BeaListItem priority) {
super(i, false, cleanAfter);
this.attachments = attachmentMetadata;
this.readReceipt = readReceipt;
Expand All @@ -727,10 +728,11 @@ public SaveBeaMessageAction(ProgressIndicator i, JDialog cleanAfter, String from
this.authority = authority;
this.azSender = azSender;
this.azRecipient = azRecipient;
this.priority=priority;
}

public SaveBeaMessageAction(ProgressIndicator i, JDialog cleanAfter, String fromSafeId, List<BeaAttachmentMetadata> attachmentMetadata, AppUserBean cu, boolean readReceipt, BeaListItem authority, Identity to, String subject, String body, ArchiveFileBean af, String documentTag, String azSender, String azRecipient, CaseFolder folder) {
this(i, cleanAfter, fromSafeId, attachmentMetadata, cu, readReceipt, authority, to, subject, body, documentTag, azSender, azRecipient);
public SaveBeaMessageAction(ProgressIndicator i, JDialog cleanAfter, String fromSafeId, List<BeaAttachmentMetadata> attachmentMetadata, AppUserBean cu, boolean readReceipt, BeaListItem authority, Identity to, String subject, String body, ArchiveFileBean af, String documentTag, String azSender, String azRecipient, CaseFolder folder, BeaListItem priority) {
this(i, cleanAfter, fromSafeId, attachmentMetadata, cu, readReceipt, authority, to, subject, body, documentTag, azSender, azRecipient, priority);
this.archiveFile = af;
this.folder = folder;
}
Expand Down Expand Up @@ -793,7 +795,7 @@ public boolean execute() throws Exception {
String toSafeId=null;
if(this.to!=null)
toSafeId=this.to.getSafeId();
sentId = bea.saveMessageToDrafts(msg, senderSafeId, toSafeId, this.authority);
sentId = bea.saveMessageToDrafts(msg, senderSafeId, toSafeId, this.authority, this.priority);

} catch (BeaWrapperException ex) {
log.error(ex);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -786,12 +786,11 @@
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="103" groupAlignment="3" attributes="0">
<Component id="cmbPriorities" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="jLabel5" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="cmbPriorities" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel5" min="-2" pref="28" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Component id="cmbMessageType" min="-2" max="-2" attributes="0"/>
Expand Down Expand Up @@ -848,7 +847,7 @@
</Component>
<Component class="javax.swing.JCheckBox" name="chkEeb">
<Properties>
<Property name="text" type="java.lang.String" value="Zust. g. Empfangsb."/>
<Property name="text" type="java.lang.String" value="Zustellung gegen Empfangsbekenntnis"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="chkEebActionPerformed"/>
Expand Down Expand Up @@ -894,7 +893,7 @@
<EmptySpace max="-2" attributes="0"/>
<Component id="cmbTemplates" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="pnlParties" pref="49" max="32767" attributes="0"/>
<Component id="pnlParties" pref="88" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1630,7 +1630,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {

jLabel6.setText("Priorität:");

chkEeb.setText("Zust. g. Empfangsb.");
chkEeb.setText("Zustellung gegen Empfangsbekenntnis");
chkEeb.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
chkEebActionPerformed(evt);
Expand Down Expand Up @@ -1660,11 +1660,11 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(cmbPriorities, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel6))
.addComponent(jLabel5))
.addContainerGap()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(cmbPriorities, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel6)
.addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(cmbMessageType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
Expand Down Expand Up @@ -1706,7 +1706,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(cmbTemplates, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(pnlParties, javax.swing.GroupLayout.DEFAULT_SIZE, 49, Short.MAX_VALUE)
.addComponent(pnlParties, javax.swing.GroupLayout.DEFAULT_SIZE, 88, Short.MAX_VALUE)
.addContainerGap())
);

Expand Down Expand Up @@ -2286,6 +2286,11 @@ private void cmdSaveDraftActionPerformed(java.awt.event.ActionEvent evt) {//GEN-
if (this.lstTo.getModel().getSize() > 0) {
recipient = (Identity) ((DefaultListModel) this.lstTo.getModel()).elements().nextElement();
}

BeaListItem priority=null;
if(this.cmbPriorities.getSelectedItem() instanceof BeaListItem)
// first index is a string (no priority selected)
priority=(BeaListItem)this.cmbPriorities.getSelectedItem();

ArrayList<BeaAttachmentMetadata> attachmentMetadata = this.getAttachmentMetdata();

Expand All @@ -2297,9 +2302,9 @@ private void cmdSaveDraftActionPerformed(java.awt.event.ActionEvent evt) {//GEN-
}

if (this.chkSaveAsDocument.isSelected()) {
a = new SaveBeaMessageAction(dlg, this, fromSafeId, attachmentMetadata, this.cu, this.chkEeb.isSelected(), this.authority, recipient, this.txtSubject.getText(), ed.getText(), this.contextArchiveFile, createDocumentTag, this.txtAzSender.getText(), this.cmbAzRecipient.getEditor().getItem().toString(), folder);
a = new SaveBeaMessageAction(dlg, this, fromSafeId, attachmentMetadata, this.cu, this.chkEeb.isSelected(), this.authority, recipient, this.txtSubject.getText(), ed.getText(), this.contextArchiveFile, createDocumentTag, this.txtAzSender.getText(), this.cmbAzRecipient.getEditor().getItem().toString(), folder, priority);
} else {
a = new SaveBeaMessageAction(dlg, this, fromSafeId, attachmentMetadata, this.cu, this.chkEeb.isSelected(), this.authority, recipient, this.txtSubject.getText(), ed.getText(), createDocumentTag, this.txtAzSender.getText(), this.cmbAzRecipient.getEditor().getItem().toString());
a = new SaveBeaMessageAction(dlg, this, fromSafeId, attachmentMetadata, this.cu, this.chkEeb.isSelected(), this.authority, recipient, this.txtSubject.getText(), ed.getText(), createDocumentTag, this.txtAzSender.getText(), this.cmbAzRecipient.getEditor().getItem().toString(), priority);
}
a.start();

Expand Down
Binary file modified j-lawyer-proprietary/libs/j-lawyer-bea-wrapper.jar
Binary file not shown.

0 comments on commit efe01e7

Please sign in to comment.