Hello.

I have patched Exhibit3 a little bit, according to our discussions.
I now load hierarchical JSON structures in the database correctly (I hope :)
cf http://search.datao.net/test/index2.html

The trick is to call _loadItem recursively.

Unfortunately, the HTML display is still wrong in my page.
I think that my lens definitions are wrong.

For the moment, I wrote something like this:

<div data-ex-role="viewPanel">
<div data-ex-role="view"
     data-ex-view-class="Thumbnail"
     data-ex-show-all="true"
     data-ex-paginate="true"
>
<table data-ex-role="lens" class="itemThumbnail" style="display:
none;" data-ex-item-types="x">
<tr>
<td style="vertial-align:bottom" class="itemThumbnail-thumbnailContainer">
<div style="position: relative">
 <div data-ex-content=".a"></div>
</div>
</td>
</tr>
</table>
<div data-ex-role="lens" data-ex-item-types="a">
 <span data-ex-content=".label"></span>
</div>
</div>
</div>

The first lens displays the outer JSON object of my data.
Inside that lens, the <div data-ex-content=".a"></div> is supposed to
delegate the display of the inner JSON object (of type a, and
available from the outer JSON object via the path .a) to a second
lens, dedicated to objects of type "a".
But that delegation does not happen, it seems.

Can anyone help me debug that part of my example?

On Fri, Sep 2, 2016 at 8:57 PM, David Karger <[email protected]> wrote:
> Exhibit uses a "graph structured" data model, of entities that can be
> connected to other entities in arbitrary shapes.  Any hierarchically
> structured data can easily be represented in a graph structured model---it's
> just graph structured data without cycles. But I can see the
> appeal/convenience of wanting use a hierarchical representation in the json
> file as well.  This does raise one problem/issue.
>
> Exhibit does use a graph representation internally, based on every item
> having a label or id that can be referenced to point to the item.  If you
> load an item without a label or id, exhibit makes one up.
>
> So, in loading the hierarchical data, one needs to extract (or generate) the
> label/id of the child item, and represent the child connection by inserting
> a reference to the child label into the database.
>
> I'd be happy to take a pull request implementing this.
>
>
>
>
> On 09/02/2016 01:53 PM, Olivier Rossel wrote:
>>
>> That sounds good.
>> But requires some JSON preprocessing.
>>
>> Could it be smarter to patch the _loadItems function in Exhibit so it
>> automatically adds in the database any nested objects it meets?
>>
>>
>> Envoyé de mon iPhone
>>
>>> Le 2 sept. 2016 à 18:33, Luis Miguel Morillas <[email protected]> a
>>> écrit :
>>>
>>> 2016-09-02 12:18 GMT+02:00 Olivier Rossel <[email protected]>:
>>>>
>>>> Making the nested objects first class items would pollute my facets, no?
>>>
>>> No, because you'll work with your default collection. Look at the
>>> collection's definition.
>>>
>>>> (In my case, the nested objects are really nested. They are a part of an
>>>> item, not item themselves).
>>>>
>>>> Envoyé de mon iPhone
>>>>
>>>>> Le 2 sept. 2016 à 09:25, Luis Miguel Morillas <[email protected]> a
>>>>> écrit :
>>>>>
>>>>> Maybe you should use a normalized json:
>>>>>
>>>>> {
>>>>>    "items": [{
>>>>>        "interests": ["xx", "yy"],
>>>>>        "label": "toto",
>>>>>        "type": "x",
>>>>>        "a": "1.1",
>>>>>        "id": "1"
>>>>>    },
>>>>>        { "b": "1", "label": "tata", "id": "1.1", "type": "y" }],
>>>>>    "properties": {
>>>>>        "a": {
>>>>>            "valueType": "item"
>>>>>        }
>>>>>    }
>>>>> }
>>>>>
>>>>> And create a default collection: <div
>>>>> data-ex-role="exhibit-collection" data-ex-item-types="x"></div>
>>>>>
>>>>> I've never used a nested structure in the json data.
>>>>>
>>>>> Saludos,
>>>>>
>>>>> -- luismiguel  (@lmorillas)
>>>>>
>>>>>
>>>>> 2016-09-01 23:55 GMT+02:00 Olivier Rossel <[email protected]>:
>>>>>>
>>>>>> Yes.
>>>>>>
>>>>>> I made them available at those URLs:
>>>>>> http://search.datao.net/test/index.html
>>>>>> http://search.datao.net/test/index2.html
>>>>>>
>>>>>> The first one fails to display the .a.b for an item.
>>>>>> The second one displays fine the .label of an item
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Wed, Aug 31, 2016 at 5:51 PM, Luis Miguel Morillas
>>>>>> <[email protected]> wrote:
>>>>>>>
>>>>>>> Are you exhibit example online? It's easier to test it.
>>>>>>>
>>>>>>> Saludos,
>>>>>>>
>>>>>>> -- luismiguel  (@lmorillas)
>>>>>>>
>>>>>>>
>>>>>>> 2016-08-25 18:23 GMT+02:00 David Karger <[email protected]>:
>>>>>>>>
>>>>>>>> On quick glance this looks right.   I am traveling till Monday will
>>>>>>>> look
>>>>>>>> then.
>>>>>>>>
>>>>>>>> Sent from BlueMail
>>>>>>>>
>>>>>>>> On Aug 25, 2016, at 12:14 PM, Olivier Rossel
>>>>>>>> <[email protected]>
>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>> Hi everyone.
>>>>>>>>>
>>>>>>>>> I need some help about lens configuration in Exhibit 3.
>>>>>>>>>
>>>>>>>>> My items have a nested structure where the property "a"
>>>>>>>>> contains an object with a property "b":
>>>>>>>>> { "items": [
>>>>>>>>>   {
>>>>>>>>>    "label":"toto",
>>>>>>>>>    "type":"x",
>>>>>>>>>    "a": {"b":"1"}
>>>>>>>>>   }
>>>>>>>>> ]
>>>>>>>>> }
>>>>>>>>>
>>>>>>>>> I wish I could define my item thumbnail to be its .a.b value
>>>>>>>>> wrapped in a
>>>>>>>>> div.
>>>>>>>>>
>>>>>>>>> Such HTML does not seem to work in that case:
>>>>>>>>>
>>>>>>>>> <div data-ex-role="viewPanel">
>>>>>>>>> <div data-ex-role="view"
>>>>>>>>>     data-ex-view-class="Thumbnail"
>>>>>>>>>     data-ex-show-all="true"
>>>>>>>>>     data-ex-paginate="true"
>>>>>>>>> <table data-ex-role="lens" class="itemThumbnail" style="display:
>>>>>>>>> none;">
>>>>>>>>> <tr>
>>>>>>>>> <td style="vertial-align:bottom"
>>>>>>>>> class="itemThumbnail-thumbnailContainer">
>>>>>>>>> <div style="position: relative">
>>>>>>>>> <div
>>>>>>>>> data-ex-content=".a.b"/>
>>>>>>>>> </div>
>>>>>>>>> </td>
>>>>>>>>> </tr>
>>>>>>>>> </table>
>>>>>>>>> </div>
>>>>>>>>> </div>
>>>>>>>>>
>>>>>>>>> I get nothing displayed in my view panel.
>>>>>>>>>
>>>>>>>>> What kind of syntax must be used to display a nested valye inside a
>>>>>>>>> <div>
>>>>>>>>> ?
>>>>>>>>>
>>>>>>>>> Any help is welcome!
>>>>>>>>>
>>>>>>>>> PS: are there some Exhibit examples managing such nested data
>>>>>>>>> structures?
>>>>>>>>
>>>>>>>> --
>>>>>>>> You received this message because you are subscribed to the Google
>>>>>>>> Groups
>>>>>>>> "SIMILE Widgets" group.
>>>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>>>> send an
>>>>>>>> email to [email protected].
>>>>>>>> To post to this group, send email to
>>>>>>>> [email protected].
>>>>>>>> Visit this group at https://groups.google.com/group/simile-widgets.
>>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>
>>>>>>> --
>>>>>>> You received this message because you are subscribed to the Google
>>>>>>> Groups "SIMILE Widgets" group.
>>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>>> send an email to [email protected].
>>>>>>> To post to this group, send email to [email protected].
>>>>>>> Visit this group at https://groups.google.com/group/simile-widgets.
>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>
>>>>>> --
>>>>>> You received this message because you are subscribed to the Google
>>>>>> Groups "SIMILE Widgets" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>>> an email to [email protected].
>>>>>> To post to this group, send email to [email protected].
>>>>>> Visit this group at https://groups.google.com/group/simile-widgets.
>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "SIMILE Widgets" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to [email protected].
>>>>> To post to this group, send email to [email protected].
>>>>> Visit this group at https://groups.google.com/group/simile-widgets.
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "SIMILE Widgets" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to [email protected].
>>>> To post to this group, send email to [email protected].
>>>> Visit this group at https://groups.google.com/group/simile-widgets.
>>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "SIMILE Widgets" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an
>>> email to [email protected].
>>> To post to this group, send email to [email protected].
>>> Visit this group at https://groups.google.com/group/simile-widgets.
>>> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "SIMILE Widgets" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/simile-widgets.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"SIMILE Widgets" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/simile-widgets.
For more options, visit https://groups.google.com/d/optout.

Reply via email to