src/org/ohmage/service/CampaignServices.java
public Collection<Campaign> campaignSearch(
			final String requestUsername,
			final String partialCampaignId,
			final String partialCampaignName,
			final String partialDescription,
			final String partialXml,
			final String partialAuthoredBy,
			final DateTime startDate,
			final DateTime endDate,
			final Campaign.PrivacyState privacyState,
			final Campaign.RunningState runningState) 
			throws ServiceException {
		
		try {
			Collection<Object> campaignSqlParameters = new LinkedList<Object>();
			
			String campaignSqlStmt = campaignQueries.getVisibleCampaignSearchSql(
					campaignSqlParameters,
					requestUsername,
					partialCampaignId,
					partialCampaignName,
					partialDescription,
					partialXml,
					partialAuthoredBy,
					startDate,
					endDate,
					privacyState,
					runningState);
						
			Collection<Campaign> campaignResults = 
					UserCampaignServices.instance().getCampaignInformation(
							campaignSqlStmt,
							campaignSqlParameters,
							requestUsername,
							true,
							true,
							true);

			return campaignResults;
			
		} catch(DataAccessException e) {
			throw new ServiceException(e);
		}
	}
/**
	 * Begins with all of the campaigns that exist in the system and then 
	 * removes those that don't match the parameterized criteria. If a  
	 * parameter is null, it is ignored. Therefore, if all parameters are null,
	 * then all campaign IDs are returned.
	 * 
	 * @param partialCampaignId Only return campaigns whose ID contains this
	 * 							value.
	 * 
	 * @param partialCampaignName Only return campaigns whose name contains 
	 * 							  this value.
	 * 
	 * @param partialDescription Only return campaigns whose description 
	 * 							 contains this value.
	 * 
	 * @param partialXml Only return campaigns whose XML contains this value.
	 * 
	 * @param partialAuthoredBy Only return campaigns whose authored by value
	 * 							contains this value.
	 * 
	 * @param startDate Only return campaigns that were created on or after 
	 * 					this date.
	 * 
	 * @param endDate Only return campaigns that were created on or before this
	 * 				  date.
	 * 
	 * @param privacyState Only return campaigns with this privacy state.
	 * 
	 * @param runningState Only return campaigns with this running state.
	 * 
	 * @return The set of campaign IDs.
	 * 
	 * @throws ServiceException There was an error.
	 */
Begins with all of the campaigns that exist in the system and then
removes those that don't match the parameterized criteria. If a
parameter is null, it is ignored. Therefore, if all parameters are null,
then all campaign IDs are returned.

@param partialCampaignId Only return campaigns whose ID contains this
value.

@param partialCampaignName Only return campaigns whose name contains
this value.

@param partialDescription Only return campaigns whose description
contains this value.

@param partialXml Only return campaigns whose XML contains this value.

@param partialAuthoredBy Only return campaigns whose authored by value
contains this value.

@param startDate Only return campaigns that were created on or after
this date.

@param endDate Only return campaigns that were created on or before this
date.

@param privacyState Only return campaigns with this privacy state.

@param runningState Only return campaigns with this running state.

@return The set of campaign IDs.

@throws ServiceException There was an error.
Begins with all of the campaigns that exist in the system and then removes those that don ' t match the parameterized criteria . If a parameter is null it is ignored . Therefore if all parameters are null then all campaign IDs are returned . @param partialCampaignId Only return campaigns whose ID contains this value . @param partialCampaignName Only return campaigns whose name contains this value . @param partialDescription Only return campaigns whose description contains this value . @param partialXml Only return campaigns whose XML contains this value . @param partialAuthoredBy Only return campaigns whose authored by value contains this value . @param startDate Only return campaigns that were created on or after this date . @param endDate Only return campaigns that were created on or before this date . @param privacyState Only return campaigns with this privacy state . @param runningState Only return campaigns with this running state . @return The set of campaign IDs . @throws ServiceException There was an error .
public Collection<Campaign> campaignSearch(
			final String requestUsername,
			final String partialCampaignId,
			final String partialCampaignName,
			final String partialDescription,
			final String partialXml,
			final String partialAuthoredBy,
			final DateTime startDate,
			final DateTime endDate,
			final Campaign.PrivacyState privacyState,
			final Campaign.RunningState runningState) 
			throws ServiceException {
		try {
			Collection<Object> campaignSqlParameters = new LinkedList<Object>();
			String campaignSqlStmt = campaignQueries.getVisibleCampaignSearchSql(
					campaignSqlParameters,
					requestUsername,
					partialCampaignId,
					partialCampaignName,
					partialDescription,
					partialXml,
					partialAuthoredBy,
					startDate,
					endDate,
					privacyState,
					runningState);
			Collection<Campaign> campaignResults = 
					UserCampaignServices.instance().getCampaignInformation(
							campaignSqlStmt,
							campaignSqlParameters,
							requestUsername,
							true,
							true,
							true);
			return campaignResults;
		} catch(DataAccessException e) {
			throw new ServiceException(e);
		}
	}
public Collection < Campaign > campaignSearch ( final String requestUsername , final String partialCampaignId , final String partialCampaignName , final String partialDescription , final String partialXml , final String partialAuthoredBy , final DateTime startDate , final DateTime endDate , final Campaign . PrivacyState privacyState , final Campaign . RunningState runningState ) throws ServiceException { try { Collection < Object > campaignSqlParameters = new LinkedList < Object > ( ) ; String campaignSqlStmt = campaignQueries . getVisibleCampaignSearchSql ( campaignSqlParameters , requestUsername , partialCampaignId , partialCampaignName , partialDescription , partialXml , partialAuthoredBy , startDate , endDate , privacyState , runningState ) ; Collection < Campaign > campaignResults = UserCampaignServices . instance ( ) . getCampaignInformation ( campaignSqlStmt , campaignSqlParameters , requestUsername , true , true , true ) ; return campaignResults ; } catch ( DataAccessException e ) { throw new ServiceException ( e ) ; } }
Begins with all of the campaigns that exist in the system and then
 removes those that don't match the parameterized criteria.
Begins with all of the campaigns that exist in the system and then removes those that don ' t match the parameterized criteria .