Return-Path: X-Original-To: apmail-camel-issues-archive@minotaur.apache.org Delivered-To: apmail-camel-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1A8E010E1A for ; Wed, 11 Feb 2015 06:39:13 +0000 (UTC) Received: (qmail 61953 invoked by uid 500); 11 Feb 2015 06:39:12 -0000 Delivered-To: apmail-camel-issues-archive@camel.apache.org Received: (qmail 61809 invoked by uid 500); 11 Feb 2015 06:39:12 -0000 Mailing-List: contact issues-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list issues@camel.apache.org Received: (qmail 61640 invoked by uid 99); 11 Feb 2015 06:39:12 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Feb 2015 06:39:12 +0000 Date: Wed, 11 Feb 2015 06:39:12 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@camel.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CAMEL-8197) Create Maven plugin to inject EIP documentation into the spring and blueprint XML DSL MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CAMEL-8197?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14315663#comment-14315663 ] ASF GitHub Bot commented on CAMEL-8197: --------------------------------------- Github user nkukhar closed the pull request at: https://github.com/apache/camel/pull/387 > Create Maven plugin to inject EIP documentation into the spring and blueprint XML DSL > ------------------------------------------------------------------------------------- > > Key: CAMEL-8197 > URL: https://issues.apache.org/jira/browse/CAMEL-8197 > Project: Camel > Issue Type: Sub-task > Components: eip, tooling > Reporter: Claus Ibsen > Assignee: Willem Jiang > Fix For: 2.15.0 > > > So we can include documentation out of the box in the XSD schema files, which allows end users to better work with Camel, as their IDE editors can show the documentation in the IDE. > To do this we need to > 1) > Create a new Maven plugin at > https://github.com/apache/camel/tree/master/tooling/maven > which can be inspired by > https://github.com/apache/camel/tree/master/tooling/maven/camel-package-maven-plugin > 2) > Run this plugin in camel-spring and camel-blueprint, so it can read the camel-spring.xsd, camel-blueprint.xsd file, and inject documentation. > 3) > Parse the XSD maybe using SAX, and inject the documentation. > For each xs:element in the top of the schema file > http://camel.apache.org/schema/spring/camel-spring.xsd > Then use the name, eg (name=split) > {code} > > {code} > To find the split.json file in camel-core. Then the json file has the documentation for that type (including inherited types). > So for the split definition > {code} > > > > > > > > > > > > > > > > > > > {code} > We can find the description of these attributes, and elements from the json file. > For example for the streaming attribute we have > {code} > "streaming": { "kind": "attribute": "required": "false", "type": "boolean", "javaType": "java.lang.Boolean", "description": "The splitter should use streaming -- exchanges are being sent as the data for them becomes available. This improves throughput and memory usage but it has a drawback: - the sent exchanges will no longer contain the link org.apache.camel.ExchangeSPLIT_SIZE header property" > {code} > Then add the needed xs:annotation to document it. > http://www.w3schools.com/schema/el_annotation.asp > Which should be > {code} > > > The splitter should use streaming -- exchanges are being sent as the data for them becomes available. This improves throughput and memory usage but it has a drawback: - the sent exchanges will no longer contain the link org.apache.camel.ExchangeSPLIT_SIZE header property > > > {code} > Notice that the xsd will become bigger due the verbosity of how to annotate xsd fields. > Mind that sometimes there is not yet documentation, so check for not empty value. > To parse the json file, then use this class from camel-core > {code} > List> rows = JsonSchemaHelper.parseJsonSchema("properties", json, true); > {code} > Then you have a map with key/value for all those values. -- This message was sent by Atlassian JIRA (v6.3.4#6332)