/** Share the data by using Email. */ private void onEmailShareEvent() { MixpanelUtil.Click_On_Email(); if (!(AppClientFactory.isAnonymous())) { AppClientFactory.getInjector() .getUserService() .getUserProfileDetails( AppClientFactory.getLoggedInUser().getGooruUId(), new SimpleAsyncCallback<SettingDo>() { @Override public void onSuccess(SettingDo result) { socialDo.setEmailId(result.getExternalId()); EmailShareUc emailShare = new EmailShareUc(socialDo) { public void triggerEmailEvent(boolean confirmStaus) { triggerShareDataEvent(PlayerDataLogEvents.MAIL, confirmStaus); } }; emailShare.show(); emailShare.center(); } }); } else { LoginPopupUc popup = new LoginPopupUc(); popup.setGlassEnabled(true); popup.show(); popup.center(); } }
/** * Call Twitter share event * * @param clickEvent instance of {@link ClickEvent} */ @UiHandler("twitterPanel") public void onTwitterClickEvent(ClickEvent event) { if (!(socialDo.getShareType().equalsIgnoreCase("private"))) { if (AppClientFactory.getCurrentPlaceToken().equals(PlaceTokens.RESOURCE_SEARCH)) { MixpanelUtil.Click_Twitter_FromResource(); } else if (AppClientFactory.getCurrentPlaceToken().equals(PlaceTokens.COLLECTION_SEARCH)) { MixpanelUtil.Click_Twitter_FromCollection(); } else if (AppClientFactory.getCurrentPlaceToken().equals(PlaceTokens.COLLECTION_PLAY) || AppClientFactory.getCurrentPlaceToken().equals(PlaceTokens.PREVIEW_PLAY)) { if (socialShareContainer.getElement().getId().equalsIgnoreCase("collectionShareViewPage")) { MixpanelUtil.ClickTwitterFromShareInCollectionplayer(); } else if (socialShareContainer .getElement() .getId() .equalsIgnoreCase("collectionShareSummaryPage")) { MixpanelUtil.ClickTwitterFromSummaryPageInCollectionplayer(); } } onTwisterShareEvent(); } }
/** Share the data by using FB. */ private void onFbShareEvent() { MixpanelUtil.Click_On_FaceBook(); if (AppClientFactory.getCurrentPlaceToken().equals(PlaceTokens.PROFILE_PAGE)) { if (socialDo.getIsSearchShare()) { triggerShareDataEvent(PlayerDataLogEvents.FACEBOOK, false); SocialShareView.postOnFacebook( socialDo.getTitle(), socialDo.getRawUrl(), description, categoryImage.getUrl()); // Window.open( // "http://www.facebook.com/sharer/sharer.php?s=100&p[url]=" // + socialDo.getRawUrl() + "&p[images][0]=" // + socialDo.getThumbnailurl() + "&p[title]=" // + socialDo.getTitle().replaceAll("\\+", "%2B") + "&p[summary]=" + description, // "_blank", "width=626,height=436"); } else { triggerShareDataEvent(PlayerDataLogEvents.FACEBOOK, false); String title = i18n.GL1995() + " " + i18n.GL1433(); String token = Window.Location.getHref(); SocialShareView.postOnFacebook( title, socialDo.getRawUrl(), getAsHtml(description) + " " + token, categoryImage.getUrl()); // Window.open( // "http://www.facebook.com/sharer/sharer.php?s=100&p[url]=" // +socialDo.getRawUrl() + "&p[images][0]=" // + socialDo.getThumbnailurl() + "&p[title]=" // + "Check out "+socialDo.getTitle().replaceAll("\\+", "%2B")+" on Gooru" + // "&p[summary]=" + description, // "_blank", "width=626,height=436"); } } else { triggerShareDataEvent(PlayerDataLogEvents.FACEBOOK, false); SocialShareView.postOnFacebook( socialDo.getTitle(), socialDo.getRawUrl(), description, categoryImage.getUrl()); // Window.open( // "http://www.facebook.com/sharer/sharer.php?s=100&p[url]=" // + socialDo.getRawUrl() + "&p[images][0]=" // + socialDo.getThumbnailurl() + "&p[title]=" // + socialDo.getTitle().replaceAll("\\+", "%2B") + "&p[summary]=" + description, // "_blank", "width=626,height=436"); } }
/** Share the data by using Twister. */ private void onTwisterShareEvent() { MixpanelUtil.Click_On_Twitter(); if (AppClientFactory.getCurrentPlaceToken().equals(PlaceTokens.PROFILE_PAGE)) { if (socialDo.getIsSearchShare()) { triggerShareDataEvent(PlayerDataLogEvents.TWITTER, false); Window.open( "http://twitter.com/intent/tweet?text=" + "Gooru - " + socialDo.getTitle().replaceAll("\\+", "%2B") + ": " + socialDo.getBitlylink(), "_blank", "width=600,height=300"); } else { triggerShareDataEvent(PlayerDataLogEvents.TWITTER, false); // Window.open("http://twitter.com/intent/tweet?text=" + "Check out // "+socialDo.getTitle().replaceAll("\\+", "%2B")+ "'s Gooru Profile Page - " + // socialDo.getBitlylink(), "_blank", "width=600,height=300"); Window.open( "http://twitter.com/intent/tweet?text=" + getEncodedUrl(i18n.GL1085_1()) + socialDo.getBitlylink(), "_blank", "width=600,height=300"); } } else { triggerShareDataEvent(PlayerDataLogEvents.TWITTER, false); Window.open( "http://twitter.com/intent/tweet?text=" + "Gooru - " + socialDo.getTitle().replaceAll("\\+", "%2B") + ": " + socialDo.getBitlylink(), "_blank", "width=600,height=300"); } }
/** * @function openResurceLink * @created_date : Jan 2, 2014 * @description To open original resource link in new tab. * @parm(s) : @param ClickEvent * @return : void * @throws : <Mentioned if any exceptions> */ @UiHandler("btnResourceLink") public void openResurceLink(ClickEvent event) { MixpanelUtil.mixpanelEvent("Player_Click_Linked_Out_Resource"); Window.open(collectionItemDo.getResource().getUrl(), "_blank", ""); }