Compare commits

...

10 Commits

Author SHA1 Message Date
Costantino Perciante e9bf423f02 minor fixes to SearchableFields class
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/social-networking/social-data-indexing-common@141584 82a268e6-3cf1-43bd-a215-b396298e98cf
2017-01-16 09:46:49 +00:00
Costantino Perciante 408c9e6bc0 minor fixes. Version updated to 1.0.1 in the pom.xml
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/social-networking/social-data-indexing-common@141583 82a268e6-3cf1-43bd-a215-b396298e98cf
2017-01-16 08:57:20 +00:00
Costantino Perciante 41ddcd35a5 minor fixes
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/social-networking/social-data-indexing-common@141581 82a268e6-3cf1-43bd-a215-b396298e98cf
2017-01-15 18:48:00 +00:00
Costantino Perciante cccb6275f4 minor fix
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/social-networking/social-data-indexing-common@132063 82a268e6-3cf1-43bd-a215-b396298e98cf
2016-09-29 12:41:12 +00:00
Costantino Perciante 3838788052 Fixed descriptor.xml
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/social-networking/social-data-indexing-common@125978 82a268e6-3cf1-43bd-a215-b396298e98cf
2016-03-21 18:37:13 +00:00
Costantino Perciante d470d8978c Distro dir updated
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/social-networking/social-data-indexing-common@125336 82a268e6-3cf1-43bd-a215-b396298e98cf
2016-03-15 17:30:06 +00:00
Costantino Perciante 19a5fa479e Document structure fixed
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/social-networking/social-data-indexing-common@124412 82a268e6-3cf1-43bd-a215-b396298e98cf
2016-02-22 13:33:02 +00:00
Costantino Perciante 478e51435d Each document now has a timestamp associated. Removed the social-networking library dependency from the pom
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/social-networking/social-data-indexing-common@124390 82a268e6-3cf1-43bd-a215-b396298e98cf
2016-02-19 17:41:59 +00:00
Costantino Perciante 7983473db8 elasticsearch dependency removed
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/social-networking/social-data-indexing-common@124168 82a268e6-3cf1-43bd-a215-b396298e98cf
2016-02-15 10:23:17 +00:00
Costantino Perciante 694dc1fc2c Pom fix
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/social-networking/social-data-indexing-common@124158 82a268e6-3cf1-43bd-a215-b396298e98cf
2016-02-13 14:34:28 +00:00
18 changed files with 135 additions and 147 deletions

View File

@ -15,6 +15,7 @@
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">

View File

@ -5,6 +5,11 @@
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
@ -15,9 +20,17 @@
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
</natures>
</projectDescription>

View File

@ -1,5 +1,8 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.7

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="social-data-indexing-common">
<wb-resource deploy-path="/" source-path="/src/main/java"/>
</wb-module>
</project-modules>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<installed facet="java" version="1.7"/>
<installed facet="jst.utility" version="1.0"/>
</faceted-project>

View File

@ -1,2 +0,0 @@

View File

@ -1,7 +1 @@
gCube System - License
------------------------------------------------------------
The gCube/gCore software is licensed as Free Open Source software conveying to the EUPL (http://ec.europa.eu/idabc/eupl).
The software and documentation is provided by its authors/distributors "as is" and no expressed or
implied warranty is given for its use, quality or fitness for a particular case.
${gcube.license}

View File

@ -1,6 +0,0 @@
Mantainers
-------
* Costantino Perciante (costantino.perciante@isti.cnr.it), CNR Pisa,
Istituto di Scienza e Tecnologie dell'Informazione "A. Faedo".

View File

@ -1,37 +1,62 @@
The gCube System - Social Library
------------------------------------------------------------
This work is partially funded by the European Commission in the
context of the iMarine project (www.i-marine.eu), under the 1st call of FP7 IST priority.
Authors
-------
* Costantino Perciante (costantino.perciante@isti.cnr.it), CNR Pisa,
Istituto di Scienza e Tecnologie dell'Informazione "A. Faedo".
Version and Release Date
------------------------
Feb 2016
Description
-----------
The gCube System - ${name}
--------------------------------------------------
${description}
${gcube.description}
${gcube.funding}
Version
--------------------------------------------------
${version} (${buildDate})
Please see the file named "changelog.xml" in this directory for the release notes.
Authors
--------------------------------------------------
* Costantino Perciante(costantino.perciante@isti.cnr.it), Istituto di Scienza e Tecnologie dell'Informazione "A. Faedo" - CNR, Pisa (Italy).
Maintainers
-----------
* Costantino Perciante(costantino.perciante@isti.cnr.it), Istituto di Scienza e Tecnologie dell'Informazione "A. Faedo" - CNR, Pisa (Italy).
Download information
--------------------
Source code is available from SVN:
${scm.url}
Binaries can be downloaded from:
http://software.d4science.research-infrastructures.eu/
--------------------------------------------------
Source code is available from SVN:
${scm.url}
Binaries can be downloaded from the gCube website:
${gcube.website}
Installation
--------------------------------------------------
Installation documentation is available on-line in the gCube Wiki:
${gcube.wikiRoot}
Documentation
-------------
Documentation is available on-line from the Projects Documentation Wiki:
--------------------------------------------------
Documentation is available on-line in the gCube Wiki:
${gcube.wikiRoot}
Support
--------------------------------------------------
Bugs and support requests can be reported in the gCube issue tracking tool:
${gcube.issueTracking}
Licensing
---------
This software is licensed under the terms you may find in the file named "LICENSE" in this directory.
--------------------------------------------------
This software is licensed under the terms you may find in the file named "LICENSE" in this directory.

View File

@ -1,4 +1,8 @@
<ReleaseNotes>
<Changeset component="org.gcube.socialnetworking.social-data-indexing-common.1-0-1"
date="2017-02-01">
<Change>Minor fixes</Change>
</Changeset>
<Changeset component="org.gcube.socialnetworking.social-data-indexing-common.1-0-0"
date="2016-02-29">
<Change>First Release</Change>

View File

@ -15,34 +15,17 @@
<includes>
<include>README</include>
<include>LICENSE</include>
<include>INSTALL</include>
<include>MAINTAINERS</include>
<include>changelog.xml</include>
<include>profile.xml</include>
</includes>
<fileMode>755</fileMode>
<filtered>true</filtered>
</fileSet>
<fileSet>
<directory>target/apidocs</directory>
<outputDirectory>/${artifactId}/doc/api</outputDirectory>
<useDefaultExcludes>true</useDefaultExcludes>
<fileMode>755</fileMode>
</fileSet>
</fileSets>
<files>
<file>
<source>${distroDirectory}/profile.xml</source>
<outputDirectory>./</outputDirectory>
<filtered>true</filtered>
</file>
<file>
<source>target/${build.finalName}.jar</source>
<source>target/${build.finalName}.${project.packaging}</source>
<outputDirectory>/${artifactId}</outputDirectory>
</file>
<file>
<source>${distroDirectory}/svnpath.txt</source>
<outputDirectory>/${artifactId}</outputDirectory>
<filtered>true</filtered>
</file>
</files>
</assembly>

View File

@ -1 +0,0 @@
${scm.url}

51
pom.xml
View File

@ -11,7 +11,7 @@
<groupId>org.gcube.socialnetworking</groupId>
<artifactId>social-data-indexing-common</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>1.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Social Data Indexing Common</name>
@ -26,8 +26,6 @@
</scm>
<properties>
<elasticSearchVersion>2.2.0</elasticSearchVersion>
<guavaVersion>18.0</guavaVersion>
<serviceClass>social-networking</serviceClass>
<distroDirectory>distro</distroDirectory>
<maven.compiler.source>1.7</maven.compiler.source>
@ -54,52 +52,9 @@
<artifactId>junit</artifactId>
<version>4.8</version>
</dependency>
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<version>${elasticSearchVersion}</version>
</dependency>
<dependency>
<groupId>org.gcube.common.portal</groupId>
<artifactId>portal-manager</artifactId>
</dependency>
<dependency>
<groupId>org.gcube.portal</groupId>
<artifactId>custom-portal-handler</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.applicationsupportlayer</groupId>
<artifactId>aslcore</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.applicationsupportlayer</groupId>
<artifactId>aslsocial</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.portal</groupId>
<artifactId>social-networking-library</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.portal</groupId>
<artifactId>notifications-common-library</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>home-library</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.dvos</groupId>
<artifactId>usermanagement-core</artifactId>
</dependency>
<dependency>
<groupId>com.sun.mail</groupId>
<artifactId>javax.mail</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
@ -107,10 +62,6 @@
<artifactId>ic-client</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.netflix.astyanax</groupId>
<artifactId>astyanax</artifactId>
</dependency>
<dependency>
<groupId>org.gcube.core</groupId>
<artifactId>common-encryption</artifactId>

View File

@ -28,7 +28,7 @@ import org.slf4j.LoggerFactory;
public class ElasticSearchRunningCluster {
//logger
private static final Logger _log = LoggerFactory.getLogger(ElasticSearchRunningCluster.class);
private static final Logger logger = LoggerFactory.getLogger(ElasticSearchRunningCluster.class);
//properties
private final static String RUNTIME_RESOURCE_NAME = "SocialPortalDataIndex";
@ -46,19 +46,19 @@ public class ElasticSearchRunningCluster {
List<ServiceEndpoint> resources = getConfigurationFromIS(infrastructure);
if (resources.size() > 1) {
_log.error("Too many Runtime Resource having name " + RUNTIME_RESOURCE_NAME +" in this scope");
logger.error("Too many Runtime Resource having name " + RUNTIME_RESOURCE_NAME +" in this scope");
throw new TooManyRunningClustersException("There exist more than 1 Runtime Resource in this scope having name "
+ RUNTIME_RESOURCE_NAME + " and Platform " + PLATFORM_NAME + ". Only one allowed per infrasrtucture.");
}
else if (resources.size() == 0){
_log.error("There is no Runtime Resource having name " + RUNTIME_RESOURCE_NAME +" and Platform " + PLATFORM_NAME + " in this scope.");
logger.error("There is no Runtime Resource having name " + RUNTIME_RESOURCE_NAME +" and Platform " + PLATFORM_NAME + " in this scope.");
throw new NoElasticSearchRuntimeResourceException();
}
else {
try{
_log.debug(resources.toString());
logger.debug(resources.toString());
for (ServiceEndpoint res : resources) {
Iterator<AccessPoint> accessPointIterator = res.profile().accessPoints().iterator();
@ -81,12 +81,12 @@ public class ElasticSearchRunningCluster {
}
}catch(Exception e ){
_log.error(e.toString());
logger.error(e.toString());
throw new ServiceEndPointException();
}
}
} catch (Exception e) {
_log.error(e.toString());
logger.error(e.toString());
throw e;
}

View File

@ -1,25 +1,15 @@
package org.gcube.socialnetworking.social_data_indexing_common.utils;
/**
* The fields used to build up the index.
* @author Costantino Perciante at ISTI-CNR
* (costantino.perciante@isti.cnr.it)
*
* The name of the index and the type of the documents used to build up the index.
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
*/
public class IndexFields {
// name of the index
public static final String INDEX_NAME = "social";
// table for enhanced feeds
public static final String EF_FEEDS_TABLE = "enhanced_feeds";
// enhanced feeds' fields of interest
public static final String EF_ATTACHMENT_NAME = "attachments.name";
public static final String EF_FEED_TEXT = "feed.description";
public static final String EF_COMMENT_TEXT = "comments.text";
public static final String EF_PREVIEW_DESCRIPTION = "feed.linkTitle";
public static final String EF_FEED_AUTHOR = "feed.fullName";
public static final String EF_FEED_VRE_ID = "feed.vreid";
public static final String EF_COMMENT_FULL_NAME = "comments.fullName";
}

View File

@ -0,0 +1,26 @@
package org.gcube.socialnetworking.social_data_indexing_common.utils;
/**
* The fields of the documents which are searchable.
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
*/
public enum SearchableFields {
POST_TEXT("feed.description"),
COMMENT_TEXT("comments.text"),
PREVIEW_DESCRIPTION("feed.linkTitle"),
POST_AUTHOR("feed.fullName"),
POST_VRE_ID("feed.vreid"),
COMMENT_AUTHOR("comments.fullName"),
ATTACHMENT_NAME("attachments.name");
String name;
SearchableFields(String name){
this.name = name;
}
@Override
public String toString() {
return name;
}
}

View File

@ -1,9 +1,6 @@
package org.gcube.socialnetworking.social_data_indexing_common;
import org.gcube.socialnetworking.social_data_indexing_common.utils.ElasticSearchRunningCluster;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -12,23 +9,23 @@ public class Tests {
/**
* Logger
*/
private static Logger _log = LoggerFactory.getLogger(Tests.class);
private static Logger logger = LoggerFactory.getLogger(Tests.class);
@Before
//@Before
public void beforeTest(){
// set security token
//SecurityTokenProvider.instance.set("");
}
@Test
//@Test
public void retrieveElasticSearchInformation() throws Exception{
ElasticSearchRunningCluster es = new ElasticSearchRunningCluster(null);
_log.debug("Result is " + es.getClusterName() + " " + es.getHosts() + " " + es.getPorts());
logger.debug("Result is " + es.getClusterName() + " " + es.getHosts() + " " + es.getPorts());
}
@After
//@After
public void after(){
}