You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2014/12/18 10:59:21 UTC

[3/8] camel git commit: CAMEL-7999: More components include documentation

CAMEL-7999: More components include documentation


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/7f400eff
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/7f400eff
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/7f400eff

Branch: refs/heads/master
Commit: 7f400eff1482e1b669fa37a9d25d22ec48679dbc
Parents: 142f4de
Author: Claus Ibsen <da...@apache.org>
Authored: Thu Dec 18 10:08:42 2014 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Thu Dec 18 10:58:54 2014 +0100

----------------------------------------------------------------------
 .../camel/component/fop/FopComponent.java       |  8 +++-
 .../apache/camel/component/fop/FopEndpoint.java | 42 +++++++++++++++-----
 2 files changed, 37 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/7f400eff/components/camel-fop/src/main/java/org/apache/camel/component/fop/FopComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-fop/src/main/java/org/apache/camel/component/fop/FopComponent.java b/components/camel-fop/src/main/java/org/apache/camel/component/fop/FopComponent.java
index 1f2e557..774dd47 100644
--- a/components/camel-fop/src/main/java/org/apache/camel/component/fop/FopComponent.java
+++ b/components/camel-fop/src/main/java/org/apache/camel/component/fop/FopComponent.java
@@ -19,12 +19,16 @@ package org.apache.camel.component.fop;
 import java.util.Map;
 
 import org.apache.camel.Endpoint;
-import org.apache.camel.impl.DefaultComponent;
+import org.apache.camel.impl.UriEndpointComponent;
 
 /**
  * Represents the component that manages {@link FopEndpoint}.
  */
-public class FopComponent extends DefaultComponent {
+public class FopComponent extends UriEndpointComponent {
+
+    public FopComponent() {
+        super(FopEndpoint.class);
+    }
 
     protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters)
         throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/7f400eff/components/camel-fop/src/main/java/org/apache/camel/component/fop/FopEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-fop/src/main/java/org/apache/camel/component/fop/FopEndpoint.java b/components/camel-fop/src/main/java/org/apache/camel/component/fop/FopEndpoint.java
index 7b29109..1e3108b 100644
--- a/components/camel-fop/src/main/java/org/apache/camel/component/fop/FopEndpoint.java
+++ b/components/camel-fop/src/main/java/org/apache/camel/component/fop/FopEndpoint.java
@@ -16,36 +16,40 @@
  */
 package org.apache.camel.component.fop;
 
-import java.io.IOException;
 import java.io.InputStream;
 
-import org.xml.sax.SAXException;
-
 import org.apache.avalon.framework.configuration.Configuration;
-import org.apache.avalon.framework.configuration.ConfigurationException;
 import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;
 import org.apache.camel.Consumer;
 import org.apache.camel.Processor;
 import org.apache.camel.Producer;
 import org.apache.camel.impl.DefaultEndpoint;
+import org.apache.camel.spi.UriEndpoint;
+import org.apache.camel.spi.UriParam;
+import org.apache.camel.spi.UriPath;
 import org.apache.camel.util.ResourceHelper;
 import org.apache.fop.apps.FopFactory;
 
 /**
  * Represents a Fop endpoint.
  */
+@UriEndpoint(scheme = "fop", label = "transformation")
 public class FopEndpoint extends DefaultEndpoint {
+
+    @UriPath
+    private String outputFormat;
+    @UriParam
     private String userConfigURL;
+    @UriParam
     private FopFactory fopFactory;
-    private String remaining;
 
-    public FopEndpoint(String uri, FopComponent component, String remaining) {
+    public FopEndpoint(String uri, FopComponent component, String outputFormat) {
         super(uri, component);
-        this.remaining = remaining;
+        this.outputFormat = outputFormat;
     }
 
     public Producer createProducer() throws Exception {
-        return new FopProducer(this, fopFactory, remaining);
+        return new FopProducer(this, fopFactory, outputFormat);
     }
 
     public Consumer createConsumer(Processor processor) throws Exception {
@@ -56,15 +60,31 @@ public class FopEndpoint extends DefaultEndpoint {
         return true;
     }
 
-    FopFactory getFopFactory() {
-        return fopFactory;
+    public String getOutputFormat() {
+        return outputFormat;
+    }
+
+    public void setOutputFormat(String outputFormat) {
+        this.outputFormat = outputFormat;
+    }
+
+    public String getUserConfigURL() {
+        return userConfigURL;
     }
 
     public void setUserConfigURL(String userConfigURL) {
         this.userConfigURL = userConfigURL;
     }
 
-    private static void updateConfigurations(InputStream is, FopFactory fopFactory) throws SAXException, IOException, ConfigurationException {
+    public FopFactory getFopFactory() {
+        return fopFactory;
+    }
+
+    public void setFopFactory(FopFactory fopFactory) {
+        this.fopFactory = fopFactory;
+    }
+
+    private static void updateConfigurations(InputStream is, FopFactory fopFactory) throws Exception {
         DefaultConfigurationBuilder cfgBuilder = new DefaultConfigurationBuilder();
         Configuration cfg = cfgBuilder.build(is);
         fopFactory.setUserConfig(cfg);