Git Product home page Git Product logo

atlasmap's People

Contributors

abbassfaytaroony avatar abkieling avatar apupier avatar chirino avatar christophd avatar cunningt avatar deeleman avatar dependabot-preview[bot] avatar dependabot[bot] avatar fusesource-ci avatar gashcrumb avatar glassfishrobot avatar igarashitm avatar jbakermd avatar joeylimd avatar johnpoth avatar jpav avatar maximegris avatar mcoker avatar mmelko avatar pure-bot[bot] avatar rhuss avatar riccardo-forina avatar rkorytkowski avatar rohanmars avatar seanforyou23 avatar tovacohen avatar tplevko avatar zbendhiba avatar zregvart avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

atlasmap's Issues

[Design] AtlasGroupStrategy

Part of epic #248

@mattrpav 2017-09-27 enhancement

Discussed w/ the team the idea of an AtlasGroupStrategy that would be a pre-cursor to conditional logic, expressions and advanced Field Actions (including Math related on non-Collections).

The GroupStrategy would collect source values and have a FieldGroup collection of sorts to pass to FieldActions that support FieldGroup as an input would be responsible for creating the single value output.

Another thought was that the CombineStrategy could be converted to a Group-of-Field field Action and then deprecate the CombineStrategy in the engine.

The UI could then still have a first class mapping action called 'Combine', that would create a group strategy and apply a combine field action

Add TemplateCombineStrategy

Part of epic #248

@igarashitm 2017-10-03 enhancement
  • MappingType: COMBINE
  • Source field: some Strings, like
{
  "firstname": "foo",
  "lastname": "bar",
  "phone": "111-111-1111"
}
  • Target field: String
  • User input to the field action: "You have a message from ${firstname} ${lastname}, call ${phone}."
  • Expected output: "You have a message from foo bar, call 111-111-1111."

FieldAction name would be 'template' or something.

Add format detection (XML/JSON) on AtlasMappingService

@igarashitm 2017-08-09

Right now it requires AtlasMappingFormat as an parameter on loadMapping() and saveMappingAsFile(), but it would be better to let AtlasMappingService detect the format so that the invoker doesn't have to worry about the format. If it's File/URL/URI then it's easy to detect from file extension, but if it's Stream/Reader then it has to read the content and check if there's "<" or "{". Also it needs to consider about the character encoding.

Update BYTE conversion behavior

@igarashitm commented on Wed Nov 08 2017

It looks Byte related converters are all marked as UNSUPPORTED but shouldn't be, easy to implement. Also NUMBER type conversion must be provided OOTB as it often appears in the JSON schema.

BYTE -> Short
BYTE -> String (string representation of the number)
...

-127 to 127
Int, Short, Long -> BYTE (range concern)
String -> BYTE (range concern and type concern)
Decimal -> BYTE (precision concern.. if 1.2 comes in as a source value throw an exception)

Add runtime tests

@igarashitm 2017-10-09 housekeeping

I have hit/fixed several bugs caused by the lack of dependency specific to the runtime. They should have been detected by the tests. Introduce runtime tests which run atlasmap spring-boot runtime and test if all the services are working properly, including each modules.

Add logging dependency or split out json handling of atlas-model module

@mattrpav 2017-07-07 housekeeping

The atlas-model module includes Jackson JsonDeserializer and JsonSerializer classes for prettifying AtlasMapping json definitions to provide type-free, extensible field action support while maintaining a DSL-like syntax in JSON (say that 10x fast).

In doing so, there is no mechanism to output unsupported or type-o'd field action names. For example, if someone has "puppercase" instead of "Uppercase" in the json, we quietly skip over and continue on.

Option 1: Add slf4j dependency to the model class module

Option 2: Break off the ActionsJsonDeserializer, ActionsJsonSerializer, AtlasJsonModule and AtlasJsonMapper classes to a separate module

"outputField" : [ {
"jsonType" : "io.atlasmap.v2.MockField",
"actions" : [ {
"Uppercase" : null
}, {
"Lowercase" : null
}, {
"SubString" : {
"startIndex" : 2,
"endIndex" : 5
}
}, {
"SubStringAfter" : {
"match" : "a",
"startIndex" : 2,
"endIndex" : 5
}
}, {
"SubStringBefore" : {
"match" : "z",
"startIndex" : 2,
"endIndex" : 5
}
} ],
"value" : "map-output-value",
"fieldType" : "STRING",
"name" : "map-output"
} ]

Support $ref ahead of embedded definition in JSON schema inspection

@igarashitm 2017-09-07 enhancement

In following JSON schema 'ref'-c' refers 'urn:d' before it's defined in schema, which is not supported for JSON schema inspection today.

{
    "$schema": "http://json-schema.org/schema#",
    "type": "object",
    "properties": {
        "ref-a": { "$ref": "urn:a" },
        "ref-b": { "$ref": "urn:b" },
        "ref-c": { "$ref": "urn:d" },
        "def-d": {
            "$id": "urn:d",
            "type": "object",
            "properties": {
                "str-d": { "type": "string" }
            }
        }
....

As long as it's defined in definitions section, order doesn't matter. It's a problem only on a embedded definition.

Update Java inspection to use "@" prefix on field members

@mattrpav 2017-07-24 enhancement

Java class inspection edge case - field and setter/getter conflict

Scenario:

  1. Java class contains an int field named "myInt" with no getter/setter operating on an Integer/int type
  2. Java class contains methods named String getMyInt()/setMyInt(String myInt)
  3. Need a merge strategy when there are two potential AtlasMap "Fields" that have the same name

Note: An approach could be to use "@" to indicate field vs method

ie..

/Address/@street <-- Java field
/Address/street <-- Java get/set method

Advanced use case:
Extended class implements same field as super class

Result, 2 field definitions:

  • /Address/@street <-- Class
  • /Address/@street?fieldIsSuperClass=true . <-- SuperClass

Cleanup directory structure

Right now the directory names for the runtime is a bit verbose. It doesn't have to be same with maven module name. For example atlas-api could be just api, and atlas-{java,json,xml}-parent could be just java, json, xml. Modules could be even moved into modules subdir without changing maven hierarcy.

Support `oneOf` `anyOf` `allOf` in JSON schema and `xs:choice` in XML schema

xref: https://issues.redhat.com/browse/ENTESB-12408

We would be able to:

  • UI
    • Show everything wrapped with those rules
    • Show some decoration for the rule
  • Runtime
    • Error out if source document violates the rule
    • Error out if target document outcome violates those rule as a result of whole mappings
      But we can't determine if it violates the rule until we get source document instances and process mappings.

An example from camel-salesforce here

{
  "type": "object",
  "id": "urn:jsonschema:org:apache:camel:component:salesforce:dto",
  "$schema": "http://json-schema.org/draft-04/schema#",
  "oneOf": [
    {
      "id": "urn:jsonschema:org:apache:camel:component:salesforce:dto:QueryRecordsMerchandise__c",
      "properties": {
        "done": {
          "type": "boolean"
        },
        "totalSize": {
          "type": "integer"
        },
        "nextRecordsUrl": {
          "type": "string"
        },
        "records": {
          "type": "array",
          "required": true,
          "items": {
            "type": "object",
            "$ref": "urn:jsonschema:org:apache:camel:component:salesforce:dto:Merchandise__c"
          }
        }
      }
    },
    {
      "id": "urn:jsonschema:org:apache:camel:component:salesforce:dto:Merchandise__c",
      "title": "Merchandise",
      "properties": {
        "Id": {
          "type": "string",
          "required": true,
          "readonly": true,
          "title": "Record ID"
        },
        "OwnerId": {
          "type": "string",
          "required": true,
          "readonly": false,
          "title": "Owner ID"
        },
        "IsDeleted": {
          "type": "boolean",
          "required": true,
          "readonly": true,
          "title": "Deleted"
        },
        "Name": {
          "type": "string",
          "readonly": false,
          "title": "Merchandise Name"
        },
        "CreatedDate": {
          "type": "string",
          "required": true,
          "readonly": true,
          "title": "Created Date",
          "format": "date-time"
        },
        "CreatedById": {
          "type": "string",
          "required": true,
          "readonly": true,
          "title": "Created By ID"
        },
        "LastModifiedDate": {
          "type": "string",
          "required": true,
          "readonly": true,
          "title": "Last Modified Date",
          "format": "date-time"
        },
        "LastModifiedById": {
          "type": "string",
          "required": true,
          "readonly": true,
          "title": "Last Modified By ID"
        },
        "SystemModstamp": {
          "type": "string",
          "required": true,
          "readonly": true,
          "title": "System Modstamp",
          "format": "date-time"
        },
        "LastActivityDate": {
          "type": "string",
          "readonly": true,
          "title": "Last Activity Date",
          "format": "date-time"
        },
        "LastViewedDate": {
          "type": "string",
          "readonly": true,
          "title": "Last Viewed Date",
          "format": "date-time"
        },
        "LastReferencedDate": {
          "type": "string",
          "readonly": true,
          "title": "Last Referenced Date",
          "format": "date-time"
        },
        "Description__c": {
          "type": "string",
          "readonly": false,
          "title": "Description"
        },
        "Price__c": {
          "type": "number",
          "required": true,
          "readonly": false,
          "title": "Price"
        },
        "Total_Inventory__c": {
          "type": "number",
          "required": true,
          "readonly": false,
          "title": "Total_Inventory"
        }
      }
    }
  ]
}

OSGi compatibility tasks

@mattrpav 2017-07-12
  • Update Class.forName() references to specify class loaders
  • Test installation and bundle wiring in an OSGi runtime (such as Karaf)
  • Write an integration test that confirms data processing in Karaf or other OSGi runtime

Pass through character encoding / locale info on data sources.

@jbakermd 2017-07-20 enhancement

Character encoding / locale information needs to be added to inspection and mapping.

Add the following two properties:

  • characterEncoding (string)
  • locale (string)

To the following classes:

  • io.atlasmap.v2.Document (json/xml inspection)
  • io.atlasmap.java.v2.JavaClass (java inspection)
  • io.atlasmap.v2.DataSource (mapping data source info pass through)

Please cc me when this is finished so I can test it on the UI.

Related ticket: #70

Support for InputStreams in input

@zregvart 2017-10-02 enhancement

Currently there is only support for String in the input of JSON and XML modules, we should support InputStream as input.

See XmlModule.java#L167-L171 and JsonModule.java#L145-L150.

When `InputStream` is specified in the input the following exception is thrown: ``` io.atlasmap.api.AtlasException: Unsupported input object type=io.atlasmap.json.v2.JsonComplexType at org.apache.camel.component.atlasmap.AtlasEndpoint.onExchange(AtlasEndpoint.java:209) at org.apache.camel.impl.ProcessorEndpoint$1.process(ProcessorEndpoint.java:71) at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61) at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:148) at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:548) at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201) at org.apache.camel.processor.Pipeline.process(Pipeline.java:120) at org.apache.camel.processor.Pipeline.process(Pipeline.java:83) at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:110) at org.apache.camel.component.connector.ConnectorConsumerProcessor.process(ConnectorConsumerProcessor.java:66) at org.apache.camel.component.salesforce.SalesforceConsumer.processMessage(SalesforceConsumer.java:194) ... 35 common frames omitted ```

Allow default implementation for abstract target field

@igarashitm 2017-10-15 enhancement

Right now Java field writer only supports concrete class which can be instantiated via no-arg constructor. See createObject() in this class:
https://github.com/atlasmap/atlasmap-runtime/blob/master/atlas-java-parent/atlas-java-module/src/main/java/io/atlasmap/java/module/DocumentJavaFieldWriter.java

One option is to feed a mapping between interface/abstract types and default impl classes from configuration or something.
java.util.List : java.util.ArrayList
java.util.Map : java.util.HashMap
...

And it also should be configurable from mapping file so that the user can define their own types.

Need empty v null config flag for all formats

@mattrpav 2017-07-26
  1. When specifying a mapped field in Xml, an empty element may be interpreted as ""
    ie. The desired behavior of the value may be "" or null
  2. We need a config option in order to tell XmlFieldReader what to do
  3. The issue crops up w/ Xml to Json where the "" fields are being written : { myField: "" }

AtlasService.converterCheck() contains incomplete code

@jpav commented on Thu Nov 02 2017

Code near the end of the method that determines whether a response should be generated indicating a converter is needed to perform a mapping has been left incomplete. We should determine the necessity of this code and either complete its implementation or remove it from the class.


@igarashitm commented on Thu Nov 02 2017

Weird thing is that we sometimes see "converter is not available" warning in UI. I thought it came from this converterCheck. Need to investigate.


@igarashitm commented on Wed Nov 08 2017

I now suspect the converterCheck is not used at all. All the converter validation results I have ever seen come from validate. Make sure UI doesn't invoke it and remove.

Increate unit test coverage of atlas-core

@mattrpav commented on Wed Jul 19 2017

  • DefaultAtlasCombineStrategy (100%)

  • DefaultAtlasContext

  • DefaultAtlasContextFactory

  • DefaultAtlasConversionService (74%)

  • DefaultAtlasPropertyStrategy (84%)

  • DefaultAtlasSeparateStrategy (100%)

  • DefaultAtlasSession (100%)

  • DefaultAtlasValidationService (88%)

  • StringDelimiter (86%)

  • io.atlasmap.actions (85%)

  • io.atlasmap.converters (99%)

  • io.atlasmap.validators (70%)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.