Hi,
Did you try with defining of new document of type Address and document contact to extend Folder, for example, and to define for Contact to contains only documents of type Address? In this case you can search for ecm:parent in addresses, specific field for Address etc... The other approach is to use Directory service - I'm not sure what is exactly the case. DirectoryService is very useful - the example is users/groups (addresses/contacts). And the third - low level - direct usage of hibernate for example - but in this case you will have to write everything your own.
Regards,
Stefan
Hi All!

I can not find how to use complex type fields in NXQL queries :(
I'll very appreciate any help in this area.

In more details:

- I need to have Contact document type which has the list of addresses.
- Also, it would be nice to search for Contact by it's address. - Also, it is possible that we will need to have possibility to search for all documents which have address with some criteria (NXQL work nice for polymorphic queries if different documents reuse some schema "select * from Document where reused_schema_prefix:fields_name='pattern'"; but it does not work for complex types "sub-documents").

I have the following XSD:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
targetNamespace="http://.../contact"; xmlns:tns="http://.../contact"; />

<xs:complexType name="address">
<xs:sequence>
<xs:element name="street" type="xs:string" />
<xs:element name="city" type="xs:string" />
...
</xs:sequence>
</xs:complexType>
...
<xs:complexType name="contact_addresses">
<xs:sequence>
<xs:element name="contact_address" type="tns:address" ... />
</xs:sequence>
</xs:complexType>
...
<xs:element name="contact_addresses" type="tns:contact_addresses" />
</xs:schema>

Nuxeo store XSD complexType "address" as sub-document (record in dedicated table "address" + record 
in "hierarchy" table with "isproperty=true" flag).
When I try to search something using NXQL syntax: <select * from Document where address:city = 'my native 
city'>, Nuxeo recognize "address:cit" field, and join "address" table properly with 
correct predicate, but it additionally checks if "hierarchy.primarytype" value equals to one of registered 
core type (address is not core type in my case, it is field). So, as result, Nuxeo can not find my contact by its 
address :(
Is there are any other way to map collection of complex type (more then one 
primitive field where xsd list works fine) and have possibility to search 
document by it's complex type fields?

P.S. I've read related nuxeo-book chapters and QueryTestCase.java sources. It 
did not help me in this case :(

Best regards,
Alexader Litvin.
--
Posted by "alexander.litvin" at Nuxeo Discussions <http://nuxeo.org/discussions>
View the complete thread: 
<http://www.nuxeo.org/discussions/thread.jspa?threadID=3265#9786>
_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm
To unsubscribe, go to http://lists.nuxeo.com/mailman/options/ecm


_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm
To unsubscribe, go to http://lists.nuxeo.com/mailman/options/ecm

Reply via email to