If this is a literal quote from your JSON file, you'll need to
reorganize it so the items are all flat, not nested. That is, give your
item with id: 0 a sensible value for the type: property (Text?), make
the objects that are fileReferences their own items, and give them a
separate type: value (File?) and an identifier.
Your property fileReferences should be set as having a valueType: of
"item" in a schema. See
http://simile.mit.edu/wiki/Exhibit/Getting_Started_Tutorial#Schema
Finally, fileReferences should list the Files by reference to their
identifier. Your expression would read ".fileReferences.fileName".
The core of your question appears to be about extracting one item out of
a list - but order of values is not maintained, and there is no support
for an expression syntax using information about the original ordering.
If you want just one list element, I would suggest using a different
property for the File you want to show.
{
"items": [
{
"id": 0,
"name": "IDS_BLA_BLUB",
"count": 4,
"label": "blablub"
"fileReferences": [ "SatSettings.java", "prop.ini" ]
},
{
"label": "SatSettings.java",
"fileName": "D:\\Development\\eclipse_workspace\\bla\SatSettings.java"
...
],
"properties": {
"fileReferences" : {
"valueType": "item"
How's your scripting? There isn't a feature for that in Exhibit that I
know of, you'll have to implement your own solution.
If Javascript isn't your favorite, and if it's not too much work for you
to generate data, perhaps you can add a new property
fileReferencesExcerpt to your JSON generation pipeline that does the
selection of N items before Exhibit ever receives data.
Otherwise we're talking about adding a new Exhibit expression, or a new
Exhibit importer that does the selecting of N items into a new property
at load time, or a completely separate script that truncates Exhibit's
output; and I'm sure there are other possibilities.
One more time for the prize. Keep the flat database I suggested in my
first response. That's a hard requirement. What you excerpted below is
really no different from your original question.
The additional property I'm suggesting is in conjunction with your full
fileList property. You'd have the complete fileList and you'd also have
another property (fileListExcerpt, say) that contained just N of the
entries in the fileList.
<span ex:content=".fileReferences.fileName"></span>
which will display as a list of every item in the fileReferences value list.