int i = 0;
int size = subscriptionVO.getSubscriptionFilterVOList().size();
Iterator<SubscriptionFilterVO> subscriptionFilterVOListIterator = subscriptionVO.getSubscriptionFilterVOList().iterator();
while(subscriptionFilterVOListIterator.hasNext())
{
SubscriptionFilterVO subscriptionFilterVO = subscriptionFilterVOListIterator.next();
sb.append(" <div id=\"filterRow_" + i + "\" class=\"formRow\" style=\"min-height: 50px; border: 0px solid red; border-bottom: 1px solid #bbb;\">");
sb.append(" <label for=\"filterType_" + i + "\">" + getLocalizedString(getLocale(), "tool.common.subscriptionFilterType.label") + "</label>");
sb.append(" <select id=\"filterType_" + i + "\" name=\"filterType_" + i + "\" onchange=\"updateConditionInput(" + i + ");\">");
sb.append(" <option value=\"0\"" + (subscriptionFilterVO.getFilterType().equals("0") ? "selected='selected'" : "") + ">Content types</option>");
sb.append(" <option value=\"1\"" + (subscriptionFilterVO.getFilterType().equals("1") ? "selected='selected'" : "") + ">Categories</option>");
sb.append(" </select>");
sb.append(" <label for=\"filterCondition_" + i + "\">" + getLocalizedString(getLocale(), "tool.common.subscriptionFilterCondition.label") + "</label>");
sb.append(" <select id=\"filterCondition_" + i + "\" name=\"filterCondition_" + i + "\" multiple=\"multiple\" size=\"3\" style=\"width: 130px;\">");
if(subscriptionFilterVO.getFilterType().equals("0"))
{
Iterator contentTypeDefintionVOListIterator = contentTypeDefintionVOList.iterator();
while(contentTypeDefintionVOListIterator.hasNext())
{
ContentTypeDefinitionVO ctd = (ContentTypeDefinitionVO)contentTypeDefintionVOListIterator.next();
sb.append("<option value=\"" + ctd.getId() + "\"" + (hasValue(subscriptionFilterVO.getFilterCondition(), ctd.getId().toString()) ? "selected='selected'" : "") + ">" + ctd.getName() + "</option>");
}
}
else if(subscriptionFilterVO.getFilterType().equals("1"))
{
Iterator categoryVOListIterator = categoryVOList.iterator();
while(categoryVOListIterator.hasNext())
{
CategoryVO categoryVO = (CategoryVO)categoryVOListIterator.next();
sb.append("<option value=\"" + categoryVO.getId() + "\"" + (hasValue(subscriptionFilterVO.getFilterCondition(), categoryVO.getId().toString()) ? "selected='selected'" : "") + ">" + categoryVO.getName() + "</option>");
}
}
sb.append(" </select>");
sb.append(" <a id=\"removeFilterRowLink" + i + "\" href=\"javascript:removeFilterRow(" + i + ");\">" + getLocalizedString(getLocale(), "tool.common.deleteFilter.label") + "</a>");
if(size-1 > i)
sb.append(" <p id=\"andParagraph_" + i + "\" style=\"padding: 30px; display: block;\">");
else
sb.append(" <p id=\"andParagraph_" + i + "\" style=\"padding: 30px; display: none;\">");
sb.append(" <label for=\"isAndCondition_" + i + "\">" + getLocalizedString(getLocale(), "tool.common.subscriptionFilterIsAndCondition.label") + "</label>");
sb.append(" <select id=\"isAndCondition_" + i + "\" name=\"isAndCondition_0\">';");
sb.append(" <option value=\"true\"" + (subscriptionFilterVO.getIsAndCondition().booleanValue() ? "selected='selected'" : "") + ">AND</option>';");
sb.append(" <option value=\"false\"" + (!subscriptionFilterVO.getIsAndCondition().booleanValue() ? "selected='selected'" : "") + ">OR</option>';");
sb.append(" </select>");
sb.append(" </p>");
sb.append(" </div>");
sb.append(" <div id=\"break_" + i + "\" style=\"clear:both\"></div>");