Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): bump maven-plugin-plugin.version from 3.6.1 to 3.7.1 #1125

Open
wants to merge 41 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
f85fa69
chore(deps-dev): bump @babel/core from 7.15.5 to 7.15.8 in /ui
dependabot[bot] Oct 11, 2021
9489dfe
chore(deps): bump @patternfly/react-styles in /ui
dependabot[bot] Oct 11, 2021
e663e80
chore(deps): bump @patternfly/react-icons from 4.11.14 to 4.11.17 in /ui
dependabot[bot] Oct 11, 2021
397edcc
chore(deps): bump jandex-maven-plugin from 1.2.0 to 1.2.1
dependabot[bot] Oct 10, 2021
7d708be
chore(deps): bump mockito.version from 3.12.4 to 4.0.0
dependabot[bot] Oct 10, 2021
c0622c0
chore(deps): bump maven-version from 3.8.2 to 3.8.3
dependabot[bot] Oct 10, 2021
3d2bde0
chore(deps-dev): bump autoprefixer from 10.3.6 to 10.3.7 in /ui
dependabot[bot] Oct 10, 2021
8d20220
chore(deps-dev): bump @storybook/addon-viewport in /ui
dependabot[bot] Oct 10, 2021
806fce6
chore(deps-dev): bump @typescript-eslint/parser in /ui
dependabot[bot] Oct 10, 2021
3f8832c
chore(deps-dev): bump @storybook/addon-docs from 6.3.9 to 6.3.10 in /ui
dependabot[bot] Oct 10, 2021
17a0fc2
chore(deps-dev): bump @storybook/addon-actions in /ui
dependabot[bot] Oct 10, 2021
22a8a12
chore(deps-dev): bump @typescript-eslint/eslint-plugin in /ui
dependabot[bot] Oct 10, 2021
4ff7fa3
chore(deps-dev): bump @testing-library/user-event in /ui
dependabot[bot] Oct 10, 2021
2ba5a61
chore(deps-dev): bump @storybook/react from 6.3.9 to 6.3.10 in /ui
dependabot[bot] Oct 10, 2021
e33d3ea
chore(deps-dev): bump react-spring from 9.2.4 to 9.2.6 in /ui
dependabot[bot] Oct 10, 2021
6872194
chore(deps-dev): bump @storybook/addon-links from 6.3.9 to 6.3.10 in /ui
dependabot[bot] Oct 10, 2021
57987fa
chore(deps): bump @patternfly/react-core from 4.152.4 to 4.157.3 in /ui
dependabot[bot] Oct 11, 2021
3401744
chore(deps-dev): bump postcss from 8.3.8 to 8.3.9 in /ui
dependabot[bot] Oct 11, 2021
89f9abf
chore(deps): bump @patternfly/react-topology in /ui
dependabot[bot] Oct 11, 2021
c90a4bf
chore: bump @patternfly/react-table from 4.29.58 to 4.30.3
igarashitm Oct 12, 2021
125fcd4
fix: CSV import is broken
igarashitm Oct 12, 2021
407a6f4
fix: Correct validation of constant and property input (update) (#3394)
Oct 13, 2021
7dfe484
chore: Fix user doc / create custom transformation
igarashitm Oct 14, 2021
cea5161
fix: Restructure CSV parameters dialog (#3401)
Oct 14, 2021
4c7d144
chore: bug issue template
igarashitm Oct 15, 2021
c5fe616
chore: RFE issue template
igarashitm Oct 15, 2021
a74765d
fix: Better error message when META-INF/services/* files for custom a…
igarashitm Oct 14, 2021
89941d1
chore(deps): bump selenium.version from 3.141.59 to 4.0.0
dependabot[bot] Oct 17, 2021
f25ffbd
chore(deps): bump spring-test from 5.3.10 to 5.3.11
dependabot[bot] Oct 17, 2021
5347e9c
chore(deps): bump jetty-maven-plugin from 11.0.6 to 11.0.7
dependabot[bot] Oct 17, 2021
e700642
chore(deps-dev): bump @storybook/react from 6.3.10 to 6.3.12 in /ui
dependabot[bot] Oct 17, 2021
f2d9c0c
chore(deps-dev): bump @testing-library/user-event in /ui
dependabot[bot] Oct 17, 2021
271fbf9
chore(deps-dev): bump @storybook/addon-links in /ui
dependabot[bot] Oct 17, 2021
05e40e7
chore(deps): bump @patternfly/react-core from 4.157.3 to 4.162.3 in /ui
dependabot[bot] Oct 17, 2021
3dcf2cb
chore(deps-dev): bump @storybook/addon-viewport in /ui
dependabot[bot] Oct 17, 2021
d7bc445
chore(deps-dev): bump @storybook/addon-actions in /ui
dependabot[bot] Oct 17, 2021
2e6a864
fix: Make sure the import complete notification appears after the imp…
Oct 18, 2021
8f587a2
chore(deps): bump @patternfly/react-table from 4.30.3 to 4.31.8 in /ui
dependabot[bot] Oct 18, 2021
fcac779
chore(deps): bump @patternfly/react-core from 4.162.3 to 4.168.8 in /ui
dependabot[bot] Oct 31, 2021
08300f1
Merge pull request #396 from pleacu/dependabot/npm_and_yarn/ui/patter…
Nov 2, 2021
b5f66f9
chore(deps): bump maven-plugin-plugin.version from 3.6.1 to 3.7.1
dependabot[bot] Jan 22, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,49 @@ assignees: ''
---

**Describe the bug**
<!--
A clear and concise description of what the bug is. The more info is provided, the more likely we can fix it earlier.
-->

**Attach .adm file and source document examples**
<!--
The .adm archive file you can export from AtlasMap UI contains all metadata to reproduce your mapping. Also don't forget to provide source document examples to reproduce the runtime behavior exactly what you see.
-->

**Attach debug logs**
<!--
If it's a design time issue, attach a backend log with debug enabled
`java -Dlogging.level.io.atlasmap=debug -jar atlasmap-standalone.jar`
or for runtime issue, set the log level for `io.atlasmap` package to debug in your log4j config
-->

**To Reproduce**
<!--
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
-->

**Expected behavior**
<!--
A clear and concise description of what you expected to happen.
-->

**Screenshots**
<!--
If applicable, add screenshots to help explain your problem.
-->

**Environment (please complete the following information):**
- OS: [e.g. iOS]
<!--
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
-->

**Additional context**
<!--
Add any other context about the problem here.
-->
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/enhancement-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,26 @@ assignees: ''
---

**Is your feature request related to a problem? Please describe.**
<!--
A clear and concise description of what the problem is. Ex. I expected xxx to be happen but instead yyy[...]
-->

**Attach .adm file and source document examples if you are looking at specific current behavior**
<!--
The .adm archive file you can export from AtlasMap UI contains all metadata to reproduce your mapping. Also don't forget to provide source document examples to reproduce the runtime behavior exactly what you see.
-->

**Describe the solution you'd like**
<!--
A clear and concise description of what you want to happen.
-->

**Describe alternatives you've considered**
<!--
A clear and concise description of any alternative solutions or features you've considered.
-->

**Additional context**
<!--
Add any other context or screenshots about the feature request here.
-->
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,77 @@ transformation and prints it on the target side with the string 'concur-'
and the user-specified concur parameter.
Implement the `AtlasFieldAction` class as follows:
+
.src/main/java/io/atlasmap/maven/test/PaulsFieldActions.java
[source,java]
----
package io.atlasmap.service.my;
package io.atlasmap.maven.test;

import java.io.Serializable;
import io.atlasmap.v2.*
import io.atlasmap.spi.AtlasFieldAction;
import io.atlasmap.spi.AtlasActionProcessor;
import io.atlasmap.spi.AtlasFieldAction;

public class PaulsFieldActions implements AtlasFieldAction {

public static class Concur extends Action implements Serializable {
@AtlasActionProperty(title = "Pauls Concur Param", type = FieldType.STRING)
public String concurarg = "-paul-";

}

@AtlasActionProcessor
public static String concur(Concur action, String userInput) {
return "concur-" + action.concurarg + userInput;
public static String myCustomFieldAction(PaulsFieldActionsModel myCustomFieldAction, String input) {
return "Paul's custom field action: " + myCustomFieldAction.getPaulsParam() + " payload: " + input;
}

}
----
+
And also implement a model class `PaulsFieldActionsModel` - model class can declare transformation parameters as follows:
+
.src/main/java/io/atlasmap/maven/test/PaulsFieldActionsModel.java
[source,java]
----
package io.atlasmap.maven.test;

import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonPropertyDescription;

import io.atlasmap.v2.Action;
import io.atlasmap.v2.AtlasActionProperty;
import io.atlasmap.v2.FieldType;

public class PaulsFieldActionsModel extends Action implements Serializable {

private static final long serialVersionUID = 1L;
private String paulsParam = "";
/**
* Example of a custom field action with a string parameter.
*
* @param value
* allowed object is
* {@link String}
*
*/
@JsonPropertyDescription("Paul's custom field action parameter to display")
@AtlasActionProperty(title = "Paul's custom field action string parameter", type = FieldType.STRING)
public void setPaulsParam(String value) {
paulsParam = value;
}

public String getPaulsParam() {
return paulsParam;
}
}
----
+
. Declare for Java service loader
+
Then both class needs to be declared in `META-INF/services` to get them registered through Java service loader.
+
.src/main/resources/META-INF/services/io.atlasmap.v2.Action
----
io.atlasmap.maven.test.PaulsFieldActionsModel
----
+
.src/main/resources/META-INF/services/io.atlasmap.spi.AtlasFieldAction
----
io.atlasmap.maven.test.PaulsFieldActions
----
+
. Build your Java archive file.
+
The `io.atlasmap.v2`, `io.atlasmap.api` and `io.atlasmap.spi` target
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[id='exporting-mappings-to-an-atlasmap-catalog-file']
= Exporting mappings to an AtlasMap catalog file
[id='exporting-mappings-to-an-adm-archive-file']
= Exporting mappings to an ADM archive file

After all mappings are defined, save the mappings by exporting
them to an AtlasMap `.adm` catalog file:
them to an ADM archive file:

. Click the *AtlasMap* menu and select *Export the current mappings and support files into a catalog (.adm)*
+
Expand Down
11 changes: 11 additions & 0 deletions lib/core/src/main/java/io/atlasmap/core/AtlasUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,11 @@ public static String unescapeFromUri(String uri) {
.replaceAll("%5D", "]");
}

/**
* Delete specified directory and the contents in it.
* @see #deleteDirectoryContents
* @param targetDir
*/
public static void deleteDirectory(File targetDir) {
File[] allContents = targetDir.listFiles();
if (allContents != null) {
Expand All @@ -492,6 +497,12 @@ public static void deleteDirectory(File targetDir) {
return;
}

/**
* Delete all contents in the specified directory.
*
* @see #deleteDirectory
* @param targetDir
*/
public static void deleteDirectoryContents(File targetDir) {
File[] allContents = targetDir.listFiles();
if (allContents != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,12 @@ public Field processActions(AtlasInternalSession session, Field field) throws At
FieldType currentType = determineFieldType(field);
for (Action action : actions) {
ActionProcessor processor = findActionProcessor(action, currentType);
if (processor == null) {
AtlasUtil.addAudit(session, field, String.format(
"Couldn't find metadata for a FieldAction '%s', please make sure it's in the classpath, and also have a service declaration under META-INF/services. Ignoring...", action.getDisplayName()),
AuditStatus.WARN, null);
continue;
}
ActionDetail detail = processor.getActionDetail();
if (detail == null) {
AtlasUtil.addAudit(session, field, String.format(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ public Audits processPreview(Mapping mapping) throws AtlasException {
AtlasUtil.addAudit(session, targetField,
"It's not yet supported to have a collection field as a part of multiple target fields in a same mapping",
AuditStatus.ERROR, null);
session.getAudits().getAudit().addAll(session.head().getAudits());
return session.getAudits();
}
if (index != null) {
Expand All @@ -153,6 +154,7 @@ public Audits processPreview(Mapping mapping) throws AtlasException {
collectionHelper.copyCollectionIndexes(sourceFieldGroup, subSourceField, subTargetField, previousTargetField);
previousTargetField = subTargetField;
if (!convertSourceToTarget(session, subSourceField, subTargetField)) {
session.getAudits().getAudit().addAll(session.head().getAudits());
return session.getAudits();
};
Field processed = subTargetField;
Expand All @@ -177,9 +179,11 @@ public Audits processPreview(Mapping mapping) throws AtlasException {
}
}
if (session.hasErrors()) {
session.getAudits().getAudit().addAll(session.head().getAudits());
return session.getAudits();
}
if (!convertSourceToTarget(session, session.head().getSourceField(), targetField)) {
session.getAudits().getAudit().addAll(session.head().getAudits());
return session.getAudits();
}
Field processed = targetField;
Expand All @@ -193,6 +197,7 @@ public Audits processPreview(Mapping mapping) throws AtlasException {
targetField = targetFields.get(0);
Field combined = processCombineField(session, cloned, sourceFields, targetField);
if (!convertSourceToTarget(session, combined, targetField)) {
session.getAudits().getAudit().addAll(session.head().getAudits());
return session.getAudits();
}
applyFieldActions(session, targetField);
Expand All @@ -208,9 +213,11 @@ public Audits processPreview(Mapping mapping) throws AtlasException {
if (LOG.isDebugEnabled()) {
LOG.error("", e);
}
session.getAudits().getAudit().addAll(session.head().getAudits());
return session.getAudits();
}
if (separatedFields == null) {
session.getAudits().getAudit().addAll(session.head().getAudits());
return session.getAudits();
}
for (Field f : targetFields) {
Expand Down Expand Up @@ -241,6 +248,7 @@ public Audits processPreview(Mapping mapping) throws AtlasException {
}
mapping.getOutputField().clear();
mapping.getOutputField().addAll(cloned.getOutputField());
session.getAudits().getAudit().addAll(session.head().getAudits());
return session.getAudits();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import org.slf4j.LoggerFactory;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

import io.atlasmap.csv.core.CsvConfig;
import io.atlasmap.csv.core.CsvFieldReader;
Expand Down Expand Up @@ -97,6 +98,9 @@ public Response inspect(InputStream request, @QueryParam("format") String format

CsvInspectionResponse response = new CsvInspectionResponse();
try {
if (LOG.isDebugEnabled()) {
LOG.debug("Options: delimiter={}, firstRecordAsHeader={}", delimiter, firstRecordAsHeader);
}
CsvConfig csvConfig = new CsvConfig(format);
if (delimiter != null) {
csvConfig.setDelimiter(delimiter.charAt(0));
Expand Down Expand Up @@ -134,6 +138,9 @@ public Response inspect(InputStream request, @QueryParam("format") String format
response.setExecutionTime(System.currentTimeMillis() - startTime);
}

if (LOG.isDebugEnabled()) {
LOG.debug(("Response: {}" + new ObjectMapper().writeValueAsString(response)));
}
return Response.ok().entity(toJson(response)).build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,23 @@ public void testSchemaNoParametersSpecified() throws Exception {
assertEquals("2", fields.get(2).getName());
}

@Test
public void testSchemaFile() throws Exception {
InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("test.csv");

Response res = csvService.inspect(inputStream, null, ",", true, null, null,
null, null, null, null, null, null,
null, null, null);
Object entity = res.getEntity();
assertEquals(byte[].class, entity.getClass());
CsvInspectionResponse csvInspectionResponse = Json.mapper().readValue((byte[])entity, CsvInspectionResponse.class);
CsvComplexType complexType = (CsvComplexType) csvInspectionResponse.getCsvDocument().getFields().getField().get(0);
List<CsvField> fields = complexType.getCsvFields().getCsvField();
assertEquals(5, fields.size());
assertEquals("sourceCsvString", fields.get(0).getName());
assertEquals("sourceCsvNumber", fields.get(1).getName());
assertEquals("sourceCsvDecimal", fields.get(2).getName());
assertEquals("sourceCsvDate", fields.get(3).getName());
assertEquals("sourceCsvBoolean", fields.get(4).getName());
}
}
7 changes: 7 additions & 0 deletions lib/modules/csv/service/src/test/resources/test.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
sourceCsvString,sourceCsvNumber,sourceCsvDecimal,sourceCsvDate,sourceCsvBoolean
csv0,0,0.0,1989-05-05,true
csv1,10,10.0,1989-05-05,true
csv2,20,20.0,1989-05-05,true
csv3,30,30.0,1989-05-05,false
csv4,40,40.0,1989-05-05,false

Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLClassLoader;
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Enumeration;
Expand Down Expand Up @@ -85,13 +86,26 @@ public void addJarFromStream(InputStream is) throws Exception {
reload();
}

public void clearLibaries() {
public void clearLibraries() {
if (this.urlClassLoader != null) {
try {
this.urlClassLoader.close();
} catch (Exception e) {
LOG.warn("Ignoring an error while closing an old URLClassLoader: {}", e.getMessage());
}
this.urlClassLoader = null;
}

File[] files = saveDir.listFiles();
if (!saveDir.exists() || !saveDir.isDirectory() || files == null) {
return;
}
for (File f : saveDir.listFiles()) {
f.delete();
try {
Files.delete(f.toPath());
} catch (Exception e) {
LOG.warn("Failed to remove jar file: '{}'", e.getMessage());
};
}
reload();
}
Expand Down
Loading