---
apiVersion: v1
kind: ConfigMap
metadata:
  labels:
    funktion.fabric8.io/kind: Connector
  name: cmis
data:
  deployment.yml: |
    ---
    apiVersion: extensions/v1beta1
    kind: Deployment
    metadata:
      labels:
        funktion.fabric8.io/kind: Subscription
        connector: cmis
    spec:
      replicas: 1
      template:
        metadata:
          labels:
            funktion.fabric8.io/kind: Subscription
            connector: cmis
        spec:
          containers:
          - image: funktion/connector-cmis:${project.version}
            name: connector
  schema.yml: |
    ---
    component:
      kind: component
      scheme: cmis
      syntax: cmis:cmsUrl
      title: CMIS
      description: The cmis component uses the Apache Chemistry client API and allows you to add/read nodes to/from a CMIS compliant content repositories.
      label: cms,database
      deprecated: false
      async: false
      javaType: org.apache.camel.component.cmis.CMISComponent
      groupId: org.apache.camel
      artifactId: camel-cmis
      version: 2.18.3
    componentProperties:
      sessionFacadeFactory:
        kind: property
        type: object
        javaType: org.apache.camel.component.cmis.CMISSessionFacadeFactory
        deprecated: false
        secret: false
        description: To use a custom CMISSessionFacadeFactory to create the CMISSessionFacade instances
        order: 0
    properties:
      cmsUrl:
        kind: path
        group: common
        required: true
        type: string
        javaType: java.lang.String
        deprecated: false
        secret: false
        description: URL to the cmis repository
        order: 0
      pageSize:
        kind: parameter
        group: common
        type: integer
        javaType: int
        deprecated: false
        secret: false
        defaultValue: "100"
        description: Number of nodes to retrieve per page
        order: 1
      readContent:
        kind: parameter
        group: common
        type: boolean
        javaType: boolean
        deprecated: false
        secret: false
        defaultValue: false
        description: If set to true the content of document node will be retrieved in addition to the properties
        order: 2
      readCount:
        kind: parameter
        group: common
        type: integer
        javaType: int
        deprecated: false
        secret: false
        description: Max number of nodes to read
        order: 3
      repositoryId:
        kind: parameter
        group: common
        type: string
        javaType: java.lang.String
        deprecated: false
        secret: false
        description: The Id of the repository to use. If not specified the first available repository is used
        order: 4
      bridgeErrorHandler:
        kind: parameter
        group: consumer
        label: consumer
        type: boolean
        javaType: boolean
        optionalPrefix: consumer.
        deprecated: false
        secret: false
        defaultValue: false
        description: Allows for bridging the consumer to the Camel routing Error Handler which mean any exceptions occurred while the consumer is trying to pickup incoming messages or the likes will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions that will be logged at WARN/ERROR level and ignored.
        order: 5
      query:
        kind: parameter
        group: consumer
        label: consumer
        type: string
        javaType: java.lang.String
        deprecated: false
        secret: false
        description: The cmis query to execute against the repository. If not specified the consumer will retrieve every node from the content repository by iterating the content tree recursively
        order: 6
      exceptionHandler:
        kind: parameter
        group: consumer (advanced)
        label: consumer,advanced
        type: object
        javaType: org.apache.camel.spi.ExceptionHandler
        optionalPrefix: consumer.
        deprecated: false
        secret: false
        description: To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions that will be logged at WARN/ERROR level and ignored.
        order: 7
      exchangePattern:
        kind: parameter
        group: consumer (advanced)
        label: consumer,advanced
        type: string
        javaType: org.apache.camel.ExchangePattern
        enum:
        - InOnly
        - RobustInOnly
        - InOut
        - InOptionalOut
        - OutOnly
        - RobustOutOnly
        - OutIn
        - OutOptionalIn
        deprecated: false
        secret: false
        description: Sets the exchange pattern when the consumer creates an exchange.
        order: 8
      queryMode:
        kind: parameter
        group: producer
        label: producer
        type: boolean
        javaType: boolean
        deprecated: false
        secret: false
        defaultValue: false
        description: If true will execute the cmis query from the message body and return result otherwise will create a node in the cmis repository
        order: 9
      sessionFacadeFactory:
        kind: parameter
        group: advanced
        label: advanced
        type: object
        javaType: org.apache.camel.component.cmis.CMISSessionFacadeFactory
        deprecated: false
        secret: false
        description: To use a custom CMISSessionFacadeFactory to create the CMISSessionFacade instances
        order: 10
      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: 11
      password:
        kind: parameter
        group: security
        label: security
        type: string
        javaType: java.lang.String
        deprecated: false
        secret: true
        description: Password for the cmis repository
        order: 12
      username:
        kind: parameter
        group: security
        label: security
        type: string
        javaType: java.lang.String
        deprecated: false
        secret: true
        description: Username for the cmis repository
        order: 13
  documentation.adoc: |+
    [[CMIS-CMISComponent]]
    CMIS Component
    ~~~~~~~~~~~~~~

    *Available as of Camel 2.11* +
     The cmis component uses the
    http://chemistry.apache.org/java/opencmis.html[Apache Chemistry] client
    API and allows you to add/read nodes to/from a CMIS compliant content
    repositories.

    [[CMIS-URIFormat]]
    URI Format
    ^^^^^^^^^^

    [source,java]
    ------------------------------
    cmis://cmisServerUrl[?options]
    ------------------------------

    You can append query options to the URI in the following format,
    ?options=value&option2=value&...

    [[CMIS-URIOptions]]
    CMIS Options
    ^^^^^^^^^^^^


    // component options: START
    The CMIS component supports 1 options which are listed below.



    {% raw %}
    [width="100%",cols="2,1m,7",options="header"]
    |=======================================================================
    | Name | Java Type | Description
    | sessionFacadeFactory | CMISSessionFacadeFactory | To use a custom CMISSessionFacadeFactory to create the CMISSessionFacade instances
    |=======================================================================
    {% endraw %}
    // component options: END



    // endpoint options: START
    The CMIS component supports 14 endpoint options which are listed below:

    {% raw %}
    [width="100%",cols="2,1,1m,1m,5",options="header"]
    |=======================================================================
    | Name | Group | Default | Java Type | Description
    | cmsUrl | common |  | String | *Required* URL to the cmis repository
    | pageSize | common | 100 | int | Number of nodes to retrieve per page
    | readContent | common | false | boolean | If set to true the content of document node will be retrieved in addition to the properties
    | readCount | common |  | int | Max number of nodes to read
    | repositoryId | common |  | String | The Id of the repository to use. If not specified the first available repository is used
    | bridgeErrorHandler | consumer | false | boolean | Allows for bridging the consumer to the Camel routing Error Handler which mean any exceptions occurred while the consumer is trying to pickup incoming messages or the likes will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions that will be logged at WARN/ERROR level and ignored.
    | query | consumer |  | String | The cmis query to execute against the repository. If not specified the consumer will retrieve every node from the content repository by iterating the content tree recursively
    | exceptionHandler | consumer (advanced) |  | ExceptionHandler | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions that will be logged at WARN/ERROR level and ignored.
    | exchangePattern | consumer (advanced) |  | ExchangePattern | Sets the exchange pattern when the consumer creates an exchange.
    | queryMode | producer | false | boolean | If true will execute the cmis query from the message body and return result otherwise will create a node in the cmis repository
    | sessionFacadeFactory | advanced |  | CMISSessionFacadeFactory | To use a custom CMISSessionFacadeFactory to create the CMISSessionFacade instances
    | synchronous | advanced | false | boolean | Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported).
    | password | security |  | String | Password for the cmis repository
    | username | security |  | String | Username for the cmis repository
    |=======================================================================
    {% endraw %}
    // endpoint options: END


    [[CMIS-Usage]]
    Usage
    ^^^^^

    [[CMIS-Messageheadersevaluatedbytheproducer]]
    Message headers evaluated by the producer
    +++++++++++++++++++++++++++++++++++++++++

    [width="100%",cols="10%,10%,80%",options="header",]
    |=======================================================================
    |Header |Default Value |Description

    |`CamelCMISFolderPath` |`/` |The current folder to use during the execution. If not specified will
    use the root folder

    |`CamelCMISRetrieveContent` |`false` |In `queryMode` this header will force the producer to retrieve the
    content of document nodes.

    |`CamelCMISReadSize` |`0` |Max number of nodes to read.

    |`cmis:path` |`null` |If `CamelCMISFolderPath` is not set, will try to find out the path of
    the node from this cmis property and it is name

    |`cmis:name` |`null` |If `CamelCMISFolderPath` is not set, will try to find out the path of
    the node from this cmis property and it is path

    |`cmis:objectTypeId` |`null` |The type of the node

    |`cmis:contentStreamMimeType` |`null` |The mimetype to set for a document
    |=======================================================================

    [[CMIS-MessageheaderssetduringqueryingProduceroperation]]
    Message headers set during querying Producer operation
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++

    [width="100%",cols="10%,10%,80%",options="header",]
    |=======================================================================
    |Header |Type |Description

    |`CamelCMISResultCount` |`Integer` |Number of nodes returned from the query.
    |=======================================================================

    The message body will contain a list of maps, where each entry in the
    map is cmis property and its value. If `CamelCMISRetrieveContent` header is set to true, one additional
    entry in the map with key `CamelCMISContent` will contain `InputStream`
    of the document type of nodes.

    [[CMIS-Dependencies]]
    Dependencies
    ^^^^^^^^^^^^

    Maven users will need to add the following dependency to their pom.xml.

    *pom.xml*

    [source,xml]
    ---------------------------------------
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-cmis</artifactId>
        <version>${camel-version}</version>
    </dependency>
    ---------------------------------------

    where `${camel-version`} must be replaced by the actual version of Camel
    (2.11 or higher).

    [[CMIS-SeeAlso]]
    See Also
    ^^^^^^^^

    * link:configuring-camel.html[Configuring Camel]
    * link:component.html[Component]
    * link:endpoint.html[Endpoint]
    * link:getting-started.html[Getting Started]

