Re: [PROPOSAL] Get rid of JAXB

2017-04-21 Thread Francesco Chicchiriccò

Hi all,
after some time it seems that this proposal is getting nowhere, and 
would anyway require some time I don't have right now nor plan to have 
in the near future.

I am then going to delete the outdated 2_0_NO_JAXB branch.

Regards.

On 06/07/2016 09:39, Francesco Chicchiriccò wrote:

Hi,
FYI I am currently experimenting with some different approaches about 
generating the missing XSD for WADLGenerator:


 1.  use Javassist for adding JAXB annotations to POJOs and then 
generating XSD (to be passed as parameter to WADLGenerator) via JAXB; 
it is kind of working, but (a) there are things that cannot be easily 
inferred (as Map support) and (b) the JAXB annoations might require 
tweaking in order to produce results similar to the effective XML 
payloads as generated by Jackson


 2. generate XSD with Apache XmlSchema having swagger.json (output of 
Swagger2Feature) as input; it is working but (a) there are some 
missing bits, especially with POJO inheritance and (b) again the XSD 
entities do not map 100% with effective XML payloads as generated by 
Jackson


 3. use jackson-module-jsonSchema [5] to natively generate JSON 
schemas out of POJOs, then translate into XSD via Apache XmlSchema (I 
am asking for support about this at the jackson-user ML [6])


This last approach seems the most promising to me, especially because 
I expect it to generate the schema information most adherent to 
Jackson's XML payload representation.
Once completed my reference implementation, I will need to asses 
whether it is better to extend the CXF WADLGenerator to incorporate 
it, or instead to add a new Maven plugin to Syncope source tree for 
XSD generation, and then pass such XSD to the standard WADLGenerator.


I'll keep you posted.
Regards.

[5] https://github.com/FasterXML/jackson-module-jsonSchema
[6] https://groups.google.com/d/msg/jackson-user/4HzGsfRgIz4/YzpNugpcBgAJ

On 05/07/2016 18:30, Sergey Beryozkin wrote:

Hi Francesco
thanks, see comments inline
On 05/07/16 16:50, Francesco Chicchiriccò wrote:

Hi Sergey,
thanks for your comments.

See my replies in-line.
Regards.

On 05/07/2016 14:25, Sergey Beryozkin wrote:

Hi Francesco

Here are some thoughts/comments.

The question is and I guess this is something the team will need to
decide upon is how important having a WADL representation for Syncope
is. Having WADL without a schema is probably not worth it - the UI
View is incomplete as a result and if someone tries to generate a
client from this WADL it won't work either. But then if no-one is
working with WADL on the client or really depending on Syncope WADL UI
View then may be it is a feature that can be let go easily enough.


AFAICT, I haven't heard about anyone generating non-Java classes from
Syncope WADL, and so the most important usage that Syncope users 
make of

WADL is via the REST reference documentation available which every
deployment at at

http://syncope.apache.org/rest/2.0/index.html

Without information from XSD, I agree that even the pure documentation
purpose of WADL fades off.


Yes

So, suppose you have decided to let it go.

Then it all looks nice, indeed, having a uniform set of annotations is
advantageous.

But the absence of a schema can be a bit problematic if the
interoperability with the non Java XML clients is required. May be
everyone uses Syncope clients, but if not, then without a schema it
can be tricky for such clients to get the beans generated, etc.
Perhaps it is not going to be a problem because as far as I know only
WADL has a schema and I'm not sure if anyone in the Syncope community
has ever tried this schema to get the non-Java POJOs generated.


As said above, I don't think this could be an issue anyway - at least,
no one has reported about such usage.


Indeed

By the way, I believe you may be able to use JAXB without the
annotations, with the help of JAXBElement. Perhaps might be worth
doing a quick try with Moxy JAXB - it might be able to deal better
with some of the JAXB issues.


Could you please elaborate on JAXBElement? Do you mean we could process
the POJOs, generate the XSD offline and then pass it to WADL? We would
probably solve the documentation issue, but the effective XML objects
built via Jackson would likely differ from this XSD content.



I only meant that one can configure CXF JAXBElementProvider with a 
'marshallAsJaxbElement' property and it should work without the JAXB 
annotations. I forgot about the schema issue though, sorry.



So I suppose if you are happy with Jackson XML and dropping WADL is
acceptable then do give it a try :-) You can always revert back to
JAXB without affecting the clients too much.


Well, not the clients using JSON nor the ones using XML but via the
Syncope client library, at least.


Oh yes, re WADL and manually supporting the schemas. May be it can be
somehow done such that if a new property is added to one of the
Syncope POJOs then a 'red flag' is raised at the build time if the
schema document has not been 

[jira] [Resolved] (SYNCOPE-1070) Conversion pattern ignored for date, long and double values during propagation

2017-04-21 Thread JIRA

 [ 
https://issues.apache.org/jira/browse/SYNCOPE-1070?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Francesco Chicchiriccò resolved SYNCOPE-1070.
-
Resolution: Fixed

> Conversion pattern ignored for date, long and double values during propagation
> --
>
> Key: SYNCOPE-1070
> URL: https://issues.apache.org/jira/browse/SYNCOPE-1070
> Project: Syncope
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.2.10, 2.0.3
>Reporter: Francesco Chicchiriccò
>Assignee: Francesco Chicchiriccò
> Fix For: 1.2.11, 2.0.4, 2.1.0
>
>
> When propagating values for schemas of type date, long and double, the 
> conversion pattern is ignored and values are barely generated via 
> {{toString()}}.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (SYNCOPE-1070) Conversion pattern ignored for date, long and double values during propagation

2017-04-21 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/SYNCOPE-1070?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15978519#comment-15978519
 ] 

ASF subversion and git services commented on SYNCOPE-1070:
--

Commit 16029366613c0534ea77828bec02c7cd607fb223 in syncope's branch 
refs/heads/master from [~ilgrosso]
[ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=1602936 ]

[SYNCOPE-1070] Using the actual schema type to get the value as string


> Conversion pattern ignored for date, long and double values during propagation
> --
>
> Key: SYNCOPE-1070
> URL: https://issues.apache.org/jira/browse/SYNCOPE-1070
> Project: Syncope
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.2.10, 2.0.3
>Reporter: Francesco Chicchiriccò
>Assignee: Francesco Chicchiriccò
> Fix For: 1.2.11, 2.0.4, 2.1.0
>
>
> When propagating values for schemas of type date, long and double, the 
> conversion pattern is ignored and values are barely generated via 
> {{toString()}}.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (SYNCOPE-1070) Conversion pattern ignored for date, long and double values during propagation

2017-04-21 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/SYNCOPE-1070?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15978518#comment-15978518
 ] 

ASF subversion and git services commented on SYNCOPE-1070:
--

Commit 2381d0a358515befac417c50dd18bac20173d538 in syncope's branch 
refs/heads/2_0_X from [~ilgrosso]
[ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=2381d0a ]

[SYNCOPE-1070] Using the actual schema type to get the value as string


> Conversion pattern ignored for date, long and double values during propagation
> --
>
> Key: SYNCOPE-1070
> URL: https://issues.apache.org/jira/browse/SYNCOPE-1070
> Project: Syncope
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.2.10, 2.0.3
>Reporter: Francesco Chicchiriccò
>Assignee: Francesco Chicchiriccò
> Fix For: 1.2.11, 2.0.4, 2.1.0
>
>
> When propagating values for schemas of type date, long and double, the 
> conversion pattern is ignored and values are barely generated via 
> {{toString()}}.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (SYNCOPE-1070) Conversion pattern ignored for date, long and double values during propagation

2017-04-21 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/SYNCOPE-1070?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15978516#comment-15978516
 ] 

ASF subversion and git services commented on SYNCOPE-1070:
--

Commit 8d309e2a639a7d29ced1404727bc328ba83491a2 in syncope's branch 
refs/heads/1_2_X from [~ilgrosso]
[ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=8d309e2 ]

[SYNCOPE-1070] Using the actual schema type to get the value as string


> Conversion pattern ignored for date, long and double values during propagation
> --
>
> Key: SYNCOPE-1070
> URL: https://issues.apache.org/jira/browse/SYNCOPE-1070
> Project: Syncope
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.2.10, 2.0.3
>Reporter: Francesco Chicchiriccò
>Assignee: Francesco Chicchiriccò
> Fix For: 1.2.11, 2.0.4, 2.1.0
>
>
> When propagating values for schemas of type date, long and double, the 
> conversion pattern is ignored and values are barely generated via 
> {{toString()}}.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Created] (SYNCOPE-1070) Conversion pattern ignored for date, long and double values during propagation

2017-04-21 Thread JIRA
Francesco Chicchiriccò created SYNCOPE-1070:
---

 Summary: Conversion pattern ignored for date, long and double 
values during propagation
 Key: SYNCOPE-1070
 URL: https://issues.apache.org/jira/browse/SYNCOPE-1070
 Project: Syncope
  Issue Type: Bug
  Components: core
Affects Versions: 2.0.3, 1.2.10
Reporter: Francesco Chicchiriccò
Assignee: Francesco Chicchiriccò
 Fix For: 1.2.11, 2.0.4, 2.1.0


When propagating values for schemas of type date, long and double, the 
conversion pattern is ignored and values are barely generated via 
{{toString()}}.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)