Commit 638ca1c4 authored by Thomas Huster's avatar Thomas Huster

[20758] add create outbox element command without ui selection

parent 5f8c6593
Pipeline #15394 passed with stages
in 7 minutes and 18 seconds
......@@ -8,6 +8,7 @@ Import-Package: ch.elexis.core.documents,
ch.elexis.core.model,
ch.rgw.io,
org.apache.commons.io;version="2.4.0",
org.apache.commons.lang;version="2.6.0",
org.slf4j
Require-Bundle: at.medevit.elexis.outbox;bundle-version="1.0.0",
org.eclipse.ui;bundle-version="3.7.0",
......
......@@ -57,6 +57,15 @@
id="at.medevit.elexis.outbox.ui.command.sendAsMailXDM"
name="sendAsXDM">
</command>
<command
id="at.medevit.elexis.outbox.ui.command.createElementNoUi"
name="Create Element No UI">
<commandParameter
id="at.medevit.elexis.outbox.ui.command.createElementNoUi.dburi"
name="dburi"
optional="true">
</commandParameter>
</command>
</extension>
<extension
point="org.eclipse.ui.menus">
......@@ -143,6 +152,10 @@
</test>
</enabledWhen>
</handler>
<handler
class="at.medevit.elexis.outbox.ui.command.CreateOutboxElementNoUiHandler"
commandId="at.medevit.elexis.outbox.ui.command.createElementNoUi">
</handler>
</extension>
</plugin>
package at.medevit.elexis.outbox.ui.command;
import org.apache.commons.lang.StringUtils;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import at.medevit.elexis.outbox.model.OutboxElementType;
import at.medevit.elexis.outbox.ui.OutboxServiceComponent;
import ch.elexis.core.data.service.ContextServiceHolder;
import ch.elexis.core.model.IMandator;
import ch.elexis.core.model.IPatient;
public class CreateOutboxElementNoUiHandler extends AbstractHandler {
@Override
public Object execute(ExecutionEvent event) throws ExecutionException{
IPatient patient = ContextServiceHolder.get().getActivePatient().orElse(null);
IMandator mandant = ContextServiceHolder.get().getActiveMandator().orElse(null);
String dburi =
event.getParameter("at.medevit.elexis.outbox.ui.command.createElementNoUi.dburi");
if (StringUtils.isNotEmpty(dburi)) {
OutboxServiceComponent.getService().createOutboxElement(patient, mandant,
OutboxElementType.DB.getPrefix() + dburi);
}
return null;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment