Re: [Geotools-devel] app-schema and xs:anyType encoding

2015-03-04 Thread Ben Caradoc-Davies
Thanks, Mauro, this is a useful improvement. I confirm that all tests 
pass, including GeoServer app-schema online tests against postgis.

Merged on master:
https://github.com/geotools/geotools/pull/760

Kind regards,
Ben.

On 05/03/15 01:19, Mauro Bartolomeoli wrote:
 Hi,


 two issues:

 (1) This commit includes an xsd for the INSPIRE Land Cover Vector
 application schema. What is the licence for this document? If the licence
 permits republication, it may be included in our repository; we will
 require a copy of the licence in the licenses directory, prefaced with a
 note.


 I replaced it with a simpler hand made xsd that is enough for my unit tests.



 (2) This change causes a build failure in GeoServer gs-csw-core when
 building with -PallExtensions or -Prelease:

 Failed tests: 
 testRepeatedCapabilitiesCall(org.geoserver.csw.GetCapabilitiesDecoratorTest):
 Document did not validate.
testPostBasic(org.geoserver.csw.GetCapabilitiesTest): Document did not
 validate.
testGetBasic(org.geoserver.csw.GetCapabilitiesTest): Document did not
 validate.
testSections(org.geoserver.csw.GetCapabilitiesTest): Document did not
 validate.
testPostBasic(org.geoserver.csw.store.internal.GetCapabilitiesTest):
 Document did not validate.
testGetBasic(org.geoserver.csw.store.internal.GetCapabilitiesTest):
 Document did not validate.
testSections(org.geoserver.csw.store.internal.GetCapabilitiesTest):
 Document did not validate.


 I found and fixed the issue (in many places a plain Object instance (new
 Object()) is put as an object to be encoded, with the meaning of nothing
 to encode (this is my understanding). I added explicit checks to skip
 encoding of those objects, now geoserver seems to build fine.

 The pull request is here: https://github.com/geotools/geotools/pull/760

 Mauro


-- 
Ben Caradoc-Davies b...@transient.nz
Software Engineer
Transient Software http://transient.nz
New Zealand

--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
___
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel


Re: [Geotools-devel] app-schema and xs:anyType encoding

2015-03-04 Thread Mauro Bartolomeoli
Hi,


 two issues:

 (1) This commit includes an xsd for the INSPIRE Land Cover Vector
 application schema. What is the licence for this document? If the licence
 permits republication, it may be included in our repository; we will
 require a copy of the licence in the licenses directory, prefaced with a
 note.


I replaced it with a simpler hand made xsd that is enough for my unit tests.



 (2) This change causes a build failure in GeoServer gs-csw-core when
 building with -PallExtensions or -Prelease:

 Failed tests: 
 testRepeatedCapabilitiesCall(org.geoserver.csw.GetCapabilitiesDecoratorTest):
 Document did not validate.
   testPostBasic(org.geoserver.csw.GetCapabilitiesTest): Document did not
 validate.
   testGetBasic(org.geoserver.csw.GetCapabilitiesTest): Document did not
 validate.
   testSections(org.geoserver.csw.GetCapabilitiesTest): Document did not
 validate.
   testPostBasic(org.geoserver.csw.store.internal.GetCapabilitiesTest):
 Document did not validate.
   testGetBasic(org.geoserver.csw.store.internal.GetCapabilitiesTest):
 Document did not validate.
   testSections(org.geoserver.csw.store.internal.GetCapabilitiesTest):
 Document did not validate.


I found and fixed the issue (in many places a plain Object instance (new
Object()) is put as an object to be encoded, with the meaning of nothing
to encode (this is my understanding). I added explicit checks to skip
encoding of those objects, now geoserver seems to build fine.

The pull request is here: https://github.com/geotools/geotools/pull/760

Mauro

-- 
==
GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.
==

Dott. Mauro Bartolomeoli
@mauro_bart
Senior Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

---

*AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*

Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.



The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility  for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.
--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/___
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel


Re: [Geotools-devel] app-schema and xs:anyType encoding

2015-03-03 Thread Ben Caradoc-Davies
On 04/03/15 03:30, Mauro Bartolomeoli wrote:
 Ok, I will check the test-suite and see if anything is broken by my
 changes. Then I will prepare a pull request.
 I tried to run the app-schema online test-suite for postgis, but I have
 some issues in running it.
 The first one is this dependency:
 dependency
  groupIdorg.geotools.data/groupId
  artifactIdrefdataset-1.0/artifactId
  version1.0.7/version
  scopetest/scope
 /dependency
 Initially I thought it was a GeoTools module, but it seems I cannot find it
 anywhere in geotools source tree.
 Is the source of this module hosted anywhere?

Mauro, as far as I know, the data reference set exists only as a jar 
file. The management workflow is to obtain the jar, unzip it, edit the 
enclosed SQL, re-zip it, increment the version number, and manually 
deploy it to the osgeo maven repository.

Victor, has there been any change in this process? Is it documented?

Victor's documentation is here:
https://www.seegrid.csiro.au/wiki/Infosrvices/DataReferenceSet

 Apart from that, the postgis init scripts contained in the jar, are not
 compatible with my version of postgis (2.0.x) because some functions have
 been renamed (dims - st_dims, srid - st_srid).

Yes, this is a known incompatibility, documented here:
https://www.seegrid.csiro.au/wiki/Infosrvices/JenkinsGeoserverMasterTechnicalNotes#PostGIS_database_creation

 I fixed that locally, but many tests are still failing (currently trying on
 Windows, I will give it a chance on Linux too). Unfortunately the tests are
 failing with or without the patch I am trying to introduce. Any suggestion
 for a good environment to run the tests on?

Should work anywhere, with PostGIS 2.0 or 2.1, and PostgreSQL 8.4, and 9 
up to 9.4.

See also the instructions in this Jira issue:
https://jira.codehaus.org/browse/GEOS-6883

What failures are you seeing?

 I prepared a branch with the fix, if you want to have a look at it before I
 prepare a PR:
 https://github.com/mbarto/geotools/commit/1246d1b45aa74b80b4f063096895f99cb5e7cd60

Yes, will do.

 If you have any quick way to run the test-suite with my patch applied,
 please let me know.

All the documentation I know of is linked above and in the developer guide:
http://docs.geoserver.org/latest/en/developer/programming-guide/app-schema/index.html

Kind regards,

-- 
Ben Caradoc-Davies b...@transient.nz
Software Engineer
Transient Software http://transient.nz
New Zealand

--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
___
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel


Re: [Geotools-devel] app-schema and xs:anyType encoding

2015-03-03 Thread Mauro Bartolomeoli
Hi Ben,



 See also the instructions in this Jira issue:
 https://jira.codehaus.org/browse/GEOS-6883


Ok, this solved issues for the app-schema-postgis-test (that are passing
both without and with my patch).
I Still have some issues with tests from app-schema-test, but I will
investigate further tomorrow and eventually get a list of failing ones.

Thanks,
Mauro

-- 
==
GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.
==

Dott. Mauro Bartolomeoli
@mauro_bart
Senior Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

---

*AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*

Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.



The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility  for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.
--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/___
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel


Re: [Geotools-devel] app-schema and xs:anyType encoding

2015-03-03 Thread Ben Caradoc-Davies
On 04/03/15 03:30, Mauro Bartolomeoli wrote:
 I prepared a branch with the fix, if you want to have a look at it before I
 prepare a PR:
 https://github.com/mbarto/geotools/commit/1246d1b45aa74b80b4f063096895f99cb5e7cd60

Mauro,

two issues:

(1) This commit includes an xsd for the INSPIRE Land Cover Vector 
application schema. What is the licence for this document? If the 
licence permits republication, it may be included in our repository; we 
will require a copy of the licence in the licenses directory, prefaced 
with a note.

(2) This change causes a build failure in GeoServer gs-csw-core when 
building with -PallExtensions or -Prelease:

Failed tests: 
testRepeatedCapabilitiesCall(org.geoserver.csw.GetCapabilitiesDecoratorTest): 
Document did not validate.
   testPostBasic(org.geoserver.csw.GetCapabilitiesTest): Document did 
not validate.
   testGetBasic(org.geoserver.csw.GetCapabilitiesTest): Document did not 
validate.
   testSections(org.geoserver.csw.GetCapabilitiesTest): Document did not 
validate.
   testPostBasic(org.geoserver.csw.store.internal.GetCapabilitiesTest): 
Document did not validate.
   testGetBasic(org.geoserver.csw.store.internal.GetCapabilitiesTest): 
Document did not validate.
   testSections(org.geoserver.csw.store.internal.GetCapabilitiesTest): 
Document did not validate.

Because the main GeoServer build stopped at this failure, I did not see 
any others.

The good news is that GeoServer app-schema online tests (run separately) 
passed against postgis.

Kind regards,

-- 
Ben Caradoc-Davies b...@transient.nz
Software Engineer
Transient Software http://transient.nz
New Zealand

--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
___
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel


Re: [Geotools-devel] app-schema and xs:anyType encoding

2015-03-03 Thread Mauro Bartolomeoli
Hi Ben and all,


 Ok, I will check the test-suite and see if anything is broken by my
 changes. Then I will prepare a pull request.


I tried to run the app-schema online test-suite for postgis, but I have
some issues in running it.
The first one is this dependency:

dependency
groupIdorg.geotools.data/groupId
artifactIdrefdataset-1.0/artifactId
version1.0.7/version
scopetest/scope
/dependency

Initially I thought it was a GeoTools module, but it seems I cannot find it
anywhere in geotools source tree.

Is the source of this module hosted anywhere?

Apart from that, the postgis init scripts contained in the jar, are not
compatible with my version of postgis (2.0.x) because some functions have
been renamed (dims - st_dims, srid - st_srid).

I fixed that locally, but many tests are still failing (currently trying on
Windows, I will give it a chance on Linux too). Unfortunately the tests are
failing with or without the patch I am trying to introduce. Any suggestion
for a good environment to run the tests on?

I prepared a branch with the fix, if you want to have a look at it before I
prepare a PR:
https://github.com/mbarto/geotools/commit/1246d1b45aa74b80b4f063096895f99cb5e7cd60

If you have any quick way to run the test-suite with my patch applied,
please let me know.

Thanks in advance,
Mauro


-- 
==
GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.
==

Dott. Mauro Bartolomeoli
@mauro_bart
Senior Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

---

*AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*

Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.



The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility  for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.
--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/___
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel


Re: [Geotools-devel] app-schema and xs:anyType encoding

2015-02-27 Thread Mauro Bartolomeoli
Hi Ben,

2015-02-26 21:16 GMT+01:00 Ben Caradoc-Davies b...@transient.nz:

 Mauro,

 your proposal seems like a good idea, and would improve usability where
 the encoder should not require explicit direction. I was simply offering a
 workaround while I thought about it.  :-)

 My main concern is the interaction with type conversion. What if an
 app-schema mapping uses targetAttributeNode to set an anyType to a
 MeasureType or CodeType (or some other complex type that extends a simple
 type)? Would this type coercion still be honoured if the encoder is
 permitted to use the concrete type of the source value?


If the attribute to be encoded is a ComplexAttribute, the old code would be
used, so I presume that nothing should change for already handled
attributes.



 I am happy to review any pull request; I would run the full suite of
 GeoServer app-schema online tests against postgis. This is the most
 comprehensive set of app-schema mapping tests we have. Even offline tests
 also have anyType coverage.


Ok, I will check the test-suite and see if anything is broken by my
changes. Then I will prepare a pull request.

Thank you.

Mauro

-- 
==
GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.
==

Dott. Mauro Bartolomeoli
@mauro_bart
Senior Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

---

*AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*

Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.



The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility  for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.
--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/___
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel


Re: [Geotools-devel] app-schema and xs:anyType encoding

2015-02-26 Thread Ben Caradoc-Davies
Mauro,

your proposal seems like a good idea, and would improve usability where 
the encoder should not require explicit direction. I was simply offering 
a workaround while I thought about it.  :-)

My main concern is the interaction with type conversion. What if an 
app-schema mapping uses targetAttributeNode to set an anyType to a 
MeasureType or CodeType (or some other complex type that extends a 
simple type)? Would this type coercion still be honoured if the encoder 
is permitted to use the concrete type of the source value?

I am happy to review any pull request; I would run the full suite of 
GeoServer app-schema online tests against postgis. This is the most 
comprehensive set of app-schema mapping tests we have. Even offline 
tests also have anyType coverage.

Kind regards,
Ben.

On 26/02/15 21:19, Mauro Bartolomeoli wrote:
 Hi Ben,
 probably you are right, declaring that targetAttributeNode is used in a
 wrong way in my usecase, I added it trying to understand why the lcv:class
 attribute (declared as xs:anyType) was not encoded in GML. Probably, after
 the patch to anyType handling I talk about in my email (that's the main
 point of my issue, not the targetAttributeNode usage) it would work also
 without it (I will try).

 The main issue remains: is it correct to add handling of primitive
 (simple)  types to xs:anyType bindings and which approach seems better to
 you, changing ComplexSupportXSAnyTypeBinding or its parent class
 XSAnyTypeBinding?

 Any hint is appreciated.

 Thanks
 Mauro Bartolomeoli

 2015-02-25 21:32 GMT+01:00 Ben Caradoc-Davies b...@transient.nz:

 Mauro,

 targetAttributeNode must be applied to the containing property type
 lcv:landCoverObservation[1]/lcv:LandCoverObservation, not the terminal
 node. I am not sure exactly what you should use in this case, but please
 see these pages for examples:
 http://docs.geoserver.org/latest/en/user/data/app-
 schema/mapping-file.html#targetattributenode-optional
 http://docs.geoserver.org/latest/en/user/data/app-
 schema/polymorphism.html#any-type

 Kind regards,
 Ben.

 On 25/02/15 23:24, mauro.bartolomeoli wrote:

 Hi,I have an unexpected behaviour in app-schema mappings, when I have to
 deal with an attribute declared as xs:anyType.

   From my understanding of the xs:anyType meaning, this can be mapped to
 simple (xs:string, etc.) or complex types.
 Currently if I map an xs:anyType attribute to an xs:string it doesn't get
 encoded in the final GML3 document.


 This is the mapping configuration:


   AttributeMapping
   targetAttribute
   lcv:landCoverObservation[1]/lcv:LandCoverObservation/lcv:
 class
   /targetAttribute
   targetAttributeNodexs:string/targetAttributeNode
   sourceExpression
   OCQLUCS2007/OCQL
   /sourceExpression
   /AttributeMapping


 lcv:class is declared in its xsd as xs:anyType.



 As you can see I am explicity declaring xs:string as the target attribute
 node type, and the app-schema mapping seems to work well with it. The
 problem seems to be the encoder, that uses ComplexSupportXSAnyTypeBinding
 to encode xs:anyType attributes.


 This binding class currently only support ComplexAttribute objects, but
 with my mapping the value is a simple String, so it doesn't get encoded at
 all.


 My idea is to change the encode method to:
1) call super.encode(...) when the value is not a ComplexAttribute
2) implement the encode method in the parent class (XSAnyTypeBinding)
 to handle simple value encoding, something like:


   public Element encode(Object value, Document document, Element
 element)
  throws Exception {
  if (value != null) {
   Text text = document.createTextNode(Converters.convert(value,
 String.class));
   element.appendChild(text);
   }
  return element;
  }


 In alternative I can do all the work in ComplexSupportXSAnyTypeBinding
 encode method, without touching XSAnyTypeBinding.


 Anyone with app-schema / complex types experience can give me an advice
 on this?


 Thanks
 Mauro



 --
 ==
 GeoServer Professional Services from the experts! Visit
 http://goo.gl/NWWaa2 for more information.
 ==



 Dott. Mauro Bartolomeoli
 @mauro_bart
 Senior Software Engineer


 GeoSolutions S.A.S.
 Via Poggio alle Viti 1187
 55054  Massarosa (LU)
 Italy
 phone: +39 0584 962313
 fax: +39 0584 1660272


 http://www.geo-solutions.it
 http://twitter.com/geosolutions_it


 ---


 AVVERTENZE AI SENSI DEL D.Lgs. 196/2003Le informazioni contenute in
 questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da
 considerarsi strettamente riservate. Il loro utilizzo è consentito
 esclusivamente al destinatario del messaggio, per le finalità indicate nel
 messaggio stesso. Qualora riceviate questo messaggio senza esserne il
 destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail 

Re: [Geotools-devel] app-schema and xs:anyType encoding

2015-02-26 Thread Mauro Bartolomeoli
Hi Ben,
probably you are right, declaring that targetAttributeNode is used in a
wrong way in my usecase, I added it trying to understand why the lcv:class
attribute (declared as xs:anyType) was not encoded in GML. Probably, after
the patch to anyType handling I talk about in my email (that's the main
point of my issue, not the targetAttributeNode usage) it would work also
without it (I will try).

The main issue remains: is it correct to add handling of primitive
(simple)  types to xs:anyType bindings and which approach seems better to
you, changing ComplexSupportXSAnyTypeBinding or its parent class
XSAnyTypeBinding?

Any hint is appreciated.

Thanks
Mauro Bartolomeoli

2015-02-25 21:32 GMT+01:00 Ben Caradoc-Davies b...@transient.nz:

 Mauro,

 targetAttributeNode must be applied to the containing property type
 lcv:landCoverObservation[1]/lcv:LandCoverObservation, not the terminal
 node. I am not sure exactly what you should use in this case, but please
 see these pages for examples:
 http://docs.geoserver.org/latest/en/user/data/app-
 schema/mapping-file.html#targetattributenode-optional
 http://docs.geoserver.org/latest/en/user/data/app-
 schema/polymorphism.html#any-type

 Kind regards,
 Ben.

 On 25/02/15 23:24, mauro.bartolomeoli wrote:

 Hi,I have an unexpected behaviour in app-schema mappings, when I have to
 deal with an attribute declared as xs:anyType.

  From my understanding of the xs:anyType meaning, this can be mapped to
 simple (xs:string, etc.) or complex types.
 Currently if I map an xs:anyType attribute to an xs:string it doesn't get
 encoded in the final GML3 document.


 This is the mapping configuration:


  AttributeMapping
  targetAttribute
  lcv:landCoverObservation[1]/lcv:LandCoverObservation/lcv:
 class
  /targetAttribute
  targetAttributeNodexs:string/targetAttributeNode
  sourceExpression
  OCQLUCS2007/OCQL
  /sourceExpression
  /AttributeMapping


 lcv:class is declared in its xsd as xs:anyType.



 As you can see I am explicity declaring xs:string as the target attribute
 node type, and the app-schema mapping seems to work well with it. The
 problem seems to be the encoder, that uses ComplexSupportXSAnyTypeBinding
 to encode xs:anyType attributes.


 This binding class currently only support ComplexAttribute objects, but
 with my mapping the value is a simple String, so it doesn't get encoded at
 all.


 My idea is to change the encode method to:
   1) call super.encode(...) when the value is not a ComplexAttribute
   2) implement the encode method in the parent class (XSAnyTypeBinding)
 to handle simple value encoding, something like:


  public Element encode(Object value, Document document, Element
 element)
 throws Exception {
 if (value != null) {
  Text text = document.createTextNode(Converters.convert(value,
 String.class));
  element.appendChild(text);
  }
 return element;
 }


 In alternative I can do all the work in ComplexSupportXSAnyTypeBinding
 encode method, without touching XSAnyTypeBinding.


 Anyone with app-schema / complex types experience can give me an advice
 on this?


 Thanks
 Mauro



 --
 ==
 GeoServer Professional Services from the experts! Visit
 http://goo.gl/NWWaa2 for more information.
 ==



 Dott. Mauro Bartolomeoli
 @mauro_bart
 Senior Software Engineer


 GeoSolutions S.A.S.
 Via Poggio alle Viti 1187
 55054  Massarosa (LU)
 Italy
 phone: +39 0584 962313
 fax: +39 0584 1660272


 http://www.geo-solutions.it
 http://twitter.com/geosolutions_it


 ---


 AVVERTENZE AI SENSI DEL D.Lgs. 196/2003Le informazioni contenute in
 questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da
 considerarsi strettamente riservate. Il loro utilizzo è consentito
 esclusivamente al destinatario del messaggio, per le finalità indicate nel
 messaggio stesso. Qualora riceviate questo messaggio senza esserne il
 destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di
 procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro
 sistema. Conservare il messaggio stesso, divulgarlo anche in parte,
 distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità
 diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs.
 196/2003. The information in this message and/or attachments, is intended
 solely for the attention and use of the named addressee(s) and may be
 confidential or proprietary in nature or covered by the provisions of
 privacy act (Legislative Decree June, 30 2003, no.196 - Italy's

 New Data Protection Code).Any use not in accord with its purpose, any
 disclosure, reproduction, copying, distribution, or either dissemination,
 either whole or partial, is strictly forbidden except previous formal
 approval of the named addressee(s). If you are not the intended recipient,
 please 

[Geotools-devel] app-schema and xs:anyType encoding

2015-02-25 Thread mauro.bartolomeoli
Hi,I have an unexpected behaviour in app-schema mappings, when I have to deal 
with an attribute declared as xs:anyType.
From my understanding of the xs:anyType meaning, this can be mapped to simple 
(xs:string, etc.) or complex types.
Currently if I map an xs:anyType attribute to an xs:string it doesn't get 
encoded in the final GML3 document.


This is the mapping configuration:


    AttributeMapping
        targetAttribute
            lcv:landCoverObservation[1]/lcv:LandCoverObservation/lcv:class
        /targetAttribute
        targetAttributeNodexs:string/targetAttributeNode
        sourceExpression
            OCQLUCS2007/OCQL
        /sourceExpression
    /AttributeMapping


lcv:class is declared in its xsd as xs:anyType.



As you can see I am explicity declaring xs:string as the target attribute node 
type, and the app-schema mapping seems to work well with it. The problem seems 
to be the encoder, that uses ComplexSupportXSAnyTypeBinding to encode 
xs:anyType attributes.


This binding class currently only support ComplexAttribute objects, but with my 
mapping the value is a simple String, so it doesn't get encoded at all.


My idea is to change the encode method to:
 1) call super.encode(...) when the value is not a ComplexAttribute
 2) implement the encode method in the parent class (XSAnyTypeBinding) to 
handle simple value encoding, something like:


    public Element encode(Object value, Document document, Element element)
throws Exception {
if (value != null) {
            Text text = document.createTextNode(Converters.convert(value, 
String.class));
            element.appendChild(text);
        }
return element;
   }


In alternative I can do all the work in ComplexSupportXSAnyTypeBinding encode 
method, without touching XSAnyTypeBinding.


Anyone with app-schema / complex types experience can give me an advice on this?


Thanks
Mauro



-- 
==
GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.
==



Dott. Mauro Bartolomeoli
@mauro_bart
Senior Software Engineer


GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax:     +39 0584 1660272


http://www.geo-solutions.it
http://twitter.com/geosolutions_it


---


AVVERTENZE AI SENSI DEL D.Lgs. 196/2003Le informazioni contenute in questo 
messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi 
strettamente riservate. Il loro utilizzo è consentito esclusivamente al 
destinatario del messaggio, per le finalità indicate nel messaggio stesso. 
Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo 
cortesemente di darcene notizia via e-mail e di procedere alla distruzione del 
messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio 
stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od 
utilizzarlo per finalità diverse, costituisce comportamento contrario ai 
principi dettati dal D.Lgs. 196/2003. The information in this message and/or 
attachments, is intended solely for the attention and use of the named 
addressee(s) and may be confidential or proprietary in nature or covered by the 
provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy's 
New Data Protection Code).Any use not in accord with its purpose, any 
disclosure, reproduction, copying, distribution, or either dissemination, 
either whole or partial, is strictly forbidden except previous formal approval 
of the named addressee(s). If you are not the intended recipient, please 
contact immediately the sender by telephone, fax or e-mail and delete the 
information in this message that has been received in error. The sender does 
not give any warranty or accept liability as the content, accuracy or 
completeness of sent messages and accepts no responsibility  for changes made 
after they were sent or for other risks which arise as a result of e-mail 
transmission, viruses, etc.--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/___
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel


[Geotools-devel] app-schema and xs:anyType encoding

2015-02-25 Thread Mauro Bartolomeoli
Hi,
I have an unexpected behaviour in app-schema mappings, when I have to deal
with an attribute declared as xs:anyType.
From my understanding of the xs:anyType meaning, this can be mapped to
simple (xs:string, etc.) or complex types.
Currently if I map an xs:anyType attribute to an xs:string it doesn't get
encoded in the final GML3 document.

This is the mapping configuration:

AttributeMapping
targetAttribute
lcv:landCoverObservation[1]/lcv:LandCoverObservation/lcv:class
/targetAttribute
targetAttributeNodexs:string/targetAttributeNode
sourceExpression
OCQLUCS2007/OCQL
/sourceExpression
/AttributeMapping

lcv:class is declared in its xsd as xs:anyType.

As you can see I am explicity declaring xs:string as the target attribute
node type, and the app-schema mapping seems to work well with it. The
problem seems to be the encoder, that uses ComplexSupportXSAnyTypeBinding
to encode xs:anyType attributes.

This binding class currently only support ComplexAttribute objects, but
with my mapping the value is a simple String, so it doesn't get encoded at
all.

My idea is to change the encode method to:
 1) call super.encode(...) when the value is not a ComplexAttribute
 2) implement the encode method in the parent class (XSAnyTypeBinding) to
handle simple value encoding, something like:

public Element encode(Object value, Document document, Element element)
throws Exception {
if (value != null) {
Text text = document.createTextNode(Converters.convert(value,
String.class));
element.appendChild(text);
}
return element;
  }

In alternative I can do all the work in ComplexSupportXSAnyTypeBinding encode
method, without touching XSAnyTypeBinding.

Anyone with app-schema / complex types experience can give me an advice on
this?

Thanks
Mauro



-- 
==
GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.
==

Dott. Mauro Bartolomeoli
@mauro_bart
Senior Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

---

*AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*

Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.



The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility  for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.
--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/___
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel


Re: [Geotools-devel] app-schema and xs:anyType encoding

2015-02-25 Thread Ben Caradoc-Davies
Mauro,

targetAttributeNode must be applied to the containing property type 
lcv:landCoverObservation[1]/lcv:LandCoverObservation, not the terminal 
node. I am not sure exactly what you should use in this case, but please 
see these pages for examples:
http://docs.geoserver.org/latest/en/user/data/app-schema/mapping-file.html#targetattributenode-optional
http://docs.geoserver.org/latest/en/user/data/app-schema/polymorphism.html#any-type

Kind regards,
Ben.

On 25/02/15 23:24, mauro.bartolomeoli wrote:
 Hi,I have an unexpected behaviour in app-schema mappings, when I have to deal 
 with an attribute declared as xs:anyType.
  From my understanding of the xs:anyType meaning, this can be mapped to 
 simple (xs:string, etc.) or complex types.
 Currently if I map an xs:anyType attribute to an xs:string it doesn't get 
 encoded in the final GML3 document.


 This is the mapping configuration:


  AttributeMapping
  targetAttribute
  lcv:landCoverObservation[1]/lcv:LandCoverObservation/lcv:class
  /targetAttribute
  targetAttributeNodexs:string/targetAttributeNode
  sourceExpression
  OCQLUCS2007/OCQL
  /sourceExpression
  /AttributeMapping


 lcv:class is declared in its xsd as xs:anyType.



 As you can see I am explicity declaring xs:string as the target attribute 
 node type, and the app-schema mapping seems to work well with it. The problem 
 seems to be the encoder, that uses ComplexSupportXSAnyTypeBinding to encode 
 xs:anyType attributes.


 This binding class currently only support ComplexAttribute objects, but with 
 my mapping the value is a simple String, so it doesn't get encoded at all.


 My idea is to change the encode method to:
   1) call super.encode(...) when the value is not a ComplexAttribute
   2) implement the encode method in the parent class (XSAnyTypeBinding) to 
 handle simple value encoding, something like:


  public Element encode(Object value, Document document, Element element)
   throws Exception {
   if (value != null) {
  Text text = document.createTextNode(Converters.convert(value, 
 String.class));
  element.appendChild(text);
  }
   return element;
 }


 In alternative I can do all the work in ComplexSupportXSAnyTypeBinding encode 
 method, without touching XSAnyTypeBinding.


 Anyone with app-schema / complex types experience can give me an advice on 
 this?


 Thanks
 Mauro



 --
 ==
 GeoServer Professional Services from the experts! Visit
 http://goo.gl/NWWaa2 for more information.
 ==



 Dott. Mauro Bartolomeoli
 @mauro_bart
 Senior Software Engineer


 GeoSolutions S.A.S.
 Via Poggio alle Viti 1187
 55054  Massarosa (LU)
 Italy
 phone: +39 0584 962313
 fax: +39 0584 1660272


 http://www.geo-solutions.it
 http://twitter.com/geosolutions_it


 ---


 AVVERTENZE AI SENSI DEL D.Lgs. 196/2003Le informazioni contenute in questo 
 messaggio di posta elettronica e/o nel/i file/s allegato/i sono da 
 considerarsi strettamente riservate. Il loro utilizzo è consentito 
 esclusivamente al destinatario del messaggio, per le finalità indicate nel 
 messaggio stesso. Qualora riceviate questo messaggio senza esserne il 
 destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di 
 procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro 
 sistema. Conservare il messaggio stesso, divulgarlo anche in parte, 
 distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità 
 diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 
 196/2003. The information in this message and/or attachments, is intended 
 solely for the attention and use of the named addressee(s) and may be 
 confidential or proprietary in nature or covered by the provisions of privacy 
 act (Legislative Decree June, 30 2003, no.196 - Italy's
 New Data Protection Code).Any use not in accord with its purpose, any 
disclosure, reproduction, copying, distribution, or either dissemination, 
either whole or partial, is strictly forbidden except previous formal approval 
of the named addressee(s). If you are not the intended recipient, please 
contact immediately the sender by telephone, fax or e-mail and delete the 
information in this message that has been received in error. The sender does 
not give any warranty or accept liability as the content, accuracy or 
completeness of sent messages and accepts no responsibility  for changes made 
after they were sent or for other risks which arise as a result of e-mail 
transmission, viruses, etc.



 --
 Dive into the World of Parallel Programming The Go Parallel Website, sponsored
 by Intel and developed in partnership with Slashdot Media, is your hub for all
 things parallel software development, from weekly thought leadership blogs to
 news, videos, 

[Geotools-devel] app-schema and xs:anyType encoding

2015-02-25 Thread Mauro Bartolomeoli
Hi,
I have an unexpected behaviour in app-schema mappings, when I have to deal
with an attribute declared as xs:anyType.
From my understanding of the xs:anyType meaning, this can be mapped to
simple (xs:string, etc.) or complex types.
Currently if I map an xs:anyType attribute to an xs:string it doesn't get
encoded in the final GML3 document.

This is the mapping configuration:

AttributeMapping
targetAttribute
lcv:landCoverObservation[1]/lcv:LandCoverObservation/lcv:class
/targetAttribute
targetAttributeNodexs:string/targetAttributeNode
sourceExpression
OCQLUCS2007/OCQL
/sourceExpression
/AttributeMapping

lcv:class is declared in its xsd as xs:anyType.

As you can see I am explicity declaring xs:string as the target attribute
node type, and the app-schema mapping seems to work well with it. The
problem seems to be the encoder, that uses ComplexSupportXSAnyTypeBinding
to encode xs:anyType attributes.

This binding class currently only support ComplexAttribute objects, but
with my mapping the value is a simple String, so it doesn't get encoded at
all.

My idea is to change the encode method to:
 1) call super.encode(...) when the value is not a ComplexAttribute
 2) implement the encode method in the parent class (XSAnyTypeBinding) to
handle simple value encoding, something like:

public Element encode(Object value, Document document, Element element)
throws Exception {
if (value != null) {
Text text = document.createTextNode(Converters.convert(value,
String.class));
element.appendChild(text);
}
return element;
  }

In alternative I can do all the work in ComplexSupportXSAnyTypeBinding encode
method, without touching XSAnyTypeBinding.

Anyone with app-schema / complex types experience can give me an advice on
this?

Thanks
Mauro



-- 
==
GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.
==

Dott. Mauro Bartolomeoli
@mauro_bart
Senior Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

---

*AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*

Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.



The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility  for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.
--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/___
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel