02-28-2012 03:41 PM
Hello,
I'd like to loop through a set of Videos in my JSP. I want to display some basic fields, plus one custom field called "keyword."
What syntax should I be using, since this doesn't work?
${current.customFields.['keyword']}
Snippet below:
<c:forEach items="${results}" var="current">
<tr>
<td>${current.id}</td>
<td>
<a class="edit-link" href="edit-form.html" data-videoRefId="b1048b83-ee26-4512-ab71-4d5ce13cd e26">${current.name}</a>
<p>${current.shortDescription}</p>
<span class="hide">${current.id} ${current.referenceId} ${current.longDescription}</span>
</td>
<td>${current.tags}</td>
<td>${current.customFields}</td>
<td>${current.customFields.['keyword']}</td> <=== this does not work
<td>
<div class="btn-group">
<a href="#" data-toggle="dropdown" class="btn dropdown-toggle">Action <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a class="edit-link" href="edit-form.html"><i class="icon-pencil"></i> Edit</a></li>
<li><a href="search?method=delete&videoId=${current.id}" class="delete-link"><i class="icon-trash"></i> Delete</a></li>
</ul>
</div>
</td>
</tr>
</c:forEach>
Thanks!
02-29-2012 09:48 AM
Is customFields null too? What method in the Media API are you calling? The customFields field has to be explicitaly requested in the video_fields to be returned. For example:
command=find_all_videos&video_fields=name,shortDescription,customFields
You can find the fields that are returned by default in this document
02-29-2012 10:56 AM
Sorry I wasn't clear before.
Yes, the custom fields are populated.
For example, I can say
<td>${current.customFields}</td>
And this is the result in the JSP. What I really want is to just print the value of the custom field Taxonomy.
02-29-2012 12:05 PM
The image helped a lot. It looks like we are using one of the open source frameworks out there for the Media API. For this specific case I found on the docs for this API, and it looks that for accessing a value in this class you need to call getValue()
Here is the doc I'm refering too.
Brightcove Inc., a leading global provider of cloud content services, provides a family of products used to publish and distribute the world's professional digital media. The company's products include Brightcove Video Cloud, the market-leading online video platform, and Brightcove App Cloud, the pioneering content app platform. Together, more than 4,200 customers in 50 countries rely on Brightcove's cloud content services to build and operate exceptional media experiences across PCs, smartphones, tablets and connected TVs.
Brightcove Inc.
© 2012 Brightcove Inc.
