Skip to content

Commit

Permalink
In progress ENCUESTAME-446
Browse files Browse the repository at this point in the history
  • Loading branch information
Juan Picado committed Jun 4, 2012
1 parent f58b516 commit 218bc49
Show file tree
Hide file tree
Showing 17 changed files with 327 additions and 183 deletions.
Expand Up @@ -1029,8 +1029,7 @@ public void processItemstoCalculateRelevance(
private Integer getHashTagLastPosition(final Date maxDate, private Integer getHashTagLastPosition(final Date maxDate,
final String tagName) { final String tagName) {
Integer lastPosValue = null; Integer lastPosValue = null;
final List<HashTagRanking> tagRanking = getHashTagDao() final List<HashTagRanking> tagRanking = getHashTagDao().getHashTagRankingLastPosition(maxDate);
.getHashTagRankingLastPosition(maxDate);
if (tagRanking.size() > 0) { if (tagRanking.size() > 0) {
for (int i = 0; i < tagRanking.size(); i++) { for (int i = 0; i < tagRanking.size(); i++) {
if (tagRanking.get(i).getHashTag().getHashTag().equals(tagName)) { if (tagRanking.get(i).getHashTag().getHashTag().equals(tagName)) {
Expand Down
Expand Up @@ -1086,22 +1086,7 @@ public List<LinksSocialBean> getTweetPollLinks(final TweetPoll tweetPoll) {
final List<LinksSocialBean> linksBean = new ArrayList<LinksSocialBean>(); final List<LinksSocialBean> linksBean = new ArrayList<LinksSocialBean>();
final List<TweetPollSavedPublishedStatus> links = getTweetPollDao().getLinksByTweetPoll(tweetPoll , null, null, TypeSearchResult.TWEETPOLL); final List<TweetPollSavedPublishedStatus> links = getTweetPollDao().getLinksByTweetPoll(tweetPoll , null, null, TypeSearchResult.TWEETPOLL);
log.debug("getTweetPollLinks: "+links.size()); log.debug("getTweetPollLinks: "+links.size());
for (TweetPollSavedPublishedStatus tweetPollSavedPublishedStatus : links) { return ConvertDomainBean.convertTweetPollSavedPublishedStatus(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;
} }


/* /*
Expand Down
Expand Up @@ -1173,10 +1173,11 @@ public static final List<LinksSocialBean> convertTweetPollSavedPublishedStatus(
/** /**
* Convert {@link TweetPollSavedPublishedStatus} to {@link LinksSocialBean}. * Convert {@link TweetPollSavedPublishedStatus} to {@link LinksSocialBean}.
* @param tweetPollSavedPublishedStatus * @param tweetPollSavedPublishedStatus
* @return * @return {@link LinksSocialBean}
*/ */
public static final LinksSocialBean convertTweetPollSavedPublishedStatus( public static final LinksSocialBean convertTweetPollSavedPublishedStatus(
final TweetPollSavedPublishedStatus tweetPollSavedPublishedStatus) { final TweetPollSavedPublishedStatus tweetPollSavedPublishedStatus) {
final SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DateUtil.DEFAULT_FORMAT_DATE);
final LinksSocialBean linksSocialBean = new LinksSocialBean(); final LinksSocialBean linksSocialBean = new LinksSocialBean();
linksSocialBean.setProvider(tweetPollSavedPublishedStatus linksSocialBean.setProvider(tweetPollSavedPublishedStatus
.getSocialAccount().getAccounType().name()); .getSocialAccount().getAccounType().name());
Expand All @@ -1185,6 +1186,14 @@ public static final LinksSocialBean convertTweetPollSavedPublishedStatus(
tweetPollSavedPublishedStatus.getSocialAccount() tweetPollSavedPublishedStatus.getSocialAccount()
.getSocialAccountName(), tweetPollSavedPublishedStatus .getSocialAccountName(), tweetPollSavedPublishedStatus
.getSocialAccount().getAccounType())); .getSocialAccount().getAccounType()));
linksSocialBean
.setPublishedDate(simpleDateFormat
.format(tweetPollSavedPublishedStatus
.getPublicationDateTweet()));
linksSocialBean.setPublishText(tweetPollSavedPublishedStatus
.getTweetContent() == null ? tweetPollSavedPublishedStatus
.getTweetPoll().getQuestion().getQuestion()
: tweetPollSavedPublishedStatus.getTweetContent());
log.debug("getTweetPollLinks "+linksSocialBean.toString()); log.debug("getTweetPollLinks "+linksSocialBean.toString());
return linksSocialBean; return linksSocialBean;
} }
Expand Down
Expand Up @@ -45,7 +45,7 @@ public class LinksJsonController extends AbstractJsonController{
private Logger log = Logger.getLogger(this.getClass()); private Logger log = Logger.getLogger(this.getClass());


/** /**
* * Retrieve the social links where items has been published.
* @param id * @param id
* @param type * @param type
* @param request * @param request
Expand All @@ -65,8 +65,7 @@ public ModelMap getPublishedSocialLinks(
//FUTURE: Add SEARCHPERIODS Filter. //FUTURE: Add SEARCHPERIODS Filter.
final Map<String, Object> jsonResponse = new HashMap<String, Object>(); final Map<String, Object> jsonResponse = new HashMap<String, Object>();
if (TypeSearchResult.TWEETPOLL.name().equals(type)) { if (TypeSearchResult.TWEETPOLL.name().equals(type)) {
final TweetPoll tweetPoll = getTweetPollService() final TweetPoll tweetPoll = getTweetPollService().getTweetPollById(Long.valueOf(id), null);
.getTweetPollById(Long.valueOf(id), null);
jsonResponse.put("links", getTweetPollService() jsonResponse.put("links", getTweetPollService()
.getTweetPollLinks(tweetPoll)); .getTweetPollLinks(tweetPoll));
} else if (TypeSearchResult.POLL.name().equals(type)) { } else if (TypeSearchResult.POLL.name().equals(type)) {
Expand Down
Expand Up @@ -141,7 +141,6 @@ public ModelMap getHashTagRankingStats(
jsonResponse.put("hashTagRankingStats", getFrontService().getHashTagRanking(tagName)); jsonResponse.put("hashTagRankingStats", getFrontService().getHashTagRanking(tagName));
setItemResponse(jsonResponse); setItemResponse(jsonResponse);
} catch (Exception e) { } catch (Exception e) {
// TODO: handle exception
log.error(e); log.error(e);
setError(e.getMessage(), response); setError(e.getMessage(), response);
} }
Expand Down
Expand Up @@ -28,14 +28,31 @@ public class LinksSocialBean implements Serializable {


/** **/ /** **/
private static final long serialVersionUID = -466651445270622763L; private static final long serialVersionUID = -466651445270622763L;


/**
* Social Link url.
*/
@JsonProperty(value = "link_url") @JsonProperty(value = "link_url")
private String link; private String link;



/**
* Social Network Provider.
*/
@JsonProperty(value = "provider_social") @JsonProperty(value = "provider_social")
private String provider; 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 * @return the link
Expand Down Expand Up @@ -69,9 +86,42 @@ public String getProvider() {
public void setProvider(String provider) { public void setProvider(String provider) {
this.provider = 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() * @see java.lang.Object#toString()
*/ */
@Override @Override
Expand Down
18 changes: 12 additions & 6 deletions encuestame-war/src/main/webapp/WEB-INF/views/home/web/hashtag.jsp
Expand Up @@ -11,7 +11,8 @@
</div> </div>
<div class="web-hashtag-options"> <div class="web-hashtag-options">
<div channel="/encuestame/hashtag/time/range/refresh/graph" <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> </div>
</section> </section>


Expand Down Expand Up @@ -46,8 +47,10 @@
<section> <section>
<div dojoType="encuestame.org.core.commons.social.LinksPublished" <div dojoType="encuestame.org.core.commons.social.LinksPublished"
channel="/encuestame/hashtag/time/range/refresh/graph" channel="/encuestame/hashtag/time/range/refresh/graph"
hasthag="${tagName.hashTagName}" class="web-social-links" hasthag="${tagName.hashTagName}"
type="HASHTAG"></div> class="web-social-links"
type="HASHTAG">
</div>
</section> </section>
</article> </article>
</div> </div>
Expand All @@ -61,7 +64,8 @@
channel="/encuestame/hashtag/time/range/refresh/graph" channel="/encuestame/hashtag/time/range/refresh/graph"
typeGeneric="HASHTAG" typeGeneric="HASHTAG"
generic="${tagName.hashTagName}" generic="${tagName.hashTagName}"
id="generic"></div> id="generic">
</div>
</article> </article>
<article class="emne-box"> <article class="emne-box">
<header> <header>
Expand All @@ -71,7 +75,8 @@
tagName="${tagName.hashTagName}" tagName="${tagName.hashTagName}"
channel="/encuestame/hashtag/time/range/refresh/graph" channel="/encuestame/hashtag/time/range/refresh/graph"
class="web-rated-position" class="web-rated-position"
id="position"></section> id="position">
</section>
</article> </article>
<article class="emne-box"> <article class="emne-box">
<header> <header>
Expand All @@ -81,7 +86,8 @@
hasthag="${tagName.hashTagName}" hasthag="${tagName.hashTagName}"
channel="/encuestame/hashtag/time/range/refresh/graph" channel="/encuestame/hashtag/time/range/refresh/graph"
class="web-top-profile" class="web-top-profile"
key="HASHTAG" id="topprofiles"></div> key="HASHTAG" id="topprofiles">
</div>
</article> </article>
</aside> </aside>
</div> </div>
Expand Down
1 change: 1 addition & 0 deletions encuestame-war/src/main/webapp/WEB-INF/wro.xml
Expand Up @@ -15,6 +15,7 @@
<css>/resource/css/common.css</css> <css>/resource/css/common.css</css>
<css>/resource/css/reset.css</css> <css>/resource/css/reset.css</css>
<css>/resource/css/web/layout.css</css> <css>/resource/css/web/layout.css</css>
<css>/resource/css/web/components/*.css</css>
</group> </group>
<group name='mobile'> <group name='mobile'>
<css>/resource/css/mobile/default.css</css> <css>/resource/css/mobile/default.css</css>
Expand Down
106 changes: 55 additions & 51 deletions encuestame-war/src/main/webapp/resource/css/development.css
@@ -1,52 +1,56 @@
.enme-dropdown-menu-wrapper { /** social links references **/
width: 120px; div.web-social-links {
} overflow: auto;

}
.enme-dropdown-menu-wrapper .menu-expand {
box-shadow: 0 0 3px -1px #454343 inset; .web-social-links h2 {
} color: #CBCBCB;

font-size: 14px;
.enme-dropdown-menu-wrapper .enme-dropdown-menu { font-weight: normal;
border: 1px solid #D4D4D4; margin: 0;
border-radius: 3px 3px 3px 3px; padding: 15px;
cursor: pointer; }
font-weight: bold;
min-width: 95px; .web-social-links .links .item {
padding: 5px; font-size: 15px;
text-align: center; padding: 10px 20px;
-webkit-touch-callout: none; position: relative;
-webkit-user-select: none; cursor: pointer;
-khtml-user-select: none; }
-moz-user-select: none;
-ms-user-select: none; .web-social-links .item .link a {
user-select: none; text-decoration: none;
} }


.enme-dropdown-menu-wrapper ul { .web-social-links .item {
background-color: #767676; font-size: 14px;
border: 1px solid #9A9A9A; overflow: auto;
border-radius: 0 0 6px 6px; padding: 11px 7px 5px 20px;
box-shadow: 0 1px 1px 0 #373535; cursor: pointer;
margin: 0 0 0 2px; }
position: absolute;
top: 24px; .web-social-links .item:hover {
width: 115px; background-color: #E8E8E8;
} box-shadow : 0 1px 2px #CCC;

-webkit-box-shadow : 0 1px 2px #CCC;
.enme-dropdown-menu-wrapper li.dropdown-item { -ms-box-shadow : 0 1px 2px #ccc;
color: #FFFFFF; -moz-box-shadow : 0 1px 2px #ccc;
cursor: pointer;
font-size: 12px; }
line-height: 15px;
list-style: none outside none; .web-social-links .item .img {
margin: 0; float: left;
padding: 5px 7px; overflow: hidden;
text-shadow: 0 1px #000000; }
width: auto;
} .web-social-links .item .link {

float: left;
.enme-dropdown-menu-wrapper li.dropdown-item:hover { margin-left: 16px;
background-color: white; width: 400px;
color: black; }
text-shadow: 0 1px white;
.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;
}

0 comments on commit 218bc49

Please sign in to comment.