Iterate a List -

Dermot Butterfield - 06 September 2015

tl;dr

Iterate a List

The initial part of this example is simply retrieving a list of titles from an asset of type myAsset. This list of titles are passed into a variable of called listTitles using the listvarname attribute of the assetset:getattributevalues FatWire tag.

This list is then iterated through using the ics:listloop tag by passing the var name listTitles into the listname attribute.  This tag will step through each item in the list with can then be accessed in the loop using ics:listget tag.   ics:listget allows access to the current item in the loop and we can access any fieldname associated with that type.  Fieldname refers to the attributes of the asset you are looping through. 

In the example below we want the value of the associated title and we are assigning this value to a variable called title. We can finally use the ics.GetVar("") Java method to access a FatWire specific variable. In this case the value is output to the browser.

<assetset:setasset name="objAsset" type="myAsset" id="<%=ics.GetVar("cid")%>" />
<assetset:getattributevalues name="objAsset" attribute="Title" listvarname="listTitles" typename="myAttribute" />
 
<ics:listloop listname="listTitles">
 
	<ics:listget listname="listTitles" fieldname="value" output="title" />
	<%=ics.GetVar("title")%>
 
</ics:listloop>

Contact Us

I hope you found this useful or if you have any questions don't hesitate to leave a comment or contact support[@]tomred[.]net

Articles

Java

This what I have spent most of my time working in over the years and these are the little bits of logic or snippets I have come across. Some of these are things I have needed to search for or I have found I needed to feedback on code reviews.

Oracle WebCenter (FatWire)

During my time working in consulting I was tasked many times with delivering FatWire sites. I took notes due to the lack of useful documentation at the time. These are the results of those notes made and shared.

CSS HTML JS

I believe the majority of time on a project is spent with the UI. Web is no exception. I have compiled a set of articles covering HTML, CSS and JS with the intention of taking the sting out of this work.

DevOps

A space dedicated to all those things you need to know beyond writing code. This covers Linux, Windows, Git and SVN among other hopefully useful nuggets.

Security

I picked up some pointers over the years consulting for government and banking sectors before entering a PCI DSS development environment. This section covers aspects like coding, testing, code review and best practice.

Apps

Apps is a section which offers access to bits and pieces I have put together over the last few years. This includes Random Password Generator and Base64 Encoder.