started 1.3.5
This commit is contained in:
parent
6d7d47772c
commit
cfd974ecd2
9 changed files with 89 additions and 8 deletions
|
|
@ -6,7 +6,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>office-alexander-logistics</artifactId>
|
<artifactId>office-alexander-logistics</artifactId>
|
||||||
<groupId>com.alexander-logistics</groupId>
|
<groupId>com.alexander-logistics</groupId>
|
||||||
<version>1.3.4</version>
|
<version>1.3.5</version>
|
||||||
</parent>
|
</parent>
|
||||||
<artifactId>office-alexander-logistics-app</artifactId>
|
<artifactId>office-alexander-logistics-app</artifactId>
|
||||||
<packaging>war</packaging>
|
<packaging>war</packaging>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,81 @@
|
||||||
|
package com.alexanderlogistics.ksef;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
|
import org.imixs.archive.core.SnapshotService;
|
||||||
|
import org.imixs.workflow.ItemCollection;
|
||||||
|
import org.imixs.workflow.SignalAdapter;
|
||||||
|
import org.imixs.workflow.engine.WorkflowService;
|
||||||
|
import org.imixs.workflow.exceptions.AdapterException;
|
||||||
|
import org.imixs.workflow.exceptions.PluginException;
|
||||||
|
|
||||||
|
import com.alexanderlogistics.ksef.api.KSeFAPIService;
|
||||||
|
|
||||||
|
import jakarta.inject.Inject;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This adapter exports the invoice data to KSeF
|
||||||
|
*
|
||||||
|
* To activate debug add the following event definition
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* {@code
|
||||||
|
<ksef name="EXPORT">
|
||||||
|
<debug>true</debug>
|
||||||
|
</ksef>
|
||||||
|
* }
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* @version 1.0
|
||||||
|
* @author rsoika
|
||||||
|
*/
|
||||||
|
public class KSeFExportAdapter implements SignalAdapter {
|
||||||
|
|
||||||
|
public static final String CONFIG_ERROR = "CONFIG_ERROR";
|
||||||
|
|
||||||
|
private static Logger logger = Logger.getLogger(KSeFExportAdapter.class.getName());
|
||||||
|
private boolean debug = false;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
KSeFAPIService kSeFAPIService;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
WorkflowService workflowService;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
SnapshotService snapshotService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method calls the ksef api and uploads an invoice xml document
|
||||||
|
*
|
||||||
|
* @throws PluginException
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public ItemCollection execute(ItemCollection workitem, ItemCollection event)
|
||||||
|
throws AdapterException {
|
||||||
|
// read debug flag
|
||||||
|
try {
|
||||||
|
List<ItemCollection> ksefDefinitions = workflowService.evalWorkflowResultXML(event, "ksef",
|
||||||
|
"EXPORT", workitem, false);
|
||||||
|
if (ksefDefinitions != null && ksefDefinitions.size() > 0) {
|
||||||
|
ItemCollection ksefDefinition = ksefDefinitions.get(0);
|
||||||
|
debug = ksefDefinition.getItemValueBoolean("debug");
|
||||||
|
}
|
||||||
|
} catch (PluginException ee) {
|
||||||
|
// no op
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
|
||||||
|
kSeFAPIService.uploadInvoice(workitem, "test.xml");
|
||||||
|
|
||||||
|
} catch (PluginException e) {
|
||||||
|
// convert PluginException into a AdapterException to handle the error via the
|
||||||
|
// model!
|
||||||
|
logger.warning("Failed to export data to Zoho: " + e.getMessage());
|
||||||
|
throw new AdapterException(e);
|
||||||
|
}
|
||||||
|
return workitem;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.alexanderlogistics.ksef;
|
package com.alexanderlogistics.ksef.api;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.alexanderlogistics.ksef;
|
package com.alexanderlogistics.ksef.api;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.alexanderlogistics.ksef;
|
package com.alexanderlogistics.ksef.api;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.alexanderlogistics.ksef;
|
package com.alexanderlogistics.ksef.api;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.alexanderlogistics.ksef;
|
package com.alexanderlogistics.ksef.api;
|
||||||
|
|
||||||
public class Params {
|
public class Params {
|
||||||
public static final String TOKEN = "20251113-EC-2751AC3000-5C5466924B-62|nip-9552521552|fc0c95d020dc45d4af491fb0aa755f3f3f674b33ecbf4250a88ea6e36fa8340b";
|
public static final String TOKEN = "20251113-EC-2751AC3000-5C5466924B-62|nip-9552521552|fc0c95d020dc45d4af491fb0aa755f3f3f674b33ecbf4250a88ea6e36fa8340b";
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>office-alexander-logistics</artifactId>
|
<artifactId>office-alexander-logistics</artifactId>
|
||||||
<groupId>com.alexander-logistics</groupId>
|
<groupId>com.alexander-logistics</groupId>
|
||||||
<version>1.3.4</version>
|
<version>1.3.5</version>
|
||||||
</parent>
|
</parent>
|
||||||
<artifactId>office-alexander-logistics-testclient</artifactId>
|
<artifactId>office-alexander-logistics-testclient</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
|
||||||
2
pom.xml
2
pom.xml
|
|
@ -5,7 +5,7 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>com.alexander-logistics</groupId>
|
<groupId>com.alexander-logistics</groupId>
|
||||||
<artifactId>office-alexander-logistics</artifactId>
|
<artifactId>office-alexander-logistics</artifactId>
|
||||||
<version>1.3.4</version>
|
<version>1.3.5</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<name>Imixs Office Workflow - Custom Build</name>
|
<name>Imixs Office Workflow - Custom Build</name>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue