git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/branches/portal/social-networking-library-ws/2.2@178923 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
88f25e41c0
commit
47ad1c30da
|
@ -15,6 +15,7 @@
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
|
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
|
||||||
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
|
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
|
||||||
<attributes>
|
<attributes>
|
||||||
|
<attribute name="test" value="true"/>
|
||||||
<attribute name="optional" value="true"/>
|
<attribute name="optional" value="true"/>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
|
@ -24,9 +25,9 @@
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="owner.project.facets" value="java"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry kind="output" path="target/classes"/>
|
<classpathentry kind="output" path="target/classes"/>
|
||||||
|
|
|
@ -1,8 +1,14 @@
|
||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
|
||||||
org.eclipse.jdt.core.compiler.compliance=1.7
|
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||||
|
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||||
|
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||||
|
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||||
|
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||||
|
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||||
org.eclipse.jdt.core.compiler.source=1.7
|
org.eclipse.jdt.core.compiler.release=disabled
|
||||||
|
org.eclipse.jdt.core.compiler.source=1.8
|
||||||
|
|
|
@ -10,6 +10,9 @@
|
||||||
<dependent-module archiveName="social-util-library-1.6.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/social-util-library/social-util-library">
|
<dependent-module archiveName="social-util-library-1.6.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/social-util-library/social-util-library">
|
||||||
<dependency-type>uses</dependency-type>
|
<dependency-type>uses</dependency-type>
|
||||||
</dependent-module>
|
</dependent-module>
|
||||||
|
<dependent-module archiveName="pickitem-widget-2.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/pickitem-widget/pickitem-widget">
|
||||||
|
<dependency-type>uses</dependency-type>
|
||||||
|
</dependent-module>
|
||||||
<dependent-module archiveName="gcube-widgets-2.2.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/gcube-widgets/gcube-widgets">
|
<dependent-module archiveName="gcube-widgets-2.2.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/gcube-widgets/gcube-widgets">
|
||||||
<dependency-type>uses</dependency-type>
|
<dependency-type>uses</dependency-type>
|
||||||
</dependent-module>
|
</dependent-module>
|
||||||
|
@ -19,6 +22,12 @@
|
||||||
<dependent-module archiveName="usermanagement-core-2.4.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/usermanagement-core/usermanagement-core">
|
<dependent-module archiveName="usermanagement-core-2.4.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/usermanagement-core/usermanagement-core">
|
||||||
<dependency-type>uses</dependency-type>
|
<dependency-type>uses</dependency-type>
|
||||||
</dependent-module>
|
</dependent-module>
|
||||||
|
<dependent-module archiveName="notifications-common-library-1.4.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/notifications-common-library/notifications-common-library">
|
||||||
|
<dependency-type>uses</dependency-type>
|
||||||
|
</dependent-module>
|
||||||
|
<dependent-module archiveName="aslsocial-1.5.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/applicationSupportLayerSocial/applicationSupportLayerSocial">
|
||||||
|
<dependency-type>uses</dependency-type>
|
||||||
|
</dependent-module>
|
||||||
<property name="java-output-path" value="/social-networking-library-ws/target/classes"/>
|
<property name="java-output-path" value="/social-networking-library-ws/target/classes"/>
|
||||||
<property name="context-root" value="social-networking-library-ws"/>
|
<property name="context-root" value="social-networking-library-ws"/>
|
||||||
</wb-module>
|
</wb-module>
|
||||||
|
|
|
@ -4,5 +4,5 @@
|
||||||
<installed facet="jst.web" version="3.0"/>
|
<installed facet="jst.web" version="3.0"/>
|
||||||
<installed facet="wst.jsdt.web" version="1.0"/>
|
<installed facet="wst.jsdt.web" version="1.0"/>
|
||||||
<installed facet="jst.jaxrs" version="1.1"/>
|
<installed facet="jst.jaxrs" version="1.1"/>
|
||||||
<installed facet="java" version="1.7"/>
|
<installed facet="java" version="1.8"/>
|
||||||
</faceted-project>
|
</faceted-project>
|
||||||
|
|
27
pom.xml
27
pom.xml
|
@ -1,4 +1,5 @@
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||||
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
@ -24,6 +25,7 @@
|
||||||
<distroDirectory>distro</distroDirectory>
|
<distroDirectory>distro</distroDirectory>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
|
<java-version>1.8</java-version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<scm>
|
<scm>
|
||||||
|
@ -340,8 +342,8 @@
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>2.3.2</version>
|
<version>2.3.2</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<source>1.7</source>
|
<source>1.8</source>
|
||||||
<target>1.7</target>
|
<target>1.8</target>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<!-- SA Plugin -->
|
<!-- SA Plugin -->
|
||||||
|
@ -390,6 +392,25 @@
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-javadoc-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<additionalparam>-Xdoclint:none</additionalparam>
|
||||||
|
<additionalOptions>-Xdoclint:none</additionalOptions>
|
||||||
|
<additionalJOption>-Xdoclint:none</additionalJOption>
|
||||||
|
</configuration>
|
||||||
|
<version>3.1.0</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>generate-doc</id>
|
||||||
|
<phase>install</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>jar</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -32,6 +32,7 @@ import org.gcube.portal.social.networking.liferay.ws.UserManagerWSBuilder;
|
||||||
import org.gcube.resources.discovery.client.api.DiscoveryClient;
|
import org.gcube.resources.discovery.client.api.DiscoveryClient;
|
||||||
import org.gcube.resources.discovery.client.queries.api.Query;
|
import org.gcube.resources.discovery.client.queries.api.Query;
|
||||||
import org.gcube.resources.discovery.client.queries.impl.QueryBox;
|
import org.gcube.resources.discovery.client.queries.impl.QueryBox;
|
||||||
|
import org.gcube.socialnetworking.socialtoken.SocialMessageParser;
|
||||||
import org.gcube.vomanagement.usermanagement.GroupManager;
|
import org.gcube.vomanagement.usermanagement.GroupManager;
|
||||||
import org.gcube.vomanagement.usermanagement.UserManager;
|
import org.gcube.vomanagement.usermanagement.UserManager;
|
||||||
import org.gcube.vomanagement.usermanagement.model.GCubeUser;
|
import org.gcube.vomanagement.usermanagement.model.GCubeUser;
|
||||||
|
@ -73,15 +74,22 @@ public class SocialUtils {
|
||||||
boolean notifyGroup
|
boolean notifyGroup
|
||||||
){
|
){
|
||||||
|
|
||||||
|
/*
|
||||||
String escapedFeedText = org.gcube.social_networking.socialutillibrary.Utils.escapeHtmlAndTransformUrl(postText);
|
String escapedFeedText = org.gcube.social_networking.socialutillibrary.Utils.escapeHtmlAndTransformUrl(postText);
|
||||||
logger.info("Escaped post text is " + escapedFeedText);
|
|
||||||
String scope = ScopeProvider.instance.get();
|
|
||||||
String appId = caller.getClient().getId();
|
|
||||||
|
|
||||||
List<String> hashtags = org.gcube.social_networking.socialutillibrary.Utils.getHashTags(postText);
|
List<String> hashtags = org.gcube.social_networking.socialutillibrary.Utils.getHashTags(postText);
|
||||||
if (hashtags != null && !hashtags.isEmpty())
|
if (hashtags != null && !hashtags.isEmpty())
|
||||||
escapedFeedText = org.gcube.social_networking.socialutillibrary.Utils.convertHashtagsAnchorHTML(escapedFeedText, hashtags);
|
escapedFeedText = org.gcube.social_networking.socialutillibrary.Utils.convertHashtagsAnchorHTML(escapedFeedText, hashtags);
|
||||||
|
*/
|
||||||
|
|
||||||
|
SocialMessageParser messageParser = new SocialMessageParser(postText);
|
||||||
|
String escapedFeedText = messageParser.getParsedMessage();
|
||||||
|
List<String> hashtags = messageParser.getHashtags();
|
||||||
|
|
||||||
|
logger.info("Escaped post text is " + escapedFeedText);
|
||||||
|
String scope = ScopeProvider.instance.get();
|
||||||
|
String appId = caller.getClient().getId();
|
||||||
|
|
||||||
|
|
||||||
Feed toWrite =
|
Feed toWrite =
|
||||||
buildFeed(
|
buildFeed(
|
||||||
escapedFeedText,
|
escapedFeedText,
|
||||||
|
@ -98,11 +106,16 @@ public class SocialUtils {
|
||||||
if(res){
|
if(res){
|
||||||
logger.info("Feed correctly written by application " + appId);
|
logger.info("Feed correctly written by application " + appId);
|
||||||
|
|
||||||
try {
|
// wait a bit before saving hashtags
|
||||||
CassandraConnection.getInstance().getDatabookStore().saveHashTags(toWrite.getKey(), scope, hashtags);
|
if(hashtags != null && !hashtags.isEmpty())
|
||||||
} catch (FeedIDNotFoundException e1) {
|
new Thread(()->{
|
||||||
logger.error("Failed to save hashtags in Cassandra", e1);
|
try {
|
||||||
}
|
Thread.sleep(1000);
|
||||||
|
CassandraConnection.getInstance().getDatabookStore().saveHashTags(toWrite.getKey(), scope, hashtags);
|
||||||
|
} catch (Exception e1) {
|
||||||
|
logger.error("Failed to save hashtags in Cassandra", e1);
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
|
|
||||||
if(notifyGroup){
|
if(notifyGroup){
|
||||||
|
|
||||||
|
@ -331,12 +344,19 @@ public class SocialUtils {
|
||||||
boolean notifyGroup
|
boolean notifyGroup
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
/*
|
||||||
String escapedFeedText = org.gcube.social_networking.socialutillibrary.Utils.escapeHtmlAndTransformUrl(postText);
|
String escapedFeedText = org.gcube.social_networking.socialutillibrary.Utils.escapeHtmlAndTransformUrl(postText);
|
||||||
|
|
||||||
List<String> hashtags = org.gcube.social_networking.socialutillibrary.Utils.getHashTags(postText);
|
List<String> hashtags = org.gcube.social_networking.socialutillibrary.Utils.getHashTags(postText);
|
||||||
if (hashtags != null && !hashtags.isEmpty())
|
if (hashtags != null && !hashtags.isEmpty())
|
||||||
escapedFeedText = org.gcube.social_networking.socialutillibrary.Utils.convertHashtagsAnchorHTML(escapedFeedText, hashtags);
|
escapedFeedText = org.gcube.social_networking.socialutillibrary.Utils.convertHashtagsAnchorHTML(escapedFeedText, hashtags);
|
||||||
|
*/
|
||||||
|
|
||||||
|
SocialMessageParser messageParser = new SocialMessageParser(postText);
|
||||||
|
String escapedFeedText = messageParser.getParsedMessage();
|
||||||
|
List<String> hashtags = messageParser.getHashtags();
|
||||||
|
|
||||||
|
|
||||||
GCubeUser user;
|
GCubeUser user;
|
||||||
|
|
||||||
// retrieve group information
|
// retrieve group information
|
||||||
|
|
Loading…
Reference in New Issue