diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..12022ce --- /dev/null +++ b/.classpath @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/.project b/.project new file mode 100644 index 0000000..a87dc2d --- /dev/null +++ b/.project @@ -0,0 +1,23 @@ + + + applicationSupportLayerSocial + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + + diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..db99285 --- /dev/null +++ b/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,5 @@ +#Fri Dec 07 12:41:11 CET 2012 +eclipse.preferences.version=1 +encoding//src/main/java=UTF-8 +encoding//src/test/java=UTF-8 +encoding/=UTF-8 diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..4421ef3 --- /dev/null +++ b/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,6 @@ +#Fri Dec 07 14:00:07 CET 2012 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/.settings/org.eclipse.m2e.core.prefs b/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..ca36ba0 --- /dev/null +++ b/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,5 @@ +#Fri Dec 07 12:41:10 CET 2012 +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..b05e73e --- /dev/null +++ b/pom.xml @@ -0,0 +1,138 @@ + + 4.0.0 + + maven-parent + org.gcube.tools + 1.0.0 + + + + org.gcube.applicationsupportlayer + aslsocial + 0.0.1-SNAPSHOT + jar + + Social Portal ASL Extension + + + distro + 1.6 + 1.6 + + + UTF-8 + UTF-8 + + + + + src/main/java + + **/*.* + + + + + + maven-compiler-plugin + + 1.6 + 1.6 + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + test-jar + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + true + + + + org.apache.maven.plugins + maven-resources-plugin + 2.5 + + + copy-profile + install + + copy-resources + + + target + + + ${distroDirectory} + true + + profile.xml + + + + + + + + + + org.apache.maven.plugins + maven-assembly-plugin + 2.2 + + + ${distroDirectory}/descriptor.xml + + + + + servicearchive + install + + single + + + + + + + + + junit + junit + 3.8.1 + test + + + org.gcube.core + gcf + [1.4.0,1.5.0] + provided + + + org.gcube.applicationsupportlayer + aslcore + 3.2.0 + + + org.gcube.portlets.user + home-library + 4.2.0-SNAPSHOT + + + diff --git a/src/main/java/org/gcube/applicationsupportlayer/social/AslNotificationManager.java b/src/main/java/org/gcube/applicationsupportlayer/social/AslNotificationManager.java new file mode 100644 index 0000000..d673dbd --- /dev/null +++ b/src/main/java/org/gcube/applicationsupportlayer/social/AslNotificationManager.java @@ -0,0 +1,57 @@ +package org.gcube.applicationsupportlayer.social; + +import org.gcube.application.framework.core.session.ASLSession; +import org.gcube.common.core.utils.logging.GCUBEClientLog; +import org.gcube.portal.databook.server.DBCassandraAstyanaxImpl; +import org.gcube.portal.databook.server.DatabookStore; +import org.gcube.portal.databook.shared.NotificationType; +import org.gcube.portlets.user.homelibrary.home.workspace.WorkspaceFolder; +import org.gcube.portlets.user.homelibrary.home.workspace.WorkspaceItem; +/** + * + * @author Massimiliano Assante, ISTI-CNR + * @version 0.1 Dec 2012 + * + */ +public class AslNotificationManager implements NotificationManager { + GCUBEClientLog log = new GCUBEClientLog(AslNotificationManager.class); + + private ASLSession session; + private DatabookStore store; + + public AslNotificationManager(ASLSession session) { + this.session = session; + store = new DBCassandraAstyanaxImpl(); + } + + @Override + public boolean notifyFolderSharing(String userIdToNotify, WorkspaceFolder sharedFolder) { + return true; + } + + @Override + public boolean notifyFolderAddedUser(String userIdToNotify, WorkspaceFolder sharedFolder, String newAddedUserId) { + return true; + } + + @Override + public boolean notifyFolderRemovedUser(String userIdToNotify, WorkspaceFolder sharedFolder, String removedUserId) { + return true; + } + + @Override + public boolean notifyAddedItem(String userIdToNotify, WorkspaceItem newItem) { + return true; + } + + @Override + public boolean notifyRemovedItem(String userIdToNotify, WorkspaceItem removedItem) { + return true; + } + + @Override + public boolean notifyUpdatedItem(String userIdToNotify, WorkspaceItem updatedItem) { + return true; + } + +} diff --git a/src/main/java/org/gcube/applicationsupportlayer/social/NotificationManager.java b/src/main/java/org/gcube/applicationsupportlayer/social/NotificationManager.java new file mode 100644 index 0000000..fa84104 --- /dev/null +++ b/src/main/java/org/gcube/applicationsupportlayer/social/NotificationManager.java @@ -0,0 +1,60 @@ +package org.gcube.applicationsupportlayer.social; + +import org.gcube.portlets.user.homelibrary.home.workspace.WorkspaceFolder; +import org.gcube.portlets.user.homelibrary.home.workspace.WorkspaceItem; +/** + * + * @author Massimiliano Assante, ISTI-CNR + * @version 0.1 Dec 2012 + * + */ +public interface NotificationManager { + /** + * use to notify a user he got a workspace folder shared + * + * @param userIdToNotify the user you want to notify + * @param sharedFolder the shared {@link WorkspaceFolder} + * @return true id the notification is correctly delivered, false otherwise + */ + boolean notifyFolderSharing(String userIdToNotify, WorkspaceFolder sharedFolder); + /** + * use to notify a user that a new user was added in on of his workspace shared folder + * + * @param userIdToNotify the user you want to notify + * @param sharedFolder the shared {@link WorkspaceFolder} + * @param newAddedUserId the new user that was added + * @return true id the notification is correctly delivered, false otherwise + */ + boolean notifyFolderAddedUser(String userIdToNotify, WorkspaceFolder sharedFolder, String newAddedUserId); + /** + * use to notify a user that an existing user was removed from one of his workspace shared folder + * + * @param userIdToNotify the user you want to notify + * @param sharedFolder the shared {@link WorkspaceFolder} + * @param removedUserId the new user that was removed + * @return true id the notification is correctly delivered, false otherwise + */ + boolean notifyFolderRemovedUser(String userIdToNotify, WorkspaceFolder sharedFolder, String removedUserId); + /** + * use to notify a user he got a workspace item new in some of his workspace shared folder + * @param userIdToNotify + * @param newItem the new shared {@link WorkspaceItem} + * @return true id the notification is correctly delivered, false otherwise + */ + boolean notifyAddedItem(String userIdToNotify, WorkspaceItem newItem); + /** + * use to notify a user he got a workspace item deleted from one of his workspace shared folder + * @param userIdToNotify + * @param removedItem the removed {@link WorkspaceItem} + * @return true id the notification is correctly delivered, false otherwise + */ + boolean notifyRemovedItem(String userIdToNotify, WorkspaceItem removedItem); + /** + * use to notify a user he got a workspace item updated from one of his workspace shared folder + * @param userIdToNotify + * @param newItem the new shared {@link WorkspaceItem} + * @return true id the notification is correctly delivered, false otherwise + */ + boolean notifyUpdatedItem(String userIdToNotify, WorkspaceItem updatedItem); + +} diff --git a/src/test/java/org/gcube/applicationsupportlayer/social/AppTest.java b/src/test/java/org/gcube/applicationsupportlayer/social/AppTest.java new file mode 100644 index 0000000..39e5419 --- /dev/null +++ b/src/test/java/org/gcube/applicationsupportlayer/social/AppTest.java @@ -0,0 +1,38 @@ +package org.gcube.applicationsupportlayer.social; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +}