Author: [email protected]
Date: Tue May  3 15:30:54 2011
New Revision: 1082

Log:
[AMDATUAUTH-23] Moved oAuth example to auth subproject

Added:
   trunk/amdatu-auth/oauth-example/
      - copied from r1077, /trunk/amdatu-example/oauth/
Removed:
   trunk/amdatu-example/oauth/
Modified:
   trunk/amdatu-auth/oauth-example/pom.xml
   
trunk/amdatu-auth/oauth-example/src/main/java/org/amdatu/example/oauth/service/OAuthGadgetsRegistrationServiceImpl.java
   trunk/amdatu-auth/pom.xml
   trunk/amdatu-example/pom.xml

Modified: trunk/amdatu-auth/oauth-example/pom.xml
==============================================================================
--- /trunk/amdatu-example/oauth/pom.xml (original)
+++ trunk/amdatu-auth/oauth-example/pom.xml     Tue May  3 15:30:54 2011
@@ -3,75 +3,60 @@
   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
   <modelVersion>4.0.0</modelVersion>
   <parent>
-    <groupId>org.amdatu.example</groupId>
-    <artifactId>org.amdatu.example</artifactId>
+    <groupId>org.amdatu.auth</groupId>
+    <artifactId>org.amdatu.auth</artifactId>
     <version>0.2.0-SNAPSHOT</version>
   </parent>
-  <artifactId>org.amdatu.example.oauth</artifactId>
+  <artifactId>org.amdatu.auth.oauth.example</artifactId>
   <packaging>bundle</packaging>
-  <name>Amdatu Example - oAuth</name>
+  <name>Amdatu Auth - oAuth example</name>
   <description>Provides example services and gadgets using oAuth 
authentication</description>
 
+  <properties>
+    <amdatu.opensocial.version>0.2.0-SNAPSHOT</amdatu.opensocial.version>
+  </properties>
+
   <dependencies>
     <dependency>
       <groupId>org.amdatu.web</groupId>
-      <artifactId>dispatcher</artifactId>
-      <version>${project.version}</version>
-      <scope>provided</scope>
+      <artifactId>org.amdatu.web.dispatcher</artifactId>
       <type>bundle</type>
     </dependency>
     <dependency>
       <groupId>org.amdatu.web</groupId>
-      <artifactId>httpcontext</artifactId>
-      <version>${project.version}</version>
-      <scope>provided</scope>
+      <artifactId>org.amdatu.web.httpcontext</artifactId>
       <type>bundle</type>
     </dependency>
     <dependency>
       <groupId>org.amdatu.web</groupId>
-      <artifactId>jsp</artifactId>
-      <version>${project.version}</version>
-      <scope>provided</scope>
+      <artifactId>org.amdatu.web.jsp</artifactId>
       <type>bundle</type>
     </dependency>
     <dependency>
       <groupId>org.amdatu.web</groupId>
-      <artifactId>resource</artifactId>
-      <version>${project.version}</version>
-      <scope>provided</scope>
+      <artifactId>org.amdatu.web.resource</artifactId>
       <type>bundle</type>
     </dependency>
     <dependency>
       <groupId>org.amdatu.opensocial</groupId>
       <artifactId>org.amdatu.opensocial.gadgetmanagement</artifactId>
-      <scope>provided</scope>
-      <type>bundle</type>
-    </dependency>
-    <dependency>
-      <groupId>org.amdatu.opensocial</groupId>
-      <artifactId>org.amdatu.opensocial.shindig</artifactId>
+      <version>${amdatu.opensocial.version}</version>
       <scope>provided</scope>
       <type>bundle</type>
     </dependency>
     <dependency>
       <groupId>org.amdatu.auth</groupId>
       <artifactId>org.amdatu.auth.oauth.api</artifactId>
-      <version>${project.version}</version>
-      <scope>provided</scope>
       <type>bundle</type>
     </dependency>
     <dependency>
       <groupId>org.amdatu.auth</groupId>
       <artifactId>org.amdatu.auth.oauth.server</artifactId>
-      <version>${project.version}</version>
-      <scope>provided</scope>
       <type>bundle</type>
     </dependency>
     <dependency>
-      <groupId>org.amdatu.web.rest</groupId>
-      <artifactId>jaxrs</artifactId>
-      <version>${project.version}</version>
-      <scope>provided</scope>
+      <groupId>org.amdatu.web</groupId>
+      <artifactId>org.amdatu.web.jaxrs</artifactId>
       <type>bundle</type>
     </dependency>
     <dependency>
@@ -82,17 +67,9 @@
     </dependency>
     <dependency>
       <groupId>org.amdatu.libraries</groupId>
-      <artifactId>utilities</artifactId>
-      <version>${project.version}</version>
+      <artifactId>org.amdatu.libraries.utilities</artifactId>
       <scope>compile</scope>
     </dependency>
-    <dependency>
-      <groupId>org.amdatu.example</groupId>
-      <artifactId>gadgetrepository</artifactId>
-      <version>${project.version}</version>
-      <scope>provided</scope>
-      <type>bundle</type>
-    </dependency>
   </dependencies>
 
   <build>

Modified: 
trunk/amdatu-auth/oauth-example/src/main/java/org/amdatu/example/oauth/service/OAuthGadgetsRegistrationServiceImpl.java
==============================================================================
--- 
/trunk/amdatu-example/oauth/src/main/java/org/amdatu/example/oauth/service/OAuthGadgetsRegistrationServiceImpl.java
 (original)
+++ 
trunk/amdatu-auth/oauth-example/src/main/java/org/amdatu/example/oauth/service/OAuthGadgetsRegistrationServiceImpl.java
     Tue May  3 15:30:54 2011
@@ -15,21 +15,21 @@
  */
 package org.amdatu.example.oauth.service;
 
-import java.net.URL;
-import java.util.Map;
-
-import org.amdatu.authentication.oauth.api.ConsumerAlreadyExistsException;
-import org.amdatu.authentication.oauth.api.ConsumerNotFoundException;
-import org.amdatu.authentication.oauth.api.ConsumerRegistryStorageException;
-import org.amdatu.authentication.oauth.api.OAuthServiceConsumer;
-import org.amdatu.authentication.oauth.api.OAuthServiceConsumerRegistry;
-import org.amdatu.example.gadgetrepository.ExampleGadgetRepositoryService;
-import org.amdatu.example.oauth.osgi.Activator;
-import org.amdatu.opensocial.gadgetmanagement.GadgetDefinition;
-import org.amdatu.opensocial.gadgetmanagement.GadgetManagement;
-import org.amdatu.web.httpcontext.ResourceProvider;
-import org.osgi.framework.BundleContext;
-import org.osgi.service.log.LogService;
+import java.net.URL;
+import java.util.Map;
+
+import org.amdatu.authentication.oauth.api.ConsumerAlreadyExistsException;
+import org.amdatu.authentication.oauth.api.ConsumerNotFoundException;
+import org.amdatu.authentication.oauth.api.ConsumerRegistryStorageException;
+import org.amdatu.authentication.oauth.api.OAuthServiceConsumer;
+import org.amdatu.authentication.oauth.api.OAuthServiceConsumerRegistry;
+import org.amdatu.example.oauth.osgi.Activator;
+import org.amdatu.opensocial.gadgetmanagement.GadgetCategory;
+import org.amdatu.opensocial.gadgetmanagement.GadgetDefinition;
+import org.amdatu.opensocial.gadgetmanagement.GadgetManagement;
+import org.amdatu.web.httpcontext.ResourceProvider;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.log.LogService;
 
 /**
  * This service registers the oAuth example gadgets.
@@ -37,7 +37,8 @@
  * @author ivol
  */
 public class OAuthGadgetsRegistrationServiceImpl implements ResourceProvider {
-
+    private final static GadgetCategory AMDATU_EXAMPLE_CATEGORY = new 
GadgetCategory("amdatu_examples", "Amdatu Examples");
+    
     // oAuth properties of this gadget as service consumer
     private final static String CONSUMER_CALLBACK_URL = 
"/gadgets/oauthcallback";
     private final static String CONSUMER_KEY = "example.amdatu.org";
@@ -59,15 +60,16 @@
     public void init() {
 
         String gadgetUrl = Activator.ALIAS + "/jsp/3leggedOAuthGadget.jspf";
-        GadgetDefinition gadgetDef =
-            new GadgetDefinition(gadgetUrl, 
ExampleGadgetRepositoryService.AMDATU_EXAMPLE_CATEGORY, false);
+        GadgetDefinition gadgetDef = new GadgetDefinition(gadgetUrl, 
AMDATU_EXAMPLE_CATEGORY, false);
 
         // Set oAuth parameters
         gadgetDef.setServiceName(SERVICE_NAME);
         gadgetDef.setConsumerPublicKey(CONSUMER_KEY);
         gadgetDef.setConsumerPrivateKey(CONSUMER_SECRET);
         gadgetDef.setCallbackUrl(CONSUMER_CALLBACK_URL);
-
+
+        // Ensure that the category exists, before adding the gadget
+        m_gadgetManagement.addCategory(AMDATU_EXAMPLE_CATEGORY);
         m_gadgetManagement.addGadget(gadgetDef);
 
         // Register the service consumer in our own oAuth server such that our 
own oAuth server

Modified: trunk/amdatu-auth/pom.xml
==============================================================================
--- trunk/amdatu-auth/pom.xml   (original)
+++ trunk/amdatu-auth/pom.xml   Tue May  3 15:30:54 2011
@@ -223,6 +223,7 @@
     <module>login-service</module>
     <module>oauth-api</module>
     <module>oauth-client</module>
+    <module>oauth-example</module>
     <module>oauth-server</module>
     <module>oauth-consumerregistry-fs</module>
     <module>tokenprovider</module>

Modified: trunk/amdatu-example/pom.xml
==============================================================================
--- trunk/amdatu-example/pom.xml        (original)
+++ trunk/amdatu-example/pom.xml        Tue May  3 15:30:54 2011
@@ -131,7 +131,6 @@
     <module>course-service</module>
     <module>friends-gadget</module>
     <module>gadgetrepository</module>
-    <module>oauth</module>
   </modules>
 
 </project>
\ No newline at end of file
_______________________________________________
Amdatu-commits mailing list
[email protected]
http://lists.amdatu.org/mailman/listinfo/amdatu-commits

Reply via email to