Projects >> fluxtream-app >>df7e5e419ad60a65201453bc79348c8a0182d8e9

Chunk
Conflicting content
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
<<<<<<< HEAD
import javax.servlet.http.HttpServletResponse;
import com.fluxtream.Configuration;
import com.fluxtream.services.GuestService;
=======
import com.fluxtream.Configuration;
import com.fluxtream.connectors.Connector;
import com.fluxtream.connectors.controllers.BaseGoogleOAuthController;
import com.fluxtream.connectors.controllers.ControllerSupport;
import com.fluxtream.services.GuestService;
import com.google.gdata.client.authn.oauth.GoogleOAuthHelper;
import com.google.gdata.client.authn.oauth.OAuthHmacSha1Signer;
>>>>>>> 12b0200f9baf209d824730d0a29dbee39ce21e6b
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
Solution content
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.fluxtream.Configuration;
import com.fluxtream.services.GuestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
File
GoogleCalendarOAuthController.java
Developer's decision
Version 1
Kind of conflict
Import
Chunk
Conflicting content
	GuestService guestService;

	@RequestMapping(value = "/token")
<<<<<<< HEAD
	public String getLatitudeToken(HttpServletRequest request,
			HttpServletResponse response) throws IOException, ServletException {
		//return super.accessToken(request, CALENDAR_TOKEN_SECRET,
		//		GOOGLE_CALENDAR_SCOPE, env.get("homeBaseUrl")
		//				+ "calendar/upgradeToken");
        return null;
	}

	@RequestMapping(value = "/upgradeToken")
	public String upgradeToken(HttpServletRequest request,
			HttpServletResponse response) throws IOException {
		//return super.authorizeToken(request, CALENDAR_TOKEN_SECRET,
		//		Connector.getConnector("GOOGLE_CALENDAR"), null);
        return null;
=======
	public String getLatitudeToken(HttpServletRequest request) throws IOException, ServletException {
		return super.accessToken(request, CALENDAR_TOKEN_SECRET,
				GOOGLE_CALENDAR_SCOPE, ControllerSupport.getLocationBase(request)
						+ "calendar/upgradeToken");
	}

	@RequestMapping(value = "/upgradeToken")
	public String upgradeToken(HttpServletRequest request) throws IOException {
		return super.authorizeToken(request, CALENDAR_TOKEN_SECRET,
				Connector.getConnector("GOOGLE_CALENDAR"), null);
>>>>>>> 12b0200f9baf209d824730d0a29dbee39ce21e6b
	}

	protected GuestService guestService() {
Solution content
	GuestService guestService;

	@RequestMapping(value = "/token")
	public String getLatitudeToken(HttpServletRequest request,
			HttpServletResponse response) throws IOException, ServletException {
		//return super.accessToken(request, CALENDAR_TOKEN_SECRET,
		//		GOOGLE_CALENDAR_SCOPE, env.get("homeBaseUrl")
		//				+ "calendar/upgradeToken");
        return null;
	}

	@RequestMapping(value = "/upgradeToken")
	public String upgradeToken(HttpServletRequest request,
			HttpServletResponse response) throws IOException {
		//return super.authorizeToken(request, CALENDAR_TOKEN_SECRET,
		//		Connector.getConnector("GOOGLE_CALENDAR"), null);
        return null;
	protected GuestService guestService() {
	}
File
GoogleCalendarOAuthController.java
Developer's decision
Version 1
Kind of conflict
Annotation
Comment
Method declaration
Method invocation
Method signature
Return statement
Chunk
Conflicting content
	private void loadHistory(UpdateInfo updateInfo, long from, long to)
			throws Exception {
<<<<<<< HEAD
        //String accessToken = oAuth2Helper.getAccessToken(updateInfo.apiKey);
        //HttpTransport transport = this.getTransport(updateInfo.apiKey);
        //String key = env.get("google_latitudeApiKey");
        //List locationList = executeList(updateInfo, transport,
			//	key, 1000, from, to, accessToken);
        //if (locationList != null && locationList.size() > 0) {
			//List storedLocations = new ArrayList();
			//for (LocationFacet locationResource : locationList) {
			//	if (locationResource.timestampMs==0)
			//		continue;
        //        locationResource.guestId = updateInfo.getGuestId();
        //        locationResource.apiKeyId = updateInfo.apiKey.getId();
			//	locationResource.start = locationResource.timestampMs;
			//	locationResource.end = locationResource.timestampMs;
        //        locationResource.source = LocationFacet.Source.GOOGLE_LATITUDE;
        //        locationResource.apiKeyId = updateInfo.apiKey.getId();
        //        locationResource.api= updateInfo.apiKey.getConnector().value();
        //
			//	storedLocations.add(locationResource);
			//}
        //    apiDataService.addGuestLocations(updateInfo.getGuestId(), storedLocations);
			//Collections.sort(storedLocations);
			//LocationFacet oldest = storedLocations.get(0);
        //    // Check if there is potentially a second or more of data left to get.  If so,
        //    // recurse with a new to time of a second before the oldest location we currently have.
        //    // Otherwise, end now
        //    if(oldest.timestampMs-1000 >= from) {
        //        loadHistory(updateInfo, from, oldest.timestampMs-1000);
        //    }
        //}
=======
        String accessToken = oAuth2Helper.getAccessToken(updateInfo.apiKey);
		HttpTransport transport = this.getTransport(updateInfo.apiKey);
		String key = guestService.getApiKeyAttribute(updateInfo.apiKey, "google_latitudeApiKey");
		List locationList = executeList(updateInfo, transport,
				key, 1000, from, to, accessToken);
		if (locationList != null && locationList.size() > 0) {
			List storedLocations = new ArrayList();
			for (LocationFacet locationResource : locationList) {
				if (locationResource.timestampMs==0)
					continue;
                locationResource.guestId = updateInfo.getGuestId();
                locationResource.apiKeyId = updateInfo.apiKey.getId();
				locationResource.start = locationResource.timestampMs;
				locationResource.end = locationResource.timestampMs;
                locationResource.source = LocationFacet.Source.GOOGLE_LATITUDE;
                locationResource.apiKeyId = updateInfo.apiKey.getId();
                locationResource.api= updateInfo.apiKey.getConnector().value();

				storedLocations.add(locationResource);
			}
            apiDataService.addGuestLocations(updateInfo.getGuestId(), storedLocations);
			Collections.sort(storedLocations);
			LocationFacet oldest = storedLocations.get(0);
            // Check if there is potentially a second or more of data left to get.  If so,
            // recurse with a new to time of a second before the oldest location we currently have.
            // Otherwise, end now
            if(oldest.timestampMs-1000 >= from) {
                loadHistory(updateInfo, from, oldest.timestampMs-1000);
            }
        }
>>>>>>> 12b0200f9baf209d824730d0a29dbee39ce21e6b
	}

	private List executeList(UpdateInfo updateInfo,
Solution content
	private void loadHistory(UpdateInfo updateInfo, long from, long to)
			throws Exception {
        //String accessToken = oAuth2Helper.getAccessToken(updateInfo.apiKey);
        //HttpTransport transport = this.getTransport(updateInfo.apiKey);
        //String key = env.get("google_latitudeApiKey");
        //List locationList = executeList(updateInfo, transport,
			//	key, 1000, from, to, accessToken);
        //if (locationList != null && locationList.size() > 0) {
			//List storedLocations = new ArrayList();
			//for (LocationFacet locationResource : locationList) {
			//	if (locationResource.timestampMs==0)
			//		continue;
        //        locationResource.guestId = updateInfo.getGuestId();
        //        locationResource.apiKeyId = updateInfo.apiKey.getId();
			//	locationResource.start = locationResource.timestampMs;
			//	locationResource.end = locationResource.timestampMs;
        //        locationResource.source = LocationFacet.Source.GOOGLE_LATITUDE;
        //        locationResource.apiKeyId = updateInfo.apiKey.getId();
        //        locationResource.api= updateInfo.apiKey.getConnector().value();
        //
			//	storedLocations.add(locationResource);
			//}
        //    apiDataService.addGuestLocations(updateInfo.getGuestId(), storedLocations);
			//Collections.sort(storedLocations);
			//LocationFacet oldest = storedLocations.get(0);
        //    // Check if there is potentially a second or more of data left to get.  If so,
        //    // recurse with a new to time of a second before the oldest location we currently have.
        //    // Otherwise, end now
        //    if(oldest.timestampMs-1000 >= from) {
        //        loadHistory(updateInfo, from, oldest.timestampMs-1000);
        //    }
        //}
	}

	private List executeList(UpdateInfo updateInfo,
File
GoogleLatitudeUpdater.java
Developer's decision
Version 1
Kind of conflict
Comment
If statement
Method invocation
Variable
Chunk
Conflicting content
<<<<<<< HEAD
package com.fluxtream.connectors.twitter;

import java.util.List;
=======
	package com.fluxtream.connectors.twitter;

    import java.util.List;
>>>>>>> 12b0200f9baf209d824730d0a29dbee39ce21e6b
import com.fluxtream.aspects.FlxLogger;
import com.fluxtream.connectors.ObjectType;
import com.fluxtream.connectors.annotations.JsonFacetCollection;
Solution content
	package com.fluxtream.connectors.twitter;

    import java.util.List;
import com.fluxtream.aspects.FlxLogger;
import com.fluxtream.connectors.ObjectType;
import com.fluxtream.connectors.annotations.JsonFacetCollection;
File
TwitterFeedUpdater.java
Developer's decision
Version 1
Kind of conflict
Import
Package declaration
Chunk
Conflicting content
        em.persist(new ConnectorInfo(googleCalendar,
                                     "/images/connectors/connector-google_calendar.jpg",
                                     res.getString("google_calendar"),
<<<<<<< HEAD
                                     "/google/oauth2/token?scope=https://www.googleapis.com/auth/calendar.readonly",
                                     Connector.getConnector("google_calendar"), order++, true));
        em.persist(new ConnectorInfo("Last fm",
=======
                                     "/calendar/token",
                                     Connector.getConnector("google_calendar"), order++, googleCalendarKeys!=null,
                                     false, true, googleCalendarKeys));
        final String lastFm = "Last fm";
        String[] lastFmKeys = checkKeysExist(lastFm, Arrays.asList("lastfmConsumerKey", "lastfmConsumerSecret"));
        em.persist(new ConnectorInfo(lastFm,
>>>>>>> 12b0200f9baf209d824730d0a29dbee39ce21e6b
                                     "/images/connectors/connector-lastfm.jpg",
                                     res.getString("lastfm"),
                                     "/lastfm/token",
Solution content
        em.persist(new ConnectorInfo(googleCalendar,
                                     "/images/connectors/connector-google_calendar.jpg",
                                     res.getString("google_calendar"),
                                     "/google/oauth2/token?scope=https://www.googleapis.com/auth/calendar.readonly",
                                     Connector.getConnector("google_calendar"), order++, true));
        em.persist(new ConnectorInfo("Last fm",
                                     "/calendar/token",
                                     Connector.getConnector("google_calendar"), order++, googleCalendarKeys!=null,
                                     false, true, googleCalendarKeys));
        final String lastFm = "Last fm";
        String[] lastFmKeys = checkKeysExist(lastFm, Arrays.asList("lastfmConsumerKey", "lastfmConsumerSecret"));
        em.persist(new ConnectorInfo(lastFm,
                                     "/images/connectors/connector-lastfm.jpg",
                                     res.getString("lastfm"),
                                     "/lastfm/token",
File
SystemServiceImpl.java
Developer's decision
Concatenation
Kind of conflict
Method invocation
Variable