{
  "factory": {
    "id": "abstract-connector",
    "type": "entaxy.runtime.connector",
    "description": "Abstract connector factory",
    "isAbstract": true
  },
  "entaxy.runtime.connector": {
  	"type": "unknown",
  	"protocol": "unknown",
  	/* BOTH, SYNC_ONLY, ASYNC_ONLY */
  	"syncMode": "ASYNC_ONLY"
  },
  "fields": {
	  "__entaxyContainerId": {
		  "type": "String",
		  "isHidden": true
	  },
	  "profile": {
		  "type": "String",
		  "required": true,
		  "isHidden": true,
		  "defaultValue": {
			  "@CALCULATED": {
				  "expression": "${properties.__entaxyContainerId}",
				  "lazy": false
			  }
		  }
	  },
		"__objectId": {
			"type": "String",
			"required": true,
			"isHidden": true,
			"defaultValue": {
				"@CALCULATED": {
					"expression": "${properties.profile}.${factoryId}.${properties.classifier}",
					"targetPath": "$.objectId",
					"removeResolved": true,
					"lazy": false
				}
			}
		},
		"classifier": {
			"displayName": "Classifier",
			"type": "String",
			"required": true,
			"immutable": true,
			"defaultValue": "main",
			"@UNIQUE": {
				"filterProperties": ["direction"]
			}
		},
	    "displayName": {
			"displayName": "Display Name",
			"type": "String",
			"required": true,
			"defaultValue": {
				"@CALCULATED": {
					"expression": "${objectId}",
					"lazy": false
				}
			}
		},
		"processResponse": {
			"displayName": "Process response",
			"type": "Boolean",
			"required": true,
			"group": "response",
			"defaultValue": false
		},
		"responseRoute": {
			"displayName": "Response route",
			"type": "xml:route",
			"required": true,
			"group": "response",
			"@RESOURCE": {
				"endType": "String",
				"format": "base64",
				"preprocess":[
					{
						"processor": "xslt",
						"source":"entaxy-file-internal:routes-common/common-components.xslt",
						"parameters": {
							"profileName": {				
								"@CALCULATED": {
									"expression": "${#OWNER#.properties.systemName}",
									"lazy": false
								}
							},
							"connectorId": {
								"@CALCULATED": {
									"expression": "${#OWNER#.objectId}",
									"lazy": false
								}
							}
						}
					},
					{
						"processor": "xslt",
						"source":"entaxy-file-internal:routes-common/connector-commons.xslt",
						"parameters": {
							"profileName": {				
								"@CALCULATED": {
									"expression": "${#OWNER#.properties.systemName}",
									"lazy": false
								}
							},
							"connectorId": {
								"@CALCULATED": {
									"expression": "${#OWNER#.objectId}",
									"lazy": false
								}
							}
						}
					}
					
				]
				
			},
			"defaultValue": {
				"@RESOURCE": {
					"provider": "entaxy-file-internal",
					"location": "factories/abstract-connector/response-route.xml",
					"endType": "String",
					"format": "base64"
				}
			},
			"config": {
				"scope": "public"
			}
			
		},
		"__meta": {
			"type": "entaxy.runtime.connector",
			"isRef": true,
			"required": true,
			"isHidden": true,
			"isRefByValueOnly": true,
			"@INTERNAL": true,
			"defaultValue": {
				"type": "entaxy.runtime.connector",
				"factoryId": "#OWNER#",
				"outputType": "meta",
				"scope": "private",
				"properties": {
					"prefixClassifier": "SOURCE",
					"connectorId": {
						"@CALCULATED": {
							"expression": "${#OWNER#.objectId}",
							"lazy": true
						}
					},
					"profile": {
						"@CALCULATED": {
							"expression": "${#OWNER#.properties.profile}",
							"lazy": true
						}
					},
					"connectorProperties": {
						"@CALCULATED": {
							"expression": "${#OWNER#.#FACTORY#.#TYPEINFO#}",
							"resultType": "list_or_single",
							"lazy": false
						}
					},
					"connectorInstanceProperties": {
						"profile": {
							"@CALCULATED": {
								"expression": "${#OWNER#.properties.profile}",
								"lazy": true
							}						
						},
						"classifier": {
							"@CALCULATED": {
								"expression": "${#OWNER#.properties.classifier}",
								"lazy": true
							}						
						}/*,
						"type": {
							"@CALCULATED": {
								"expression": "${#OWNER#.factoryId}",
								"lazy": true
							}						
						}*/
					}
				}
			}
		},
		"##publish": {
			"type": "Map",
			"required": true,
			"isHidden": true,
			"defaultValue":{
				"bundleName": {
					"@CALCULATED": {
						"expression": "${objectId}",
						"lazy": true
					}
				},
				"system": {
					"@CALCULATED": {
						"expression": "${properties.profile}",
						"lazy": false,
						"allowObjects": false
					}
				},
				"classifier": {
					"@CALCULATED": {
						"expression": "${properties.classifier}",
						"lazy": false
					}
				},
				"direction": {
					"@CALCULATED": {
						"expression": "${#FACTORY#.#TYPEINFO#.direction}",
						"lazy": false
					}
				},
				"displayName": {
					"@CALCULATED": {
						"expression": "${properties.displayName}",
						"lazy": true
					}
				},
				"relation": [
					{
						"@CALCULATED": {
							"expression": "${properties.profile}:entaxy.runtime.profile:connector:-aggregation:connectors/${#FACTORY#.#TYPEINFO#.direction}",
							"lazy": false
						}
					}
				]
			}
		}
  },
  "outputs": {
    "init": {
      "isDefault": true,
      "fields": {
        "__entaxyContainerId": {},
      	"__objectId": {},
      	"__meta": {},
      	"classifier": {},
        "displayName": {},
      	"profile": {},
      	"processResponse": {},
      	"responseRoute": {},
      	"##publish": {}
      },
		"config": {
			"configurable": false
		}			
      
    },
		"meta": {
			"fields": {
				"connectorProperties": {
					"required": true,
					"type": "Map"
				},
				"connectorId": {
					"type": "String"
				},
				"profile": {}
			},
			"scopes": ["private", "public"],
			"config": {
				"@SKIP_PUBLISH": {},
				"configurable": false
			}			
		}
    
  }
}
