Permalink
Browse files

In progress ENCUESTAME-446

  • Loading branch information...
Juan Picado
Juan Picado committed Jun 4, 2012
1 parent f58b516 commit 218bc495165601e9033ad2260c0092b13c9bf594
Showing with 327 additions and 183 deletions.
  1. +1 −2 encuestame-business/src/main/java/org/encuestame/business/service/FrontEndServices.java
  2. +1 −16 encuestame-business/src/main/java/org/encuestame/business/service/TweetPollService.java
  3. +10 −1 encuestame-core/src/main/java/org/encuestame/core/util/ConvertDomainBean.java
  4. +2 −3 encuestame-mvc/src/main/java/org/encuestame/mvc/controller/json/LinksJsonController.java
  5. +0 −1 ...e-mvc/src/main/java/org/encuestame/mvc/controller/json/statistics/HashTagStatsJsonController.java
  6. +54 −4 encuestame-utils/src/main/java/org/encuestame/utils/json/LinksSocialBean.java
  7. +12 −6 encuestame-war/src/main/webapp/WEB-INF/views/home/web/hashtag.jsp
  8. +1 −0 encuestame-war/src/main/webapp/WEB-INF/wro.xml
  9. +55 −51 encuestame-war/src/main/webapp/resource/css/development.css
  10. +56 −0 encuestame-war/src/main/webapp/resource/css/web/components/social-links.css
  11. +9 −8 encuestame-war/src/main/webapp/resource/css/web/default.css
  12. +0 −36 encuestame-war/src/main/webapp/resource/css/web/public.css
  13. +26 −23 encuestame-war/src/main/webapp/resource/js/encuestame/org/core/commons/hashtags/HashTagGraph.js
  14. +55 −17 encuestame-war/src/main/webapp/resource/js/encuestame/org/core/commons/social/LinksPublished.js
  15. +4 −1 .../src/main/webapp/resource/js/encuestame/org/core/commons/social/templates/linksPublishedItem.html
  16. +36 −14 encuestame-war/src/main/webapp/resource/js/encuestame/org/core/shared/utils/TimeRangeDropDownMenu.js
  17. +5 −0 encuestame-war/src/main/webapp/resource/js/encuestame/org/main/EnmeMainLayoutWidget.js
@@ -1029,8 +1029,7 @@ public void processItemstoCalculateRelevance(
private Integer getHashTagLastPosition(final Date maxDate,
final String tagName) {
Integer lastPosValue = null;
- final List<HashTagRanking> tagRanking = getHashTagDao()
- .getHashTagRankingLastPosition(maxDate);
+ final List<HashTagRanking> tagRanking = getHashTagDao().getHashTagRankingLastPosition(maxDate);
if (tagRanking.size() > 0) {
for (int i = 0; i < tagRanking.size(); i++) {
if (tagRanking.get(i).getHashTag().getHashTag().equals(tagName)) {
@@ -1086,22 +1086,7 @@ public void checkTweetPollCompleteStatus(final TweetPoll tweetPoll) {
final List<LinksSocialBean> linksBean = new ArrayList<LinksSocialBean>();
final List<TweetPollSavedPublishedStatus> links = getTweetPollDao().getLinksByTweetPoll(tweetPoll , null, null, TypeSearchResult.TWEETPOLL);
log.debug("getTweetPollLinks: "+links.size());
- for (TweetPollSavedPublishedStatus tweetPollSavedPublishedStatus : links) {
- log.debug("getTweetPollLinks "+tweetPollSavedPublishedStatus.toString());
- final LinksSocialBean linksSocialBean = new LinksSocialBean();
- linksSocialBean.setProvider(tweetPollSavedPublishedStatus
- .getSocialAccount().getAccounType().name());
- linksSocialBean.setLink(SocialUtils.getSocialTweetPublishedUrl(
- tweetPollSavedPublishedStatus.getTweetId(),
- tweetPollSavedPublishedStatus.getSocialAccount()
- .getSocialAccountName(),
- tweetPollSavedPublishedStatus.getSocialAccount()
- .getAccounType()));
- linksBean.add(linksSocialBean);
- log.debug("getTweetPollLinks "+linksSocialBean.toString());
- }
-
- return linksBean;
+ return ConvertDomainBean.convertTweetPollSavedPublishedStatus(links);
}
/*
@@ -1173,10 +1173,11 @@ public static final ProfileRatedTopBean convertUserAccountToProfileRated(final U
/**
* Convert {@link TweetPollSavedPublishedStatus} to {@link LinksSocialBean}.
* @param tweetPollSavedPublishedStatus
- * @return
+ * @return {@link LinksSocialBean}
*/
public static final LinksSocialBean convertTweetPollSavedPublishedStatus(
final TweetPollSavedPublishedStatus tweetPollSavedPublishedStatus) {
+ final SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DateUtil.DEFAULT_FORMAT_DATE);
final LinksSocialBean linksSocialBean = new LinksSocialBean();
linksSocialBean.setProvider(tweetPollSavedPublishedStatus
.getSocialAccount().getAccounType().name());
@@ -1185,6 +1186,14 @@ public static final LinksSocialBean convertTweetPollSavedPublishedStatus(
tweetPollSavedPublishedStatus.getSocialAccount()
.getSocialAccountName(), tweetPollSavedPublishedStatus
.getSocialAccount().getAccounType()));
+ linksSocialBean
+ .setPublishedDate(simpleDateFormat
+ .format(tweetPollSavedPublishedStatus
+ .getPublicationDateTweet()));
+ linksSocialBean.setPublishText(tweetPollSavedPublishedStatus
+ .getTweetContent() == null ? tweetPollSavedPublishedStatus
+ .getTweetPoll().getQuestion().getQuestion()
+ : tweetPollSavedPublishedStatus.getTweetContent());
log.debug("getTweetPollLinks "+linksSocialBean.toString());
return linksSocialBean;
}
@@ -45,7 +45,7 @@
private Logger log = Logger.getLogger(this.getClass());
/**
- *
+ * Retrieve the social links where items has been published.
* @param id
* @param type
* @param request
@@ -65,8 +65,7 @@ public ModelMap getPublishedSocialLinks(
//FUTURE: Add SEARCHPERIODS Filter.
final Map<String, Object> jsonResponse = new HashMap<String, Object>();
if (TypeSearchResult.TWEETPOLL.name().equals(type)) {
- final TweetPoll tweetPoll = getTweetPollService()
- .getTweetPollById(Long.valueOf(id), null);
+ final TweetPoll tweetPoll = getTweetPollService().getTweetPollById(Long.valueOf(id), null);
jsonResponse.put("links", getTweetPollService()
.getTweetPollLinks(tweetPoll));
} else if (TypeSearchResult.POLL.name().equals(type)) {
@@ -141,7 +141,6 @@ public ModelMap getHashTagRankingStats(
jsonResponse.put("hashTagRankingStats", getFrontService().getHashTagRanking(tagName));
setItemResponse(jsonResponse);
} catch (Exception e) {
- // TODO: handle exception
log.error(e);
setError(e.getMessage(), response);
}
@@ -28,14 +28,31 @@
/** **/
private static final long serialVersionUID = -466651445270622763L;
-
+
+ /**
+ * Social Link url.
+ */
@JsonProperty(value = "link_url")
private String link;
-
+ /**
+ * Social Network Provider.
+ */
@JsonProperty(value = "provider_social")
private String provider;
-
+
+ /**
+ * Date of text is published.
+ */
+ @JsonProperty(value = "publishd_text")
+ private String publishText;
+
+ /**
+ * Published date.
+ */
+ @JsonProperty(value = "published_date")
+ private String publishedDate;
+
/**
* @return the link
@@ -69,9 +86,42 @@ public String getProvider() {
public void setProvider(String provider) {
this.provider = provider;
}
+
+ /**
+ * @return the publishText
+ */
+ @JsonIgnore
+ public String getPublishText() {
+ return publishText;
+ }
+
+
+ /**
+ * @param publishText the publishText to set
+ */
+ public void setPublishText(String publishText) {
+ this.publishText = publishText;
+ }
+
+
+ /**
+ * @return the publishedDate
+ */
+ @JsonIgnore
+ public String getPublishedDate() {
+ return publishedDate;
+ }
+
+
+ /**
+ * @param publishedDate the publishedDate to set
+ */
+ public void setPublishedDate(String publishedDate) {
+ this.publishedDate = publishedDate;
+ }
- /* (non-Javadoc)
+ /* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@Override
@@ -11,7 +11,8 @@
</div>
<div class="web-hashtag-options">
<div channel="/encuestame/hashtag/time/range/refresh/graph"
- dojoType="encuestame.org.core.shared.utils.TimeRangeDropDownMenu"></div>
+ dojoType="encuestame.org.core.shared.utils.TimeRangeDropDownMenu"
+ defaultDateRange="365"></div>
</div>
</section>
@@ -46,8 +47,10 @@
<section>
<div dojoType="encuestame.org.core.commons.social.LinksPublished"
channel="/encuestame/hashtag/time/range/refresh/graph"
- hasthag="${tagName.hashTagName}" class="web-social-links"
- type="HASHTAG"></div>
+ hasthag="${tagName.hashTagName}"
+ class="web-social-links"
+ type="HASHTAG">
+ </div>
</section>
</article>
</div>
@@ -61,7 +64,8 @@
channel="/encuestame/hashtag/time/range/refresh/graph"
typeGeneric="HASHTAG"
generic="${tagName.hashTagName}"
- id="generic"></div>
+ id="generic">
+ </div>
</article>
<article class="emne-box">
<header>
@@ -71,7 +75,8 @@
tagName="${tagName.hashTagName}"
channel="/encuestame/hashtag/time/range/refresh/graph"
class="web-rated-position"
- id="position"></section>
+ id="position">
+ </section>
</article>
<article class="emne-box">
<header>
@@ -81,7 +86,8 @@
hasthag="${tagName.hashTagName}"
channel="/encuestame/hashtag/time/range/refresh/graph"
class="web-top-profile"
- key="HASHTAG" id="topprofiles"></div>
+ key="HASHTAG" id="topprofiles">
+ </div>
</article>
</aside>
</div>
@@ -15,6 +15,7 @@
<css>/resource/css/common.css</css>
<css>/resource/css/reset.css</css>
<css>/resource/css/web/layout.css</css>
+ <css>/resource/css/web/components/*.css</css>
</group>
<group name='mobile'>
<css>/resource/css/mobile/default.css</css>
@@ -1,52 +1,56 @@
-.enme-dropdown-menu-wrapper {
- width: 120px;
-}
-
-.enme-dropdown-menu-wrapper .menu-expand {
- box-shadow: 0 0 3px -1px #454343 inset;
-}
-
-.enme-dropdown-menu-wrapper .enme-dropdown-menu {
- border: 1px solid #D4D4D4;
- border-radius: 3px 3px 3px 3px;
- cursor: pointer;
- font-weight: bold;
- min-width: 95px;
- padding: 5px;
- text-align: center;
- -webkit-touch-callout: none;
- -webkit-user-select: none;
- -khtml-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
-}
-
-.enme-dropdown-menu-wrapper ul {
- background-color: #767676;
- border: 1px solid #9A9A9A;
- border-radius: 0 0 6px 6px;
- box-shadow: 0 1px 1px 0 #373535;
- margin: 0 0 0 2px;
- position: absolute;
- top: 24px;
- width: 115px;
-}
-
-.enme-dropdown-menu-wrapper li.dropdown-item {
- color: #FFFFFF;
- cursor: pointer;
- font-size: 12px;
- line-height: 15px;
- list-style: none outside none;
- margin: 0;
- padding: 5px 7px;
- text-shadow: 0 1px #000000;
- width: auto;
-}
-
-.enme-dropdown-menu-wrapper li.dropdown-item:hover {
- background-color: white;
- color: black;
- text-shadow: 0 1px white;
+/** social links references **/
+div.web-social-links {
+ overflow: auto;
+}
+
+.web-social-links h2 {
+ color: #CBCBCB;
+ font-size: 14px;
+ font-weight: normal;
+ margin: 0;
+ padding: 15px;
+}
+
+.web-social-links .links .item {
+ font-size: 15px;
+ padding: 10px 20px;
+ position: relative;
+ cursor: pointer;
+}
+
+.web-social-links .item .link a {
+ text-decoration: none;
+}
+
+.web-social-links .item {
+ font-size: 14px;
+ overflow: auto;
+ padding: 11px 7px 5px 20px;
+ cursor: pointer;
+}
+
+.web-social-links .item:hover {
+ background-color: #E8E8E8;
+ box-shadow : 0 1px 2px #CCC;
+ -webkit-box-shadow : 0 1px 2px #CCC;
+ -ms-box-shadow : 0 1px 2px #ccc;
+ -moz-box-shadow : 0 1px 2px #ccc;
+
+}
+
+.web-social-links .item .img {
+ float: left;
+ overflow: hidden;
+}
+
+.web-social-links .item .link {
+ float: left;
+ margin-left: 16px;
+ width: 400px;
+}
+
+.web-social-links .item .social-date {
+ float: right;
+ margin-right: 10px;
+ font-size: 10px;
}
@@ -0,0 +1,56 @@
+/** social links references **/
+div.web-social-links {
+ overflow: auto;
+}
+
+.web-social-links h2 {
+ color: #CBCBCB;
+ font-size: 14px;
+ font-weight: normal;
+ margin: 0;
+ padding: 15px;
+}
+
+.web-social-links .links .item {
+ font-size: 15px;
+ padding: 10px 20px;
+ position: relative;
+ cursor: pointer;
+}
+
+.web-social-links .item .link a {
+ text-decoration: none;
+}
+
+.web-social-links .item {
+ font-size: 14px;
+ overflow: auto;
+ padding: 11px 7px 5px 20px;
+ cursor: pointer;
+}
+
+.web-social-links .item:hover {
+ background-color: #E8E8E8;
+ box-shadow : 0 1px 2px #CCC;
+ -webkit-box-shadow : 0 1px 2px #CCC;
+ -ms-box-shadow : 0 1px 2px #ccc;
+ -moz-box-shadow : 0 1px 2px #ccc;
+
+}
+
+.web-social-links .item .img {
+ float: left;
+ overflow: hidden;
+}
+
+.web-social-links .item .link {
+ float: left;
+ margin-left: 16px;
+ width: 400px;
+}
+
+.web-social-links .item .social-date {
+ float: right;
+ margin-right: 10px;
+ font-size: 10px;
+}
Oops, something went wrong.

0 comments on commit 218bc49

Please sign in to comment.