com.citygrid.content.places.detail
Class CGPlacesDetail

java.lang.Object
  extended by com.citygrid.content.places.detail.CGPlacesDetail
All Implemented Interfaces:
Serializable, Cloneable

public class CGPlacesDetail
extends Object
implements Serializable, Cloneable

A builder for invoking the CityGrid Places Detail API as documented at http://docs.citygridmedia.com/display/citygridv2/Places+API.

Once user have selected a place from results returned by CGPlacesSearch, we will display the full location data of this place. We will use the location ID returned from the search.

CGPlacesDetail detail = CityGrid.placesDetail();
    detail.setLocationId(295889);
    detail.setPlacement("search_page");

    CGPlacesDetailResults results = detail.detail();
    for (CGPlacesDetailLocation location : results.getLocations()) {
       assertDetailLocation(location, parent);
    }

Once you have the detail location, you can convenient track the location is displayed. See CGPlacesSearch for code sample.

See Also:
Serialized Form

Field Summary
private  boolean allResults
           
static String CGPlacesDetailUri
           
private  int connectTimeout
           
private  boolean customerOnly
           
private  String impressionId
           
private  int infoUsaId
           
private  int locationId
           
private  String phone
           
private  String placement
           
private  String publicId
           
private  String publisher
           
private  int readTimeout
           
private  int reviewCount
           
 
Constructor Summary
CGPlacesDetail(String publisher)
           
 
Method Summary
private  Map<String,Object> build()
           
 Object clone()
           
 CGPlacesDetailResults detail()
           
 boolean equals(Object o)
           
 int getConnectTimeout()
           
 String getImpressionId()
           
 int getInfoUsaId()
           
 int getLocationId()
           
 String getPhone()
           
 String getPlacement()
           
 String getPublicId()
           
 String getPublisher()
           
 int getReadTimeout()
           
 int getReviewCount()
           
 int hashCode()
           
 boolean isAllResults()
           
 boolean isCustomerOnly()
           
static CGPlacesDetail placesDetail()
           
static CGPlacesDetail placesDetailWithPlacement(String placement)
           
static CGPlacesDetail placesDetailWithPublisher(String publisher)
           
static CGPlacesDetail placesDetailWithPublisherAndPlacement(String publisher, String placement)
           
private  CGPlacesDetailAttribute[] processAttributes(org.codehaus.jackson.JsonNode parsedAttributes)
           
private  CGPlacesDetailCategory[] processCategories(org.codehaus.jackson.JsonNode parsedCategories)
           
private  CGPlacesDetailCustomerContent processCustomerContent(org.codehaus.jackson.JsonNode parsedCustomerContent)
           
private  CGPlacesDetailCustomerMessage processCustomerMessage(org.codehaus.jackson.JsonNode parsedCustomerMessage)
           
private  CGPlacesDetailEditorial[] processEditorials(org.codehaus.jackson.JsonNode editorialsNode)
           
private  CGPlacesDetailGroup[] processGroups(org.codehaus.jackson.JsonNode parsedGroups)
           
private  CGPlacesDetailImage[] processImages(org.codehaus.jackson.JsonNode imagesNode)
           
private  CGPlacesDetailLocation processLocation(org.codehaus.jackson.JsonNode locationNode)
           
private  CGPlacesDetailOffer[] processOffers(org.codehaus.jackson.JsonNode parsedOffers)
           
(package private)  CGPlacesDetailResults processResults(org.codehaus.jackson.JsonNode rootNode)
           
private  CGBaseReview[] processReviews(org.codehaus.jackson.JsonNode parsedReviews)
           
private  CGPlacesDetailReviews processReviewsInfo(org.codehaus.jackson.JsonNode reviewsInfoNode)
           
private  CGPlacesDetailTip[] processTips(org.codehaus.jackson.JsonNode parsedTips)
           
private  CGPlacesDetailUrls processUrls(org.codehaus.jackson.JsonNode parsedUrls, String impressionId)
           
 void setAllResults(boolean allResults)
           
 void setConnectTimeout(int connectTimeout)
           
 void setCustomerOnly(boolean customerOnly)
           
 void setImpressionId(String impressionId)
           
 void setInfoUsaId(int infoUsaId)
           
 void setLocationId(int locationId)
           
 void setPhone(String phone)
           
 void setPlacement(String placement)
           
 void setPublicId(String publicId)
           
 void setPublisher(String publisher)
           
 void setReadTimeout(int readTimeout)
           
 void setReviewCount(int reviewCount)
           
 String toString()
           
private  List<CGError> validate()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

CGPlacesDetailUri

public static final String CGPlacesDetailUri
See Also:
Constant Field Values

publisher

private String publisher

locationId

private int locationId

infoUsaId

private int infoUsaId

phone

private String phone

customerOnly

private boolean customerOnly

allResults

private boolean allResults

reviewCount

private int reviewCount

placement

private String placement

connectTimeout

private int connectTimeout

readTimeout

private int readTimeout

impressionId

private String impressionId

publicId

private String publicId
Constructor Detail

CGPlacesDetail

public CGPlacesDetail(String publisher)
Method Detail

placesDetail

public static CGPlacesDetail placesDetail()

placesDetailWithPublisher

public static CGPlacesDetail placesDetailWithPublisher(String publisher)

placesDetailWithPlacement

public static CGPlacesDetail placesDetailWithPlacement(String placement)

placesDetailWithPublisherAndPlacement

public static CGPlacesDetail placesDetailWithPublisherAndPlacement(String publisher,
                                                                   String placement)

detail

public CGPlacesDetailResults detail()
                             throws CGException
Throws:
CGException

validate

private List<CGError> validate()

build

private Map<String,Object> build()

processLocation

private CGPlacesDetailLocation processLocation(org.codehaus.jackson.JsonNode locationNode)

processImages

private CGPlacesDetailImage[] processImages(org.codehaus.jackson.JsonNode imagesNode)

processReviewsInfo

private CGPlacesDetailReviews processReviewsInfo(org.codehaus.jackson.JsonNode reviewsInfoNode)

processReviews

private CGBaseReview[] processReviews(org.codehaus.jackson.JsonNode parsedReviews)

processEditorials

private CGPlacesDetailEditorial[] processEditorials(org.codehaus.jackson.JsonNode editorialsNode)

processTips

private CGPlacesDetailTip[] processTips(org.codehaus.jackson.JsonNode parsedTips)

processAttributes

private CGPlacesDetailAttribute[] processAttributes(org.codehaus.jackson.JsonNode parsedAttributes)

processCategories

private CGPlacesDetailCategory[] processCategories(org.codehaus.jackson.JsonNode parsedCategories)

processGroups

private CGPlacesDetailGroup[] processGroups(org.codehaus.jackson.JsonNode parsedGroups)

processOffers

private CGPlacesDetailOffer[] processOffers(org.codehaus.jackson.JsonNode parsedOffers)

processCustomerContent

private CGPlacesDetailCustomerContent processCustomerContent(org.codehaus.jackson.JsonNode parsedCustomerContent)

processCustomerMessage

private CGPlacesDetailCustomerMessage processCustomerMessage(org.codehaus.jackson.JsonNode parsedCustomerMessage)

processUrls

private CGPlacesDetailUrls processUrls(org.codehaus.jackson.JsonNode parsedUrls,
                                       String impressionId)

processResults

CGPlacesDetailResults processResults(org.codehaus.jackson.JsonNode rootNode)

getPublisher

public String getPublisher()

setPublisher

public void setPublisher(String publisher)

getLocationId

public int getLocationId()

setLocationId

public void setLocationId(int locationId)

getInfoUsaId

public int getInfoUsaId()

setInfoUsaId

public void setInfoUsaId(int infoUsaId)

getPublicId

public String getPublicId()

setPublicId

public void setPublicId(String publicId)

getPhone

public String getPhone()

setPhone

public void setPhone(String phone)

isCustomerOnly

public boolean isCustomerOnly()

setCustomerOnly

public void setCustomerOnly(boolean customerOnly)

isAllResults

public boolean isAllResults()

setAllResults

public void setAllResults(boolean allResults)

getReviewCount

public int getReviewCount()

setReviewCount

public void setReviewCount(int reviewCount)

getPlacement

public String getPlacement()

setPlacement

public void setPlacement(String placement)

getConnectTimeout

public int getConnectTimeout()

setConnectTimeout

public void setConnectTimeout(int connectTimeout)

getReadTimeout

public int getReadTimeout()

setReadTimeout

public void setReadTimeout(int readTimeout)

getImpressionId

public String getImpressionId()

setImpressionId

public void setImpressionId(String impressionId)

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

clone

public Object clone()
             throws CloneNotSupportedException
Overrides:
clone in class Object
Throws:
CloneNotSupportedException


Copyright © 2011. All Rights Reserved.