Reply
Ags
Visitor
Ags
Posts: 2
Registered: ‎02-14-2012
0 Kudos

Accessing a video's custom fields in JSP EL

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-4d5ce13cde26">${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!

Brightcove Team
BC-Oscar
Posts: 503
Registered: ‎12-11-2008
0 Kudos

Re: Accessing a video's custom fields in JSP EL

 

 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

http://docs.brightcove.com/en/media/#Video_Read 

Ags
Visitor
Ags
Posts: 2
Registered: ‎02-14-2012
0 Kudos

Re: Accessing a video's custom fields in JSP EL

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.

 

Brightcove Team
BC-Oscar
Posts: 503
Registered: ‎12-11-2008
0 Kudos

Re: Accessing a video's custom fields in JSP EL

 

  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. 

 

http://bc-j-mapi-w.sourceforge.net/javadoc/com/brightcove/proserve/mediaapi/wrapper/apiobjects/Custo...