---
apiVersion: v1
kind: ConfigMap
metadata:
  labels:
    funktion.fabric8.io/kind: Connector
  name: dozer
data:
  deployment.yml: |
    ---
    apiVersion: extensions/v1beta1
    kind: Deployment
    metadata:
      labels:
        funktion.fabric8.io/kind: Subscription
        connector: dozer
    spec:
      replicas: 1
      template:
        metadata:
          labels:
            funktion.fabric8.io/kind: Subscription
            connector: dozer
        spec:
          containers:
          - image: funktion/connector-dozer:${project.version}
            name: connector
  schema.yml: |
    ---
    component:
      kind: component
      scheme: dozer
      syntax: dozer:name
      title: Dozer
      description: The dozer component provides the ability to map between Java beans using the Dozer mapping library.
      label: transformation
      deprecated: false
      async: false
      producerOnly: true
      javaType: org.apache.camel.component.dozer.DozerComponent
      groupId: org.apache.camel
      artifactId: camel-dozer
      version: 2.18.3
    componentProperties: {}
    properties:
      name:
        kind: path
        group: producer
        required: true
        type: string
        javaType: java.lang.String
        deprecated: false
        secret: false
        description: A human readable name of the mapping.
        order: 0
      mappingConfiguration:
        kind: parameter
        group: producer
        type: object
        javaType: org.apache.camel.converter.dozer.DozerBeanMapperConfiguration
        deprecated: false
        secret: false
        description: The name of a DozerBeanMapperConfiguration bean in the Camel registry which should be used for configuring the Dozer mapping. This is an alternative to the mappingFile option that can be used for fine-grained control over how Dozer is configured. Remember to use a prefix in the value to indicate that the bean is in the Camel registry (e.g. myDozerConfig).
        order: 1
      mappingFile:
        kind: parameter
        group: producer
        type: string
        javaType: java.lang.String
        deprecated: false
        secret: false
        defaultValue: dozerBeanMapping.xml
        description: 'The location of a Dozer configuration file. The file is loaded from
          the classpath by default but you can use file: classpath: or http: to load the
          configuration from a specific location.'
        order: 2
      marshalId:
        kind: parameter
        group: producer
        type: string
        javaType: java.lang.String
        deprecated: false
        secret: false
        description: The id of a dataFormat defined within the Camel Context to use for marshalling the mapping output to a non-Java type.
        order: 3
      sourceModel:
        kind: parameter
        group: producer
        type: string
        javaType: java.lang.String
        deprecated: false
        secret: false
        description: Fully-qualified class name for the source type used in the mapping. If specified the input to the mapping is converted to the specified type before being mapped with Dozer.
        order: 4
      targetModel:
        kind: parameter
        group: producer
        required: true
        type: string
        javaType: java.lang.String
        deprecated: false
        secret: false
        description: Fully-qualified class name for the target type used in the mapping.
        order: 5
      unmarshalId:
        kind: parameter
        group: producer
        type: string
        javaType: java.lang.String
        deprecated: false
        secret: false
        description: The id of a dataFormat defined within the Camel Context to use for unmarshalling the mapping input from a non-Java type.
        order: 6
      synchronous:
        kind: parameter
        group: advanced
        label: advanced
        type: boolean
        javaType: boolean
        deprecated: false
        secret: false
        defaultValue: false
        description: Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported).
        order: 7
  documentation.adoc: "[[Dozer-Dozer]]\nDozer\n~~~~~\n\nThe\_*dozer:*\_component provides\
    \ the ability to map between Java beans\nusing the http://camel.apache.org/dozer-type-conversion.html[Dozer]\n\
    mapping framework since *Camel 2.15.0*. \_Camel also supports the ability\nto\
    \ trigger Dozer mappings\nhttp://camel.apache.org/dozer-type-conversion.html[as\
    \ a type converter].\n\_The primary differences between using a Dozer endpoint\
    \ and a Dozer\nconverter are:\n\n* The ability to manage Dozer mapping configuration\
    \ on a per-endpoint\nbasis vs. global configuration via the converter registry.\n\
    * A Dozer endpoint can be configured to marshal/unmarshal input and\noutput data\
    \ using Camel data formats to support a single, any-to-any\ntransformation endpoint\n\
    * The Dozer component allows for fine-grained integration and extension\nof Dozer\
    \ to support additional functionality (e.g. mapping literal\nvalues, using expressions\
    \ for mappings, etc.).\n\nIn order to use the Dozer component, Maven users will\
    \ need to add the\nfollowing dependency to their\_`pom.xml`:\n\n[source,xml]\n\
    ------------------------------------------------------------\n<dependency>\n \
    \   <groupId>org.apache.camel</groupId>\n    <artifactId>camel-dozer</artifactId>\n\
    \    <version>x.x.x</version>\n    <!-- use the same version as your Camel core\
    \ version -->\n</dependency>\n------------------------------------------------------------\n\
    \n[[Dozer-URIformat]]\nURI format\n^^^^^^^^^^\n\nThe Dozer component only supports\
    \ producer endpoints.\n\n[source,java]\n--------------------------\ndozer:endpointId[?options]\n\
    --------------------------\n\nWhere\_*endpointId*\_is a name used to uniquely\
    \ identify the Dozer\nendpoint configuration.\_\n\nAn example Dozer endpoint URI:\n\
    \n[source,java]\n---------------------------------------------------------------------------------------\n\
    from(\"direct:orderInput\").\n  to(\"dozer:transformOrder?mappingFile=orderMapping.xml&targetModel=example.XYZOrder\"\
    ).\n  to(\"direct:orderOutput\");\n---------------------------------------------------------------------------------------\n\
    \n[[Dozer-Options]]\nOptions\n^^^^^^^\n\n// component options: START\nThe Dozer\
    \ component has no options.\n// component options: END\n\n// endpoint options:\
    \ START\nThe Dozer component supports 8 endpoint options which are listed below:\n\
    \n{% raw %}\n[width=\"100%\",cols=\"2,1,1m,1m,5\",options=\"header\"]\n|=======================================================================\n\
    | Name | Group | Default | Java Type | Description\n| name | producer |  | String\
    \ | *Required* A human readable name of the mapping.\n| mappingConfiguration |\
    \ producer |  | DozerBeanMapperConfiguration | The name of a DozerBeanMapperConfiguration\
    \ bean in the Camel registry which should be used for configuring the Dozer mapping.\
    \ This is an alternative to the mappingFile option that can be used for fine-grained\
    \ control over how Dozer is configured. Remember to use a prefix in the value\
    \ to indicate that the bean is in the Camel registry (e.g. myDozerConfig).\n|\
    \ mappingFile | producer | dozerBeanMapping.xml | String | The location of a Dozer\
    \ configuration file. The file is loaded from the classpath by default but you\
    \ can use file: classpath: or http: to load the configuration from a specific\
    \ location.\n| marshalId | producer |  | String | The id of a dataFormat defined\
    \ within the Camel Context to use for marshalling the mapping output to a non-Java\
    \ type.\n| sourceModel | producer |  | String | Fully-qualified class name for\
    \ the source type used in the mapping. If specified the input to the mapping is\
    \ converted to the specified type before being mapped with Dozer.\n| targetModel\
    \ | producer |  | String | *Required* Fully-qualified class name for the target\
    \ type used in the mapping.\n| unmarshalId | producer |  | String | The id of\
    \ a dataFormat defined within the Camel Context to use for unmarshalling the mapping\
    \ input from a non-Java type.\n| synchronous | advanced | false | boolean | Sets\
    \ whether synchronous processing should be strictly used or Camel is allowed to\
    \ use asynchronous processing (if supported).\n|=======================================================================\n\
    {% endraw %}\n// endpoint options: END\n\n[[Dozer-UsingDataFormatswithDozer]]\n\
    Using Data Formats with Dozer\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nDozer does not\
    \ support non-Java sources and targets for mappings, so it\ncannot, for example,\
    \ map an XML document to a Java object on its own.\n\_Luckily, Camel has extensive\
    \ support for marshalling between Java and a\nwide variety of formats using\n\
    http://camel.apache.org/data-format.html[data formats]. \_The Dozer\ncomponent\
    \ takes advantage of this support by allowing you to specify\nthat input and output\
    \ data should be passed through a data format prior\nto processing via Dozer.\
    \ \_You can always do this on your own outside the\ncall to Dozer, but supporting\
    \ it directly in the Dozer component allows\nyou to use a single endpoints to\
    \ configure any-to-any transformation\nwithin Camel.\n\nAs an example, let's say\
    \ you wanted to map between an XML data structure\nand a JSON data structure using\
    \ the Dozer component. \_If you had the\nfollowing data formats defined in a Camel\
    \ Context:\n\n[source,xml]\n-----------------------------------------------\n\
    <dataFormats>\n  <json library=\"Jackson\" id=\"myjson\"/>\n  <jaxb contextPath=\"\
    org.example\" id=\"myjaxb\"/>\n</dataFormats>\n-----------------------------------------------\n\
    \nYou could then configure a Dozer endpoint to unmarshal the input XML\nusing\
    \ a JAXB data format and marshal the mapping output using Jackson.\n\n[source,xml]\n\
    ----------------------------------------------------------------------------------------------------------\n\
    <endpoint uri=\"dozer:xml2json?marshalId=myjson&amp;unmarshalId=myjaxb&amp;targetModel=org.example.Order\"\
    />\n----------------------------------------------------------------------------------------------------------\n\
    \n[[Dozer-ConfiguringDozer]]\nConfiguring Dozer\n^^^^^^^^^^^^^^^^^\n\nAll Dozer\
    \ endpoints require a Dozer mapping configuration file which\ndefines mappings\
    \ between source and target objects. \_The component will\ndefault to a location\
    \ of META-INF/dozerBeanMapping.xml if the\nmappingFile or mappingConfiguration\
    \ options are not specified on an\nendpoint. \_If you need to supply multiple\
    \ mapping configuration files\nfor a single endpoint or specify additional configuration\
    \ options (e.g.\nevent listeners, custom converters, etc.), then you can use an\
    \ instance\nof\_`org.apache.camel.converter.dozer.DozerBeanMapperConfiguration`.\n\
    \n[source,xml]\n------------------------------------------------------------------------------------------\n\
    <bean id=\"mapper\" class=\"org.apache.camel.converter.dozer.DozerBeanMapperConfiguration\"\
    > \_\n  <property name=\"mappingFiles\">\n    <list>\n      <value>mapping1.xml</value>\n\
    \      <value>mapping2.xml</value>\n    </list>\n  </property>\n</bean>\n------------------------------------------------------------------------------------------\n\
    \n[[Dozer-MappingExtensions]]\nMapping Extensions\n^^^^^^^^^^^^^^^^^^\n\nThe Dozer\
    \ component implements a number of extensions to the Dozer\nmapping framework\
    \ as custom converters. \_These converters implement\nmapping functions that are\
    \ not supported directly by Dozer itself.\n\n[[Dozer-VariableMappings]]\nVariable\
    \ Mappings\n+++++++++++++++++\n\nVariable mappings allow you to map the value\
    \ of a variable definition\nwithin a Dozer configuration into a target field instead\
    \ of using the\nvalue of a source field. \_This is equivalent to constant mapping\
    \ in\nother mapping frameworks, where can you assign a literal value to a\ntarget\
    \ field. \_To use a variable mapping, simply define a variable\nwithin your mapping\
    \ configuration and then map from the VariableMapper\nclass into your target field\
    \ of choice:\n\n[source,xml]\n--------------------------------------------------------------------------------------------------------\n\
    <mappings\_xmlns=\"http://dozer.sourceforge.net\"\_\n  xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\
    \n  xsi:schemaLocation=\"http://dozer.sourceforge.net http://dozer.sourceforge.net/schema/beanmapping.xsd\"\
    >\n  <configuration>\n    <variables>\n      <variable name=\"CUST_ID\">ACME-SALES</variable>\n\
    \    </variables>\n  </configuration>\n  <mapping>\n    <class-a>org.apache.camel.component.dozer.VariableMapper</class-a>\n\
    \    <class-b>org.example.Order</class-b>\n    <field custom-converter-id=\"_variableMapping\"\
    \ custom-converter-param=\"${CUST_ID}\">\n      <a>literal</a>\n      <b>custId</b>\n\
    \    </field>\n  </mapping>\n</mappings>\n--------------------------------------------------------------------------------------------------------\n\
    \n[[Dozer-CustomMappings]]\nCustom Mappings\n+++++++++++++++\n\nCustom mappings\
    \ allow you to define your own logic for how a source\nfield is mapped to a target\
    \ field. \_They are similar in function to\nDozer customer converters, with two\
    \ notable differences:\n\n* You can have multiple converter methods in a single\
    \ class with custom\nmappings.\n* There is no requirement to implement a Dozer-specific\
    \ interface with\ncustom mappings.\n\nA custom mapping is declared by using the\
    \ built-in '_customMapping'\nconverter in your mapping configuration. \_The parameter\
    \ to this\nconverter has the following syntax:\n\n[source,shell]\n--------------------------\n\
    [class-name][,method-name]\n--------------------------\n\nMethod name is optional\
    \ - the Dozer component will search for a method\nthat matches the input and output\
    \ types required for a mapping. \_An\nexample custom mapping and configuration\
    \ are provided below.\n\n[source,java]\n--------------------------------------------------\n\
    public class CustomMapper {\n    // All customer ids must be wrapped in \"[ ]\"\
    \n    public Object mapCustomer(String customerId) {\n        return \"[\" + customerId\
    \ + \"]\";\n    }\n}\_\n--------------------------------------------------\n\n\
    [source,xml]\n--------------------------------------------------------------------------------------------------------\n\
    <mappings\_xmlns=\"http://dozer.sourceforge.net\"\_\n  xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\
    \n  xsi:schemaLocation=\"http://dozer.sourceforge.net http://dozer.sourceforge.net/schema/beanmapping.xsd\"\
    >\n  <mapping>\n    <class-a>org.example.A</class-a>\n    <class-b>org.example.B</class-b>\n\
    \    <field custom-converter-id=\"_customMapping\" \n        custom-converter-param=\"\
    org.example.CustomMapper,mapCustomer\">\n      <a>header.customerNum</a>\n   \
    \   <b>custId</b>\n    </field>\n  </mapping>\n</mappings>\n--------------------------------------------------------------------------------------------------------\n\
    \n[[Dozer-ExpressionMappings]]\nExpression Mappings\n+++++++++++++++++++\n\nExpression\
    \ mappings allow you to use the powerful\nhttp://camel.apache.org/languages.html[language]\
    \ capabilities of Camel\nto evaluate an expression and assign the result to a\
    \ target field in a\nmapping. \_Any language that Camel supports can be used in\
    \ an expression\nmapping. \_Basic examples of expressions include the ability\
    \ to map a\nCamel message header or exchange property to a target field or to\n\
    concatenate multiple source fields into a target field. \_The syntax of a\nmapping\
    \ expression is:\n\n[source,shell]\n----------------------- \n[language]:[expression]\n\
    -----------------------\n\nAn example of mapping a message header into a target\
    \ field:\n\n[source,xml]\n--------------------------------------------------------------------------------------------------------------\n\
    <mappings\_xmlns=\"http://dozer.sourceforge.net\"\_\n  xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\
    \n  xsi:schemaLocation=\"http://dozer.sourceforge.net http://dozer.sourceforge.net/schema/beanmapping.xsd\"\
    >\n  <mapping>\n    <class-a>org.apache.camel.component.dozer.ExpressionMapper</class-a>\n\
    \    <class-b>org.example.B</class-b>\n    <field custom-converter-id=\"_expressionMapping\"\
    \ custom-converter-param=\"simple:\\${header.customerNumber}\">\n      <a>expression</a>\n\
    \      <b>custId</b>\n    </field>\n  </mapping>\n</mappings>\n--------------------------------------------------------------------------------------------------------------\n\
    \nNote that any properties within your expression must be escaped with \"\\\"\n\
    to prevent an error when Dozer attempts to resolve variable values\ndefined using\
    \ the EL.\n\n"
