writer.writeAttribute(ComponentConstants.ID_ATTRIBUTE, diggSearchList.getClientId(context),
ComponentConstants.ID_ATTRIBUTE);
// get the component attributes.
List<ServiceParameter> parameters = new ArrayList<ServiceParameter>();
DiggSearchService diggSearchService = DiggServicesFactory.getDiggSearchService();
parameters.add(new ServiceParameter(DiggSearchServiceParameters.SEARCH_ARGS_SEARCH_QUERY, diggSearchList.getSearchQuery()));
parameters.add(new ServiceParameter(DiggSearchServiceParameters.SEARCH_ARGS_OFFSET, diggSearchList.getStartResultIndex().toString()));
parameters.add(new ServiceParameter(DiggSearchServiceParameters.SEARCH_ARGS_COUNT, diggSearchList.getResultSetSize().toString()));
if (diggSearchList.getDomain() != null) {
parameters.add(new ServiceParameter(DiggSearchServiceParameters.SEARCH_ARGS_DOMAIN, diggSearchList.getDomain()));
}
if (diggSearchList.getSortBy() != null) {
parameters.add(new ServiceParameter(DiggSearchServiceParameters.SEARCH_ARGS_SORT, diggSearchList.getSortBy()));
}
// perform the actual stories search on digg.
List<DiggSearchStoryResultItem> diggSearchResults = diggSearchService.getStoriesList(parameters).getSearchResultList();
// encode results .
UIComponent itemFacet = diggSearchList.getFacet(DIGG_STORIES_RESULT_ITEM);
if (itemFacet == null) {