Skip to content

Commit

Permalink
Merge branch 'release/v0.9.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
benjp committed Apr 11, 2014
2 parents d4fc414 + 994195a commit 148d3ef
Show file tree
Hide file tree
Showing 114 changed files with 3,947 additions and 384 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -11,6 +11,9 @@ extension/target/*
exo-addons-chat-extension/target/*
exo-addons-chat-extension-config/target/*
exo-addons-chat-extension-pkg/target/*
exo-addons-chat-extension-community/target/*
exo-addons-chat-extension-config-community/target/*
exo-addons-chat-extension-pkg-community/target/*


release.properties
Expand Down
2 changes: 1 addition & 1 deletion application/pom.xml
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>chat-application</artifactId>
<groupId>org.exoplatform.addons.chat</groupId>
<version>0.8.2-SNAPSHOT</version>
<version>0.9.0</version>
</parent>
<artifactId>application</artifactId>
<packaging>war</packaging>
Expand Down
Expand Up @@ -22,6 +22,7 @@
import org.apache.commons.io.IOUtils;
import org.benjp.model.SpaceBeans;
import org.benjp.utils.ChatUtils;
import org.benjp.utils.MessageDigester;
import org.benjp.utils.PropertyManager;
import org.exoplatform.portal.webui.util.Util;

Expand Down Expand Up @@ -62,7 +63,11 @@ public static void addUserFullNameAndEmail(String username, String fullname, Str

public static String getToken(String username)
{
return callServer("getToken", "username="+username+"&tokenOnly=true");
// return callServer("getToken", "username="+username+"&tokenOnly=true");
String passphrase = PropertyManager.getProperty(PropertyManager.PROPERTY_PASSPHRASE);
String in = username+passphrase;
String token = MessageDigester.getHash(in);
return token;
}

public static void setSpaces(String username, SpaceBeans beans)
Expand Down
Expand Up @@ -290,7 +290,7 @@ public Response.Content createEvent(String space, String users, String summary,
@Ajax
@Resource
public Response.Content saveWiki(String targetFullname, String content) {
SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy");
SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy HH-mm");
String group = null, title = null, path="";
Space spaceBean = spaceService_.getSpaceByDisplayName(targetFullname);
if (spaceBean!=null) // Space use case
Expand Down
Expand Up @@ -12,6 +12,7 @@
import org.exoplatform.services.jcr.ext.app.SessionProviderService;
import org.exoplatform.services.jcr.ext.common.SessionProvider;
import org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator;
import org.exoplatform.services.listener.ListenerService;
import org.exoplatform.social.core.space.model.Space;
import org.exoplatform.social.core.space.spi.SpaceService;

Expand All @@ -35,15 +36,20 @@ public class DocumentsData {

SpaceService spaceService_;

ListenerService listenerService_;

public static String FILE_CREATED_ACTIVITY = "ActivityNotify.event.FileCreated";

public static final String TYPE_DOCUMENT="Documents";

@Inject
public DocumentsData(RepositoryService repositoryService, SessionProviderService sessionProviderService, NodeHierarchyCreator nodeHierarchyCreator, SpaceService spaceService)
public DocumentsData(RepositoryService repositoryService, SessionProviderService sessionProviderService, NodeHierarchyCreator nodeHierarchyCreator, SpaceService spaceService, ListenerService listenerService)
{
repositoryService_ = repositoryService;
nodeHierarchyCreator_= nodeHierarchyCreator;
sessionProviderService_ = sessionProviderService;
spaceService_ = spaceService;
listenerService_ = listenerService;
}

public SessionProvider getUserSessionProvider() {
Expand Down Expand Up @@ -234,6 +240,8 @@ else if (filename.endsWith(".zip"))
jcrContent.setProperty("jcr:mimeType", "application/octet-stream");
session.save();
uuid = fileNode.getUUID();
listenerService_.broadcast(FILE_CREATED_ACTIVITY, null, fileNode);

}
catch (Exception e)
{
Expand Down
Expand Up @@ -3,6 +3,7 @@
import org.exoplatform.portal.config.model.PortalConfig;
import org.exoplatform.wiki.mow.core.api.wiki.PageImpl;
import org.exoplatform.wiki.resolver.TitleResolver;
import org.exoplatform.wiki.service.listener.PageWikiListener;
import org.xwiki.rendering.syntax.Syntax;

import javax.enterprise.context.ApplicationScoped;
Expand Down Expand Up @@ -74,6 +75,7 @@ private String createOrEditPage(String parentTitle, String title, String content

page.getContent().setText(content);
page.setSyntax(Syntax.XWIKI_2_0.toIdString());
page.setMinorEdit(false);
page.checkin();
page.checkout();

Expand All @@ -88,6 +90,9 @@ else if (wikiType.equals(PortalConfig.PORTAL_TYPE))
path = "/portal/intranet/wiki/"+ page.getName();
}

//Post Activity
wikiService_.postAddPage(wikiType, wikiOwner, TitleResolver.getId(title, false), page);
//wikiService_.postUpdatePage(wikiType, wikiOwner, TitleResolver.getId(title, false), page, PageWikiListener.EDIT_PAGE_CONTENT_AND_TITLE_TYPE);

} catch (Exception e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
Expand Down
Expand Up @@ -393,6 +393,7 @@ tr.info td {
display: none;
}

//.btn-weemo-download, .btn-app-logout {
.btn-weemo-download {
margin: 6px 10px 0 0!important;
display: none;
Expand Down
Expand Up @@ -3,7 +3,6 @@
@import "exo";
@import "base";
@import "panels";
@import "emoticons";
@import "sized";
@import "retina";
@import "ie-hacks";
106 changes: 0 additions & 106 deletions application/src/main/java/org/benjp/portlet/chat/assets/retina.less
@@ -1,115 +1,9 @@
@media only screen and (-webkit-min-device-pixel-ratio: 1.5) {
@imgEmoticonPath: "@{imgPath}2x/emoticons.png";

.background(@left, @top) {
background: url('@{imgPath}2x/general.png') no-repeat @left @top;
background-size: 96px 162px;
}
.background-emoticon(@left, @top) {
background: url('@{imgEmoticonPath}') no-repeat @left @top;
background-size: 128px 64px;
}

.msg-emoticons {
.background-emoticon(-112px, -32px);
}

.emoticon-smile {
.background-emoticon(-112px, -32px);
}
.emoticon-big-smile {
.background-emoticon(-48px, 0);
}
.emoticon-eye-blink {
.background-emoticon(-112px, -16px);
}
.emoticon-no-voice {
.background-emoticon(-48px, -32px);
}
.emoticon-sad {
.background-emoticon(-80px, -32px);
}
.emoticon-surprise {
.background-emoticon(-48px, -48px);
}
.emoticon-smile-white {
.background-emoticon(-96px, -32px);
}
.emoticon-big-smile-white {
.background-emoticon(-32px, 0);
}
.emoticon-eye-blink-white {
.background-emoticon(-96px, -16px);
}
.emoticon-no-voice-white {
.background-emoticon(-32px, -32px);
}
.emoticon-sad-white {
.background-emoticon(-64px, -32px);
}
.emoticon-surprise-white {
.background-emoticon(-32px, -48px);
}
.emoticon-beer {
.background-emoticon(-16px, 0);
}
.emoticon-bow {
.background-emoticon(-80px, 0);
}
.emoticon-bug {
.background-emoticon(-112px, 0);
}
.emoticon-cake {
.background-emoticon(-16px, -16px);
}
.emoticon-cash {
.background-emoticon(-48px, -16px);
}
.emoticon-coffee {
.background-emoticon(-80px, -16px);
}
.emoticon-no {
.background-emoticon(-16px, -32px);
}
.emoticon-star {
.background-emoticon(-16px, -48px);
}
.emoticon-yes {
.background-emoticon(-112px, -48px);
}
.emoticon-tongue {
.background-emoticon(-80px, -48px);
}
.emoticon-beer-white {
.background-emoticon(0, 0);
}
.emoticon-bow-white {
.background-emoticon(-64px, 0);
}
.emoticon-bug-white {
.background-emoticon(-96px, 0);
}
.emoticon-cake-white {
.background-emoticon(0, -16px);
}
.emoticon-cash-white {
.background-emoticon(-32px, -16px);
}
.emoticon-coffee-white {
.background-emoticon(-64px, -16px);
}
.emoticon-no-white {
.background-emoticon(0, -32px);
}
.emoticon-star-white {
.background-emoticon(0, -48px);
}
.emoticon-yes-white {
.background-emoticon(-96px, -48px);
}
.emoticon-tongue-white {
.background-emoticon(-64px, -48px);
}

.user-status {
.background(-64px, 0);
Expand Down
Expand Up @@ -64,11 +64,14 @@

.sh_container {
overflow-x: scroll;
width: (@widthMessages - 55);
min-width: (@widthMessages - 55);
width: 90%;
background-color: @colorLightText;
}
.sh_java, .sh_javascript, .sh_css, .sh_html {
min-width: (@widthMessages - 55);
border: 0;
font-style: 10px;
}

#chat-users
Expand Down
Expand Up @@ -27,7 +27,8 @@
@Binding(value = org.exoplatform.services.organization.OrganizationService.class),
@Binding(value = org.exoplatform.social.core.space.spi.SpaceService.class),
@Binding(value = org.exoplatform.calendar.service.CalendarService.class),
@Binding(value = org.exoplatform.wiki.service.WikiService.class)
@Binding(value = org.exoplatform.wiki.service.WikiService.class),
@Binding(value = org.exoplatform.services.listener.ListenerService.class)
}
)

Expand Down
Expand Up @@ -78,6 +78,8 @@
</label>
</span>
<span class="menu-standard pull-right">
<!--a type="button" class="btn btn-app-logout" title="Logout" href="#">
<i class="icon-off"></i> Logout</a-->
<a type="button" class="btn btn-weemo-download" title="&{benjp.chat.button.install}" href="#">
<i class="icon-download-alt"></i> &{benjp.chat.button.install}</a>

Expand Down
Expand Up @@ -34,6 +34,8 @@
import org.exoplatform.social.core.space.spi.SpaceService;

import javax.inject.Inject;
import javax.inject.Provider;
import javax.portlet.PortletPreferences;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
Expand All @@ -55,6 +57,9 @@ public class NotificationApplication

SpaceService spaceService_;

@Inject
Provider<PortletPreferences> providerPreferences;

@Inject
public NotificationApplication(OrganizationService organizationService, SpaceService spaceService)
{
Expand All @@ -72,11 +77,15 @@ public void index(RenderContext renderContext) throws IOException
String chatIntervalNotif = PropertyManager.getProperty(PropertyManager.PROPERTY_INTERVAL_NOTIF);
String chatWeemoKey = PropertyManager.getProperty(PropertyManager.PROPERTY_WEEMO_KEY);

PortletPreferences portletPreferences = providerPreferences.get();
String title = portletPreferences.getValue("title", "---");

index.with().set("user", remoteUser_).set("token", token_)
.set("chatServerURL", chatServerURL).set("chatPage", chatPage)
.set("chatIntervalStatus", chatIntervalStatus)
.set("chatIntervalNotif", chatIntervalNotif)
.set("weemoKey", chatWeemoKey)
.set("title", title)
.render();
}

Expand Down

0 comments on commit 148d3ef

Please sign in to comment.