diff --git a/.gitignore b/.gitignore index c6cc0de..9b0d458 100644 --- a/.gitignore +++ b/.gitignore @@ -10,9 +10,10 @@ hs_err_pid* # maven target/ +lib/mvn-deps/ # ivy -lib/mvn-deps/ -logs/ +classes/ src_dataClasses/ src_wsproc/ +logs/ diff --git a/.project b/.project new file mode 100644 index 0000000..c8e0456 --- /dev/null +++ b/.project @@ -0,0 +1,11 @@ + + + ups-modules + + + + + + + + diff --git a/MY-PRODUCT-NAME-product/README.md b/MY-PRODUCT-NAME-product/README.md deleted file mode 100644 index ee9062a..0000000 --- a/MY-PRODUCT-NAME-product/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# MY-PRODUCT-NAME - -YOUR DESCRIPTION GOES HERE - -## Demo - -YOUR DEMO DESCRIPTION GOES HERE - -## Setup - -YOUR SETUP DESCRIPTION GOES HERE - -``` -@variables.yaml@ -``` \ No newline at end of file diff --git a/MY-PRODUCT-NAME-product/pom.xml b/MY-PRODUCT-NAME-product/pom.xml deleted file mode 100644 index dd59011..0000000 --- a/MY-PRODUCT-NAME-product/pom.xml +++ /dev/null @@ -1,67 +0,0 @@ - - 4.0.0 - com.axonivy.market - MY-PRODUCT-NAME-product - 10.0.0-SNAPSHOT - pom - - - ../MY-PRODUCT-NAME/config/variables.yaml - - - - - - org.apache.maven.plugins - maven-assembly-plugin - 3.3.0 - - - package - - single - - - false - - zip.xml - - - - - - - maven-antrun-plugin - 1.7 - - - generate-sources - - ${skip-readme} - - - - - - - - - - - run - - - - - - - - - org.apache.maven.plugins - maven-deploy-plugin - 3.0.0-M1 - - - - - diff --git a/README.md b/README.md index 0f94020..da2fa7d 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ -# MY-PRODUCT-NAME +# UPS connector +[![CI Build](https://github.com/axonivy-market/ups-connector/actions/workflows/ci.yml/badge.svg)](https://github.com/axonivy-market/ups-connector/actions/workflows/ci.yml) -[![CI Build](https://github.com/axonivy-market/REPO-NAME/actions/workflows/ci.yml/badge.svg)](https://github.com/axonivy-market/REPO-NAME/actions/workflows/ci.yml) +This is a UPS module built in the Axon Ivy framework, enabling users to seamlessly integrate with UPS services. With this app, users can effortlessly manage their packages through UPS. -"YOUR SHORT DESCRIPTION GOES HERE" - -Read our [documentation](MY-PRODUCT-NAME-product/README.md). +Read our [documentation](ups-connector-product/README.md). \ No newline at end of file diff --git a/pom.xml b/pom.xml index 517336b..f21f704 100644 --- a/pom.xml +++ b/pom.xml @@ -1,12 +1,13 @@ 4.0.0 - com.axonivy.market - my-product - my-product-modules - 10.0.0-SNAPSHOT + com.axonivy.connector.ups + ups-connector + ups-connector-modules + 10.0.14-SNAPSHOT pom + ups-oauth-feature ${project.name} ${project.name}-demo ${project.name}-test diff --git a/ups-connector-demo/.classpath b/ups-connector-demo/.classpath new file mode 100644 index 0000000..45a97e4 --- /dev/null +++ b/ups-connector-demo/.classpath @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ups-connector-demo/.gitignore b/ups-connector-demo/.gitignore new file mode 100644 index 0000000..9b0d458 --- /dev/null +++ b/ups-connector-demo/.gitignore @@ -0,0 +1,19 @@ +# general +Thumbs.db +.DS_Store +*~ +*.log + +# java +*.class +hs_err_pid* + +# maven +target/ +lib/mvn-deps/ + +# ivy +classes/ +src_dataClasses/ +src_wsproc/ +logs/ diff --git a/ups-connector-demo/.project b/ups-connector-demo/.project new file mode 100644 index 0000000..c8a5d15 --- /dev/null +++ b/ups-connector-demo/.project @@ -0,0 +1,49 @@ + + + ups-connector-demo + + + + + + ch.ivyteam.ivy.designer.dataClasses.ui.ivyDataClassBuilder + + + + + ch.ivyteam.ivy.designer.process.ui.ivyWebServiceProcessClassBuilder + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.wst.common.project.facet.core.builder + + + + + ch.ivyteam.ivy.designer.ide.ivyModelValidationBuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + ch.ivyteam.ivy.project.IvyProjectNature + org.eclipse.wst.common.modulecore.ModuleCoreNature + org.eclipse.jem.workbench.JavaEMFNature + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + org.eclipse.jem.beaninfo.BeanInfoNature + org.eclipse.wst.common.project.facet.core.nature + org.eclipse.wst.jsdt.core.jsNature + + diff --git a/ups-connector-demo/.settings/.jsdtscope b/ups-connector-demo/.settings/.jsdtscope new file mode 100644 index 0000000..869c01d --- /dev/null +++ b/ups-connector-demo/.settings/.jsdtscope @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/ups-connector-demo/.settings/ch.ivyteam.ivy.designer.prefs b/ups-connector-demo/.settings/ch.ivyteam.ivy.designer.prefs new file mode 100644 index 0000000..a4be099 --- /dev/null +++ b/ups-connector-demo/.settings/ch.ivyteam.ivy.designer.prefs @@ -0,0 +1,5 @@ +ch.ivyteam.ivy.designer.preferences.DataClassPreferencePage\:DEFAULT_DATA_CLASS=com.axonivy.ups.connector.demo.Data +ch.ivyteam.ivy.designer.preferences.DataClassPreferencePage\:DEFAULT_NAMESPACE=com.axonivy.ups.connector.demo +ch.ivyteam.ivy.project.preferences\:PRIMEFACES_VERSION=11 +ch.ivyteam.ivy.project.preferences\:PROJECT_VERSION=100000 +eclipse.preferences.version=1 diff --git a/ups-connector-demo/.settings/org.eclipse.jdt.core.prefs b/ups-connector-demo/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..d4540a5 --- /dev/null +++ b/ups-connector-demo/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,10 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 +org.eclipse.jdt.core.compiler.compliance=17 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=17 diff --git a/ups-connector-demo/.settings/org.eclipse.wst.common.component b/ups-connector-demo/.settings/org.eclipse.wst.common.component new file mode 100644 index 0000000..2d09748 --- /dev/null +++ b/ups-connector-demo/.settings/org.eclipse.wst.common.component @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/ups-connector-demo/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml b/ups-connector-demo/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml new file mode 100644 index 0000000..9b4b9fc --- /dev/null +++ b/ups-connector-demo/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/ups-connector-demo/.settings/org.eclipse.wst.common.project.facet.core.xml b/ups-connector-demo/.settings/org.eclipse.wst.common.project.facet.core.xml new file mode 100644 index 0000000..156ecdb --- /dev/null +++ b/ups-connector-demo/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/ups-connector-demo/.settings/org.eclipse.wst.css.core.prefs b/ups-connector-demo/.settings/org.eclipse.wst.css.core.prefs new file mode 100644 index 0000000..5ddc6bd --- /dev/null +++ b/ups-connector-demo/.settings/org.eclipse.wst.css.core.prefs @@ -0,0 +1,2 @@ +css-profile/=org.eclipse.wst.css.core.cssprofile.css3 +eclipse.preferences.version=1 diff --git a/ups-connector-demo/.settings/org.eclipse.wst.jsdt.ui.superType.container b/ups-connector-demo/.settings/org.eclipse.wst.jsdt.ui.superType.container new file mode 100644 index 0000000..3bd5d0a --- /dev/null +++ b/ups-connector-demo/.settings/org.eclipse.wst.jsdt.ui.superType.container @@ -0,0 +1 @@ +org.eclipse.wst.jsdt.launching.baseBrowserLibrary \ No newline at end of file diff --git a/ups-connector-demo/.settings/org.eclipse.wst.jsdt.ui.superType.name b/ups-connector-demo/.settings/org.eclipse.wst.jsdt.ui.superType.name new file mode 100644 index 0000000..05bd71b --- /dev/null +++ b/ups-connector-demo/.settings/org.eclipse.wst.jsdt.ui.superType.name @@ -0,0 +1 @@ +Window \ No newline at end of file diff --git a/ups-connector-demo/config/custom-fields.yaml b/ups-connector-demo/config/custom-fields.yaml new file mode 100644 index 0000000..aa19ae0 --- /dev/null +++ b/ups-connector-demo/config/custom-fields.yaml @@ -0,0 +1,20 @@ +# == Custom Fields Information == +# +# You can define here your project custom fields. +# Have a look at our documentation for more information. +# +CustomFields: +# Tasks: +# MyTaskCustomField: +# Label: My task custom field +# Description: This new task custom field can be used to ... +# Type: STRING +# Cases: +# MyCaseCustomField: +# Label: My case custom field +# Description: This new case custom field can be used to ... +# Type: STRING +# Starts: +# MyStartCustomField: +# Label: My start custom field +# Description: This new start custom field can be used to ... diff --git a/ups-connector-demo/config/databases.yaml b/ups-connector-demo/config/databases.yaml new file mode 100644 index 0000000..247b128 --- /dev/null +++ b/ups-connector-demo/config/databases.yaml @@ -0,0 +1 @@ +Databases: diff --git a/ups-connector-demo/config/overrides.any b/ups-connector-demo/config/overrides.any new file mode 100644 index 0000000..f59ec20 --- /dev/null +++ b/ups-connector-demo/config/overrides.any @@ -0,0 +1 @@ +* \ No newline at end of file diff --git a/ups-connector-demo/config/persistence.xml b/ups-connector-demo/config/persistence.xml new file mode 100644 index 0000000..d6b96d7 --- /dev/null +++ b/ups-connector-demo/config/persistence.xml @@ -0,0 +1,2 @@ + + diff --git a/ups-connector-demo/config/rest-clients.yaml b/ups-connector-demo/config/rest-clients.yaml new file mode 100644 index 0000000..8e85296 --- /dev/null +++ b/ups-connector-demo/config/rest-clients.yaml @@ -0,0 +1 @@ +RestClients: diff --git a/ups-connector-demo/config/roles.xml b/ups-connector-demo/config/roles.xml new file mode 100644 index 0000000..59892fe --- /dev/null +++ b/ups-connector-demo/config/roles.xml @@ -0,0 +1,4 @@ + + + Everybody + diff --git a/ups-connector-demo/config/users.xml b/ups-connector-demo/config/users.xml new file mode 100644 index 0000000..51a6906 --- /dev/null +++ b/ups-connector-demo/config/users.xml @@ -0,0 +1,2 @@ + + diff --git a/ups-connector-demo/config/variables.yaml b/ups-connector-demo/config/variables.yaml new file mode 100644 index 0000000..4c09a51 --- /dev/null +++ b/ups-connector-demo/config/variables.yaml @@ -0,0 +1,24 @@ +# == Variables == +# +# You can define here your project Variables. +# If you want to define/override a Variable for a specific Environment, +# add an additional ‘variables.yaml’ file in a subdirectory in the ‘Config’ folder: +# '/Config/_/variables.yaml +# +Variables: + + ups-connector: + + # Url to UPS connector + Url: "https://wwwcie.ups.com/api" + + # Your UPS Auth base URI + authUri: "https://wwwcie.ups.com/security/v1/oauth" + + # Your UPS Application (client) ID + appId: "ZItPy7z8Ep1bZBpGLVQbW3CPiMk9rGFJDpRLjgocLCJbQ5Tw" + + # Secret key from your applications "certificates & secrets" + # [password] + secretKey: "rLLiUjXI5j59kjvCWBfmXspBNCeW7Oo6x0RhOL0EyDSnADF7Vj4kHjx0JNAK3Jvi" + diff --git a/ups-connector-demo/config/webservice-clients.yaml b/ups-connector-demo/config/webservice-clients.yaml new file mode 100644 index 0000000..060b018 --- /dev/null +++ b/ups-connector-demo/config/webservice-clients.yaml @@ -0,0 +1 @@ +WebServiceClients: diff --git a/ups-connector-demo/dataclasses/com/axonivy/ups/connector/demo/Data.ivyClass b/ups-connector-demo/dataclasses/com/axonivy/ups/connector/demo/Data.ivyClass new file mode 100644 index 0000000..b4402a4 --- /dev/null +++ b/ups-connector-demo/dataclasses/com/axonivy/ups/connector/demo/Data.ivyClass @@ -0,0 +1,2 @@ +Data #class +com.axonivy.ups.connector.demo #namespace diff --git a/ups-connector-demo/pom.xml b/ups-connector-demo/pom.xml new file mode 100644 index 0000000..64c3f13 --- /dev/null +++ b/ups-connector-demo/pom.xml @@ -0,0 +1,27 @@ + + + 4.0.0 + com.axonivy.connector.ups + ups-connector-demo + 10.0.14-SNAPSHOT + iar + + + com.axonivy.connector.ups + ups-connector + ${project.version} + iar + + + + + + com.axonivy.ivy.ci + project-build-plugin + 10.0.14 + true + + + + diff --git a/ups-connector-demo/processes/Address.p.json b/ups-connector-demo/processes/Address.p.json new file mode 100644 index 0000000..07bfa38 --- /dev/null +++ b/ups-connector-demo/processes/Address.p.json @@ -0,0 +1,40 @@ +{ + "format" : "10.0.0", + "id" : "18BEBB83F9E96872", + "config" : { + "data" : "com.axonivy.ups.connector.demo.Data" + }, + "elements" : [ { + "id" : "f0", + "type" : "RequestStart", + "name" : "addressValidation.ivp", + "config" : { + "callSignature" : "addressValidation", + "outLink" : "addressValidation.ivp", + "startName" : "Validate Address", + "tags" : "demo" + }, + "visual" : { + "at" : { "x" : 96, "y" : 64 } + }, + "connect" : { "id" : "f4", "to" : "f3" } + }, { + "id" : "f1", + "type" : "TaskEnd", + "visual" : { + "at" : { "x" : 664, "y" : 64 } + } + }, { + "id" : "f3", + "type" : "DialogCall", + "name" : "Address form", + "config" : { + "dialogId" : "com.axonivy.ups.connector.demo.Address", + "startMethod" : "start()" + }, + "visual" : { + "at" : { "x" : 424, "y" : 64 } + }, + "connect" : { "id" : "f2", "to" : "f1" } + } ] +} \ No newline at end of file diff --git a/ups-connector-demo/processes/ManageShipments.p.json b/ups-connector-demo/processes/ManageShipments.p.json new file mode 100644 index 0000000..3511313 --- /dev/null +++ b/ups-connector-demo/processes/ManageShipments.p.json @@ -0,0 +1,45 @@ +{ + "format" : "10.0.0", + "id" : "18B6B1E5C8AA1A82", + "config" : { + "data" : "com.axonivy.ups.connector.demo.Data" + }, + "elements" : [ { + "id" : "f6", + "type" : "RequestStart", + "name" : "getTrackingInfo.ivp", + "config" : { + "callSignature" : "getTrackingInfo", + "outLink" : "getTrackingInfo.ivp", + "startName" : "Get Tracking", + "tags" : "demo" + }, + "visual" : { + "at" : { "x" : 88, "y" : 200 } + }, + "connect" : { "id" : "f7", "to" : "f8" } + }, { + "id" : "f8", + "type" : "DialogCall", + "name" : "TrackDetail", + "config" : { + "dialogId" : "com.axonivy.ups.connector.demo.TrackDetail", + "startMethod" : "start(com.ups.wwwcie.client.TrackApiResponse)", + "call" : { + "params" : [ + { "name" : "trackApiResponse", "type" : "com.ups.wwwcie.client.TrackApiResponse" } + ] + } + }, + "visual" : { + "at" : { "x" : 400, "y" : 200 } + }, + "connect" : { "id" : "f12", "to" : "f9" } + }, { + "id" : "f9", + "type" : "TaskEnd", + "visual" : { + "at" : { "x" : 688, "y" : 200 } + } + } ] +} \ No newline at end of file diff --git a/ups-connector-demo/processes/PickupDemo.p.json b/ups-connector-demo/processes/PickupDemo.p.json new file mode 100644 index 0000000..144db27 --- /dev/null +++ b/ups-connector-demo/processes/PickupDemo.p.json @@ -0,0 +1,74 @@ +{ + "format" : "10.0.0", + "id" : "18BEFEC3A70B2B09", + "config" : { + "data" : "com.axonivy.ups.connector.demo.Data" + }, + "elements" : [ { + "id" : "f0", + "type" : "RequestStart", + "name" : "pickupCreation.ivp", + "config" : { + "callSignature" : "pickupCreation", + "outLink" : "pickupCreation.ivp", + "startName" : "Pickup Creation", + "tags" : "demo" + }, + "visual" : { + "at" : { "x" : 96, "y" : 64 }, + "labelOffset" : { "x" : 17, "y" : 33 } + }, + "connect" : { "id" : "f4", "to" : "f3" } + }, { + "id" : "f1", + "type" : "TaskEnd", + "visual" : { + "at" : { "x" : 400, "y" : 64 } + } + }, { + "id" : "f3", + "type" : "DialogCall", + "name" : "PickupCreation", + "config" : { + "dialogId" : "com.axonivy.ups.connector.demo.PickupCreation", + "startMethod" : "start()" + }, + "visual" : { + "at" : { "x" : 272, "y" : 64 } + }, + "connect" : { "id" : "f2", "to" : "f1" } + }, { + "id" : "f5", + "type" : "RequestStart", + "name" : "pickupCancel.ivp", + "config" : { + "callSignature" : "pickupCancel", + "outLink" : "pickupCancel.ivp", + "startName" : "Pickup Cancel", + "tags" : "demo" + }, + "visual" : { + "at" : { "x" : 88, "y" : 248 }, + "labelOffset" : { "x" : 17, "y" : 33 } + }, + "connect" : { "id" : "f9", "to" : "f6" } + }, { + "id" : "f6", + "type" : "DialogCall", + "name" : "PickupCancel", + "config" : { + "dialogId" : "com.axonivy.ups.connector.demo.PickupCancel", + "startMethod" : "start()" + }, + "visual" : { + "at" : { "x" : 272, "y" : 248 } + }, + "connect" : { "id" : "f8", "to" : "f7" } + }, { + "id" : "f7", + "type" : "TaskEnd", + "visual" : { + "at" : { "x" : 448, "y" : 248 } + } + } ] +} \ No newline at end of file diff --git a/ups-connector-demo/src/com/axonivy/connector/ups/demo/bean/UpsBean.java b/ups-connector-demo/src/com/axonivy/connector/ups/demo/bean/UpsBean.java new file mode 100644 index 0000000..ae6edf6 --- /dev/null +++ b/ups-connector-demo/src/com/axonivy/connector/ups/demo/bean/UpsBean.java @@ -0,0 +1,54 @@ +package com.axonivy.connector.ups.demo.bean; + +import java.text.DateFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; + +import javax.faces.bean.ManagedBean; +import javax.faces.bean.ViewScoped; + +import com.ups.wwwcie.api.client.PickupCreationRequestPickupPiece; +import com.ups.wwwcie.api.client.XAVRequestAddressKeyFormat; + +@ViewScoped +@ManagedBean +public class UpsBean { + private final DateFormat timeFormatter = new SimpleDateFormat("HH:mm"); + private final DateFormat dateFormatter = new SimpleDateFormat("dd.MM.yyyy"); + private final DateFormat inputDateFormatter = new SimpleDateFormat("yyyyMMdd"); + private final DateFormat inputTimeFormatter = new SimpleDateFormat("HHmmss"); + private XAVRequestAddressKeyFormat addressKeyFormat = new XAVRequestAddressKeyFormat(); + private PickupCreationRequestPickupPiece pickupPiece = new PickupCreationRequestPickupPiece(); + + public String getFormatedDate(String date) throws ParseException { + return dateFormatter.format(inputDateFormatter.parse(date)); + } + + public String getFormatedTime(String time) throws ParseException { + return timeFormatter.format(inputTimeFormatter.parse(time)); + } + + public DateFormat getTimeFormatter() { + return timeFormatter; + } + + public DateFormat getDateFormatter() { + return dateFormatter; + } + + public XAVRequestAddressKeyFormat getAddressKeyFormat() { + return addressKeyFormat; + } + + public void setAddressKeyFormat(XAVRequestAddressKeyFormat addressKeyFormat) { + this.addressKeyFormat = addressKeyFormat; + } + + public PickupCreationRequestPickupPiece getPickupPiece() { + return pickupPiece; + } + + public void setPickupPiece(PickupCreationRequestPickupPiece pickupPiece) { + this.pickupPiece = pickupPiece; + } +} diff --git a/ups-connector-demo/src_hd/com/axonivy/ups/connector/demo/Address/Address.rddescriptor b/ups-connector-demo/src_hd/com/axonivy/ups/connector/demo/Address/Address.rddescriptor new file mode 100644 index 0000000..ae605f0 --- /dev/null +++ b/ups-connector-demo/src_hd/com/axonivy/ups/connector/demo/Address/Address.rddescriptor @@ -0,0 +1,7 @@ + + + + viewTechnology + JSF + + diff --git a/ups-connector-demo/src_hd/com/axonivy/ups/connector/demo/Address/Address.xhtml b/ups-connector-demo/src_hd/com/axonivy/ups/connector/demo/Address/Address.xhtml new file mode 100644 index 0000000..1ebe88c --- /dev/null +++ b/ups-connector-demo/src_hd/com/axonivy/ups/connector/demo/Address/Address.xhtml @@ -0,0 +1,68 @@ + + + + Address + +

Address Validation

+

The UPS Address Validation API's database is updated every + month with new address information from USPS. Address Validation for + City, State, Zip is only available for the United States.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+
+
+
+
+ + \ No newline at end of file diff --git a/ups-connector-demo/src_hd/com/axonivy/ups/connector/demo/Address/AddressData.ivyClass b/ups-connector-demo/src_hd/com/axonivy/ups/connector/demo/Address/AddressData.ivyClass new file mode 100644 index 0000000..cb1348d --- /dev/null +++ b/ups-connector-demo/src_hd/com/axonivy/ups/connector/demo/Address/AddressData.ivyClass @@ -0,0 +1,16 @@ +AddressData #class +com.axonivy.ups.connector.demo.Address #namespace +requestOption Integer #field +requestOption PERSISTENT #fieldModifier +version String #field +version PERSISTENT #fieldModifier +regionalRequestIndicator String #field +regionalRequestIndicator PERSISTENT #fieldModifier +maximumCandidateListSize Integer #field +maximumCandidateListSize PERSISTENT #fieldModifier +xavRequest com.ups.wwwcie.api.client.XAVRequest #field +xavRequest PERSISTENT #fieldModifier +xavResponseWrapper com.ups.wwwcie.api.client.XAVResponseWrapper #field +xavResponseWrapper PERSISTENT #fieldModifier +errorMessage String #field +errorMessage PERSISTENT #fieldModifier diff --git a/ups-connector-demo/src_hd/com/axonivy/ups/connector/demo/Address/AddressProcess.p.json b/ups-connector-demo/src_hd/com/axonivy/ups/connector/demo/Address/AddressProcess.p.json new file mode 100644 index 0000000..b6e29dd --- /dev/null +++ b/ups-connector-demo/src_hd/com/axonivy/ups/connector/demo/Address/AddressProcess.p.json @@ -0,0 +1,166 @@ +{ + "format" : "10.0.0", + "id" : "18D0B18AB2CBDAED", + "kind" : "HTML_DIALOG", + "config" : { + "data" : "com.axonivy.ups.connector.demo.Address.AddressData" + }, + "elements" : [ { + "id" : "f0", + "type" : "HtmlDialogStart", + "name" : "start()", + "config" : { + "callSignature" : "start", + "guid" : "18BEBB941531104C" + }, + "visual" : { + "at" : { "x" : 96, "y" : 64 } + }, + "connect" : { "id" : "f12", "to" : "f11" } + }, { + "id" : "f1", + "type" : "HtmlDialogEnd", + "visual" : { + "at" : { "x" : 728, "y" : 64 } + } + }, { + "id" : "f3", + "type" : "HtmlDialogEventStart", + "name" : "close", + "config" : { + "guid" : "18BEBB9415432EC4" + }, + "visual" : { + "at" : { "x" : 96, "y" : 160 } + }, + "connect" : { "id" : "f5", "to" : "f4" } + }, { + "id" : "f4", + "type" : "HtmlDialogExit", + "visual" : { + "at" : { "x" : 224, "y" : 160 } + } + }, { + "id" : "f6", + "type" : "HtmlDialogMethodStart", + "name" : "validate()", + "config" : { + "callSignature" : "validate", + "guid" : "18BEBC5EA159DC94" + }, + "visual" : { + "at" : { "x" : 88, "y" : 288 } + }, + "connect" : { "id" : "f14", "to" : "f13" } + }, { + "id" : "f7", + "type" : "HtmlDialogEnd", + "visual" : { + "at" : { "x" : 664, "y" : 288 } + } + }, { + "id" : "f8", + "type" : "SubProcessCall", + "name" : "AddressValidation", + "config" : { + "processCall" : "AddressValidation:addressValidation(Integer,String,String,Integer,com.ups.wwwcie.api.client.XAVRequest)", + "output" : { + "map" : { + "out" : "in", + "out.xavResponseWrapper" : "result.xavResponseWrapper" + }, + "code" : [ + "import javax.faces.application.FacesMessage;", + "import org.primefaces.context.RequestContext;", + "import org.primefaces.component.inputtext.InputText;", + "import javax.faces.context.FacesContext;", + "", + "FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, result.xavResponseWrapper.xaVResponse.response.responseStatus.description, null));" + ] + }, + "call" : { + "params" : [ + { "name" : "requestoption", "type" : "Integer" }, + { "name" : "version", "type" : "String" }, + { "name" : "regionalrequestindicator", "type" : "String" }, + { "name" : "maximumcandidatelistsize", "type" : "Integer" }, + { "name" : "xavRequest", "type" : "com.ups.wwwcie.api.client.XAVRequest" } + ], + "map" : { + "param.requestOption" : "1", + "param.version" : "\"v1\"", + "param.regionalRequestIndicator" : "\"false\"", + "param.maximumCandidateListSize" : "1", + "param.xavRequest.addressKeyFormat" : "in.xavRequest.addressKeyFormat", + "param.xavRequest.request.requestOption" : "\"1\"" + } + } + }, + "visual" : { + "at" : { "x" : 376, "y" : 288 } + }, + "boundaries" : [ { + "id" : "f15", + "type" : "ErrorBoundaryEvent", + "visual" : { + "at" : { "x" : 408, "y" : 328 } + }, + "connect" : { "id" : "f17", "to" : "f16" } + } ], + "connect" : { "id" : "f10", "to" : "f7" } + }, { + "id" : "f11", + "type" : "Script", + "name" : "init", + "config" : { + "output" : { + "code" : "in.xavRequest.addressKeyFormat = [];" + } + }, + "visual" : { + "at" : { "x" : 392, "y" : 64 } + }, + "connect" : { "id" : "f2", "to" : "f1" } + }, { + "id" : "f13", + "type" : "Script", + "name" : "add addressKeyFormat", + "config" : { + "output" : { + "code" : [ + "import com.axonivy.connector.ups.demo.bean.UpsBean;", + "import javax.faces.context.FacesContext;", + "import java.util.Map;", + "", + "Map viewMap = FacesContext.getCurrentInstance().getViewRoot().getViewMap();", + "UpsBean bean = viewMap.get(\"upsBean\") as UpsBean;", + "in.xavRequest.addressKeyFormat.add(bean.addressKeyFormat);" + ] + } + }, + "visual" : { + "at" : { "x" : 216, "y" : 288 } + }, + "connect" : { "id" : "f9", "to" : "f8" } + }, { + "id" : "f16", + "type" : "Script", + "name" : "Show validation falied message", + "config" : { + "output" : { + "code" : [ + "import javax.faces.application.FacesMessage;", + "import org.primefaces.context.RequestContext;", + "import org.primefaces.component.inputtext.InputText;", + "import javax.faces.context.FacesContext;", + "", + "FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, \"Validation Falied\", null));" + ] + } + }, + "visual" : { + "at" : { "x" : 536, "y" : 392 } + }, + "connect" : { "id" : "f18", "to" : "f7" } + } ] +} \ No newline at end of file diff --git a/ups-connector-demo/src_hd/com/axonivy/ups/connector/demo/PickupCancel/PickupCancel.rddescriptor b/ups-connector-demo/src_hd/com/axonivy/ups/connector/demo/PickupCancel/PickupCancel.rddescriptor new file mode 100644 index 0000000..ae605f0 --- /dev/null +++ b/ups-connector-demo/src_hd/com/axonivy/ups/connector/demo/PickupCancel/PickupCancel.rddescriptor @@ -0,0 +1,7 @@ + + + + viewTechnology + JSF + + diff --git a/ups-connector-demo/src_hd/com/axonivy/ups/connector/demo/PickupCancel/PickupCancel.xhtml b/ups-connector-demo/src_hd/com/axonivy/ups/connector/demo/PickupCancel/PickupCancel.xhtml new file mode 100644 index 0000000..d82f74f --- /dev/null +++ b/ups-connector-demo/src_hd/com/axonivy/ups/connector/demo/PickupCancel/PickupCancel.xhtml @@ -0,0 +1,58 @@ + + + + PickupCancel + +

Pickup Cancel

+

Using the Pickup API, applications can cancel previously + scheduled pickups.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+
+
+
+
+ + \ No newline at end of file diff --git a/ups-connector-demo/src_hd/com/axonivy/ups/connector/demo/PickupCancel/PickupCancelData.ivyClass b/ups-connector-demo/src_hd/com/axonivy/ups/connector/demo/PickupCancel/PickupCancelData.ivyClass new file mode 100644 index 0000000..5663c15 --- /dev/null +++ b/ups-connector-demo/src_hd/com/axonivy/ups/connector/demo/PickupCancel/PickupCancelData.ivyClass @@ -0,0 +1,14 @@ +PickupCancelData #class +com.axonivy.ups.connector.demo.PickupCancel #namespace +transId String #field +transId PERSISTENT #fieldModifier +transactionSrc String #field +transactionSrc PERSISTENT #fieldModifier +prn String #field +prn PERSISTENT #fieldModifier +cancelBy String #field +cancelBy PERSISTENT #fieldModifier +pickupResponse com.ups.wwwcie.api.client.PickupCancelResponse #field +pickupResponse PERSISTENT #fieldModifier +accountNumber String #field +accountNumber PERSISTENT #fieldModifier diff --git a/ups-connector-demo/src_hd/com/axonivy/ups/connector/demo/PickupCancel/PickupCancelProcess.p.json b/ups-connector-demo/src_hd/com/axonivy/ups/connector/demo/PickupCancel/PickupCancelProcess.p.json new file mode 100644 index 0000000..ce30750 --- /dev/null +++ b/ups-connector-demo/src_hd/com/axonivy/ups/connector/demo/PickupCancel/PickupCancelProcess.p.json @@ -0,0 +1,144 @@ +{ + "format" : "10.0.0", + "id" : "18D0B1909147679A", + "kind" : "HTML_DIALOG", + "config" : { + "data" : "com.axonivy.ups.connector.demo.PickupCancel.PickupCancelData" + }, + "elements" : [ { + "id" : "f0", + "type" : "HtmlDialogStart", + "name" : "start()", + "config" : { + "callSignature" : "start", + "guid" : "18C003D38FDDA263" + }, + "visual" : { + "at" : { "x" : 96, "y" : 64 } + }, + "connect" : { "id" : "f12", "to" : "f11" } + }, { + "id" : "f1", + "type" : "HtmlDialogEnd", + "visual" : { + "at" : { "x" : 352, "y" : 64 } + } + }, { + "id" : "f3", + "type" : "HtmlDialogEventStart", + "name" : "close", + "config" : { + "guid" : "18C003D38FEE1AD7" + }, + "visual" : { + "at" : { "x" : 96, "y" : 160 } + }, + "connect" : { "id" : "f5", "to" : "f4" } + }, { + "id" : "f4", + "type" : "HtmlDialogExit", + "visual" : { + "at" : { "x" : 224, "y" : 160 } + } + }, { + "id" : "f6", + "type" : "HtmlDialogMethodStart", + "name" : "callAPI()", + "config" : { + "callSignature" : "callAPI", + "guid" : "18C0042C10E9140A" + }, + "visual" : { + "at" : { "x" : 104, "y" : 344 }, + "labelOffset" : { "x" : 11, "y" : 35 } + }, + "connect" : { "id" : "f8", "to" : "f7" } + }, { + "id" : "f7", + "type" : "SubProcessCall", + "name" : "Pickup", + "config" : { + "processCall" : "Pickup:pickupCancel(String,String,String,String,String)", + "call" : { + "params" : [ + { "name" : "version", "type" : "String" }, + { "name" : "transId", "type" : "String" }, + { "name" : "transactionSrc", "type" : "String" }, + { "name" : "prn", "type" : "String" }, + { "name" : "cancelBy", "type" : "String" } + ], + "map" : { + "param.version" : "\"v1\"", + "param.transId" : "in.transId", + "param.transactionSrc" : "in.transactionSrc", + "param.prn" : "in.prn", + "param.cancelBy" : "in.cancelBy" + } + }, + "output" : { + "code" : [ + "import javax.faces.application.FacesMessage;", + "import org.primefaces.context.RequestContext;", + "import org.primefaces.component.inputtext.InputText;", + "import javax.faces.context.FacesContext;", + "", + "FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, \"Cancel Pickup sucessfully\", null));" + ] + } + }, + "visual" : { + "at" : { "x" : 336, "y" : 344 } + }, + "boundaries" : [ { + "id" : "f13", + "type" : "ErrorBoundaryEvent", + "visual" : { + "at" : { "x" : 368, "y" : 384 } + }, + "connect" : { "id" : "f15", "to" : "f14" } + } ], + "connect" : { "id" : "f10", "to" : "f9" } + }, { + "id" : "f9", + "type" : "HtmlDialogEnd", + "visual" : { + "at" : { "x" : 528, "y" : 344 } + } + }, { + "id" : "f11", + "type" : "Script", + "name" : "init", + "config" : { + "output" : { + "code" : [ + "in.transactionSrc = \"testing\";", + "in.cancelBy = \"01\";" + ] + } + }, + "visual" : { + "at" : { "x" : 224, "y" : 64 } + }, + "connect" : { "id" : "f2", "to" : "f1" } + }, { + "id" : "f14", + "type" : "Script", + "name" : "show error message", + "config" : { + "output" : { + "code" : [ + "import javax.faces.application.FacesMessage;", + "import org.primefaces.context.RequestContext;", + "import org.primefaces.component.inputtext.InputText;", + "import javax.faces.context.FacesContext;", + "", + "FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, \"Cancel pickup failed\", null));" + ] + } + }, + "visual" : { + "at" : { "x" : 456, "y" : 448 } + }, + "connect" : { "id" : "f16", "to" : "f9" } + } ] +} \ No newline at end of file diff --git a/ups-connector-demo/src_hd/com/axonivy/ups/connector/demo/PickupCreation/PickupCreation.rddescriptor b/ups-connector-demo/src_hd/com/axonivy/ups/connector/demo/PickupCreation/PickupCreation.rddescriptor new file mode 100644 index 0000000..ae605f0 --- /dev/null +++ b/ups-connector-demo/src_hd/com/axonivy/ups/connector/demo/PickupCreation/PickupCreation.rddescriptor @@ -0,0 +1,7 @@ + + + + viewTechnology + JSF + + diff --git a/ups-connector-demo/src_hd/com/axonivy/ups/connector/demo/PickupCreation/PickupCreation.xhtml b/ups-connector-demo/src_hd/com/axonivy/ups/connector/demo/PickupCreation/PickupCreation.xhtml new file mode 100644 index 0000000..2547c89 --- /dev/null +++ b/ups-connector-demo/src_hd/com/axonivy/ups/connector/demo/PickupCreation/PickupCreation.xhtml @@ -0,0 +1,245 @@ + + + + PickupCreation + +

Pickup Creation

+

Using the Pickup API, applications can schedule pickups.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ +
+

Pickup Creation Response

+ + + + + + + + + + + +
+
+
+
+
+ \ No newline at end of file diff --git a/ups-connector-demo/src_hd/com/axonivy/ups/connector/demo/PickupCreation/PickupCreationData.ivyClass b/ups-connector-demo/src_hd/com/axonivy/ups/connector/demo/PickupCreation/PickupCreationData.ivyClass new file mode 100644 index 0000000..697a664 --- /dev/null +++ b/ups-connector-demo/src_hd/com/axonivy/ups/connector/demo/PickupCreation/PickupCreationData.ivyClass @@ -0,0 +1,18 @@ +PickupCreationData #class +com.axonivy.ups.connector.demo.PickupCreation #namespace +version String #field +version PERSISTENT #fieldModifier +pickuptype String #field +pickuptype PERSISTENT #fieldModifier +transId String #field +transId PERSISTENT #fieldModifier +transactionSrc String #field +transactionSrc PERSISTENT #fieldModifier +accountNumber String #field +accountNumber PERSISTENT #fieldModifier +pickupCreationRequest com.ups.wwwcie.api.client.PickupCreationRequest #field +pickupCreationRequest PERSISTENT #fieldModifier +pickupCreationResponse com.ups.wwwcie.api.client.PickupCreationResponse #field +pickupCreationResponse PERSISTENT #fieldModifier +address String #field +address PERSISTENT #fieldModifier diff --git a/ups-connector-demo/src_hd/com/axonivy/ups/connector/demo/PickupCreation/PickupCreationProcess.p.json b/ups-connector-demo/src_hd/com/axonivy/ups/connector/demo/PickupCreation/PickupCreationProcess.p.json new file mode 100644 index 0000000..2d56476 --- /dev/null +++ b/ups-connector-demo/src_hd/com/axonivy/ups/connector/demo/PickupCreation/PickupCreationProcess.p.json @@ -0,0 +1,176 @@ +{ + "format" : "10.0.0", + "id" : "18D0B1934138CE5E", + "kind" : "HTML_DIALOG", + "config" : { + "data" : "com.axonivy.ups.connector.demo.PickupCreation.PickupCreationData" + }, + "elements" : [ { + "id" : "f0", + "type" : "HtmlDialogStart", + "name" : "start()", + "config" : { + "callSignature" : "start", + "guid" : "18BEFED6CDECA2DE" + }, + "visual" : { + "at" : { "x" : 96, "y" : 64 } + }, + "connect" : { "id" : "f14", "to" : "f12" } + }, { + "id" : "f1", + "type" : "HtmlDialogEnd", + "visual" : { + "at" : { "x" : 352, "y" : 64 } + } + }, { + "id" : "f3", + "type" : "HtmlDialogEventStart", + "name" : "close", + "config" : { + "guid" : "18BEFED6CDF96004" + }, + "visual" : { + "at" : { "x" : 96, "y" : 160 } + }, + "connect" : { "id" : "f5", "to" : "f4" } + }, { + "id" : "f4", + "type" : "HtmlDialogExit", + "visual" : { + "at" : { "x" : 224, "y" : 160 } + } + }, { + "id" : "f6", + "type" : "SubProcessCall", + "name" : "Pickup", + "config" : { + "call" : { + "params" : [ + { "name" : "version", "type" : "String" }, + { "name" : "transId", "type" : "String" }, + { "name" : "transactionSrc", "type" : "String" }, + { "name" : "pickupCreationRequest", "type" : "com.ups.wwwcie.api.client.PickupCreationRequest" } + ], + "map" : { + "param.version" : "\"v1\"", + "param.transId" : "in.transId", + "param.transactionSrc" : "in.transactionSrc", + "param.pickupCreationRequest" : "in.pickupCreationRequest" + }, + "code" : "ivy.log.info(\"Start calling pickup creation API\");" + }, + "processCall" : "Pickup:pickupCreation(String,String,String,com.ups.wwwcie.api.client.PickupCreationRequest)", + "output" : { + "map" : { + "out" : "in", + "out.pickupCreationResponse" : "result.pickupCreationResponse" + }, + "code" : [ + "import javax.faces.application.FacesMessage;", + "import org.primefaces.context.RequestContext;", + "import org.primefaces.component.inputtext.InputText;", + "import javax.faces.context.FacesContext;", + "", + "FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, \"Pickup created sucessfully\", null));" + ] + } + }, + "visual" : { + "at" : { "x" : 488, "y" : 320 } + }, + "boundaries" : [ { + "id" : "f15", + "type" : "ErrorBoundaryEvent", + "visual" : { + "at" : { "x" : 520, "y" : 360 } + }, + "connect" : { "id" : "f17", "to" : "f16" } + } ], + "connect" : { "id" : "f10", "to" : "f9" } + }, { + "id" : "f7", + "type" : "HtmlDialogMethodStart", + "name" : "callAPI()", + "config" : { + "callSignature" : "callAPI", + "guid" : "18BEFF42A346A1D4" + }, + "visual" : { + "at" : { "x" : 112, "y" : 320 } + }, + "connect" : { "id" : "f11", "to" : "f13" } + }, { + "id" : "f9", + "type" : "HtmlDialogEnd", + "visual" : { + "at" : { "x" : 744, "y" : 320 } + } + }, { + "id" : "f13", + "type" : "Script", + "name" : "add PickupPiece", + "config" : { + "output" : { + "code" : [ + "import com.axonivy.connector.ups.demo.bean.UpsBean;", + "import javax.faces.context.FacesContext;", + "import java.util.Map;", + "", + "Map viewMap = FacesContext.getCurrentInstance().getViewRoot().getViewMap();", + "UpsBean bean = viewMap.get(\"upsBean\") as UpsBean;", + "in.pickupCreationRequest.pickupPiece = [];", + "in.pickupCreationRequest.pickupPiece.add(bean.pickupPiece);", + "in.pickupCreationRequest.pickupAddress.addressLine = [];", + "in.pickupCreationRequest.pickupAddress.addressLine.add(in.address);" + ] + } + }, + "visual" : { + "at" : { "x" : 240, "y" : 320 } + }, + "connect" : { "id" : "f8", "to" : "f6" } + }, { + "id" : "f12", + "type" : "Script", + "name" : "init", + "config" : { + "output" : { + "code" : [ + "in.pickupCreationRequest;", + "in.pickupCreationRequest.pickupAddress.phone;", + "in.pickupCreationRequest.shipper.account;", + "in.pickupCreationRequest.pickupDateInfo;", + "in.pickupCreationRequest.totalWeight;", + "in.pickupCreationRequest.pickupPiece;", + "in.pickupCreationResponse=null;" + ] + } + }, + "visual" : { + "at" : { "x" : 224, "y" : 64 } + }, + "connect" : { "id" : "f2", "to" : "f1" } + }, { + "id" : "f16", + "type" : "Script", + "name" : "show error message", + "config" : { + "output" : { + "code" : [ + "import javax.faces.application.FacesMessage;", + "import org.primefaces.context.RequestContext;", + "import org.primefaces.component.inputtext.InputText;", + "import javax.faces.context.FacesContext;", + "ivy.log.error(\"Error: {0}\", in.pickupCreationRequest);", + "", + "FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, \"Error\", null));" + ] + } + }, + "visual" : { + "at" : { "x" : 600, "y" : 456 } + }, + "connect" : { "id" : "f18", "to" : "f9" } + } ] +} \ No newline at end of file diff --git a/ups-connector-demo/src_hd/com/axonivy/ups/connector/demo/TrackDetail/TrackDetail.rddescriptor b/ups-connector-demo/src_hd/com/axonivy/ups/connector/demo/TrackDetail/TrackDetail.rddescriptor new file mode 100644 index 0000000..ae605f0 --- /dev/null +++ b/ups-connector-demo/src_hd/com/axonivy/ups/connector/demo/TrackDetail/TrackDetail.rddescriptor @@ -0,0 +1,7 @@ + + + + viewTechnology + JSF + + diff --git a/ups-connector-demo/src_hd/com/axonivy/ups/connector/demo/TrackDetail/TrackDetail.xhtml b/ups-connector-demo/src_hd/com/axonivy/ups/connector/demo/TrackDetail/TrackDetail.xhtml new file mode 100644 index 0000000..db2e578 --- /dev/null +++ b/ups-connector-demo/src_hd/com/axonivy/ups/connector/demo/TrackDetail/TrackDetail.xhtml @@ -0,0 +1,96 @@ + + + + TrackDetail + +

Get single tracking

+

UPS uses tracking numbers to identify and track packages in + its system. Applications can use this tracking number to track, + locate, and verify arrival of a package. A successful query by + tracking number returns information for the specific package within + a shipment. For example, if a package shipment contained four + individual packages, the query response would show a shipment + containing the one package out of four with the associated tracking + number.

+ + + + + + + + + + + + + + + +
+
+ + +
+ +
+

Package information

+ + + + + + + + + + + +

Package Activity

+ + + + + + + + + + + + + + +
+ +
+ +
+
+
+ + \ No newline at end of file diff --git a/ups-connector-demo/src_hd/com/axonivy/ups/connector/demo/TrackDetail/TrackDetailData.ivyClass b/ups-connector-demo/src_hd/com/axonivy/ups/connector/demo/TrackDetail/TrackDetailData.ivyClass new file mode 100644 index 0000000..44143e3 --- /dev/null +++ b/ups-connector-demo/src_hd/com/axonivy/ups/connector/demo/TrackDetail/TrackDetailData.ivyClass @@ -0,0 +1,6 @@ +TrackDetailData #class +com.axonivy.ups.connector.demo.TrackDetail #namespace +trackingRequest com.axonivy.ups.connector.TrackingRequestData #field +trackingRequest PERSISTENT #fieldModifier +trackApiResponse com.ups.wwwcie.client.TrackApiResponse #field +trackApiResponse PERSISTENT #fieldModifier diff --git a/ups-connector-demo/src_hd/com/axonivy/ups/connector/demo/TrackDetail/TrackDetailProcess.p.json b/ups-connector-demo/src_hd/com/axonivy/ups/connector/demo/TrackDetail/TrackDetailProcess.p.json new file mode 100644 index 0000000..79c5746 --- /dev/null +++ b/ups-connector-demo/src_hd/com/axonivy/ups/connector/demo/TrackDetail/TrackDetailProcess.p.json @@ -0,0 +1,122 @@ +{ + "format" : "10.0.0", + "id" : "18D0B1942A6D959F", + "kind" : "HTML_DIALOG", + "config" : { + "data" : "com.axonivy.ups.connector.demo.TrackDetail.TrackDetailData" + }, + "elements" : [ { + "id" : "f0", + "type" : "HtmlDialogStart", + "name" : "start()", + "config" : { + "callSignature" : "start", + "input" : { + "params" : [ + { "name" : "trackApiResponse", "type" : "com.ups.wwwcie.client.TrackApiResponse" } + ], + "map" : { + "out.trackApiResponse" : "param.trackApiResponse" + } + }, + "guid" : "18BD64A9EB95A6D9" + }, + "visual" : { + "at" : { "x" : 96, "y" : 64 } + }, + "connect" : { "id" : "f12", "to" : "f9" } + }, { + "id" : "f1", + "type" : "HtmlDialogEnd", + "visual" : { + "at" : { "x" : 352, "y" : 64 } + } + }, { + "id" : "f3", + "type" : "HtmlDialogEventStart", + "name" : "close", + "config" : { + "guid" : "18BD64A9EBC4458A" + }, + "visual" : { + "at" : { "x" : 96, "y" : 160 } + }, + "connect" : { "id" : "f5", "to" : "f4" } + }, { + "id" : "f4", + "type" : "HtmlDialogExit", + "visual" : { + "at" : { "x" : 224, "y" : 160 } + } + }, { + "id" : "f6", + "type" : "HtmlDialogMethodStart", + "name" : "getTracking(TrackingRequestData)", + "config" : { + "callSignature" : "getTracking", + "input" : { + "params" : [ + { "name" : "trackingRequest", "type" : "com.axonivy.ups.connector.TrackingRequestData" } + ], + "map" : { + "out.trackingRequest" : "param.trackingRequest", + "out.trackingRequest.returnSignature" : "\"false\"" + } + }, + "guid" : "18BEAE53145EE6DF" + }, + "visual" : { + "at" : { "x" : 96, "y" : 304 }, + "labelOffset" : { "x" : 67, "y" : 35 } + }, + "connect" : { "id" : "f7", "to" : "f8" } + }, { + "id" : "f8", + "type" : "SubProcessCall", + "name" : "Tracking", + "config" : { + "processCall" : "Tracking:tracking(com.axonivy.ups.connector.TrackingRequestData)", + "output" : { + "map" : { + "out" : "in", + "out.trackApiResponse" : "result.trackApiResponse" + } + }, + "call" : { + "params" : [ + { "name" : "trackingRequest", "type" : "com.axonivy.ups.connector.TrackingRequestData" } + ], + "map" : { + "param.trackingRequest" : "in.trackingRequest" + } + } + }, + "visual" : { + "at" : { "x" : 392, "y" : 304 } + }, + "connect" : { "id" : "f10", "to" : "f11" } + }, { + "id" : "f11", + "type" : "HtmlDialogEnd", + "visual" : { + "at" : { "x" : 712, "y" : 304 } + } + }, { + "id" : "f9", + "type" : "Script", + "name" : "init", + "config" : { + "output" : { + "code" : [ + "in.trackingRequest.transId = \"iewssoas2cq10QnkCX2r1P\";", + "in.trackingRequest.transactionSrc = \"Testing\";", + "in.trackingRequest.locale = \"de_DE\";" + ] + } + }, + "visual" : { + "at" : { "x" : 224, "y" : 64 } + }, + "connect" : { "id" : "f2", "to" : "f1" } + } ] +} \ No newline at end of file diff --git a/ups-connector-demo/webContent/layouts/basic-10.xhtml b/ups-connector-demo/webContent/layouts/basic-10.xhtml new file mode 100644 index 0000000..bcb6631 --- /dev/null +++ b/ups-connector-demo/webContent/layouts/basic-10.xhtml @@ -0,0 +1,68 @@ + + + + + + + + + + <ui:insert name="title">Ivy Html Dialog</ui:insert> + + + + + + + + + + + + + + +
+ + default content + + + + + +
+ + + + +
+ \ No newline at end of file diff --git a/ups-connector-demo/webContent/layouts/demo.css b/ups-connector-demo/webContent/layouts/demo.css new file mode 100644 index 0000000..687811a --- /dev/null +++ b/ups-connector-demo/webContent/layouts/demo.css @@ -0,0 +1,15 @@ +.width-8-percent { + width: 8%; +} + +.width-23-percent { + width: 23%; +} + +.mt-8 { + margin-top: 8px; +} + +.width-100 { + width: 100%; +} \ No newline at end of file diff --git a/ups-connector-demo/webContent/layouts/frame-10.xhtml b/ups-connector-demo/webContent/layouts/frame-10.xhtml new file mode 100644 index 0000000..72e72df --- /dev/null +++ b/ups-connector-demo/webContent/layouts/frame-10.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + <ui:insert name="title">Ivy Html Dialog</ui:insert> + + + + + + + + + +
+ + default content + +
+ + + + + + + +
+ \ No newline at end of file diff --git a/ups-connector-demo/webContent/layouts/includes/exception-details.xhtml b/ups-connector-demo/webContent/layouts/includes/exception-details.xhtml new file mode 100644 index 0000000..a4979dc --- /dev/null +++ b/ups-connector-demo/webContent/layouts/includes/exception-details.xhtml @@ -0,0 +1,109 @@ + + + + + + +

+ +

+ + +

Error id

+

#{errorPage.exceptionId}

+

Error Timestamp

+

#{errorPage.createdAt}

+
+ + + + +

Attributes

+
+ + + + + + + + + + + + + + + +
NameValue
+
+
+

Thrown by

+

Process: + +
Element: + +

+
+ + +

Process call stack

+ +
#{caller.callerElement}
+
+
+ +

Technical cause

+
#{causedBy.class.simpleName}: #{causedBy.message.trim()}
+
+
+ +

Request Uri

+

#{errorPage.getRequestUri()}

+
+

Servlet

+

#{errorPage.getServletName()}

+
+ +

Application

+

#{errorPage.applicationName}

+
+ + +

Thread local values

+
+ + + + + + + + + + + + + + + +
KeyValue
+
+
+
+ +

Stack-Trace

+
#{errorPage.getStackTrace()}
+
+ diff --git a/ups-connector-demo/webContent/layouts/includes/exception.xhtml b/ups-connector-demo/webContent/layouts/includes/exception.xhtml new file mode 100644 index 0000000..2303e7c --- /dev/null +++ b/ups-connector-demo/webContent/layouts/includes/exception.xhtml @@ -0,0 +1,47 @@ + + + + + + + + + +
+
+ + +
+ + + + + + + + + +
+ + \ No newline at end of file diff --git a/ups-connector-demo/webContent/layouts/includes/footer.xhtml b/ups-connector-demo/webContent/layouts/includes/footer.xhtml new file mode 100644 index 0000000..3eb052b --- /dev/null +++ b/ups-connector-demo/webContent/layouts/includes/footer.xhtml @@ -0,0 +1,18 @@ + + + +
+ + #{ivyAdvisor.applicationName} + + +
+
+ + \ No newline at end of file diff --git a/ups-connector-demo/webContent/layouts/includes/progress-loader.xhtml b/ups-connector-demo/webContent/layouts/includes/progress-loader.xhtml new file mode 100644 index 0000000..0d68a75 --- /dev/null +++ b/ups-connector-demo/webContent/layouts/includes/progress-loader.xhtml @@ -0,0 +1,15 @@ + + + + +
+
+
Loading...
+
+
+ + + +
+
\ No newline at end of file diff --git a/ups-connector-product/README.md b/ups-connector-product/README.md new file mode 100644 index 0000000..2f0e09f --- /dev/null +++ b/ups-connector-product/README.md @@ -0,0 +1,93 @@ +# UPS Modules + +## Description +This is a UPS module built in the Axon Ivy framework, enabling users to seamlessly integrate with UPS services. With this app, users can effortlessly manage their packages through UPS. + +With this connector: +- Empowers you with full access to the OpenAPI UPS services. +- Provides an easy-to-copy demo implementation to streamline your integration efforts. + +The UPS modules comprises the following components: +- ups-connector +- ups-oauth-feature +- ups-connector-demo +- ups-connector-product +- ups-connector-test + +Common use cases for UPS APIs include: +- Shipping and tracking packages for your business. +- Obtaining shipping rates and transit times for e-commerce. +- Creating visibility applications for your customers on your platform. + +Explore the [API catalog](https://developer.ups.com/catalog) to identify which APIs align with your business needs. +We hope you enjoy using this module, and we look forward to your contributions! + +## Set up + +1. Visit https://developer.ups.com, log in, or create a new UPS accoun. +2. Create an application on UPS +3. Once your application is created, the **Client ID** and **Client Secret** are generated and can be used to obtain an access token for authorizing your API requests +4. Configure the following variables in your project: +![Alt text](./images/image-11.png) + + + +## Demo +### Get tracking information +This service is used to retrieve package information. +1. Login to the Axon Ivy Portal +2. On the Process List page, click on **Get Tracking** + +![Alt text](./images/image-1.png) + +3. Fill in your tracking number + +![Alt text](./images/image-2.png) + +4. Click **Search** button to get all information of the package + +![Alt text](./images/image-3.png) + +### Pickup Creation +This service is used to schedule pickups. +1. Login to the Axon Ivy Portal +2. On the Process List page, click on **Pickup Creation** + +![Alt text](./images/image-5.png) + +3. Fill in required fields + +![Alt text](./images/image-4.png) + +4. Click **Process** button to schedule pickups + +![Alt text](./images/image-12.png) + + + +### Pickup cancel +This service is used to cancel previously scheduled pickups. +1. Login to the Axon Ivy Portal +2. On the Process List page, click on **Pickup Creation** + +![Alt text](./images/image-8.png) + +3. Fill in required fields + +![Alt text](./images/image-7.png) + +4. Click **Cancel** button to finish + + +### Address validation +This service is utilized to verify addresses against the United States Postal Service database of valid addresses in the U.S. +1. Login to the Axon Ivy Portal +2. On the Process List page, click on **Validate Address** + +![Alt text](./images/image-9.png) + +3. Fill in address info + +![Alt text](./images/image-10.png) + +4. Click **Validate** button diff --git a/ups-connector-product/images/image-1.png b/ups-connector-product/images/image-1.png new file mode 100644 index 0000000..7a34d20 Binary files /dev/null and b/ups-connector-product/images/image-1.png differ diff --git a/ups-connector-product/images/image-10.png b/ups-connector-product/images/image-10.png new file mode 100644 index 0000000..f7290c5 Binary files /dev/null and b/ups-connector-product/images/image-10.png differ diff --git a/ups-connector-product/images/image-11.png b/ups-connector-product/images/image-11.png new file mode 100644 index 0000000..6f90a7f Binary files /dev/null and b/ups-connector-product/images/image-11.png differ diff --git a/ups-connector-product/images/image-12.png b/ups-connector-product/images/image-12.png new file mode 100644 index 0000000..90483ba Binary files /dev/null and b/ups-connector-product/images/image-12.png differ diff --git a/ups-connector-product/images/image-2.png b/ups-connector-product/images/image-2.png new file mode 100644 index 0000000..0c0bfef Binary files /dev/null and b/ups-connector-product/images/image-2.png differ diff --git a/ups-connector-product/images/image-3.png b/ups-connector-product/images/image-3.png new file mode 100644 index 0000000..d20972d Binary files /dev/null and b/ups-connector-product/images/image-3.png differ diff --git a/ups-connector-product/images/image-4.png b/ups-connector-product/images/image-4.png new file mode 100644 index 0000000..19b71e2 Binary files /dev/null and b/ups-connector-product/images/image-4.png differ diff --git a/ups-connector-product/images/image-5.png b/ups-connector-product/images/image-5.png new file mode 100644 index 0000000..b000a13 Binary files /dev/null and b/ups-connector-product/images/image-5.png differ diff --git a/ups-connector-product/images/image-6.png b/ups-connector-product/images/image-6.png new file mode 100644 index 0000000..bdc7933 Binary files /dev/null and b/ups-connector-product/images/image-6.png differ diff --git a/ups-connector-product/images/image-7.png b/ups-connector-product/images/image-7.png new file mode 100644 index 0000000..815b354 Binary files /dev/null and b/ups-connector-product/images/image-7.png differ diff --git a/ups-connector-product/images/image-8.png b/ups-connector-product/images/image-8.png new file mode 100644 index 0000000..8c7e210 Binary files /dev/null and b/ups-connector-product/images/image-8.png differ diff --git a/ups-connector-product/images/image-9.png b/ups-connector-product/images/image-9.png new file mode 100644 index 0000000..7aefc1b Binary files /dev/null and b/ups-connector-product/images/image-9.png differ diff --git a/ups-connector-product/images/image.png b/ups-connector-product/images/image.png new file mode 100644 index 0000000..758dce1 Binary files /dev/null and b/ups-connector-product/images/image.png differ diff --git a/ups-connector-product/pom.xml b/ups-connector-product/pom.xml new file mode 100644 index 0000000..aa52e0b --- /dev/null +++ b/ups-connector-product/pom.xml @@ -0,0 +1,7 @@ + + 4.0.0 + com.axonivy.connector.ups + ups-connector-product + 10.0.14-SNAPSHOT + pom + diff --git a/MY-PRODUCT-NAME-product/product.json b/ups-connector-product/product.json similarity index 58% rename from MY-PRODUCT-NAME-product/product.json rename to ups-connector-product/product.json index a5a4b33..9f1bcb5 100644 --- a/MY-PRODUCT-NAME-product/product.json +++ b/ups-connector-product/product.json @@ -6,8 +6,8 @@ "data": { "projects": [ { - "groupId": "MY-GROUP-ID", - "artifactId": "MY-PRODUCT-NAME-demo", + "groupId": "com.axonivy.connector.ups", + "artifactId": "ups-connector-demo", "version": "${version}", "type": "iar" } @@ -28,8 +28,8 @@ "data": { "dependencies": [ { - "groupId": "MY-GROUP-ID", - "artifactId": "MY-PRODUCT-NAME", + "groupId": "com.axonivy.connector.ups", + "artifactId": "ups-connector", "version": "${version}", "type": "iar" } @@ -44,27 +44,6 @@ } ] } - }, - { - "id": "maven-dropins", - "data": { - "dependencies": [ - { - "groupId": "MY-GROUP-ID", - "artifactId": "MY-PRODUCT-NAME", - "version": "${version}" - } - ], - "repositories": [ - { - "id": "maven.axonivy.com", - "url": "https://maven.axonivy.com", - "snapshots": { - "enabled": "true" - } - } - ] - } } ] } diff --git a/MY-PRODUCT-NAME-product/zip.xml b/ups-connector-product/zip.xml similarity index 100% rename from MY-PRODUCT-NAME-product/zip.xml rename to ups-connector-product/zip.xml diff --git a/ups-connector-test/.classpath b/ups-connector-test/.classpath new file mode 100644 index 0000000..e938886 --- /dev/null +++ b/ups-connector-test/.classpath @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ups-connector-test/.gitignore b/ups-connector-test/.gitignore new file mode 100644 index 0000000..9b0d458 --- /dev/null +++ b/ups-connector-test/.gitignore @@ -0,0 +1,19 @@ +# general +Thumbs.db +.DS_Store +*~ +*.log + +# java +*.class +hs_err_pid* + +# maven +target/ +lib/mvn-deps/ + +# ivy +classes/ +src_dataClasses/ +src_wsproc/ +logs/ diff --git a/ups-connector-test/.project b/ups-connector-test/.project new file mode 100644 index 0000000..223bfa9 --- /dev/null +++ b/ups-connector-test/.project @@ -0,0 +1,49 @@ + + + ups-connector-test + + + + + + ch.ivyteam.ivy.designer.dataClasses.ui.ivyDataClassBuilder + + + + + ch.ivyteam.ivy.designer.process.ui.ivyWebServiceProcessClassBuilder + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.wst.common.project.facet.core.builder + + + + + ch.ivyteam.ivy.designer.ide.ivyModelValidationBuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + ch.ivyteam.ivy.project.IvyProjectNature + org.eclipse.wst.common.modulecore.ModuleCoreNature + org.eclipse.jem.workbench.JavaEMFNature + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + org.eclipse.jem.beaninfo.BeanInfoNature + org.eclipse.wst.common.project.facet.core.nature + org.eclipse.wst.jsdt.core.jsNature + + diff --git a/ups-connector-test/.settings/.jsdtscope b/ups-connector-test/.settings/.jsdtscope new file mode 100644 index 0000000..869c01d --- /dev/null +++ b/ups-connector-test/.settings/.jsdtscope @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/ups-connector-test/.settings/ch.ivyteam.ivy.designer.prefs b/ups-connector-test/.settings/ch.ivyteam.ivy.designer.prefs new file mode 100644 index 0000000..0ffbc71 --- /dev/null +++ b/ups-connector-test/.settings/ch.ivyteam.ivy.designer.prefs @@ -0,0 +1,5 @@ +ch.ivyteam.ivy.designer.preferences.DataClassPreferencePage\:DEFAULT_DATA_CLASS=com.axonivy.ups.connector.test.Data +ch.ivyteam.ivy.designer.preferences.DataClassPreferencePage\:DEFAULT_NAMESPACE=com.axonivy.ups.connector.test +ch.ivyteam.ivy.project.preferences\:PRIMEFACES_VERSION=11 +ch.ivyteam.ivy.project.preferences\:PROJECT_VERSION=100000 +eclipse.preferences.version=1 diff --git a/ups-connector-test/.settings/org.eclipse.jdt.core.prefs b/ups-connector-test/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..d4540a5 --- /dev/null +++ b/ups-connector-test/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,10 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 +org.eclipse.jdt.core.compiler.compliance=17 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=17 diff --git a/ups-connector-test/.settings/org.eclipse.wst.common.component b/ups-connector-test/.settings/org.eclipse.wst.common.component new file mode 100644 index 0000000..c149cac --- /dev/null +++ b/ups-connector-test/.settings/org.eclipse.wst.common.component @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/ups-connector-test/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml b/ups-connector-test/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml new file mode 100644 index 0000000..9b4b9fc --- /dev/null +++ b/ups-connector-test/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/ups-connector-test/.settings/org.eclipse.wst.common.project.facet.core.xml b/ups-connector-test/.settings/org.eclipse.wst.common.project.facet.core.xml new file mode 100644 index 0000000..156ecdb --- /dev/null +++ b/ups-connector-test/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/ups-connector-test/.settings/org.eclipse.wst.css.core.prefs b/ups-connector-test/.settings/org.eclipse.wst.css.core.prefs new file mode 100644 index 0000000..5ddc6bd --- /dev/null +++ b/ups-connector-test/.settings/org.eclipse.wst.css.core.prefs @@ -0,0 +1,2 @@ +css-profile/=org.eclipse.wst.css.core.cssprofile.css3 +eclipse.preferences.version=1 diff --git a/ups-connector-test/.settings/org.eclipse.wst.jsdt.ui.superType.container b/ups-connector-test/.settings/org.eclipse.wst.jsdt.ui.superType.container new file mode 100644 index 0000000..3bd5d0a --- /dev/null +++ b/ups-connector-test/.settings/org.eclipse.wst.jsdt.ui.superType.container @@ -0,0 +1 @@ +org.eclipse.wst.jsdt.launching.baseBrowserLibrary \ No newline at end of file diff --git a/ups-connector-test/.settings/org.eclipse.wst.jsdt.ui.superType.name b/ups-connector-test/.settings/org.eclipse.wst.jsdt.ui.superType.name new file mode 100644 index 0000000..05bd71b --- /dev/null +++ b/ups-connector-test/.settings/org.eclipse.wst.jsdt.ui.superType.name @@ -0,0 +1 @@ +Window \ No newline at end of file diff --git a/ups-connector-test/config/custom-fields.yaml b/ups-connector-test/config/custom-fields.yaml new file mode 100644 index 0000000..aa19ae0 --- /dev/null +++ b/ups-connector-test/config/custom-fields.yaml @@ -0,0 +1,20 @@ +# == Custom Fields Information == +# +# You can define here your project custom fields. +# Have a look at our documentation for more information. +# +CustomFields: +# Tasks: +# MyTaskCustomField: +# Label: My task custom field +# Description: This new task custom field can be used to ... +# Type: STRING +# Cases: +# MyCaseCustomField: +# Label: My case custom field +# Description: This new case custom field can be used to ... +# Type: STRING +# Starts: +# MyStartCustomField: +# Label: My start custom field +# Description: This new start custom field can be used to ... diff --git a/ups-connector-test/config/databases.yaml b/ups-connector-test/config/databases.yaml new file mode 100644 index 0000000..247b128 --- /dev/null +++ b/ups-connector-test/config/databases.yaml @@ -0,0 +1 @@ +Databases: diff --git a/ups-connector-test/config/overrides.any b/ups-connector-test/config/overrides.any new file mode 100644 index 0000000..f59ec20 --- /dev/null +++ b/ups-connector-test/config/overrides.any @@ -0,0 +1 @@ +* \ No newline at end of file diff --git a/ups-connector-test/config/persistence.xml b/ups-connector-test/config/persistence.xml new file mode 100644 index 0000000..d6b96d7 --- /dev/null +++ b/ups-connector-test/config/persistence.xml @@ -0,0 +1,2 @@ + + diff --git a/ups-connector-test/config/rest-clients.yaml b/ups-connector-test/config/rest-clients.yaml new file mode 100644 index 0000000..8e85296 --- /dev/null +++ b/ups-connector-test/config/rest-clients.yaml @@ -0,0 +1 @@ +RestClients: diff --git a/ups-connector-test/config/roles.xml b/ups-connector-test/config/roles.xml new file mode 100644 index 0000000..59892fe --- /dev/null +++ b/ups-connector-test/config/roles.xml @@ -0,0 +1,4 @@ + + + Everybody + diff --git a/ups-connector-test/config/users.xml b/ups-connector-test/config/users.xml new file mode 100644 index 0000000..51a6906 --- /dev/null +++ b/ups-connector-test/config/users.xml @@ -0,0 +1,2 @@ + + diff --git a/ups-connector-test/config/variables.yaml b/ups-connector-test/config/variables.yaml new file mode 100644 index 0000000..64c8fa0 --- /dev/null +++ b/ups-connector-test/config/variables.yaml @@ -0,0 +1,9 @@ +# == Variables == +# +# You can define here your project Variables. +# If you want to define/override a Variable for a specific Environment, +# add an additional ‘variables.yaml’ file in a subdirectory in the ‘Config’ folder: +# '/Config/_/variables.yaml +# +Variables: +# myVariable: value diff --git a/ups-connector-test/config/webservice-clients.yaml b/ups-connector-test/config/webservice-clients.yaml new file mode 100644 index 0000000..060b018 --- /dev/null +++ b/ups-connector-test/config/webservice-clients.yaml @@ -0,0 +1 @@ +WebServiceClients: diff --git a/ups-connector-test/dataclasses/com/axonivy/ups/connector/test/Data.ivyClass b/ups-connector-test/dataclasses/com/axonivy/ups/connector/test/Data.ivyClass new file mode 100644 index 0000000..9a5b165 --- /dev/null +++ b/ups-connector-test/dataclasses/com/axonivy/ups/connector/test/Data.ivyClass @@ -0,0 +1,2 @@ +Data #class +com.axonivy.ups.connector.test #namespace diff --git a/ups-connector-test/pom.xml b/ups-connector-test/pom.xml new file mode 100644 index 0000000..c1fadac --- /dev/null +++ b/ups-connector-test/pom.xml @@ -0,0 +1,52 @@ + + + 4.0.0 + com.axonivy.connector.ups + ups-connector-test + 10.0.14-SNAPSHOT + iar + + + com.axonivy.connector.ups + ups-connector + ${project.version} + iar + + + com.axonivy.ivy.test + unit-tester + 10.0.14 + test + + + + src_test + + + com.axonivy.ivy.ci + project-build-plugin + 10.0.14 + true + + + + + + maven-deploy-plugin + 3.0.0-M1 + + true + + + + + + + maven.axonivy.com + https://maven.axonivy.com + + true + + + diff --git a/ups-connector-test/src/com/axonivy/connector/ups/test/UPSMock.java b/ups-connector-test/src/com/axonivy/connector/ups/test/UPSMock.java new file mode 100644 index 0000000..1c95d07 --- /dev/null +++ b/ups-connector-test/src/com/axonivy/connector/ups/test/UPSMock.java @@ -0,0 +1,115 @@ +package com.axonivy.connector.ups.test; + +import java.io.IOException; +import java.nio.charset.StandardCharsets; + +import javax.annotation.security.PermitAll; +import javax.ws.rs.DELETE; +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; + +import org.apache.commons.io.IOUtils; + +import io.swagger.v3.oas.annotations.Hidden; + +@Path("upsMock") +@PermitAll +@Hidden +public class UPSMock { + @GET + @Path("track/v1/details/{inquiryNumber}") + @Produces(MediaType.APPLICATION_JSON) + public Response getTracking(@PathParam("inquiryNumber") String inquiryNumber, @PathParam("locale") String locale, + @PathParam("returnSignature") String returnSignature) { + return Response.status(200).entity(load("CreateTrackingResponse.json")).build(); + } + + @DELETE + @Path("shipments/{version}/pickup/{cancelBy}") + @Produces(MediaType.APPLICATION_JSON) + public Response pickupCancel(@PathParam("cancelBy") String cancelBy, @PathParam("version") String version) { + return Response.status(200).entity("{\r\n" + + " \"PickupCancelResponse\": {\r\n" + + " \"Response\": {\r\n" + + " \"ResponseStatus\": {\r\n" + + " \"Code\": \"1\",\r\n" + + " \"Description\": \"Success\"\r\n" + + " },\r\n" + + " \"TransactionReference\": {\r\n" + + " \"CustomerContext\": \"testing\",\r\n" + + " \"TransactionIdentifier\": \"iewssoat2dtc6rrV5x2prt\"\r\n" + + " }\r\n" + + " },\r\n" + + " \"PickupType\": \"01\"\r\n" + + " }\r\n" + + "}") + .build(); + } + + @GET + @Path("shipments/{version}/pickup/{pickupType}") + @Produces(MediaType.APPLICATION_JSON) + public Response pickupPendingStatus(@PathParam("pickupType") String pickupType, + @PathParam("version") String version) { + return Response.status(200).entity("{\r\n" + + " \"PickupPendingStatusResponse\": {\r\n" + + " \"Response\": {\r\n" + + " \"ResponseStatus\": {\r\n" + + " \"Code\": \"1\",\r\n" + + " \"Description\": \"Success\"\r\n" + + " },\r\n" + + " \"TransactionReference\": {\r\n" + + " \"CustomerContext\": \"testing\",\r\n" + + " \"TransactionIdentifier\": \"iewssoas21bcKvQwVSC7b5\"\r\n" + + " }\r\n" + + " },\r\n" + + " \"PendingStatus\": {\r\n" + + " \"PickupType\": \"01\",\r\n" + + " \"ServiceDate\": \"20240110\",\r\n" + + " \"PRN\": \"2929AONCALL\",\r\n" + + " \"OnCallStatusCode\": \"001\",\r\n" + + " \"PickupStatusMessage\": \"Received at dispatch\",\r\n" + + " \"BillingCode\": \"01\",\r\n" + + " \"ContactName\": \"Shipping Mgr.\",\r\n" + + " \"ReferenceNumber\": \"OnCallNextDayAir\"\r\n" + + " }\r\n" + + " }\r\n" + + "}") + .build(); + } + + @POST + @Produces(MediaType.APPLICATION_JSON) + @Path("addressvalidation/{version}/{requestOption}") + public Response addressValidation(@PathParam("version") String version, + @PathParam("requestOption") String requestOption) { + return Response.status(200).entity("{\r\n" + + " \"XAVResponse\": {\r\n" + + " \"Response\": {\r\n" + + " \"ResponseStatus\": {\r\n" + + " \"Code\": \"1\",\r\n" + + " \"Description\": \"Success\"\r\n" + + " }\r\n" + + " },\r\n" + + " \"NoCandidatesIndicator\": \"\"\r\n" + + " }\r\n" + + "}") + .build(); + } + + private static String load(String json) { + try (var is = UPSMock.class.getResourceAsStream("json/" + json)) { + if (is == null) { + throw new RuntimeException("The json file '" + json + "' does not exist."); + } + return IOUtils.toString(is, StandardCharsets.UTF_8); + } catch (IOException ex) { + throw new RuntimeException("Failed to read json " + json, ex); + } + } +} diff --git a/ups-connector-test/src/com/axonivy/connector/ups/test/json/CreateTrackingResponse.json b/ups-connector-test/src/com/axonivy/connector/ups/test/json/CreateTrackingResponse.json new file mode 100644 index 0000000..e5b0dcf --- /dev/null +++ b/ups-connector-test/src/com/axonivy/connector/ups/test/json/CreateTrackingResponse.json @@ -0,0 +1,230 @@ +{ + "trackResponse": { + "shipment": [ + { + "inquiryNumber": "1Z615V90DK63764633", + "package": [ + { + "trackingNumber": "1Z615V90DK63764633", + "deliveryDate": [ + { + "type": "DEL", + "date": "20231115" + } + ], + "deliveryTime": { + "type": "DEL", + "endTime": "095319" + }, + "activity": [ + { + "location": { + "address": { + "city": "MUENCHEN", + "countryCode": "DE", + "country": "DE" + }, + "slic": "8015" + }, + "status": { + "type": "D", + "description": "DELIVERED ", + "code": "KB", + "statusCode": "011" + }, + "date": "20231115", + "time": "095319" + }, + { + "location": { + "address": { + "city": "Garching", + "countryCode": "DE", + "country": "DE" + }, + "slic": "0639" + }, + "status": { + "type": "I", + "description": "Out For Delivery", + "code": "OF", + "statusCode": "071" + }, + "date": "20231115", + "time": "074500" + }, + { + "location": { + "address": { + "city": "Garching", + "countryCode": "DE", + "country": "DE" + }, + "slic": "0639" + }, + "status": { + "type": "I", + "description": "Arrived at Facility", + "code": "AR", + "statusCode": "005" + }, + "date": "20231115", + "time": "062700" + }, + { + "location": { + "address": { + "city": "Frankfurt", + "countryCode": "DE", + "country": "DE" + }, + "slic": "0639" + }, + "status": { + "type": "I", + "description": "Departed from Facility", + "code": "DP", + "statusCode": "005" + }, + "date": "20231115", + "time": "014900" + }, + { + "location": { + "address": { + "city": "Garching", + "countryCode": "DE", + "country": "DE" + }, + "slic": "8015" + }, + "status": { + "type": "I", + "description": "Processing at UPS Facility", + "code": "DS", + "statusCode": "005" + }, + "date": "20231114", + "time": "092800" + }, + { + "location": { + "address": {}, + "slic": "0639" + }, + "status": { + "type": "X", + "description": "Due to operating conditions, your package may be delayed.", + "code": "08", + "statusCode": "048" + }, + "date": "20231114", + "time": "034000" + }, + { + "location": { + "address": { + "city": "Frankfurt", + "countryCode": "DE", + "country": "DE" + }, + "slic": "0949" + }, + "status": { + "type": "I", + "description": "Arrived at Facility", + "code": "AR", + "statusCode": "005" + }, + "date": "20231114", + "time": "013900" + }, + { + "location": { + "address": { + "city": "Herne-Boernig", + "countryCode": "DE", + "country": "DE" + }, + "slic": "0949" + }, + "status": { + "type": "I", + "description": "Departed from Facility", + "code": "DP", + "statusCode": "005" + }, + "date": "20231113", + "time": "221600" + }, + { + "location": { + "address": { + "city": "Herne-Boernig", + "countryCode": "DE", + "country": "DE" + }, + "slic": "0949" + }, + "status": { + "type": "I", + "description": "Origin Scan", + "code": "OR", + "statusCode": "005" + }, + "date": "20231113", + "time": "205426" + }, + { + "location": { + "address": { + "countryCode": "DE", + "country": "DE" + } + }, + "status": { + "type": "M", + "description": "Order Processed: In Transit to UPS ", + "code": "DP", + "statusCode": "003" + }, + "date": "20231113", + "time": "150557" + } + ], + "currentStatus": { + "description": "Delivered", + "code": "011" + }, + "packageAddress": [ + { + "type": "ORIGIN", + "address": { + "city": "HERNE", + "stateProvince": "", + "countryCode": "DE", + "country": "DE" + } + }, + { + "type": "DESTINATION", + "address": { + "city": "MUENCHEN", + "stateProvince": "", + "countryCode": "DE", + "country": "DE" + } + } + ], + "service": { + "code": "559", + "levelCode": "011", + "description": "UPS Standard®" + }, + "packageCount": 1 + } + ] + } + ] + } +} \ No newline at end of file diff --git a/ups-connector-test/src_test/com/axonivy/ups/connector/test/AddressValidationProcessTest.java b/ups-connector-test/src_test/com/axonivy/ups/connector/test/AddressValidationProcessTest.java new file mode 100644 index 0000000..86bfbae --- /dev/null +++ b/ups-connector-test/src_test/com/axonivy/ups/connector/test/AddressValidationProcessTest.java @@ -0,0 +1,55 @@ +package com.axonivy.ups.connector.test; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import com.ups.wwwcie.api.client.XAVRequest; +import com.ups.wwwcie.api.client.XAVRequestAddressKeyFormat; +import com.ups.wwwcie.api.client.XAVRequestRequest; +import com.ups.wwwcie.api.client.XAVResponseWrapper; + +import ch.ivyteam.ivy.bpm.engine.client.BpmClient; +import ch.ivyteam.ivy.bpm.engine.client.ExecutionResult; +import ch.ivyteam.ivy.bpm.engine.client.element.BpmElement; +import ch.ivyteam.ivy.bpm.engine.client.element.BpmProcess; +import ch.ivyteam.ivy.bpm.exec.client.IvyProcessTest; +import ch.ivyteam.ivy.environment.AppFixture; + +/** + *

+ * Detailed guidance on writing these kind of tests can be found in our Process + * Testing docs + *

+ */ +@IvyProcessTest(enableWebServer = true) +public class AddressValidationProcessTest { + + private static final BpmProcess testee = BpmProcess.path("AddressValidation"); + + @BeforeEach + void beforeEach(AppFixture fixture) { + // Disable OAuth feature for mock rest service + fixture.config("RestClients.ups (Address Validation - Street Level).Features", + "ch.ivyteam.ivy.rest.client.mapper.JsonFeature"); + fixture.var("ups-connector.Url", "{ivy.app.baseurl}/api/upsMock"); + } + + @Test + void addressValidation(BpmClient bpmClient) throws NoSuchFieldException { + BpmElement startable = testee.elementName("addressValidation(Integer,String,String,Integer,XAVRequest)"); + XAVRequest requestData = new XAVRequest(); + requestData.setRequest(new XAVRequestRequest()); + requestData.getRequest().setRequestOption("1"); + XAVRequestAddressKeyFormat addressKeyFormat = new XAVRequestAddressKeyFormat(); + addressKeyFormat.setConsigneeName("test"); + addressKeyFormat.setRegion("ROSWELL,GA,30076-1521"); + addressKeyFormat.countryCode("CountryCode"); + ExecutionResult result = bpmClient.start().subProcess(startable).execute(1, "v1", "1", 1, requestData); + var response = (XAVResponseWrapper) result.data().last().get("xavResponseWrapper"); + assertThat(response.getXaVResponse().getResponse().getResponseStatus().getCode()).isEqualTo("1"); + assertThat(response.getXaVResponse().getResponse().getResponseStatus().getDescription()).isEqualTo("Success"); + } +} \ No newline at end of file diff --git a/ups-connector-test/src_test/com/axonivy/ups/connector/test/PickupProcessTest.java b/ups-connector-test/src_test/com/axonivy/ups/connector/test/PickupProcessTest.java new file mode 100644 index 0000000..b6cc6ea --- /dev/null +++ b/ups-connector-test/src_test/com/axonivy/ups/connector/test/PickupProcessTest.java @@ -0,0 +1,45 @@ +package com.axonivy.ups.connector.test; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import com.ups.wwwcie.api.client.PickupCancelResponse; + +import ch.ivyteam.ivy.bpm.engine.client.BpmClient; +import ch.ivyteam.ivy.bpm.engine.client.ExecutionResult; +import ch.ivyteam.ivy.bpm.engine.client.element.BpmElement; +import ch.ivyteam.ivy.bpm.engine.client.element.BpmProcess; +import ch.ivyteam.ivy.bpm.exec.client.IvyProcessTest; +import ch.ivyteam.ivy.environment.AppFixture; + +/** + *

+ * Detailed guidance on writing these kind of tests can be found in our Process + * Testing docs + *

+ */ +@IvyProcessTest(enableWebServer = true) +public class PickupProcessTest { + + private static final BpmProcess testee = BpmProcess.path("Pickup"); + + @BeforeEach + void beforeEach(AppFixture fixture) { + // Disable OAuth feature for mock rest service + fixture.config("RestClients.ups (Pickup).Features", "ch.ivyteam.ivy.rest.client.mapper.JsonFeature"); + fixture.var("ups-connector.Url", "{ivy.app.baseurl}/api/upsMock"); + } + + @Test + void cancelPickup(BpmClient bpmClient) throws NoSuchFieldException { + BpmElement startable = testee.elementName("pickupCancel(String,String,String,String,String)"); + ExecutionResult result = bpmClient.start().subProcess(startable).execute("1", "ciewssoatcnc0lRzHj9P2z", + "testing", "2929602E9CP", "02"); + var response = (PickupCancelResponse) result.data().last().get("PickupCancelResponse"); + assertThat(response.getResponse().getResponseStatus().getCode()).isEqualTo("1"); + assertThat(response.getResponse().getResponseStatus().getDescription()).isEqualTo("Success"); + } +} \ No newline at end of file diff --git a/ups-connector-test/src_test/com/axonivy/ups/connector/test/TrackingProcessTest.java b/ups-connector-test/src_test/com/axonivy/ups/connector/test/TrackingProcessTest.java new file mode 100644 index 0000000..2105fd5 --- /dev/null +++ b/ups-connector-test/src_test/com/axonivy/ups/connector/test/TrackingProcessTest.java @@ -0,0 +1,44 @@ +package com.axonivy.ups.connector.test; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import com.axonivy.ups.connector.TrackingRequestData; +import com.ups.wwwcie.client.TrackApiResponse; + +import ch.ivyteam.ivy.bpm.engine.client.BpmClient; +import ch.ivyteam.ivy.bpm.engine.client.ExecutionResult; +import ch.ivyteam.ivy.bpm.engine.client.element.BpmElement; +import ch.ivyteam.ivy.bpm.engine.client.element.BpmProcess; +import ch.ivyteam.ivy.bpm.exec.client.IvyProcessTest; +import ch.ivyteam.ivy.environment.AppFixture; + +@IvyProcessTest(enableWebServer = true) +public class TrackingProcessTest { + + private static final BpmProcess testee = BpmProcess.path("Tracking"); + + @BeforeEach + void beforeEach(AppFixture fixture) { + // Disable OAuth feature for mock rest service + fixture.config("RestClients.ups (TrackService API).Features", "ch.ivyteam.ivy.rest.client.mapper.JsonFeature"); + fixture.var("ups-connector.Url", "{ivy.app.baseurl}/api/upsMock"); + } + + @Test + void getTracking(BpmClient bpmClient) throws NoSuchFieldException { + BpmElement startable = testee.elementName("tracking(TrackingRequestData)"); + TrackingRequestData requestData = new TrackingRequestData(); + requestData.setInquiryNumber("1Z615V90DK63764633"); + requestData.setLocale("de_DE"); + requestData.setReturnSignature("false"); + requestData.setTransactionSrc("testing"); + requestData.setTransId("ciewssoatcnc0lRzHj9P2z"); + ExecutionResult result = bpmClient.start().subProcess(startable).execute(requestData); + var response = (TrackApiResponse) result.data().last().get("TrackApiResponse"); + assertThat(response.getTrackResponse().getShipment().get(0).getInquiryNumber()).isEqualTo("1Z615V90DK63764633"); + } + +} \ No newline at end of file diff --git a/ups-connector/.classpath b/ups-connector/.classpath new file mode 100644 index 0000000..804a531 --- /dev/null +++ b/ups-connector/.classpath @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ups-connector/.gitignore b/ups-connector/.gitignore new file mode 100644 index 0000000..9b0d458 --- /dev/null +++ b/ups-connector/.gitignore @@ -0,0 +1,19 @@ +# general +Thumbs.db +.DS_Store +*~ +*.log + +# java +*.class +hs_err_pid* + +# maven +target/ +lib/mvn-deps/ + +# ivy +classes/ +src_dataClasses/ +src_wsproc/ +logs/ diff --git a/ups-connector/.project b/ups-connector/.project new file mode 100644 index 0000000..6f391e2 --- /dev/null +++ b/ups-connector/.project @@ -0,0 +1,49 @@ + + + ups-connector + + + + + + ch.ivyteam.ivy.designer.dataClasses.ui.ivyDataClassBuilder + + + + + ch.ivyteam.ivy.designer.process.ui.ivyWebServiceProcessClassBuilder + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.wst.common.project.facet.core.builder + + + + + ch.ivyteam.ivy.designer.ide.ivyModelValidationBuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + ch.ivyteam.ivy.project.IvyProjectNature + org.eclipse.wst.common.modulecore.ModuleCoreNature + org.eclipse.jem.workbench.JavaEMFNature + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + org.eclipse.jem.beaninfo.BeanInfoNature + org.eclipse.wst.common.project.facet.core.nature + org.eclipse.wst.jsdt.core.jsNature + + diff --git a/ups-connector/.settings/.jsdtscope b/ups-connector/.settings/.jsdtscope new file mode 100644 index 0000000..869c01d --- /dev/null +++ b/ups-connector/.settings/.jsdtscope @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/ups-connector/.settings/ch.ivyteam.ivy.designer.prefs b/ups-connector/.settings/ch.ivyteam.ivy.designer.prefs new file mode 100644 index 0000000..074dec1 --- /dev/null +++ b/ups-connector/.settings/ch.ivyteam.ivy.designer.prefs @@ -0,0 +1,5 @@ +ch.ivyteam.ivy.designer.preferences.DataClassPreferencePage\:DEFAULT_DATA_CLASS=ups.connector.Data +ch.ivyteam.ivy.designer.preferences.DataClassPreferencePage\:DEFAULT_NAMESPACE=ups.connector +ch.ivyteam.ivy.project.preferences\:PRIMEFACES_VERSION=11 +ch.ivyteam.ivy.project.preferences\:PROJECT_VERSION=100000 +eclipse.preferences.version=1 diff --git a/ups-connector/.settings/org.eclipse.jdt.core.prefs b/ups-connector/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..d4540a5 --- /dev/null +++ b/ups-connector/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,10 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 +org.eclipse.jdt.core.compiler.compliance=17 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=17 diff --git a/ups-connector/.settings/org.eclipse.wst.common.component b/ups-connector/.settings/org.eclipse.wst.common.component new file mode 100644 index 0000000..6bc53ef --- /dev/null +++ b/ups-connector/.settings/org.eclipse.wst.common.component @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/ups-connector/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml b/ups-connector/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml new file mode 100644 index 0000000..9b4b9fc --- /dev/null +++ b/ups-connector/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/ups-connector/.settings/org.eclipse.wst.common.project.facet.core.xml b/ups-connector/.settings/org.eclipse.wst.common.project.facet.core.xml new file mode 100644 index 0000000..156ecdb --- /dev/null +++ b/ups-connector/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/ups-connector/.settings/org.eclipse.wst.css.core.prefs b/ups-connector/.settings/org.eclipse.wst.css.core.prefs new file mode 100644 index 0000000..5ddc6bd --- /dev/null +++ b/ups-connector/.settings/org.eclipse.wst.css.core.prefs @@ -0,0 +1,2 @@ +css-profile/=org.eclipse.wst.css.core.cssprofile.css3 +eclipse.preferences.version=1 diff --git a/ups-connector/.settings/org.eclipse.wst.jsdt.ui.superType.container b/ups-connector/.settings/org.eclipse.wst.jsdt.ui.superType.container new file mode 100644 index 0000000..3bd5d0a --- /dev/null +++ b/ups-connector/.settings/org.eclipse.wst.jsdt.ui.superType.container @@ -0,0 +1 @@ +org.eclipse.wst.jsdt.launching.baseBrowserLibrary \ No newline at end of file diff --git a/ups-connector/.settings/org.eclipse.wst.jsdt.ui.superType.name b/ups-connector/.settings/org.eclipse.wst.jsdt.ui.superType.name new file mode 100644 index 0000000..05bd71b --- /dev/null +++ b/ups-connector/.settings/org.eclipse.wst.jsdt.ui.superType.name @@ -0,0 +1 @@ +Window \ No newline at end of file diff --git a/ups-connector/config/custom-fields.yaml b/ups-connector/config/custom-fields.yaml new file mode 100644 index 0000000..aa19ae0 --- /dev/null +++ b/ups-connector/config/custom-fields.yaml @@ -0,0 +1,20 @@ +# == Custom Fields Information == +# +# You can define here your project custom fields. +# Have a look at our documentation for more information. +# +CustomFields: +# Tasks: +# MyTaskCustomField: +# Label: My task custom field +# Description: This new task custom field can be used to ... +# Type: STRING +# Cases: +# MyCaseCustomField: +# Label: My case custom field +# Description: This new case custom field can be used to ... +# Type: STRING +# Starts: +# MyStartCustomField: +# Label: My start custom field +# Description: This new start custom field can be used to ... diff --git a/ups-connector/config/databases.yaml b/ups-connector/config/databases.yaml new file mode 100644 index 0000000..247b128 --- /dev/null +++ b/ups-connector/config/databases.yaml @@ -0,0 +1 @@ +Databases: diff --git a/ups-connector/config/overrides.any b/ups-connector/config/overrides.any new file mode 100644 index 0000000..f59ec20 --- /dev/null +++ b/ups-connector/config/overrides.any @@ -0,0 +1 @@ +* \ No newline at end of file diff --git a/ups-connector/config/persistence.xml b/ups-connector/config/persistence.xml new file mode 100644 index 0000000..d6b96d7 --- /dev/null +++ b/ups-connector/config/persistence.xml @@ -0,0 +1,2 @@ + + diff --git a/ups-connector/config/rest-clients.yaml b/ups-connector/config/rest-clients.yaml new file mode 100644 index 0000000..5a05960 --- /dev/null +++ b/ups-connector/config/rest-clients.yaml @@ -0,0 +1,139 @@ +RestClients: + ups (TrackService API): + UUID: be29775f-9c8b-4f21-a9bc-b45cf89f932d + Url: ${ivy.var.ups-connector.Url} + Features: + - ch.ivyteam.ivy.rest.client.mapper.JsonFeature + - com.axonivy.ups.connector.oauth.OAuth2Feature + Properties: + AUTH.baseUri: ${ivy.var.ups-connector.authUri} + AUTH.appId: ${ivy.var.ups-connector.appId} + jersey.client.connectorProvider: org.glassfish.jersey.client.HttpUrlConnectorProvider + JSON.Serialization.PROPERTY_INCLUSION: NON_NULL + AUTH.secretKey: ${ivy.var.ups-connector.secretKey} + OpenAPI: + SpecUrl: file:///D:/Atomic/project/UPS/OpenApi/Tracking.json + Namespace: com.ups.wwwcie.client + #The Address Validation Street Level API can be used to check addresses against the United States Postal Service database of valid addresses in the U.S. and Puerto Rico. + ups (Address Validation - Street Level): + UUID: 221ae58e-3b92-4977-a80a-94693778aaf4 + Url: ${ivy.var.ups-connector.Url} + Features: + - ch.ivyteam.ivy.rest.client.mapper.JsonFeature + - com.axonivy.ups.connector.oauth.OAuth2Feature + Properties: + AUTH.baseUri: ${ivy.var.ups-connector.authUri} + AUTH.appId: ${ivy.var.ups-connector.appId} + jersey.client.connectorProvider: org.glassfish.jersey.client.HttpUrlConnectorProvider + JSON.Serialization.PROPERTY_INCLUSION: NON_NULL + AUTH.secretKey: ${ivy.var.ups-connector.secretKey} + OpenAPI: + SpecUrl: file:///D:/Atomic/project/UPS/OpenApi/Address%20Validation.json + Namespace: com.ups.wwwcie.api.client + #The Locator API provides UPS full-service and self-service locations, hours of operation and pickup times. + ups (Locator): + UUID: 392a25b1-ff85-48ae-95cb-44dddd4a876b + Url: ${ivy.var.ups-connector.Url} + Features: + - ch.ivyteam.ivy.rest.client.mapper.JsonFeature + - com.axonivy.ups.connector.oauth.OAuth2Feature + Properties: + AUTH.baseUri: ${ivy.var.ups-connector.authUri} + AUTH.appId: ${ivy.var.ups-connector.appId} + jersey.client.connectorProvider: org.glassfish.jersey.client.HttpUrlConnectorProvider + JSON.Serialization.PROPERTY_INCLUSION: NON_NULL + AUTH.secretKey: ${ivy.var.ups-connector.secretKey} + OpenAPI: + SpecUrl: file:///D:/Atomic/project/UPS/OpenApi/Locator.json + Namespace: com.ups.wwwcie.api.client + ups (Time In Transit): + UUID: 4af7d355-b229-44e3-9a0f-d8862b85e6cb + Url: ${ivy.var.ups-connector.Url} + Features: + - ch.ivyteam.ivy.rest.client.mapper.JsonFeature + - com.axonivy.ups.connector.oauth.OAuth2Feature + Properties: + AUTH.baseUri: ${ivy.var.ups-connector.authUri} + AUTH.appId: ${ivy.var.ups-connector.appId} + jersey.client.connectorProvider: org.glassfish.jersey.client.HttpUrlConnectorProvider + JSON.Serialization.PROPERTY_INCLUSION: NON_NULL + AUTH.secretKey: ${ivy.var.ups-connector.secretKey} + OpenAPI: + SpecUrl: file:///D:/Atomic/project/UPS/OpenApi/TimeInTransit.json + Namespace: com.ups.wwwcie.api.client + ups (Paperless Document): + UUID: 9fe556c4-9078-4bb9-8d0d-ec1fd217a822 + Url: ${ivy.var.ups-connector.Url} + Features: + - ch.ivyteam.ivy.rest.client.mapper.JsonFeature + - com.axonivy.ups.connector.oauth.OAuth2Feature + Properties: + AUTH.baseUri: ${ivy.var.ups-connector.authUri} + AUTH.appId: ${ivy.var.ups-connector.appId} + jersey.client.connectorProvider: org.glassfish.jersey.client.HttpUrlConnectorProvider + JSON.Serialization.PROPERTY_INCLUSION: NON_NULL + AUTH.secretKey: ${ivy.var.ups-connector.secretKey} + OpenAPI: + SpecUrl: file:///D:/Atomic/project/UPS/OpenApi/Paperless%20Documents.json + Namespace: com.ups.wwwcie.api.client + ups (Pickup): + UUID: 3c375417-832b-43bf-83b8-3a522adc3f15 + Url: ${ivy.var.ups-connector.Url} + Features: + - ch.ivyteam.ivy.rest.client.mapper.JsonFeature + - com.axonivy.ups.connector.oauth.OAuth2Feature + Properties: + AUTH.baseUri: ${ivy.var.ups-connector.authUri} + AUTH.appId: ${ivy.var.ups-connector.appId} + jersey.client.connectorProvider: org.glassfish.jersey.client.HttpUrlConnectorProvider + JSON.Serialization.PROPERTY_INCLUSION: NON_NULL + AUTH.secretKey: ${ivy.var.ups-connector.secretKey} + OpenAPI: + SpecUrl: file:///D:/Atomic/project/UPS/OpenApi/Pickup.json + Namespace: com.ups.wwwcie.api.client + ups (Ship): + UUID: 674eeece-45b5-403b-83a4-5d04d5132034 + Url: ${ivy.var.ups-connector.Url} + Features: + - ch.ivyteam.ivy.rest.client.mapper.JsonFeature + - com.axonivy.ups.connector.oauth.OAuth2Feature + Properties: + AUTH.baseUri: ${ivy.var.ups-connector.authUri} + AUTH.appId: ${ivy.var.ups-connector.appId} + jersey.client.connectorProvider: org.glassfish.jersey.client.HttpUrlConnectorProvider + JSON.Serialization.PROPERTY_INCLUSION: NON_NULL + AUTH.secretKey: ${ivy.var.ups-connector.secretKey} + OpenAPI: + SpecUrl: file:///D:/Atomic/project/UPS/OpenApi/Shipping.json + Namespace: com.ups.wwwcie.api.client + #The Pre-Notification API allows customer applications to inform UPS operations of Dangerous Goods shipments as they are processed and will enter the UPS transportation network prior to an upload of manifest information at the end of the day. + ups (PreNotification): + UUID: 84689dff-8a92-4f25-b37a-1d4edde2574a + Url: ${ivy.var.ups-connector.Url} + Features: + - ch.ivyteam.ivy.rest.client.mapper.JsonFeature + - com.axonivy.ups.connector.oauth.OAuth2Feature + Properties: + AUTH.baseUri: ${ivy.var.ups-connector.authUri} + AUTH.appId: ${ivy.var.ups-connector.appId} + jersey.client.connectorProvider: org.glassfish.jersey.client.HttpUrlConnectorProvider + JSON.Serialization.PROPERTY_INCLUSION: NON_NULL + AUTH.secretKey: ${ivy.var.ups-connector.secretKey} + OpenAPI: + SpecUrl: file:///D:/Atomic/project/UPS/OpenApi/PreNotification.json + Namespace: com.ups.wwwcie.api.client + ups (Quantum View): + UUID: 510bac2d-97f1-439a-8007-5b853c2d0af9 + Url: ${ivy.var.ups-connector.Url} + Features: + - ch.ivyteam.ivy.rest.client.mapper.JsonFeature + - com.axonivy.ups.connector.oauth.OAuth2Feature + Properties: + AUTH.baseUri: ${ivy.var.ups-connector.authUri} + AUTH.appId: ${ivy.var.ups-connector.appId} + jersey.client.connectorProvider: org.glassfish.jersey.client.HttpUrlConnectorProvider + JSON.Serialization.PROPERTY_INCLUSION: NON_NULL + AUTH.secretKey: ${ivy.var.ups-connector.secretKey} + OpenAPI: + SpecUrl: file:///D:/Atomic/project/UPS/OpenApi/QuantumView.json + Namespace: com.ups.wwwcie.api.client diff --git a/ups-connector/config/roles.xml b/ups-connector/config/roles.xml new file mode 100644 index 0000000..59892fe --- /dev/null +++ b/ups-connector/config/roles.xml @@ -0,0 +1,4 @@ + + + Everybody + diff --git a/ups-connector/config/users.xml b/ups-connector/config/users.xml new file mode 100644 index 0000000..51a6906 --- /dev/null +++ b/ups-connector/config/users.xml @@ -0,0 +1,2 @@ + + diff --git a/ups-connector/config/variables.yaml b/ups-connector/config/variables.yaml new file mode 100644 index 0000000..7305e26 --- /dev/null +++ b/ups-connector/config/variables.yaml @@ -0,0 +1,20 @@ +# == Variables == +# +# You can define here your project Variables. +# If you want to define/override a Variable for a specific Environment, +# add an additional ‘variables.yaml’ file in a subdirectory in the ‘Config’ folder: +# '/Config/_/variables.yaml +# +Variables: + ups-connector: + # Url to UPS connector + Url: "https://onlinetools.ups.com/api" + + # Your UPS Auth base URI + authUri: "https://onlinetools.ups.com/security/v1/oauth" + + # Your UPS Application Client ID + appId: "" + + # Your UPS Application Client Secret + secretKey: "" \ No newline at end of file diff --git a/ups-connector/config/webservice-clients.yaml b/ups-connector/config/webservice-clients.yaml new file mode 100644 index 0000000..060b018 --- /dev/null +++ b/ups-connector/config/webservice-clients.yaml @@ -0,0 +1 @@ +WebServiceClients: diff --git a/ups-connector/dataclasses/com/axonivy/ups/connector/AddressValidationData.ivyClass b/ups-connector/dataclasses/com/axonivy/ups/connector/AddressValidationData.ivyClass new file mode 100644 index 0000000..74c7a14 --- /dev/null +++ b/ups-connector/dataclasses/com/axonivy/ups/connector/AddressValidationData.ivyClass @@ -0,0 +1,14 @@ +AddressValidationData #class +com.axonivy.ups.connector #namespace +requestOption Integer #field +requestOption PERSISTENT #fieldModifier +version String #field +version PERSISTENT #fieldModifier +regionalRequestindicator String #field +regionalRequestindicator PERSISTENT #fieldModifier +maximumCandidateListSize Integer #field +maximumCandidateListSize PERSISTENT #fieldModifier +xavRequest com.ups.wwwcie.api.client.XAVRequest #field +xavRequest PERSISTENT #fieldModifier +xavResponseWrapper com.ups.wwwcie.api.client.XAVResponseWrapper #field +xavResponseWrapper PERSISTENT #fieldModifier diff --git a/ups-connector/dataclasses/com/axonivy/ups/connector/Data.ivyClass b/ups-connector/dataclasses/com/axonivy/ups/connector/Data.ivyClass new file mode 100644 index 0000000..9a05455 --- /dev/null +++ b/ups-connector/dataclasses/com/axonivy/ups/connector/Data.ivyClass @@ -0,0 +1,2 @@ +Data #class +com.axonivy.ups.connector #namespace diff --git a/ups-connector/dataclasses/com/axonivy/ups/connector/LocatorData.ivyClass b/ups-connector/dataclasses/com/axonivy/ups/connector/LocatorData.ivyClass new file mode 100644 index 0000000..669455c --- /dev/null +++ b/ups-connector/dataclasses/com/axonivy/ups/connector/LocatorData.ivyClass @@ -0,0 +1,16 @@ +LocatorData #class +com.axonivy.ups.connector #namespace +version String #field +version PERSISTENT #fieldModifier +reqOption String #field +reqOption PERSISTENT #fieldModifier +locale String #field +locale PERSISTENT #fieldModifier +transId String #field +transId PERSISTENT #fieldModifier +transactionSrc String #field +transactionSrc PERSISTENT #fieldModifier +locatorRequest com.ups.wwwcie.api.client.LocatorRequest #field +locatorRequest PERSISTENT #fieldModifier +locatorResponseWrapper com.ups.wwwcie.api.client.LOCATORResponseWrapper #field +locatorResponseWrapper PERSISTENT #fieldModifier diff --git a/ups-connector/dataclasses/com/axonivy/ups/connector/PaperlessDocumentsData.ivyClass b/ups-connector/dataclasses/com/axonivy/ups/connector/PaperlessDocumentsData.ivyClass new file mode 100644 index 0000000..2c01809 --- /dev/null +++ b/ups-connector/dataclasses/com/axonivy/ups/connector/PaperlessDocumentsData.ivyClass @@ -0,0 +1,22 @@ +PaperlessDocumentsData #class +com.axonivy.ups.connector #namespace +version String #field +version PERSISTENT #fieldModifier +transId String #field +transId PERSISTENT #fieldModifier +transactionSrc String #field +transactionSrc PERSISTENT #fieldModifier +shipperNumber String #field +shipperNumber PERSISTENT #fieldModifier +documentId String #field +documentId PERSISTENT #fieldModifier +deleteResponse com.ups.wwwcie.api.client.DeleteResponse #field +deleteResponse PERSISTENT #fieldModifier +pushToImageRepositoryRequest com.ups.wwwcie.api.client.PushToImageRepositoryRequest #field +pushToImageRepositoryRequest PERSISTENT #fieldModifier +pushToImageRepositoryResponse com.ups.wwwcie.api.client.PushToImageRepositoryResponse #field +pushToImageRepositoryResponse PERSISTENT #fieldModifier +uploadRequest com.ups.wwwcie.api.client.UploadRequest #field +uploadRequest PERSISTENT #fieldModifier +uploadResponse com.ups.wwwcie.api.client.UploadResponse #field +uploadResponse PERSISTENT #fieldModifier diff --git a/ups-connector/dataclasses/com/axonivy/ups/connector/PickupData.ivyClass b/ups-connector/dataclasses/com/axonivy/ups/connector/PickupData.ivyClass new file mode 100644 index 0000000..0806a35 --- /dev/null +++ b/ups-connector/dataclasses/com/axonivy/ups/connector/PickupData.ivyClass @@ -0,0 +1,32 @@ +PickupData #class +com.axonivy.ups.connector #namespace +version String #field +version PERSISTENT #fieldModifier +pickuptype String #field +pickuptype PERSISTENT #fieldModifier +pickupRequestWrapper com.ups.wwwcie.api.client.PICKUPRequestWrapper #field +pickupRequestWrapper PERSISTENT #fieldModifier +pickupRateResponse com.ups.wwwcie.api.client.PickupRateResponse #field +pickupRateResponse PERSISTENT #fieldModifier +transId String #field +transId PERSISTENT #fieldModifier +transactionSrc String #field +transactionSrc PERSISTENT #fieldModifier +accountNumber String #field +accountNumber PERSISTENT #fieldModifier +pickupPendingStatusResponse com.ups.wwwcie.api.client.PickupPendingStatusResponse #field +pickupPendingStatusResponse PERSISTENT #fieldModifier +cancelBy String #field +cancelBy PERSISTENT #fieldModifier +prn String #field +prn PERSISTENT #fieldModifier +pickupCancelResponse com.ups.wwwcie.api.client.PickupCancelResponse #field +pickupCancelResponse PERSISTENT #fieldModifier +pickupCreationResponse com.ups.wwwcie.api.client.PickupCreationResponse #field +pickupCreationResponse PERSISTENT #fieldModifier +pickupCreationRequest com.ups.wwwcie.api.client.PickupCreationRequest #field +pickupCreationRequest PERSISTENT #fieldModifier +pickupGetServiceCenterFacilitiesRequest com.ups.wwwcie.api.client.PickupGetServiceCenterFacilitiesRequest #field +pickupGetServiceCenterFacilitiesRequest PERSISTENT #fieldModifier +pickupGetServiceCenterFacilitiesResponse com.ups.wwwcie.api.client.PickupGetServiceCenterFacilitiesResponse #field +pickupGetServiceCenterFacilitiesResponse PERSISTENT #fieldModifier diff --git a/ups-connector/dataclasses/com/axonivy/ups/connector/PreNotificationData.ivyClass b/ups-connector/dataclasses/com/axonivy/ups/connector/PreNotificationData.ivyClass new file mode 100644 index 0000000..b1193dc --- /dev/null +++ b/ups-connector/dataclasses/com/axonivy/ups/connector/PreNotificationData.ivyClass @@ -0,0 +1,12 @@ +PreNotificationData #class +com.axonivy.ups.connector #namespace +version String #field +version PERSISTENT #fieldModifier +transId String #field +transId PERSISTENT #fieldModifier +transactionSrc String #field +transactionSrc PERSISTENT #fieldModifier +preNotificationRequest com.ups.wwwcie.api.client.PreNotificationRequest #field +preNotificationRequest PERSISTENT #fieldModifier +preNotificationResponse com.ups.wwwcie.api.client.PreNotificationResponse #field +preNotificationResponse PERSISTENT #fieldModifier diff --git a/ups-connector/dataclasses/com/axonivy/ups/connector/QuatumViewData.ivyClass b/ups-connector/dataclasses/com/axonivy/ups/connector/QuatumViewData.ivyClass new file mode 100644 index 0000000..2ede1e6 --- /dev/null +++ b/ups-connector/dataclasses/com/axonivy/ups/connector/QuatumViewData.ivyClass @@ -0,0 +1,8 @@ +QuatumViewData #class +com.axonivy.ups.connector #namespace +version String #field +version PERSISTENT #fieldModifier +quantumViewRequest com.ups.wwwcie.api.client.QuantumViewRequest #field +quantumViewRequest PERSISTENT #fieldModifier +quantumViewResponse com.ups.wwwcie.api.client.QuantumViewResponse #field +quantumViewResponse PERSISTENT #fieldModifier diff --git a/ups-connector/dataclasses/com/axonivy/ups/connector/ShipingData.ivyClass b/ups-connector/dataclasses/com/axonivy/ups/connector/ShipingData.ivyClass new file mode 100644 index 0000000..e798963 --- /dev/null +++ b/ups-connector/dataclasses/com/axonivy/ups/connector/ShipingData.ivyClass @@ -0,0 +1,24 @@ +ShipingData #class +com.axonivy.ups.connector #namespace +version String #field +version PERSISTENT #fieldModifier +additionalAddressValidation String #field +additionalAddressValidation PERSISTENT #fieldModifier +transId String #field +transId PERSISTENT #fieldModifier +transactionSrc String #field +transactionSrc PERSISTENT #fieldModifier +shipmentRequest com.ups.wwwcie.api.client.ShipmentRequest #field +shipmentRequest PERSISTENT #fieldModifier +shipmentResponse com.ups.wwwcie.api.client.ShipmentResponse #field +shipmentResponse PERSISTENT #fieldModifier +shipmentIdentificationNumber String #field +shipmentIdentificationNumber PERSISTENT #fieldModifier +trackingNumber String #field +trackingNumber PERSISTENT #fieldModifier +voidShipmentResponse com.ups.wwwcie.api.client.VoidShipmentResponse #field +voidShipmentResponse PERSISTENT #fieldModifier +labelRecoveryRequest com.ups.wwwcie.api.client.LabelRecoveryRequest #field +labelRecoveryRequest PERSISTENT #fieldModifier +labelRecoveryResponse com.ups.wwwcie.api.client.LabelRecoveryResponse #field +labelRecoveryResponse PERSISTENT #fieldModifier diff --git a/ups-connector/dataclasses/com/axonivy/ups/connector/TimeInTransitData.ivyClass b/ups-connector/dataclasses/com/axonivy/ups/connector/TimeInTransitData.ivyClass new file mode 100644 index 0000000..d64589a --- /dev/null +++ b/ups-connector/dataclasses/com/axonivy/ups/connector/TimeInTransitData.ivyClass @@ -0,0 +1,12 @@ +TimeInTransitData #class +com.axonivy.ups.connector #namespace +version String #field +version PERSISTENT #fieldModifier +transId String #field +transId PERSISTENT #fieldModifier +transactionSrc String #field +transactionSrc PERSISTENT #fieldModifier +timeInTransitRequest com.ups.wwwcie.api.client.TimeInTransitRequest #field +timeInTransitRequest PERSISTENT #fieldModifier +timeInTransitResponse com.ups.wwwcie.api.client.TimeInTransitResponse #field +timeInTransitResponse PERSISTENT #fieldModifier diff --git a/ups-connector/dataclasses/com/axonivy/ups/connector/TrackingData.ivyClass b/ups-connector/dataclasses/com/axonivy/ups/connector/TrackingData.ivyClass new file mode 100644 index 0000000..4833a34 --- /dev/null +++ b/ups-connector/dataclasses/com/axonivy/ups/connector/TrackingData.ivyClass @@ -0,0 +1,6 @@ +TrackingData #class +com.axonivy.ups.connector #namespace +trackingRequest com.axonivy.ups.connector.TrackingRequestData #field +trackingRequest PERSISTENT #fieldModifier +trackApiResponse com.ups.wwwcie.client.TrackApiResponse #field +trackApiResponse PERSISTENT #fieldModifier diff --git a/ups-connector/dataclasses/com/axonivy/ups/connector/TrackingRequestData.ivyClass b/ups-connector/dataclasses/com/axonivy/ups/connector/TrackingRequestData.ivyClass new file mode 100644 index 0000000..35193dc --- /dev/null +++ b/ups-connector/dataclasses/com/axonivy/ups/connector/TrackingRequestData.ivyClass @@ -0,0 +1,12 @@ +TrackingRequestData #class +com.axonivy.ups.connector #namespace +inquiryNumber String #field +inquiryNumber PERSISTENT #fieldModifier +locale String #field +locale PERSISTENT #fieldModifier +returnSignature String #field +returnSignature PERSISTENT #fieldModifier +transId String #field +transId PERSISTENT #fieldModifier +transactionSrc String #field +transactionSrc PERSISTENT #fieldModifier diff --git a/ups-connector/lib/generated/rest/jaxRsClient_221ae58e-3b92-4977-a80a-94693778aaf4.jar b/ups-connector/lib/generated/rest/jaxRsClient_221ae58e-3b92-4977-a80a-94693778aaf4.jar new file mode 100644 index 0000000..a57154c Binary files /dev/null and b/ups-connector/lib/generated/rest/jaxRsClient_221ae58e-3b92-4977-a80a-94693778aaf4.jar differ diff --git a/ups-connector/lib/generated/rest/jaxRsClient_392a25b1-ff85-48ae-95cb-44dddd4a876b.jar b/ups-connector/lib/generated/rest/jaxRsClient_392a25b1-ff85-48ae-95cb-44dddd4a876b.jar new file mode 100644 index 0000000..3b919c2 Binary files /dev/null and b/ups-connector/lib/generated/rest/jaxRsClient_392a25b1-ff85-48ae-95cb-44dddd4a876b.jar differ diff --git a/ups-connector/lib/generated/rest/jaxRsClient_3c375417-832b-43bf-83b8-3a522adc3f15.jar b/ups-connector/lib/generated/rest/jaxRsClient_3c375417-832b-43bf-83b8-3a522adc3f15.jar new file mode 100644 index 0000000..20f5813 Binary files /dev/null and b/ups-connector/lib/generated/rest/jaxRsClient_3c375417-832b-43bf-83b8-3a522adc3f15.jar differ diff --git a/ups-connector/lib/generated/rest/jaxRsClient_4af7d355-b229-44e3-9a0f-d8862b85e6cb.jar b/ups-connector/lib/generated/rest/jaxRsClient_4af7d355-b229-44e3-9a0f-d8862b85e6cb.jar new file mode 100644 index 0000000..fca4a29 Binary files /dev/null and b/ups-connector/lib/generated/rest/jaxRsClient_4af7d355-b229-44e3-9a0f-d8862b85e6cb.jar differ diff --git a/ups-connector/lib/generated/rest/jaxRsClient_510bac2d-97f1-439a-8007-5b853c2d0af9.jar b/ups-connector/lib/generated/rest/jaxRsClient_510bac2d-97f1-439a-8007-5b853c2d0af9.jar new file mode 100644 index 0000000..a24dfe3 Binary files /dev/null and b/ups-connector/lib/generated/rest/jaxRsClient_510bac2d-97f1-439a-8007-5b853c2d0af9.jar differ diff --git a/ups-connector/lib/generated/rest/jaxRsClient_674eeece-45b5-403b-83a4-5d04d5132034.jar b/ups-connector/lib/generated/rest/jaxRsClient_674eeece-45b5-403b-83a4-5d04d5132034.jar new file mode 100644 index 0000000..be5e928 Binary files /dev/null and b/ups-connector/lib/generated/rest/jaxRsClient_674eeece-45b5-403b-83a4-5d04d5132034.jar differ diff --git a/ups-connector/lib/generated/rest/jaxRsClient_84689dff-8a92-4f25-b37a-1d4edde2574a.jar b/ups-connector/lib/generated/rest/jaxRsClient_84689dff-8a92-4f25-b37a-1d4edde2574a.jar new file mode 100644 index 0000000..13b242d Binary files /dev/null and b/ups-connector/lib/generated/rest/jaxRsClient_84689dff-8a92-4f25-b37a-1d4edde2574a.jar differ diff --git a/ups-connector/lib/generated/rest/jaxRsClient_9fe556c4-9078-4bb9-8d0d-ec1fd217a822.jar b/ups-connector/lib/generated/rest/jaxRsClient_9fe556c4-9078-4bb9-8d0d-ec1fd217a822.jar new file mode 100644 index 0000000..8a0db74 Binary files /dev/null and b/ups-connector/lib/generated/rest/jaxRsClient_9fe556c4-9078-4bb9-8d0d-ec1fd217a822.jar differ diff --git a/ups-connector/lib/generated/rest/jaxRsClient_be29775f-9c8b-4f21-a9bc-b45cf89f932d.jar b/ups-connector/lib/generated/rest/jaxRsClient_be29775f-9c8b-4f21-a9bc-b45cf89f932d.jar new file mode 100644 index 0000000..d6d4888 Binary files /dev/null and b/ups-connector/lib/generated/rest/jaxRsClient_be29775f-9c8b-4f21-a9bc-b45cf89f932d.jar differ diff --git a/ups-connector/pom.xml b/ups-connector/pom.xml new file mode 100644 index 0000000..7b011b5 --- /dev/null +++ b/ups-connector/pom.xml @@ -0,0 +1,27 @@ + + + 4.0.0 + com.axonivy.connector.ups + ups-connector + 10.0.14-SNAPSHOT + iar + + + com.axonivy.connector.ups + ups-oauth-feature + ${project.version} + iar + + + + + + com.axonivy.ivy.ci + project-build-plugin + 10.0.14 + true + + + + diff --git a/ups-connector/processes/AddressValidation.p.json b/ups-connector/processes/AddressValidation.p.json new file mode 100644 index 0000000..45d9c48 --- /dev/null +++ b/ups-connector/processes/AddressValidation.p.json @@ -0,0 +1,88 @@ +{ + "format" : "10.0.0", + "id" : "18B94088D7BAEC17", + "kind" : "CALLABLE_SUB", + "config" : { + "data" : "com.axonivy.ups.connector.AddressValidationData" + }, + "elements" : [ { + "id" : "f0", + "type" : "CallSubStart", + "name" : "addressValidation(Integer,String,String,Integer,XAVRequest)", + "config" : { + "callSignature" : "addressValidation", + "input" : { + "params" : [ + { "name" : "requestOption", "type" : "Integer" }, + { "name" : "version", "type" : "String" }, + { "name" : "regionalRequestIndicator", "type" : "String" }, + { "name" : "maximumCandidateListSize", "type" : "Integer" }, + { "name" : "xavRequest", "type" : "com.ups.wwwcie.api.client.XAVRequest" } + ], + "map" : { + "out.maximumCandidateListSize" : "param.maximumCandidateListSize", + "out.regionalRequestindicator" : "param.regionalRequestIndicator", + "out.requestOption" : "param.requestOption", + "out.version" : "param.version", + "out.xavRequest" : "param.xavRequest" + } + }, + "result" : { + "params" : [ + { "name" : "xavResponseWrapper", "type" : "com.ups.wwwcie.api.client.XAVResponseWrapper" } + ], + "map" : { + "result.xavResponseWrapper" : "in.xavResponseWrapper" + } + }, + "tags" : "connector" + }, + "visual" : { + "at" : { "x" : 96, "y" : 64 }, + "labelOffset" : { "x" : 105, "y" : 49 } + }, + "connect" : { "id" : "f4", "to" : "f3" } + }, { + "id" : "f1", + "type" : "CallSubEnd", + "visual" : { + "at" : { "x" : 856, "y" : 64 } + } + }, { + "id" : "f3", + "type" : "RestClientCall", + "name" : "Call address validation API", + "config" : { + "headers" : { + "Accept" : "*/*", + "X-Requested-By" : "in.version" + }, + "bodyObjectMapping" : { + "param.xaVRequest" : "in.xavRequest" + }, + "clientId" : "221ae58e-3b92-4977-a80a-94693778aaf4", + "method" : "POST", + "queryParams" : { + "regionalrequestindicator" : "in.regionalrequestindicator", + "maximumcandidatelistsize" : "in.maximumcandidatelistsize" + }, + "statusErrorCode" : "ivy:error:rest:client", + "bodyObjectType" : "com.ups.wwwcie.api.client.XAVRequestWrapper", + "bodyInputType" : "ENTITY", + "path" : "/addressvalidation/{version}/{requestoption}", + "clientErrorCode" : "ivy:error:rest:client", + "responseMapping" : { + "out.xavResponseWrapper" : "result" + }, + "templateParams" : { + "requestoption" : "in.requestoption", + "version" : "in.version" + }, + "resultType" : "com.ups.wwwcie.api.client.XAVResponseWrapper" + }, + "visual" : { + "at" : { "x" : 536, "y" : 64 } + }, + "connect" : { "id" : "f2", "to" : "f1" } + } ] +} \ No newline at end of file diff --git a/ups-connector/processes/Locator.p.json b/ups-connector/processes/Locator.p.json new file mode 100644 index 0000000..6ae3461 --- /dev/null +++ b/ups-connector/processes/Locator.p.json @@ -0,0 +1,84 @@ +{ + "format" : "10.0.0", + "id" : "18B9434D3583828B", + "kind" : "CALLABLE_SUB", + "config" : { + "data" : "com.axonivy.ups.connector.LocatorData" + }, + "elements" : [ { + "id" : "f0", + "type" : "CallSubStart", + "name" : "locator(String,String,String,String,String,LocatorRequest)", + "config" : { + "callSignature" : "locator", + "input" : { + "params" : [ + { "name" : "version", "type" : "String" }, + { "name" : "reqOption", "type" : "String" }, + { "name" : "locale", "type" : "String" }, + { "name" : "transId", "type" : "String" }, + { "name" : "transactionSrc", "type" : "String" }, + { "name" : "locatorRequest", "type" : "com.ups.wwwcie.api.client.LocatorRequest" } + ], + "map" : { + "out.locale" : "param.locale", + "out.locatorRequest" : "param.locatorRequest", + "out.reqOption" : "param.reqOption", + "out.transId" : "param.transId", + "out.transactionSrc" : "param.transactionSrc", + "out.version" : "param.version" + } + }, + "result" : { + "params" : [ + { "name" : "locatorResponseWrapper", "type" : "com.ups.wwwcie.api.client.LOCATORResponseWrapper" } + ], + "map" : { + "result.locatorResponseWrapper" : "in.locatorResponseWrapper" + } + }, + "tags" : "connector" + }, + "visual" : { + "at" : { "x" : 200, "y" : 64 } + }, + "connect" : { "id" : "f4", "to" : "f3" } + }, { + "id" : "f1", + "type" : "CallSubEnd", + "visual" : { + "at" : { "x" : 800, "y" : 64 } + } + }, { + "id" : "f3", + "type" : "RestClientCall", + "name" : "Get Locator", + "config" : { + "bodyObjectMapping" : { + "param.locatorRequest" : "in.locatorRequest" + }, + "clientId" : "392a25b1-ff85-48ae-95cb-44dddd4a876b", + "method" : "POST", + "queryParams" : { + "Locale" : "in.locale" + }, + "statusErrorCode" : "ivy:error:rest:client", + "bodyObjectType" : "com.ups.wwwcie.api.client.LOCATORRequestWrapper", + "bodyInputType" : "ENTITY", + "path" : "/locations/{version}/search/availabilities/{reqOption}", + "clientErrorCode" : "ivy:error:rest:client", + "responseMapping" : { + "out.locatorResponseWrapper" : "result" + }, + "templateParams" : { + "reqOption" : "in.reqOption", + "version" : "in.version" + }, + "resultType" : "com.ups.wwwcie.api.client.LOCATORResponseWrapper" + }, + "visual" : { + "at" : { "x" : 528, "y" : 64 } + }, + "connect" : { "id" : "f2", "to" : "f1" } + } ] +} \ No newline at end of file diff --git a/ups-connector/processes/PaperlessDocuments.p.json b/ups-connector/processes/PaperlessDocuments.p.json new file mode 100644 index 0000000..98266f8 --- /dev/null +++ b/ups-connector/processes/PaperlessDocuments.p.json @@ -0,0 +1,211 @@ +{ + "format" : "10.0.0", + "id" : "18BA7FF3B06A0E62", + "kind" : "CALLABLE_SUB", + "config" : { + "data" : "com.axonivy.ups.connector.PaperlessDocumentsData" + }, + "elements" : [ { + "id" : "f0", + "type" : "CallSubStart", + "name" : "deletePaperlessDocument()", + "config" : { + "callSignature" : "deletePaperlessDocument", + "result" : { + "params" : [ + { "name" : "deleteResponse", "type" : "com.ups.wwwcie.api.client.DeleteResponse" } + ], + "map" : { + "result.deleteResponse" : "in.deleteResponse" + } + }, + "tags" : "connector" + }, + "visual" : { + "at" : { "x" : 272, "y" : 64 } + }, + "connect" : { "id" : "f4", "to" : "f3" } + }, { + "id" : "f1", + "type" : "CallSubEnd", + "visual" : { + "at" : { "x" : 872, "y" : 64 } + } + }, { + "id" : "f3", + "type" : "RestClientCall", + "name" : "Delete Paperless Document", + "config" : { + "path" : "/paperlessdocuments/{version}/DocumentId/ShipperNumber", + "headers" : { + "Accept" : "*/*", + "transId" : "in.transId", + "transactionSrc" : "in.transactionSrc", + "shipperNumber" : "in.shipperNumber", + "documentId" : "in.documentId" + }, + "clientId" : "9fe556c4-9078-4bb9-8d0d-ec1fd217a822", + "clientErrorCode" : "ivy:error:rest:client", + "method" : "DELETE", + "statusErrorCode" : "ivy:error:rest:client", + "responseMapping" : { + "out.deleteResponse" : "result.deleteResponse" + }, + "templateParams" : { + "version" : "in.version" + }, + "resultType" : "com.ups.wwwcie.api.client.PAPERLESSDOCUMENTDeleteResponseWrapper" + }, + "visual" : { + "at" : { "x" : 640, "y" : 64 } + }, + "connect" : { "id" : "f2", "to" : "f1" } + }, { + "id" : "f5", + "type" : "CallSubStart", + "name" : "paperlessDocumentPushImage(String,String,String,String,PushToImageRepositoryRequest)", + "config" : { + "callSignature" : "paperlessDocumentPushImage", + "input" : { + "params" : [ + { "name" : "version", "type" : "String" }, + { "name" : "transId", "type" : "String" }, + { "name" : "transactionSrc", "type" : "String" }, + { "name" : "shipperNumber", "type" : "String" }, + { "name" : "pushToImageRepositoryRequest", "type" : "com.ups.wwwcie.api.client.PushToImageRepositoryRequest" } + ], + "map" : { + "out.pushToImageRepositoryRequest" : "param.pushToImageRepositoryRequest", + "out.shipperNumber" : "param.shipperNumber", + "out.transId" : "param.transId", + "out.transactionSrc" : "param.transactionSrc", + "out.version" : "param.version" + } + }, + "result" : { + "params" : [ + { "name" : "pushToImageRepositoryResponse", "type" : "com.ups.wwwcie.api.client.PushToImageRepositoryResponse" } + ], + "map" : { + "result.pushToImageRepositoryResponse" : "in.pushToImageRepositoryResponse" + } + }, + "tags" : "connector" + }, + "visual" : { + "at" : { "x" : 272, "y" : 240 } + }, + "connect" : { "id" : "f9", "to" : "f7" } + }, { + "id" : "f6", + "type" : "CallSubEnd", + "visual" : { + "at" : { "x" : 872, "y" : 240 } + } + }, { + "id" : "f7", + "type" : "RestClientCall", + "name" : "Paperless Document Push Image", + "config" : { + "headers" : { + "Accept" : "*/*", + "transId" : "in.transId", + "transactionSrc" : "in.transactionSrc", + "shipperNumber" : "in.shipperNumber" + }, + "bodyObjectMapping" : { + "param.pushToImageRepositoryRequest" : "in.pushToImageRepositoryRequest" + }, + "clientId" : "9fe556c4-9078-4bb9-8d0d-ec1fd217a822", + "method" : "POST", + "statusErrorCode" : "ivy:error:rest:client", + "bodyObjectType" : "com.ups.wwwcie.api.client.PAPERLESSDOCUMENTRequestWrapper", + "bodyInputType" : "ENTITY", + "path" : "/paperlessdocuments/{version}/image", + "clientErrorCode" : "ivy:error:rest:client", + "responseMapping" : { + "out.pushToImageRepositoryResponse" : "in.pushToImageRepositoryResponse" + }, + "templateParams" : { + "version" : "in.version" + }, + "resultType" : "com.ups.wwwcie.api.client.PAPERLESSDOCUMENTResponseWrapper" + }, + "visual" : { + "at" : { "x" : 640, "y" : 240 } + }, + "connect" : { "id" : "f8", "to" : "f6" } + }, { + "id" : "f10", + "type" : "CallSubStart", + "name" : "uploadPaperlessDocument(String,String,String,String,UploadRequest)", + "config" : { + "callSignature" : "uploadPaperlessDocument", + "input" : { + "params" : [ + { "name" : "version", "type" : "String" }, + { "name" : "transId", "type" : "String" }, + { "name" : "transactionSrc", "type" : "String" }, + { "name" : "shipperNumber", "type" : "String" }, + { "name" : "uploadRequest", "type" : "com.ups.wwwcie.api.client.UploadRequest" } + ], + "map" : { + "out.shipperNumber" : "param.shipperNumber", + "out.transId" : "param.transId", + "out.transactionSrc" : "param.transactionSrc", + "out.uploadRequest" : "param.uploadRequest", + "out.version" : "param.version" + } + }, + "result" : { + "params" : [ + { "name" : "uploadResponse", "type" : "com.ups.wwwcie.api.client.UploadResponse" } + ], + "map" : { + "result.uploadResponse" : "in.uploadResponse" + } + }, + "tags" : "connector" + }, + "visual" : { + "at" : { "x" : 272, "y" : 416 } + }, + "connect" : { "id" : "f14", "to" : "f12" } + }, { + "id" : "f11", + "type" : "CallSubEnd", + "visual" : { + "at" : { "x" : 872, "y" : 416 } + } + }, { + "id" : "f12", + "type" : "RestClientCall", + "name" : "Upload Paperless Document", + "config" : { + "path" : "/paperlessdocuments/{version}/upload", + "headers" : { + "Accept" : "*/*", + "transId" : "in.transId", + "transactionSrc" : "in.transactionSrc", + "shipperNumber" : "in.shipperNumber" + }, + "bodyObjectMapping" : { + "param.uploadRequest" : "in.uploadRequest" + }, + "clientId" : "9fe556c4-9078-4bb9-8d0d-ec1fd217a822", + "clientErrorCode" : "ivy:error:rest:client", + "method" : "POST", + "statusErrorCode" : "ivy:error:rest:client", + "bodyObjectType" : "com.ups.wwwcie.api.client.PAPERLESSDOCUMENTUploadRequestWrapper", + "templateParams" : { + "version" : "in.version" + }, + "resultType" : "com.ups.wwwcie.api.client.PAPERLESSDOCUMENTUploadResponseWrapper", + "bodyInputType" : "ENTITY" + }, + "visual" : { + "at" : { "x" : 640, "y" : 416 } + }, + "connect" : { "id" : "f13", "to" : "f11" } + } ] +} \ No newline at end of file diff --git a/ups-connector/processes/Pickup.p.json b/ups-connector/processes/Pickup.p.json new file mode 100644 index 0000000..4ae86fb --- /dev/null +++ b/ups-connector/processes/Pickup.p.json @@ -0,0 +1,371 @@ +{ + "format" : "10.0.0", + "id" : "18BA81B8D6761598", + "kind" : "CALLABLE_SUB", + "config" : { + "data" : "com.axonivy.ups.connector.PickupData" + }, + "elements" : [ { + "id" : "f0", + "type" : "CallSubStart", + "name" : "pickupRate(String,String,PICKUPRequestWrapper,String,String)", + "config" : { + "callSignature" : "pickupRate", + "input" : { + "params" : [ + { "name" : "version", "type" : "String" }, + { "name" : "pickuptype", "type" : "String" }, + { "name" : "pickupRequestWrapper", "type" : "com.ups.wwwcie.api.client.PICKUPRequestWrapper" }, + { "name" : "transId", "type" : "String" }, + { "name" : "transactionSrc", "type" : "String" } + ], + "map" : { + "out.pickupRequestWrapper" : "param.pickupRequestWrapper", + "out.pickuptype" : "param.pickuptype", + "out.transId" : "param.transId", + "out.transactionSrc" : "param.transactionSrc", + "out.version" : "param.version" + } + }, + "result" : { + "params" : [ + { "name" : "pickupRateResponse", "type" : "com.ups.wwwcie.api.client.PickupRateResponse" } + ], + "map" : { + "result.pickupRateResponse" : "in.pickupRateResponse" + } + }, + "tags" : "connector" + }, + "visual" : { + "at" : { "x" : 256, "y" : 64 } + }, + "connect" : { "id" : "f4", "to" : "f3" } + }, { + "id" : "f1", + "type" : "CallSubEnd", + "visual" : { + "at" : { "x" : 856, "y" : 64 } + } + }, { + "id" : "f3", + "type" : "RestClientCall", + "name" : "Pickup Rate", + "config" : { + "headers" : { + "Accept" : "*/*", + "transId" : "in.transId", + "transactionSrc" : "in.transactionSrc" + }, + "bodyObjectMapping" : { + "param" : "in.pickupRequestWrapper" + }, + "clientId" : "3c375417-832b-43bf-83b8-3a522adc3f15", + "method" : "POST", + "statusErrorCode" : "ivy:error:rest:client", + "bodyObjectType" : "com.ups.wwwcie.api.client.PICKUPRequestWrapper", + "bodyInputType" : "ENTITY", + "path" : "/shipments/{version}/pickup/{pickuptype}", + "clientErrorCode" : "ivy:error:rest:client", + "responseMapping" : { + "out.pickupRateResponse" : "result.pickupRateResponse" + }, + "templateParams" : { + "version" : "in.version", + "pickuptype" : "in.pickuptype" + }, + "resultType" : "com.ups.wwwcie.api.client.PICKUPResponseWrapper" + }, + "visual" : { + "at" : { "x" : 632, "y" : 64 } + }, + "connect" : { "id" : "f2", "to" : "f1" } + }, { + "id" : "f5", + "type" : "CallSubStart", + "name" : "pickupPendingStatus(String,String,String,String,String)", + "config" : { + "callSignature" : "pickupPendingStatus", + "input" : { + "params" : [ + { "name" : "version", "type" : "String" }, + { "name" : "transId", "type" : "String" }, + { "name" : "transactionSrc", "type" : "String" }, + { "name" : "accountNumber", "type" : "String" }, + { "name" : "pickuptype", "type" : "String" } + ], + "map" : { + "out.accountNumber" : "param.accountNumber", + "out.pickuptype" : "param.pickuptype", + "out.transId" : "param.transId", + "out.transactionSrc" : "param.transactionSrc", + "out.version" : "param.version" + } + }, + "result" : { + "params" : [ + { "name" : "pickupPendingStatusResponse", "type" : "com.ups.wwwcie.api.client.PickupPendingStatusResponse" } + ], + "map" : { + "result.pickupPendingStatusResponse" : "in.pickupPendingStatusResponse" + } + }, + "tags" : "connector" + }, + "visual" : { + "at" : { "x" : 256, "y" : 208 } + }, + "connect" : { "id" : "f8", "to" : "f7" } + }, { + "id" : "f6", + "type" : "CallSubEnd", + "visual" : { + "at" : { "x" : 856, "y" : 208 } + } + }, { + "id" : "f7", + "type" : "RestClientCall", + "name" : "Pickup Pending Status", + "config" : { + "path" : "/shipments/{version}/pickup/{pickuptype}", + "headers" : { + "Accept" : "*/*", + "transId" : "in.transId", + "transactionSrc" : "in.transactionSrc", + "AccountNumber" : "in.accountNumber" + }, + "clientId" : "3c375417-832b-43bf-83b8-3a522adc3f15", + "clientErrorCode" : "ivy:error:rest:client", + "statusErrorCode" : "ivy:error:rest:client", + "responseMapping" : { + "out.pickupPendingStatusResponse" : "result.pickupPendingStatusResponse" + }, + "templateParams" : { + "version" : "in.version", + "pickuptype" : "in.pickuptype" + }, + "resultType" : "com.ups.wwwcie.api.client.PICKUPPendingResponseWrapper" + }, + "visual" : { + "at" : { "x" : 640, "y" : 208 } + }, + "connect" : { "id" : "f9", "to" : "f6" } + }, { + "id" : "f10", + "type" : "CallSubStart", + "name" : "pickupCancel(String,String,String,String,String)", + "config" : { + "callSignature" : "pickupCancel", + "input" : { + "params" : [ + { "name" : "version", "type" : "String" }, + { "name" : "transId", "type" : "String" }, + { "name" : "transactionSrc", "type" : "String" }, + { "name" : "prn", "type" : "String" }, + { "name" : "cancelBy", "type" : "String" } + ], + "map" : { + "out.cancelBy" : "param.cancelBy", + "out.prn" : "param.prn", + "out.transId" : "param.transId", + "out.transactionSrc" : "param.transactionSrc", + "out.version" : "param.version" + } + }, + "result" : { + "params" : [ + { "name" : "pickupCancelResponse", "type" : "com.ups.wwwcie.api.client.PickupCancelResponse" } + ], + "map" : { + "result.pickupCancelResponse" : "in.pickupCancelResponse" + } + }, + "tags" : "connector" + }, + "visual" : { + "at" : { "x" : 256, "y" : 368 } + }, + "connect" : { "id" : "f13", "to" : "f12" } + }, { + "id" : "f11", + "type" : "CallSubEnd", + "visual" : { + "at" : { "x" : 856, "y" : 368 } + } + }, { + "id" : "f12", + "type" : "RestClientCall", + "name" : "Pickup Cancel", + "config" : { + "path" : "/shipments/{version}/pickup/{CancelBy}", + "headers" : { + "Accept" : "*/*", + "transId" : "in.transId", + "transactionSrc" : "in.transactionSrc", + "Prn" : "in.prn", + "X-Requested-By" : "in.cancelBy" + }, + "clientId" : "3c375417-832b-43bf-83b8-3a522adc3f15", + "clientErrorCode" : "ivy:error:rest:client", + "method" : "DELETE", + "statusErrorCode" : "ivy:error:rest:client", + "responseMapping" : { + "out.pickupCancelResponse" : "result.pickupCancelResponse" + }, + "templateParams" : { + "version" : "in.version", + "pickuptype" : "in.pickuptype", + "CancelBy" : "in.cancelBy" + }, + "resultType" : "com.ups.wwwcie.api.client.PICKUPCancelResponseWrapper" + }, + "visual" : { + "at" : { "x" : 640, "y" : 368 } + }, + "connect" : { "id" : "f14", "to" : "f11" } + }, { + "id" : "f15", + "type" : "CallSubStart", + "name" : "pickupCreation(String,String,String,PickupCreationRequest)", + "config" : { + "callSignature" : "pickupCreation", + "input" : { + "params" : [ + { "name" : "version", "type" : "String" }, + { "name" : "transId", "type" : "String" }, + { "name" : "transactionSrc", "type" : "String" }, + { "name" : "pickupCreationRequest", "type" : "com.ups.wwwcie.api.client.PickupCreationRequest" } + ], + "map" : { + "out.pickupCreationRequest" : "param.pickupCreationRequest", + "out.transId" : "param.transId", + "out.transactionSrc" : "param.transactionSrc", + "out.version" : "param.version" + } + }, + "result" : { + "params" : [ + { "name" : "pickupCreationResponse", "type" : "com.ups.wwwcie.api.client.PickupCreationResponse" } + ], + "map" : { + "result.pickupCreationResponse" : "in.pickupCreationResponse" + } + }, + "tags" : "connector" + }, + "visual" : { + "at" : { "x" : 256, "y" : 512 } + }, + "connect" : { "id" : "f18", "to" : "f17" } + }, { + "id" : "f16", + "type" : "CallSubEnd", + "visual" : { + "at" : { "x" : 856, "y" : 512 } + } + }, { + "id" : "f17", + "type" : "RestClientCall", + "name" : "Pickup Creation", + "config" : { + "headers" : { + "Accept" : "*/*", + "transId" : "in.transId", + "transactionSrc" : "in.transactionSrc" + }, + "bodyObjectMapping" : { + "param.pickupCreationRequest" : "in.pickupCreationRequest" + }, + "clientId" : "3c375417-832b-43bf-83b8-3a522adc3f15", + "method" : "POST", + "statusErrorCode" : "ivy:error:rest:client", + "bodyObjectType" : "com.ups.wwwcie.api.client.PICKUPCreationRequestWrapper", + "bodyInputType" : "ENTITY", + "path" : "/pickupcreation/{version}/pickup", + "clientErrorCode" : "ivy:error:rest:client", + "responseMapping" : { + "out.pickupCreationResponse" : "result.pickupCreationResponse" + }, + "templateParams" : { + "version" : "in.version" + }, + "resultType" : "com.ups.wwwcie.api.client.PICKUPCreationResponseWrapper" + }, + "visual" : { + "at" : { "x" : 640, "y" : 512 } + }, + "connect" : { "id" : "f19", "to" : "f16" } + }, { + "id" : "f20", + "type" : "CallSubStart", + "name" : "pickupGetServiceCenterFacilities(String,String,String,PickupGetServiceCenterFacilitiesRequest)", + "config" : { + "callSignature" : "pickupGetServiceCenterFacilities", + "input" : { + "params" : [ + { "name" : "version", "type" : "String" }, + { "name" : "transId", "type" : "String" }, + { "name" : "transactionSrc", "type" : "String" }, + { "name" : "pickupGetServiceCenterFacilitiesRequest", "type" : "com.ups.wwwcie.api.client.PickupGetServiceCenterFacilitiesRequest" } + ], + "map" : { + "out.pickupGetServiceCenterFacilitiesRequest" : "param.pickupGetServiceCenterFacilitiesRequest", + "out.transId" : "param.transId", + "out.transactionSrc" : "param.transactionSrc", + "out.version" : "param.version" + } + }, + "result" : { + "params" : [ + { "name" : "pickupGetServiceCenterFacilitiesResponse", "type" : "com.ups.wwwcie.api.client.PickupGetServiceCenterFacilitiesResponse" } + ], + "map" : { + "result.pickupGetServiceCenterFacilitiesResponse" : "in.pickupGetServiceCenterFacilitiesResponse" + } + }, + "tags" : "connector" + }, + "visual" : { + "at" : { "x" : 256, "y" : 656 } + }, + "connect" : { "id" : "f24", "to" : "f22" } + }, { + "id" : "f21", + "type" : "CallSubEnd", + "visual" : { + "at" : { "x" : 856, "y" : 656 } + } + }, { + "id" : "f22", + "type" : "RestClientCall", + "name" : "Pickup Get Service Center Facilities", + "config" : { + "headers" : { + "Accept" : "*/*", + "transId" : "in.transId", + "transactionSrc" : "in.transactionSrc" + }, + "bodyObjectMapping" : { + "param.pickupGetServiceCenterFacilitiesRequest" : "in.pickupGetServiceCenterFacilitiesRequest" + }, + "clientId" : "3c375417-832b-43bf-83b8-3a522adc3f15", + "method" : "POST", + "statusErrorCode" : "ivy:error:rest:client", + "bodyObjectType" : "com.ups.wwwcie.api.client.PICKUPServCenterRequestWrapper", + "bodyInputType" : "ENTITY", + "path" : "/pickup/{version}/servicecenterlocations", + "clientErrorCode" : "ivy:error:rest:client", + "responseMapping" : { + "out.pickupGetServiceCenterFacilitiesResponse" : "result.pickupGetServiceCenterFacilitiesResponse" + }, + "templateParams" : { + "version" : "in.version" + }, + "resultType" : "com.ups.wwwcie.api.client.PICKUPServCenterResponseWrapper" + }, + "visual" : { + "at" : { "x" : 640, "y" : 656 } + }, + "connect" : { "id" : "f23", "to" : "f21" } + } ] +} \ No newline at end of file diff --git a/ups-connector/processes/PreNotification.p.json b/ups-connector/processes/PreNotification.p.json new file mode 100644 index 0000000..89145fb --- /dev/null +++ b/ups-connector/processes/PreNotification.p.json @@ -0,0 +1,81 @@ +{ + "format" : "10.0.0", + "id" : "18BA8EFA66A3E32A", + "kind" : "CALLABLE_SUB", + "config" : { + "data" : "com.axonivy.ups.connector.PreNotificationData" + }, + "elements" : [ { + "id" : "f0", + "type" : "CallSubStart", + "name" : "preNotification(String,String,String,PreNotificationRequest)", + "config" : { + "callSignature" : "preNotification", + "input" : { + "params" : [ + { "name" : "version", "type" : "String" }, + { "name" : "transId", "type" : "String" }, + { "name" : "tramsactionSrc", "type" : "String" }, + { "name" : "preNotificationRequest", "type" : "com.ups.wwwcie.api.client.PreNotificationRequest" } + ], + "map" : { + "out.preNotificationRequest" : "param.preNotificationRequest", + "out.transId" : "param.transId", + "out.transactionSrc" : "param.tramsactionSrc", + "out.version" : "param.version" + } + }, + "result" : { + "params" : [ + { "name" : "preNotificationResponse", "type" : "com.ups.wwwcie.api.client.PreNotificationResponse" } + ], + "map" : { + "result.preNotificationResponse" : "in.preNotificationResponse" + } + }, + "tags" : "connector" + }, + "visual" : { + "at" : { "x" : 232, "y" : 64 } + }, + "connect" : { "id" : "f4", "to" : "f3" } + }, { + "id" : "f1", + "type" : "CallSubEnd", + "visual" : { + "at" : { "x" : 776, "y" : 64 } + } + }, { + "id" : "f3", + "type" : "RestClientCall", + "name" : "Pre-Notification", + "config" : { + "headers" : { + "Accept" : "*/*", + "transId" : "in.transId", + "transactionSrc" : "in.transactionSrc" + }, + "bodyObjectMapping" : { + "param.preNotificationRequest" : "in.preNotificationRequest" + }, + "clientId" : "84689dff-8a92-4f25-b37a-1d4edde2574a", + "method" : "POST", + "statusErrorCode" : "ivy:error:rest:client", + "bodyObjectType" : "com.ups.wwwcie.api.client.PRENOTIFICATIONRequestWrapper", + "bodyInputType" : "ENTITY", + "path" : "/dangerousgoods/{version}/prenotification", + "clientErrorCode" : "ivy:error:rest:client", + "responseMapping" : { + "out.preNotificationResponse" : "result.preNotificationResponse" + }, + "templateParams" : { + "version" : "in.version" + }, + "resultType" : "com.ups.wwwcie.api.client.PRENOTIFICATIONResponseWrapper" + }, + "visual" : { + "at" : { "x" : 536, "y" : 64 } + }, + "connect" : { "id" : "f2", "to" : "f1" } + } ] +} \ No newline at end of file diff --git a/ups-connector/processes/QuatumView.p.json b/ups-connector/processes/QuatumView.p.json new file mode 100644 index 0000000..b4288e6 --- /dev/null +++ b/ups-connector/processes/QuatumView.p.json @@ -0,0 +1,72 @@ +{ + "format" : "10.0.0", + "id" : "18BA92FE8801A9AF", + "kind" : "CALLABLE_SUB", + "config" : { + "data" : "com.axonivy.ups.connector.QuatumViewData" + }, + "elements" : [ { + "id" : "f0", + "type" : "CallSubStart", + "name" : "quatumView(String,QuantumViewRequest)", + "config" : { + "callSignature" : "quatumView", + "input" : { + "params" : [ + { "name" : "version", "type" : "String" }, + { "name" : "quantumViewRequest", "type" : "com.ups.wwwcie.api.client.QuantumViewRequest" } + ], + "map" : { + "out.quantumViewRequest" : "param.quantumViewRequest", + "out.version" : "param.version" + } + }, + "result" : { + "params" : [ + { "name" : "quantumViewResponse", "type" : "com.ups.wwwcie.api.client.QuantumViewResponse" } + ], + "map" : { + "result.quantumViewResponse" : "in.quantumViewResponse" + } + }, + "tags" : "connector" + }, + "visual" : { + "at" : { "x" : 256, "y" : 64 } + }, + "connect" : { "id" : "f4", "to" : "f3" } + }, { + "id" : "f1", + "type" : "CallSubEnd", + "visual" : { + "at" : { "x" : 888, "y" : 64 } + } + }, { + "id" : "f3", + "type" : "RestClientCall", + "name" : "Get Quantum View", + "config" : { + "path" : "/quantumview/{version}/events", + "bodyObjectMapping" : { + "param.quantumViewRequest" : "in.quantumViewRequest" + }, + "clientId" : "510bac2d-97f1-439a-8007-5b853c2d0af9", + "clientErrorCode" : "ivy:error:rest:client", + "method" : "POST", + "statusErrorCode" : "ivy:error:rest:client", + "responseMapping" : { + "out.quantumViewResponse" : "result.quantumViewResponse" + }, + "bodyObjectType" : "com.ups.wwwcie.api.client.QUANTUMVIEWRequestWrapper", + "templateParams" : { + "version" : "in.version" + }, + "resultType" : "com.ups.wwwcie.api.client.QUANTUMVIEWResponseWrapper", + "bodyInputType" : "ENTITY" + }, + "visual" : { + "at" : { "x" : 568, "y" : 64 } + }, + "connect" : { "id" : "f2", "to" : "f1" } + } ] +} \ No newline at end of file diff --git a/ups-connector/processes/Shipping.p.json b/ups-connector/processes/Shipping.p.json new file mode 100644 index 0000000..c89e6a2 --- /dev/null +++ b/ups-connector/processes/Shipping.p.json @@ -0,0 +1,225 @@ +{ + "format" : "10.0.0", + "id" : "18BA8C00018E3138", + "kind" : "CALLABLE_SUB", + "config" : { + "data" : "com.axonivy.ups.connector.ShipingData" + }, + "elements" : [ { + "id" : "f0", + "type" : "CallSubStart", + "name" : "shipment(String,String,String,String,ShipmentRequest)", + "config" : { + "callSignature" : "shipment", + "input" : { + "params" : [ + { "name" : "version", "type" : "String" }, + { "name" : "additionalAddressValidation", "type" : "String" }, + { "name" : "transId", "type" : "String" }, + { "name" : "transactionSrc", "type" : "String" }, + { "name" : "shipmentRequest", "type" : "com.ups.wwwcie.api.client.ShipmentRequest" } + ], + "map" : { + "out.additionalAddressValidation" : "param.additionalAddressValidation", + "out.shipmentRequest" : "param.shipmentRequest", + "out.transId" : "param.transId", + "out.transactionSrc" : "param.transactionSrc", + "out.version" : "param.version" + } + }, + "result" : { + "params" : [ + { "name" : "shipmentResponse", "type" : "com.ups.wwwcie.api.client.ShipmentResponse" } + ], + "map" : { + "result.shipmentResponse" : "in.shipmentResponse" + } + }, + "tags" : "connector" + }, + "visual" : { + "at" : { "x" : 248, "y" : 64 }, + "labelOffset" : { "x" : 17, "y" : 33 } + }, + "connect" : { "id" : "f4", "to" : "f3" } + }, { + "id" : "f1", + "type" : "CallSubEnd", + "visual" : { + "at" : { "x" : 872, "y" : 64 } + } + }, { + "id" : "f3", + "type" : "RestClientCall", + "name" : "Shipment", + "config" : { + "bodyObjectMapping" : { + "param.shipmentRequest" : "in.shipmentRequest" + }, + "clientId" : "674eeece-45b5-403b-83a4-5d04d5132034", + "method" : "POST", + "queryParams" : { + "additionaladdressvalidation" : "in.additionalAddressValidation" + }, + "statusErrorCode" : "ivy:error:rest:client", + "bodyObjectType" : "com.ups.wwwcie.api.client.SHIPRequestWrapper", + "bodyInputType" : "ENTITY", + "path" : "/shipments/{version}/ship", + "clientErrorCode" : "ivy:error:rest:client", + "responseMapping" : { + "out.shipmentResponse" : "result.shipmentResponse" + }, + "templateParams" : { + "version" : "in.version" + }, + "resultType" : "com.ups.wwwcie.api.client.SHIPResponseWrapper" + }, + "visual" : { + "at" : { "x" : 584, "y" : 64 } + }, + "connect" : { "id" : "f2", "to" : "f1" } + }, { + "id" : "f5", + "type" : "CallSubStart", + "name" : "voidShipment(String,String,String,String)", + "config" : { + "callSignature" : "voidShipment", + "input" : { + "params" : [ + { "name" : "version", "type" : "String" }, + { "name" : "shipmentIdentificationNumber", "type" : "String" }, + { "name" : "transId", "type" : "String" }, + { "name" : "transactionSrc", "type" : "String" } + ], + "map" : { + "out.shipmentIdentificationNumber" : "param.shipmentIdentificationNumber", + "out.transId" : "param.transId", + "out.transactionSrc" : "param.transactionSrc", + "out.version" : "param.version" + } + }, + "result" : { + "params" : [ + { "name" : "voidShipmentResponse", "type" : "com.ups.wwwcie.api.client.VoidShipmentResponse" } + ], + "map" : { + "result.voidShipmentResponse" : "in.voidShipmentResponse" + } + }, + "tags" : "connector" + }, + "visual" : { + "at" : { "x" : 248, "y" : 224 } + }, + "connect" : { "id" : "f8", "to" : "f7" } + }, { + "id" : "f6", + "type" : "CallSubEnd", + "visual" : { + "at" : { "x" : 872, "y" : 224 } + } + }, { + "id" : "f7", + "type" : "RestClientCall", + "name" : "Void Shipment", + "config" : { + "path" : "/shipments/{version}/void/cancel/{shipmentidentificationnumber}", + "headers" : { + "Accept" : "*/*", + "transId" : "in.transId", + "transactionSrc" : "in.transactionSrc" + }, + "clientId" : "674eeece-45b5-403b-83a4-5d04d5132034", + "clientErrorCode" : "ivy:error:rest:client", + "method" : "DELETE", + "queryParams" : { + "trackingnumber" : "in.trackingNumber" + }, + "statusErrorCode" : "ivy:error:rest:client", + "responseMapping" : { + "out.voidShipmentResponse" : "result.voidShipmentResponse" + }, + "templateParams" : { + "shipmentidentificationnumber" : "in.shipmentIdentificationNumber", + "version" : "in.version" + }, + "resultType" : "com.ups.wwwcie.api.client.VOIDSHIPMENTResponseWrapper" + }, + "visual" : { + "at" : { "x" : 592, "y" : 224 } + }, + "connect" : { "id" : "f9", "to" : "f6" } + }, { + "id" : "f10", + "type" : "CallSubStart", + "name" : "labelRecovery(String,String,String,LabelRecoveryRequest)", + "config" : { + "callSignature" : "labelRecovery", + "input" : { + "params" : [ + { "name" : "version", "type" : "String" }, + { "name" : "transId", "type" : "String" }, + { "name" : "transactionSrc", "type" : "String" }, + { "name" : "labelRecoveryRequest", "type" : "com.ups.wwwcie.api.client.LabelRecoveryRequest" } + ], + "map" : { + "out.labelRecoveryRequest" : "param.labelRecoveryRequest", + "out.transId" : "param.transId", + "out.transactionSrc" : "param.transactionSrc", + "out.version" : "param.version" + } + }, + "result" : { + "params" : [ + { "name" : "labelRecoveryResponse", "type" : "com.ups.wwwcie.api.client.LabelRecoveryResponse" } + ], + "map" : { + "result.labelRecoveryResponse" : "in.labelRecoveryResponse" + } + }, + "tags" : "connector" + }, + "visual" : { + "at" : { "x" : 256, "y" : 400 } + }, + "connect" : { "id" : "f14", "to" : "f12" } + }, { + "id" : "f11", + "type" : "CallSubEnd", + "visual" : { + "at" : { "x" : 880, "y" : 400 } + } + }, { + "id" : "f12", + "type" : "RestClientCall", + "name" : "Label Recovery", + "config" : { + "headers" : { + "Accept" : "*/*", + "transId" : "in.transId", + "transactionSrc" : "in.transactionSrc" + }, + "bodyObjectMapping" : { + "param.labelRecoveryRequest" : "in.labelRecoveryRequest" + }, + "clientId" : "674eeece-45b5-403b-83a4-5d04d5132034", + "method" : "POST", + "statusErrorCode" : "ivy:error:rest:client", + "bodyObjectType" : "com.ups.wwwcie.api.client.LABELRECOVERYRequestWrapper", + "bodyInputType" : "ENTITY", + "path" : "/labels/{version}/recovery", + "clientErrorCode" : "ivy:error:rest:client", + "responseMapping" : { + "out.labelRecoveryResponse" : "result.labelRecoveryResponse" + }, + "templateParams" : { + "version" : "in.version" + }, + "resultType" : "com.ups.wwwcie.api.client.LABELRECOVERYResponseWrapper" + }, + "visual" : { + "at" : { "x" : 600, "y" : 400 } + }, + "connect" : { "id" : "f13", "to" : "f11" } + } ] +} \ No newline at end of file diff --git a/ups-connector/processes/TimeInTransit.p.json b/ups-connector/processes/TimeInTransit.p.json new file mode 100644 index 0000000..e767ce8 --- /dev/null +++ b/ups-connector/processes/TimeInTransit.p.json @@ -0,0 +1,81 @@ +{ + "format" : "10.0.0", + "id" : "18BA7F3EF0ADEECC", + "kind" : "CALLABLE_SUB", + "config" : { + "data" : "com.axonivy.ups.connector.TimeInTransitData" + }, + "elements" : [ { + "id" : "f0", + "type" : "CallSubStart", + "name" : "call(String,String,String,TimeInTransitRequest)", + "config" : { + "callSignature" : "call", + "input" : { + "params" : [ + { "name" : "version", "type" : "String" }, + { "name" : "transId", "type" : "String" }, + { "name" : "transactionSrc", "type" : "String" }, + { "name" : "timeInTransitRequest", "type" : "com.ups.wwwcie.api.client.TimeInTransitRequest" } + ], + "map" : { + "out.timeInTransitRequest" : "param.timeInTransitRequest", + "out.transId" : "param.transId", + "out.transactionSrc" : "param.transactionSrc", + "out.version" : "param.version" + } + }, + "result" : { + "params" : [ + { "name" : "timeInTransitResponse", "type" : "com.ups.wwwcie.api.client.TimeInTransitResponse" } + ], + "map" : { + "result.timeInTransitResponse" : "in.timeInTransitResponse" + } + }, + "tags" : "connector" + }, + "visual" : { + "at" : { "x" : 208, "y" : 64 } + }, + "connect" : { "id" : "f4", "to" : "f3" } + }, { + "id" : "f1", + "type" : "CallSubEnd", + "visual" : { + "at" : { "x" : 848, "y" : 64 } + } + }, { + "id" : "f3", + "type" : "RestClientCall", + "name" : "Get Time and Transit", + "config" : { + "headers" : { + "Accept" : "*/*", + "transId" : "in.transId", + "transactionSrc" : "in.transactionSrc" + }, + "bodyObjectMapping" : { + "param" : "in.timeInTransitRequest" + }, + "clientId" : "4af7d355-b229-44e3-9a0f-d8862b85e6cb", + "method" : "POST", + "statusErrorCode" : "ivy:error:rest:client", + "bodyObjectType" : "com.ups.wwwcie.api.client.TimeInTransitRequest", + "bodyInputType" : "ENTITY", + "path" : "/shipments/{version}/transittimes", + "clientErrorCode" : "ivy:error:rest:client", + "responseMapping" : { + "out.timeInTransitResponse" : "result" + }, + "templateParams" : { + "version" : "in.version" + }, + "resultType" : "com.ups.wwwcie.api.client.TimeInTransitResponse" + }, + "visual" : { + "at" : { "x" : 544, "y" : 64 } + }, + "connect" : { "id" : "f2", "to" : "f1" } + } ] +} \ No newline at end of file diff --git a/ups-connector/processes/Tracking.p.json b/ups-connector/processes/Tracking.p.json new file mode 100644 index 0000000..5a29bfb --- /dev/null +++ b/ups-connector/processes/Tracking.p.json @@ -0,0 +1,74 @@ +{ + "format" : "10.0.0", + "id" : "18B6AEC03011C993", + "kind" : "CALLABLE_SUB", + "config" : { + "data" : "com.axonivy.ups.connector.TrackingData" + }, + "elements" : [ { + "id" : "f0", + "type" : "CallSubStart", + "name" : "tracking(TrackingRequestData)", + "config" : { + "callSignature" : "tracking", + "input" : { + "params" : [ + { "name" : "trackingRequest", "type" : "com.axonivy.ups.connector.TrackingRequestData" } + ], + "map" : { + "out.trackingRequest" : "param.trackingRequest" + } + }, + "result" : { + "params" : [ + { "name" : "trackApiResponse", "type" : "com.ups.wwwcie.client.TrackApiResponse" } + ], + "map" : { + "result.trackApiResponse" : "in.trackApiResponse" + } + }, + "tags" : "connector" + }, + "visual" : { + "at" : { "x" : 96, "y" : 64 }, + "labelOffset" : { "x" : 17, "y" : 33 } + }, + "connect" : { "id" : "f4", "to" : "f3" } + }, { + "id" : "f1", + "type" : "CallSubEnd", + "visual" : { + "at" : { "x" : 640, "y" : 64 } + } + }, { + "id" : "f3", + "type" : "RestClientCall", + "name" : "Call Tracking API", + "config" : { + "path" : "/track/v1/details/{inquiryNumber}", + "headers" : { + "Accept" : "*/*", + "transactionSrc" : "in.trackingRequest.transactionSrc", + "transId" : "in.trackingRequest.transId" + }, + "clientId" : "be29775f-9c8b-4f21-a9bc-b45cf89f932d", + "clientErrorCode" : "ivy:error:rest:client", + "queryParams" : { + "locale" : "in.trackingRequest.locale", + "returnSignature" : "in.trackingRequest.returnSignature" + }, + "statusErrorCode" : "ivy:error:rest:client", + "responseMapping" : { + "out.trackApiResponse" : "result" + }, + "templateParams" : { + "inquiryNumber" : "in.trackingRequest.inquiryNumber" + }, + "resultType" : "com.ups.wwwcie.client.TrackApiResponse" + }, + "visual" : { + "at" : { "x" : 352, "y" : 64 } + }, + "connect" : { "id" : "f2", "to" : "f1" } + } ] +} \ No newline at end of file diff --git a/ups-oauth-feature/.classpath b/ups-oauth-feature/.classpath new file mode 100644 index 0000000..9c93e42 --- /dev/null +++ b/ups-oauth-feature/.classpath @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ups-oauth-feature/.gitignore b/ups-oauth-feature/.gitignore new file mode 100644 index 0000000..9b0d458 --- /dev/null +++ b/ups-oauth-feature/.gitignore @@ -0,0 +1,19 @@ +# general +Thumbs.db +.DS_Store +*~ +*.log + +# java +*.class +hs_err_pid* + +# maven +target/ +lib/mvn-deps/ + +# ivy +classes/ +src_dataClasses/ +src_wsproc/ +logs/ diff --git a/ups-oauth-feature/.project b/ups-oauth-feature/.project new file mode 100644 index 0000000..2edf817 --- /dev/null +++ b/ups-oauth-feature/.project @@ -0,0 +1,49 @@ + + + ups-oauth-feature + + + + + + ch.ivyteam.ivy.designer.dataClasses.ui.ivyDataClassBuilder + + + + + ch.ivyteam.ivy.designer.process.ui.ivyWebServiceProcessClassBuilder + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.wst.common.project.facet.core.builder + + + + + ch.ivyteam.ivy.designer.ide.ivyModelValidationBuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + ch.ivyteam.ivy.project.IvyProjectNature + org.eclipse.wst.common.modulecore.ModuleCoreNature + org.eclipse.jem.workbench.JavaEMFNature + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + org.eclipse.jem.beaninfo.BeanInfoNature + org.eclipse.wst.common.project.facet.core.nature + org.eclipse.wst.jsdt.core.jsNature + + diff --git a/ups-oauth-feature/.settings/.jsdtscope b/ups-oauth-feature/.settings/.jsdtscope new file mode 100644 index 0000000..869c01d --- /dev/null +++ b/ups-oauth-feature/.settings/.jsdtscope @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/ups-oauth-feature/.settings/ch.ivyteam.ivy.designer.prefs b/ups-oauth-feature/.settings/ch.ivyteam.ivy.designer.prefs new file mode 100644 index 0000000..0327425 --- /dev/null +++ b/ups-oauth-feature/.settings/ch.ivyteam.ivy.designer.prefs @@ -0,0 +1,5 @@ +ch.ivyteam.ivy.designer.preferences.DataClassPreferencePage\:DEFAULT_DATA_CLASS=com.axonivy.ups.connector.oauth.Data +ch.ivyteam.ivy.designer.preferences.DataClassPreferencePage\:DEFAULT_NAMESPACE=com.axonivy.ups.connector.oauth +ch.ivyteam.ivy.project.preferences\:PRIMEFACES_VERSION=11 +ch.ivyteam.ivy.project.preferences\:PROJECT_VERSION=100000 +eclipse.preferences.version=1 diff --git a/ups-oauth-feature/.settings/org.eclipse.jdt.core.prefs b/ups-oauth-feature/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..d4540a5 --- /dev/null +++ b/ups-oauth-feature/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,10 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 +org.eclipse.jdt.core.compiler.compliance=17 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=17 diff --git a/ups-oauth-feature/.settings/org.eclipse.wst.common.component b/ups-oauth-feature/.settings/org.eclipse.wst.common.component new file mode 100644 index 0000000..50dbe15 --- /dev/null +++ b/ups-oauth-feature/.settings/org.eclipse.wst.common.component @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/ups-oauth-feature/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml b/ups-oauth-feature/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml new file mode 100644 index 0000000..9b4b9fc --- /dev/null +++ b/ups-oauth-feature/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/ups-oauth-feature/.settings/org.eclipse.wst.common.project.facet.core.xml b/ups-oauth-feature/.settings/org.eclipse.wst.common.project.facet.core.xml new file mode 100644 index 0000000..156ecdb --- /dev/null +++ b/ups-oauth-feature/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/ups-oauth-feature/.settings/org.eclipse.wst.css.core.prefs b/ups-oauth-feature/.settings/org.eclipse.wst.css.core.prefs new file mode 100644 index 0000000..5ddc6bd --- /dev/null +++ b/ups-oauth-feature/.settings/org.eclipse.wst.css.core.prefs @@ -0,0 +1,2 @@ +css-profile/=org.eclipse.wst.css.core.cssprofile.css3 +eclipse.preferences.version=1 diff --git a/ups-oauth-feature/.settings/org.eclipse.wst.jsdt.ui.superType.container b/ups-oauth-feature/.settings/org.eclipse.wst.jsdt.ui.superType.container new file mode 100644 index 0000000..3bd5d0a --- /dev/null +++ b/ups-oauth-feature/.settings/org.eclipse.wst.jsdt.ui.superType.container @@ -0,0 +1 @@ +org.eclipse.wst.jsdt.launching.baseBrowserLibrary \ No newline at end of file diff --git a/ups-oauth-feature/.settings/org.eclipse.wst.jsdt.ui.superType.name b/ups-oauth-feature/.settings/org.eclipse.wst.jsdt.ui.superType.name new file mode 100644 index 0000000..05bd71b --- /dev/null +++ b/ups-oauth-feature/.settings/org.eclipse.wst.jsdt.ui.superType.name @@ -0,0 +1 @@ +Window \ No newline at end of file diff --git a/ups-oauth-feature/config/custom-fields.yaml b/ups-oauth-feature/config/custom-fields.yaml new file mode 100644 index 0000000..aa19ae0 --- /dev/null +++ b/ups-oauth-feature/config/custom-fields.yaml @@ -0,0 +1,20 @@ +# == Custom Fields Information == +# +# You can define here your project custom fields. +# Have a look at our documentation for more information. +# +CustomFields: +# Tasks: +# MyTaskCustomField: +# Label: My task custom field +# Description: This new task custom field can be used to ... +# Type: STRING +# Cases: +# MyCaseCustomField: +# Label: My case custom field +# Description: This new case custom field can be used to ... +# Type: STRING +# Starts: +# MyStartCustomField: +# Label: My start custom field +# Description: This new start custom field can be used to ... diff --git a/ups-oauth-feature/config/databases.yaml b/ups-oauth-feature/config/databases.yaml new file mode 100644 index 0000000..247b128 --- /dev/null +++ b/ups-oauth-feature/config/databases.yaml @@ -0,0 +1 @@ +Databases: diff --git a/ups-oauth-feature/config/overrides.any b/ups-oauth-feature/config/overrides.any new file mode 100644 index 0000000..f59ec20 --- /dev/null +++ b/ups-oauth-feature/config/overrides.any @@ -0,0 +1 @@ +* \ No newline at end of file diff --git a/ups-oauth-feature/config/persistence.xml b/ups-oauth-feature/config/persistence.xml new file mode 100644 index 0000000..d6b96d7 --- /dev/null +++ b/ups-oauth-feature/config/persistence.xml @@ -0,0 +1,2 @@ + + diff --git a/ups-oauth-feature/config/rest-clients.yaml b/ups-oauth-feature/config/rest-clients.yaml new file mode 100644 index 0000000..8e85296 --- /dev/null +++ b/ups-oauth-feature/config/rest-clients.yaml @@ -0,0 +1 @@ +RestClients: diff --git a/ups-oauth-feature/config/roles.xml b/ups-oauth-feature/config/roles.xml new file mode 100644 index 0000000..59892fe --- /dev/null +++ b/ups-oauth-feature/config/roles.xml @@ -0,0 +1,4 @@ + + + Everybody + diff --git a/ups-oauth-feature/config/users.xml b/ups-oauth-feature/config/users.xml new file mode 100644 index 0000000..51a6906 --- /dev/null +++ b/ups-oauth-feature/config/users.xml @@ -0,0 +1,2 @@ + + diff --git a/ups-oauth-feature/config/variables.yaml b/ups-oauth-feature/config/variables.yaml new file mode 100644 index 0000000..64c8fa0 --- /dev/null +++ b/ups-oauth-feature/config/variables.yaml @@ -0,0 +1,9 @@ +# == Variables == +# +# You can define here your project Variables. +# If you want to define/override a Variable for a specific Environment, +# add an additional ‘variables.yaml’ file in a subdirectory in the ‘Config’ folder: +# '/Config/_/variables.yaml +# +Variables: +# myVariable: value diff --git a/ups-oauth-feature/config/webservice-clients.yaml b/ups-oauth-feature/config/webservice-clients.yaml new file mode 100644 index 0000000..060b018 --- /dev/null +++ b/ups-oauth-feature/config/webservice-clients.yaml @@ -0,0 +1 @@ +WebServiceClients: diff --git a/ups-oauth-feature/dataclasses/com/axonivy/ups/connector/oauth/Data.ivyClass b/ups-oauth-feature/dataclasses/com/axonivy/ups/connector/oauth/Data.ivyClass new file mode 100644 index 0000000..39af752 --- /dev/null +++ b/ups-oauth-feature/dataclasses/com/axonivy/ups/connector/oauth/Data.ivyClass @@ -0,0 +1,2 @@ +Data #class +com.axonivy.ups.connector.oauth #namespace diff --git a/ups-oauth-feature/pom.xml b/ups-oauth-feature/pom.xml new file mode 100644 index 0000000..fb80bfb --- /dev/null +++ b/ups-oauth-feature/pom.xml @@ -0,0 +1,48 @@ + + + 4.0.0 + com.axonivy.connector.ups + ups-oauth-feature + 10.0.14-SNAPSHOT + iar + + scm:git:https://github.com/axonivy-market/${project.name}.git + + + + + true + + maven.axonivy.com + https://maven.axonivy.com + + + + + + always + + sonatype + https://oss.sonatype.org/content/repositories/snapshots + + + + src + + + com.axonivy.ivy.ci + project-build-plugin + 10.0.14 + true + + + maven-release-plugin + 3.0.0-M4 + + oauth-v@{project.version} + + + + + diff --git a/ups-oauth-feature/src/com/axonivy/ups/connector/oauth/OAuth2Feature.java b/ups-oauth-feature/src/com/axonivy/ups/connector/oauth/OAuth2Feature.java new file mode 100644 index 0000000..6c5e9fd --- /dev/null +++ b/ups-oauth-feature/src/com/axonivy/ups/connector/oauth/OAuth2Feature.java @@ -0,0 +1,58 @@ +package com.axonivy.ups.connector.oauth; + +import javax.ws.rs.Priorities; +import javax.ws.rs.client.Entity; +import javax.ws.rs.core.Feature; +import javax.ws.rs.core.FeatureContext; +import javax.ws.rs.core.Form; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; + +import ch.ivyteam.ivy.rest.client.FeatureConfig; +import ch.ivyteam.ivy.rest.client.authentication.HttpBasicAuthenticationFeature; +import ch.ivyteam.ivy.rest.client.oauth2.OAuth2BearerFilter; +import ch.ivyteam.ivy.rest.client.oauth2.OAuth2TokenRequester.AuthContext; +import ch.ivyteam.ivy.rest.client.oauth2.uri.OAuth2UriProperty; + +/** + * UPS AUTH flow implementation. + * + *
    + *
  • Requires a registered application: + * https://developer.ups.com/get-started?loc=en_US#tabs_1_tabPane_4
  • + *
+ * + * @since 9.2 + */ +public class OAuth2Feature implements Feature { + + public static interface Default { + String AUTH_URI = "https://onlinetools.ups.com/security/v1/oauth"; + } + + public static interface Property { + String APP_ID = "AUTH.appId"; + String CLIENT_SECRET = "AUTH.secretKey"; + String AUTH_BASE_URI = "AUTH.baseUri"; + } + + @Override + public boolean configure(FeatureContext context) { + var config = new FeatureConfig(context.getConfiguration(), OAuth2Feature.class); + var oauth2 = new OAuth2BearerFilter(OAuth2Feature::requestToken, + new OAuth2UriProperty(config, Property.AUTH_BASE_URI, Default.AUTH_URI)); + context.register(oauth2, Priorities.AUTHORIZATION); + return true; + } + + private static Response requestToken(AuthContext ctxt) { + FeatureConfig config = ctxt.config; + Form form = new Form("grant_type", "client_credentials"); + var response = ctxt.target + .register(HttpBasicAuthenticationFeature.basic(config.readMandatory(Property.APP_ID), + config.readMandatory(Property.CLIENT_SECRET))) + .request().accept(MediaType.WILDCARD).post(Entity.form(form)); + + return response; + } +}