Re: Question about Camel Connector

2019-03-25 Thread Willem Jiang
As we are moving to the Camel 3.x,  it is important for the user to
know if they can still keep their investment of Camel Connector, or is
there any replacement of Camel Connector.

Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem

On Fri, Mar 15, 2019 at 10:02 AM Tadayoshi Sato
 wrote:
>
> Could anyone answer this question?  I was also surprised to find Camel
> Connector discontinued in 3.x and would like to get explanation from
> someone knowledgeable on the topic.
>
> I can only find this JIRA other than Claus' commits that deprecated
> connectors, but the JIRA doesn't refer to any background discussions.
> https://issues.apache.org/jira/browse/CAMEL-13052
>
>
> On Thu, Mar 7, 2019 at 12:02 PM Willem Jiang  wrote:
>
> > Hi,
> >
> > I think Camel Connector[1] is quit useful if we have some
> > configuration need to be done on the component or endpoint level.
> > I just found the codes of CamelConnector were removed in the camel
> > 3.x.  But there is not much discussion about it. May I know the reason
> > why do we deprecate these connectors and remove them in Camel 3.x?
> >
> > Thanks,
> >
> > [1]https://issues.apache.org/jira/browse/CAMEL-10721
> >
> > Willem Jiang
> >
> > Twitter: willemjiang
> > Weibo: 姜宁willem
> >


Re: [Question] I cannot access Property value with camel

2019-03-25 Thread Willem Jiang
I just answer the question there.
FYI, you can find how to use the camel properties component here[1]

[1]https://github.com/apache/camel/blob/67b3fa5781dec77cb6d908730ef916782785214d/docs/user-manual/modules/ROOT/pages/using-propertyplaceholder.adoc#examples-using-properties-component

Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem

On Mon, Mar 25, 2019 at 11:46 PM 이성규  wrote:
>
> Hi, guys.
>
> I have some problem for property of camel.
> I registered below url.
>
> https://stackoverflow.com/questions/55335795/property-value-is-not-access
>
> Please check this issue.
> Thank you.


Re: using jsonpath for choice

2019-03-25 Thread Larry Shields
I'm using the Jsonpath functionality in a split() with the syntax you have
without any issue.  What version of camel and do you have the
camel-jsonpath dependency?

On Mon, Mar 25, 2019 at 4:29 PM Rajith Muditha Attapattu 
wrote:

> Is there a better way to do the following ?
>
> .when(PredicateBuilder.isEqualTo(ExpressionBuilder.languageExpression("jsonpath","$.approved"),ExpressionBuilder.constantExpression(true)))
>
>
> as in
> .when().jsonpath(...)
>
> Already tried .when().jsonpath("$.approved[?(@ == true)]") and it doesn't
> work.
>
> --
> Regards,
>
> Rajith Muditha Attapattu 
>


using jsonpath for choice

2019-03-25 Thread Rajith Muditha Attapattu
Is there a better way to do the following ?
.when(PredicateBuilder.isEqualTo(ExpressionBuilder.languageExpression("jsonpath","$.approved"),ExpressionBuilder.constantExpression(true)))


as in
.when().jsonpath(...)

Already tried .when().jsonpath("$.approved[?(@ == true)]") and it doesn't
work.

-- 
Regards,

Rajith Muditha Attapattu 


[Question] I cannot access Property value with camel

2019-03-25 Thread 이성규
Hi, guys.

I have some problem for property of camel.
I registered below url.

https://stackoverflow.com/questions/55335795/property-value-is-not-access

Please check this issue.
Thank you.


Rest DSL, Servlet, Jetty, Multi part file upload

2019-03-25 Thread Alex Soto
Hello,

Using Camel version 2.21.1,  I need to process file upload from a multi part 
form web UI.  My setup is as follows:











   







My uploadHandler bean

public void processUpload(Exchange exchange) throws Exception {
Map attachments = 
exchange.getIn().getAttachments();
if (attachments.size() == 0) {
log.warn("No attachments found!");
} else {
for (String key : attachments.keySet()) {
log.info("Filename: " + key);
}
}
}


My integration test:


Part[] parts = {new StringPart("comment", “File to upload"),
new FilePart(outPath.getFileName().toString(), 
outPath.toFile())};

MultipartRequestEntity entity = new 
MultipartRequestEntity(parts, new HttpMethodParams());
HttpClient httpclient = new HttpClient();
PutMethod httppost = new 
PutMethod("http://localhost:8182/api/rest/offline/datasources;);
httppost.setRequestEntity(entity);
int status = httpclient.executeMethod(httppost);


The problem is that upload handler never receives any attachments.  Any help 
would be appreciated.

Best regards,
Alex soto






Re: Dataformat/ POJO for tab indentation?

2019-03-25 Thread Riaan Annandale

Hi Ricardo

That looks exactly like the thing I need.

Thanks for the reply!
Riaan

On 2019/03/25 3:00 PM, Ricardo Zanini wrote:

Hi!

You mentioned templating system, so Velocity [1] comes to mind. Have you
tried that? I guess that should be simple mapping from JSON/XML to velocity
(and keeping your formmating).

[1] - http://camel.apache.org/velocity.html

Cheers!

On Mon, 25 Mar 2019 at 05:07 Riaan Annandale  wrote:


Hi everyone

I'm in the process of designing a solution to manage config files which
look something like this:

config firewall service category
  edit "General"
  set comment "General services."
  next
  edit "Web Access"
  set comment "Web access."
  next
  edit "File Access"
  set comment "File access."
end

Some of you may recognize this as the config for a fortigate firewall.
It's tab indented, so while it looks a bit yaml-ish it isn't.

With a mix of POJO/ Dataformat clauses I'm hoping to map this from JSON/
XML to a templating system in order to generate files similar to the
snippet above.

I tried googling about camel and tab indentation but only find
references to bindi which is used for csv/tsv files, this is not quite
the same use case.

Worst case scenario I guess I'd do it with some kind of hack in
xslt/xquery to make it "look" like this, but that feels like a hack

Any thoughts, or suggestions welcome

Thanks
Riaan