writer.writeAttribute(ComponentConstants.ID_ATTRIBUTE, googleSearchList.getClientId(context),
ComponentConstants.ID_ATTRIBUTE);
// get the component attributes.
List<ServiceParameter> parameters = new ArrayList<ServiceParameter>();
GoogleSearchService googleSearchService = GoogleServicesFactory.getGoogleSearchService();
parameters.add(new ServiceParameter(GoogleSearchServiceParameters.VERSION, "1.0"));
parameters.add(new ServiceParameter(GoogleSearchServiceParameters.QUERY, googleSearchList.getSearchQuery()));
parameters.add(new ServiceParameter(GoogleSearchServiceParameters.START, googleSearchList.getStartResultIndex().toString()));
parameters.add(new ServiceParameter(GoogleSearchServiceParameters.RSZ, googleSearchList.getResultSetSize()));
parameters.add(new ServiceParameter(GoogleSearchServiceParameters.HL, googleSearchList.getHostLanguage()));
if (googleSearchList.getKey() != null) {
parameters.add(new ServiceParameter(GoogleSearchServiceParameters.KEY, googleSearchList.getKey()));
}
// perform the actual video search on youTube.
List<GoogleSearchResultItem> googleSearchResults = googleSearchService.getWebSearchResultList(parameters);
// encode results .
UIComponent itemFacet = googleSearchList.getFacet(GOOGLE_RESULT_ITEM);
if (itemFacet == null) {