Skip to content

Commit

Permalink
Merge branch 'master' of ssh://ssh.github.com:443/lmco/eurekastreams
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob Keane committed Aug 10, 2011
2 parents 72802e0 + f5fa92f commit 50bbc87
Show file tree
Hide file tree
Showing 15 changed files with 127 additions and 29 deletions.
Expand Up @@ -24,14 +24,14 @@
/**
* DB mapper for getting {@link FeaturedStreamDTO}s. NOTE these are not full {@link FeaturedStreamDTO}s, just the
* cachable version excluding per-request info such as following status and dynamic info like avatar id.
*
*
*/
public class GetFeaturedStreamDTOsDbMapper extends BaseArgDomainMapper<MapperRequest, List<FeaturedStreamDTO>>
{

/**
* Return list of {@link FeaturedStreamDTO}s.
*
*
* @param inRequest
* ignored.
* @return {@link FeaturedStreamDTO}s from DB, ordered by date desc.
Expand Down
Expand Up @@ -33,7 +33,7 @@ public class GetSuggestedGroupsForPersonDbMapper extends
/**
* Get a list of suggested group streams for a person by getting all groups that their followers are members of,
* sorted by follow count within that group.
*
*
* @param inRequest
* the request containing the person and stream count
* @return the top NN suggested groups by their followers
Expand All @@ -46,7 +46,7 @@ public List<DomainGroupModelView> execute(final SuggestedStreamsRequest inReques
.createQuery(
"SELECT new org.eurekastreams.server.search.modelview.DomainGroupModelView(g.id, "
+ "g.shortName, g.name, COUNT(theirGroups.pk.followingId), "
+ "g.dateAdded, g.streamScope.id) "
+ "g.dateAdded, g.streamScope.id, g.publicGroup) "
+ "FROM Follower peopleIFollow, GroupFollower theirGroups, DomainGroup g "
+ "WHERE peopleIFollow.pk.followingId = theirGroups.pk.followerId "
+ "AND theirGroups.pk.followingId = g.id "
Expand All @@ -56,7 +56,7 @@ public List<DomainGroupModelView> execute(final SuggestedStreamsRequest inReques
+ "(SELECT pk.scopeId FROM PersonBlockedSuggestion WHERE "
+ "personid = :personBlockedId) "
+ "GROUP BY theirGroups.pk.followingId, g.id, g.shortName, g.name, g.dateAdded, "
+ "g.streamScope.id ORDER BY COUNT(theirGroups.pk.followingId) DESC")
+ "g.streamScope.id, g.publicGroup ORDER BY COUNT(theirGroups.pk.followingId) DESC")
.setParameter("personId", inRequest.getPersonId())
.setParameter("personBlockedId", inRequest.getPersonId());
query.setMaxResults(inRequest.getStreamCount());
Expand Down
Expand Up @@ -38,11 +38,11 @@ public class GetStreamsByDailyAverageMessageCountDbMapper extends
/**
* Number of streams to get.
*/
private Integer streamCount;
private final Integer streamCount;

/**
* Constructor.
*
*
* @param inStreamCount
* the number of streams to pull
*/
Expand All @@ -54,7 +54,7 @@ public GetStreamsByDailyAverageMessageCountDbMapper(final Integer inStreamCount)
/**
* Get a list of the stream scope ids for the most active streams. Note that this mapper expects
* TempWeekdaysSinceDate to be populated with current data.
*
*
* @param inIgnored
* ignored param - go nuts
* @return list of stream scope ids
Expand Down Expand Up @@ -108,7 +108,7 @@ public SublistWithResultCount<StreamDTO> execute(final Serializable inIgnored)
// get the group streams
q = getEntityManager().createQuery(
"SELECT new org.eurekastreams.server.search.modelview.DomainGroupModelView(id, "
+ "shortName, name, 0, dateAdded, streamScope.id) FROM DomainGroup "
+ "shortName, name, 0, dateAdded, streamScope.id, publicGroup) FROM DomainGroup "
+ "WHERE streamScope.id IN(:streamScopeIds)").setParameter("streamScopeIds", streamScopeIds);
streamDtos.addAll(q.getResultList());

Expand Down
Expand Up @@ -39,7 +39,7 @@ public class GetStreamsByDailyAverageViewersDbMapper extends BaseArgDomainMapper

/**
* Constructor.
*
*
* @param inStreamCount
* the number of streams to get
*/
Expand All @@ -50,7 +50,7 @@ public GetStreamsByDailyAverageViewersDbMapper(final Integer inStreamCount)

/**
* Get a list of the stream scope ids for the most viewed streams.
*
*
* @param inIgnored
* ignored param - go nuts
* @return list of stream scope ids
Expand Down Expand Up @@ -105,7 +105,7 @@ public List<StreamDTO> execute(final Serializable inIgnored)
// get the group streams
q = getEntityManager().createQuery(
"SELECT new org.eurekastreams.server.search.modelview.DomainGroupModelView(id, "
+ "shortName, name, 0, dateAdded, streamScope.id) FROM DomainGroup "
+ "shortName, name, 0, dateAdded, streamScope.id, publicGroup) FROM DomainGroup "
+ "WHERE streamScope.id IN(:streamScopeIds)").setParameter("streamScopeIds", streamScopeIds);
streamDtos.addAll(q.getResultList());

Expand Down
Expand Up @@ -73,7 +73,7 @@ public List<StreamDTO> execute(final Serializable inIgnored)

q = getEntityManager().createQuery(
"SELECT new org.eurekastreams.server.search.modelview.DomainGroupModelView(id, "
+ "shortName, name, followersCount, dateAdded, streamScope.id) "
+ "shortName, name, followersCount, dateAdded, streamScope.id, publicGroup) "
+ "FROM DomainGroup WHERE isPending = false AND followersCount > 0 "
+ "ORDER BY followersCount DESC");
if (streamCount > 0)
Expand Down
Expand Up @@ -57,7 +57,7 @@ public List<StreamDTO> execute(final Serializable inIgnored)
{
Query q = getEntityManager().createQuery(
"SELECT new org.eurekastreams.server.search.modelview.DomainGroupModelView(id, "
+ "shortName, name, followersCount, dateAdded, streamScope.id) "
+ "shortName, name, followersCount, dateAdded, streamScope.id, publicGroup) "
+ "FROM DomainGroup WHERE isPending=false ORDER BY dateAdded DESC");
if (streamCount > 0)
{
Expand Down
Expand Up @@ -277,6 +277,36 @@ public DomainGroupModelView(final Long inId, final String inShortName, final Str
setStreamScopeId(inStreamScopeId);
}

/**
* Constructor.
*
* @param inId
* the domain group id
* @param inShortName
* the domain group short name
* @param inName
* the domain group name
* @param inFollowerCount
* the number of followers
* @param inDateAdded
* the date added
* @param inStreamScopeId
* the stream scope id
* @param inIsPublic
* whether the group is public
*/
public DomainGroupModelView(final Long inId, final String inShortName, final String inName,
final Long inFollowerCount, final Date inDateAdded, final Long inStreamScopeId, final Boolean inIsPublic)
{
setEntityId(inId);
setShortName(inShortName);
setName(inName);
setFollowersCount(inFollowerCount.intValue());
setDateAdded(inDateAdded);
setStreamScopeId(inStreamScopeId);
setIsPublic(inIsPublic);
}

/**
* Constructor.
*
Expand Down Expand Up @@ -304,6 +334,36 @@ public DomainGroupModelView(final Long inId, final String inShortName, final Str
setStreamScopeId(inStreamScopeId);
}

/**
* Constructor.
*
* @param inId
* the domain group id
* @param inShortName
* the domain group short name
* @param inName
* the domain group name
* @param inFollowerCount
* the number of followers
* @param inDateAdded
* the date added
* @param inStreamScopeId
* the stream scope id
* @param inIsPublic
* whether the group is public
*/
public DomainGroupModelView(final Long inId, final String inShortName, final String inName,
final Integer inFollowerCount, final Date inDateAdded, final Long inStreamScopeId, final Boolean inIsPublic)
{
setEntityId(inId);
setShortName(inShortName);
setName(inName);
setFollowersCount(inFollowerCount.intValue());
setDateAdded(inDateAdded);
setStreamScopeId(inStreamScopeId);
setIsPublic(inIsPublic);
}

/**
* Follower status.
*/
Expand Down
Expand Up @@ -101,6 +101,18 @@ interface LocalStyle extends CssResource
@ClassName("block-button")
String blockButton();

/** @return Button style. */
@ClassName("request-access-button-small")
String requestAccessButtonSmall();

// /** @return Button style. */
// @ClassName("pending-access-button-small")
// String requestAccessButtonPendingSmall();
//
// /** @return Button style. */
// @ClassName("private-group-lock-small")
// String privateGroupLockSmall();

/** @return When multiple controls are in the follower controls panel. */
String multi();
}
Expand All @@ -123,7 +135,7 @@ interface LocalStyle extends CssResource

/**
* Constructor.
*
*
* @param inStreamDTO
* the streamDTO to represent
* @param inListItemType
Expand All @@ -136,7 +148,7 @@ public DiscoverListItemPanel(final StreamDTO inStreamDTO, final ListItemType inL

/**
* Constructor.
*
*
* @param inStreamDTO
* the streamDTO to represent
* @param inListItemType
Expand Down Expand Up @@ -207,21 +219,31 @@ public DiscoverListItemPanel(final StreamDTO inStreamDTO, final ListItemType inL

if (showBlockSuggestion)
{
followPanel = new FollowPanel(inStreamDTO, style.followButton(), style.unfollowButton(),
coreCss.buttonLabel(), true, new ClickHandler()
{
public void onClick(final ClickEvent event)
{
removeFromParent();
}
});
followPanel = new FollowPanel(inStreamDTO, style.followButton(), style.unfollowButton(), coreCss
.buttonLabel(), true, new ClickHandler()
{
public void onClick(final ClickEvent event)
{
removeFromParent();
}
});
}
else
{
followPanel = new FollowPanel(inStreamDTO, style.followButton(), style.unfollowButton(),
coreCss.buttonLabel(), true);
followPanel = new FollowPanel(inStreamDTO, style.followButton(), style.unfollowButton(), coreCss
.buttonLabel(), true);
}

// Panel p1 = new FlowPanel();
// p1.addStyleName(style.requestAccessButtonPendingSmall());
// main.add(p1);
// p1 = new FlowPanel();
// p1.addStyleName(style.requestAccessBtnPendingSmall());
// main.add(p1);
// p1 = new FlowPanel();
// p1.addStyleName(style.requestAccessBtnSmall());
// main.add(p1);

if (!showBlockSuggestion)
{
followPanel.addStyleName(style.followControlsPanel());
Expand Down
Expand Up @@ -8,6 +8,10 @@
<ui:image field="removeHoverImage" src="style/images/removeSmallHover.png" />
<ui:image field="followingImage" src="style/images/followingSmall.png" />
<ui:image field="unfollowImage" src="style/images/unfollowSmall.png" />

<ui:image field="requestAccessBtnSmall" src="style/images/requestAccessBtnSmall.png" />
<ui:image field="requestAccessBtnPendingSmall" src="style/images/requestAccessBtnPendingSmall.png" />
<ui:image field="privateGroupLockSmall" src="style/images/privateGroupLockSmall.png" />

<ui:with field="coreCss"
type="org.eurekastreams.web.client.ui.pages.master.CoreCss" />
Expand Down Expand Up @@ -42,7 +46,7 @@
font-size: 11px;
}

@sprite .follow-button {
@sprite .follow-button {
gwt-image: "followImage";
}
@sprite .follow-button:hover {
Expand All @@ -54,15 +58,27 @@
}
@sprite .unfollow-button:hover{
gwt-image: "unfollowImage";

}
@sprite .block-button{
gwt-image: "removeImage";
}
@sprite .block-button:hover{
gwt-image: "removeHoverImage";
}


@sprite .request-access-button-small {
gwt-image: "requestAccessBtnSmall";
}

@sprite .pending-access-button-small {
gwt-image: "requestAccessBtnPendingSmall";
}

@sprite .private-group-lock-small {
gwt-image: "privateGroupLockSmall";
}

</ui:style>

<g:HTMLPanel addStyleNames="{coreCss.connectionItem} {coreCss.listItem} {coreCss.person} {style.main}">
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 50bbc87

Please sign in to comment.