You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ch...@apache.org on 2012/12/04 20:35:26 UTC

svn commit: r1417136 - in /airavata/trunk/modules/rest: ./ service/ service/src/main/resources/ service/src/main/webapp/ webapp/ webapp/src/ webapp/src/main/ webapp/src/main/resources/ webapp/src/main/webapp/ webapp/src/main/webapp/WEB-INF/ webapp/src/...

Author: chathuri
Date: Tue Dec  4 19:35:25 2012
New Revision: 1417136

URL: http://svn.apache.org/viewvc?rev=1417136&view=rev
Log:
create a seperate web app for rest service

Added:
    airavata/trunk/modules/rest/webapp/
    airavata/trunk/modules/rest/webapp/pom.xml
    airavata/trunk/modules/rest/webapp/src/
    airavata/trunk/modules/rest/webapp/src/main/
    airavata/trunk/modules/rest/webapp/src/main/resources/
    airavata/trunk/modules/rest/webapp/src/main/resources/airavata-server.properties
    airavata/trunk/modules/rest/webapp/src/main/resources/authenticators.xml
    airavata/trunk/modules/rest/webapp/src/main/resources/log4j.xml
    airavata/trunk/modules/rest/webapp/src/main/resources/registry.properties
    airavata/trunk/modules/rest/webapp/src/main/webapp/
    airavata/trunk/modules/rest/webapp/src/main/webapp/WEB-INF/
    airavata/trunk/modules/rest/webapp/src/main/webapp/WEB-INF/web.xml
    airavata/trunk/modules/rest/webapp/src/main/webapp/index.jsp
    airavata/trunk/modules/rest/webapp/src/main/webapp/user-store/
    airavata/trunk/modules/rest/webapp/src/main/webapp/user-store/add.jsp
    airavata/trunk/modules/rest/webapp/src/main/webapp/user-store/index.jsp
    airavata/trunk/modules/rest/webapp/src/main/webapp/user-store/password.jsp
Removed:
    airavata/trunk/modules/rest/service/src/main/resources/
    airavata/trunk/modules/rest/service/src/main/webapp/
Modified:
    airavata/trunk/modules/rest/pom.xml
    airavata/trunk/modules/rest/service/pom.xml

Modified: airavata/trunk/modules/rest/pom.xml
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/rest/pom.xml?rev=1417136&r1=1417135&r2=1417136&view=diff
==============================================================================
--- airavata/trunk/modules/rest/pom.xml (original)
+++ airavata/trunk/modules/rest/pom.xml Tue Dec  4 19:35:25 2012
@@ -32,6 +32,7 @@
             <modules>
                 <module>mappings</module>
                 <module>service</module>
+                <module>webapp</module>
                 <module>client</module>
             </modules>
         </profile>

Modified: airavata/trunk/modules/rest/service/pom.xml
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/rest/service/pom.xml?rev=1417136&r1=1417135&r2=1417136&view=diff
==============================================================================
--- airavata/trunk/modules/rest/service/pom.xml (original)
+++ airavata/trunk/modules/rest/service/pom.xml Tue Dec  4 19:35:25 2012
@@ -33,37 +33,12 @@
 			<version>${derby.version}</version>
 		</dependency>
 		<dependency>
-			<groupId>com.sun.jersey</groupId>
-			<artifactId>jersey-servlet</artifactId>
-			<version>${jersey.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>com.sun.jersey</groupId>
-			<artifactId>jersey-json</artifactId>
-			<version>${jersey.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>com.sun.jersey.contribs</groupId>
-			<artifactId>jersey-multipart</artifactId>
-			<version>${jersey.version}</version>
-		</dependency>
-		<dependency>
 			<groupId>com.sun.jersey.jersey-test-framework</groupId>
 			<artifactId>jersey-test-framework-grizzly2</artifactId>
 			<version>${jersey.version}</version>
 			<scope>test</scope>
 		</dependency>
 		<dependency>
-			<groupId>com.sun.jersey</groupId>
-			<artifactId>jersey-server</artifactId>
-			<version>${jersey.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>com.sun.jersey</groupId>
-			<artifactId>jersey-client</artifactId>
-			<version>${jersey.version}</version>
-		</dependency>
-		<dependency>
 			<groupId>org.apache.shiro</groupId>
 			<artifactId>shiro-core</artifactId>
 			<version>1.2.1</version>
@@ -121,15 +96,5 @@
 	</dependencies>
 	<properties>
 		<jersey.version>1.13</jersey.version>
-		<grizzly.version>2.0.0-M3</grizzly.version>
-		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-		<cargo.version>1.2.1</cargo.version>
-		<!-- if you want a remote debugging on a different a address override on 
-			command line with -Dcargo.debug.addres=xxxx -->
-		<cargo.debug.address>5000</cargo.debug.address>
-		<!-- if you want to start remote debugging session suspended override on 
-			command line with -Dcargo.debug.suspend=y -->
-		<cargo.debug.suspend>n</cargo.debug.suspend>
-		<javaagent />
 	</properties>
 </project>

Added: airavata/trunk/modules/rest/webapp/pom.xml
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/rest/webapp/pom.xml?rev=1417136&view=auto
==============================================================================
--- airavata/trunk/modules/rest/webapp/pom.xml (added)
+++ airavata/trunk/modules/rest/webapp/pom.xml Tue Dec  4 19:35:25 2012
@@ -0,0 +1,187 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--Licensed to the Apache Software Foundation (ASF) under one or more contributor 
+	license agreements. See the NOTICE file distributed with this work for additional 
+	information regarding copyright ownership. The ASF licenses this file to 
+	you under the Apache License, Version 2.0 (theÏ "License"); you may not use 
+	this file except in compliance with the License. You may obtain a copy of 
+	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
+	by applicable law or agreed to in writing, software distributed under the 
+	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
+	OF ANY ~ KIND, either express or implied. See the License for the specific 
+	language governing permissions and limitations under the License. -->
+
+<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/xsd/maven-4.0.0.xsd">
+	
+	<parent>
+		<groupId>org.apache.airavata</groupId>
+		<artifactId>rest</artifactId>
+		<version>0.6-SNAPSHOT</version>
+		<relativePath>../pom.xml</relativePath>
+	</parent>
+
+	<modelVersion>4.0.0</modelVersion>
+	<artifactId>airavata-rest-service-webapp</artifactId>
+	<packaging>war</packaging>
+	<name>airavata-rest-service-webapp</name>
+	<build>
+		<finalName>airavata-rest-service-webapp</finalName>
+		<plugins>
+			<plugin>
+				<groupId>org.codehaus.cargo</groupId>
+				<artifactId>cargo-maven2-plugin</artifactId>
+				<version>${cargo.version}</version>
+				<configuration>
+					<wait>true</wait>
+					<configuration>
+						<properties>
+							<cargo.servlet.port>9080</cargo.servlet.port>
+							<cargo.tomcat.ajp.port>9009</cargo.tomcat.ajp.port>
+							<cargo.rmi.port>9099</cargo.rmi.port>
+							<cargo.jvmargs>
+                                <![CDATA[-Xdebug -Xrunjdwp:transport=dt_socket,address=${cargo.debug.address},server=y,suspend=${cargo.debug.suspend} -noverify ${javaagent}]]>
+							</cargo.jvmargs>
+							<cargo.tomcat.context.reloadable>true</cargo.tomcat.context.reloadable>
+						</properties>
+						<home>${project.build.directory}/tomcat6x</home>
+						<deployables>
+							<deployable>
+								<groupId>org.apache.airavata</groupId>
+								<artifactId>airavata-rest-service-webapp</artifactId>
+								<type>war</type>
+								<properties>
+									<context>/airavata-services</context>
+								</properties>
+							</deployable>
+						</deployables>
+					</configuration>
+					<container>
+						<containerId>tomcat6x</containerId>
+						<timeout>180000</timeout>
+						<zipUrlInstaller>
+							<url>
+								http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.32/bin/apache-tomcat-6.0.32.tar.gz
+							</url>
+						</zipUrlInstaller>
+						<systemProperties>
+
+						</systemProperties>
+					</container>
+				</configuration>
+			</plugin>
+		</plugins>
+
+	</build>
+	<dependencies>
+		<dependency>
+			<groupId>org.apache.derby</groupId>
+			<artifactId>derbyclient</artifactId>
+			<version>${derby.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>com.sun.jersey</groupId>
+			<artifactId>jersey-servlet</artifactId>
+			<version>${jersey.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>com.sun.jersey</groupId>
+			<artifactId>jersey-json</artifactId>
+			<version>${jersey.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>com.sun.jersey.contribs</groupId>
+			<artifactId>jersey-multipart</artifactId>
+			<version>${jersey.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>com.sun.jersey.jersey-test-framework</groupId>
+			<artifactId>jersey-test-framework-grizzly2</artifactId>
+			<version>${jersey.version}</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>com.sun.jersey</groupId>
+			<artifactId>jersey-server</artifactId>
+			<version>${jersey.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>com.sun.jersey</groupId>
+			<artifactId>jersey-client</artifactId>
+			<version>${jersey.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.shiro</groupId>
+			<artifactId>shiro-core</artifactId>
+			<version>1.2.1</version>
+		</dependency>
+		<dependency>
+			<groupId>com.h2database</groupId>
+			<artifactId>h2</artifactId>
+			<version>1.3.168</version>
+			<scope>test</scope>
+		</dependency>
+
+		<!-- Airavata -->
+		<dependency>
+			<groupId>org.apache.airavata</groupId>
+			<artifactId>airavata-gfac-schema-utils</artifactId>
+			<version>${project.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.airavata</groupId>
+			<artifactId>airavata-registry-api</artifactId>
+			<version>${project.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.airavata</groupId>
+			<artifactId>airavata-security</artifactId>
+			<version>${project.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.airavata</groupId>
+			<artifactId>airavata-jpa-registry</artifactId>
+			<version>${project.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.airavata</groupId>
+			<artifactId>airavata-rest-mappings</artifactId>
+			<version>${project.version}</version>
+		</dependency>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-rest-services</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+		<!-- Logging -->
+		<dependency>
+			<groupId>org.slf4j</groupId>
+			<artifactId>slf4j-api</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.slf4j</groupId>
+			<artifactId>slf4j-simple</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.slf4j</groupId>
+			<artifactId>jcl-over-slf4j</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.slf4j</groupId>
+			<artifactId>slf4j-log4j12</artifactId>
+		</dependency>
+	</dependencies>
+	<properties>
+		<jersey.version>1.13</jersey.version>
+		<grizzly.version>2.0.0-M3</grizzly.version>
+		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+		<cargo.version>1.2.1</cargo.version>
+		<!-- if you want a remote debugging on a different a address override on 
+			command line with -Dcargo.debug.addres=xxxx -->
+		<cargo.debug.address>5000</cargo.debug.address>
+		<!-- if you want to start remote debugging session suspended override on 
+			command line with -Dcargo.debug.suspend=y -->
+		<cargo.debug.suspend>n</cargo.debug.suspend>
+		<javaagent />
+	</properties>
+</project>

Added: airavata/trunk/modules/rest/webapp/src/main/resources/airavata-server.properties
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/rest/webapp/src/main/resources/airavata-server.properties?rev=1417136&view=auto
==============================================================================
--- airavata/trunk/modules/rest/webapp/src/main/resources/airavata-server.properties (added)
+++ airavata/trunk/modules/rest/webapp/src/main/resources/airavata-server.properties Tue Dec  4 19:35:25 2012
@@ -0,0 +1,204 @@
+#
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+###########################################################################
+#
+#  This properties file provides configuration for all Airavata Services: 
+#  Registry, Workflow Interpreter, GFac, Message Broker, Message Box
+#
+###########################################################################
+
+###########################################################################
+# Airavata Embedded-Tomcat Server Configuration
+###########################################################################
+# By default, tomcat runs on port 80. If the port is changed, it will be  
+#  have to be specified with port properties. This will be picked up by 
+#  the registry service to register the service end-points.
+
+port=8080
+
+# Axis2 server automatically picks up IP address from axis configuration, 
+#  but some DHCP enables machines do not report correct ip addresses,  
+#  in which case, the IP address can be manually specified. 
+
+#ip=192.2.33.12
+
+###########################################################################
+# Airavata Registry Configuration
+###########################################################################
+
+#registry.user=admin
+#registry.password=admin
+gateway.id=default
+#registry.jdbc.user=airavata
+#registry.jdbc.password=airavata
+#start.derby.server.mode=true
+
+system.gateway=default
+system.user=admin
+system.password=admin
+
+#for mysql
+    #registry.jdbc.driver=com.mysql.jdbc.Driver
+#registry.jdbc.url=jdbc:mysql://localhost:3306/persistent_data
+
+#for derby
+#registry.jdbc.driver=org.apache.derby.jdbc.ClientDriver
+#registry.jdbc.url=jdbc:derby://localhost:1527/persistent_data;create=true;user=airavata;password=airavata
+
+###########################################################################
+# Airavata Workflow Interpreter Configurations
+###########################################################################
+
+runInThread=false
+provenance=true
+provenanceWriterThreadPoolSize=20
+gfac.embedded=false
+
+#
+# Security Configuration used by Airavata Generic Factory Service
+#  to interact with Computational Resources.
+#
+
+###########################################################################
+# Airavata GFac MyProxy GSI credentials to access Grid Resources.
+###########################################################################
+
+myproxy.server=myproxy.teragrid.org
+myproxy.user=username
+myproxy.pass=password
+myproxy.life=3600
+# XSEDE Trusted certificates can be downloaded from https://software.xsede.org/security/xsede-certs.tar.gz
+trusted.cert.location=/path/to/trusted/certificates
+
+# SSH PKI key pair is SSH based authentication is used.
+#ssh.key=/home/user/.ssh/id_rsa
+#ssh.keypass=
+#ssh.username=usernameAtHost
+
+###########################################################################
+# Airavata Message Broker Basic Configurations.
+#  the Advanced section provides detailed custom configuration properties.
+###########################################################################
+
+# Default derby database configuration
+broker.jdbc.driver=org.apache.derby.jdbc.EmbeddedDriver
+broker.jdbc.url=jdbc:derby:wsmg;create=true;user=airavata;password=airavata
+
+# Note: This database will only be used  if 'broker.storage.type=persistent' 
+#       is set in advanced properties below.
+# MySql database configuration
+#broker.jdbc.driver=com.mysql.jdbc.Driver
+#broker.jdbc.url=jdbc:mysql://localhost:3306/wsmg?user=airavata&password=airavata
+
+###########################################################################
+# Airavata Message Box Basic Configurations, 
+#  the Advanced section provides detailed custom configuration properties.
+###########################################################################  
+
+# Default derby database
+msgBox.jdbc.driver=org.apache.derby.jdbc.EmbeddedDriver
+msgBox.jdbc.url=jdbc:derby:wsmg;create=true;user=airavata;password=airavata
+
+# MySql database configuration
+#msgBox.jdbc.driver=com.mysql.jdbc.Driver
+#msgBox.jdbc.url=jdbc:mysql://localhost:3306/wsmg?user=airavata&password=airavata
+
+###########################################################################
+# Advance configuration to change service implementations
+###########################################################################
+
+# By default all provenance data is also cataloged in Airavata Registry. 
+# A custom provenance implementation can be plugged in for Provenance Registry. 
+# The full qualified path to the implementation class has to be specified.
+# BY default a mysql JPA provenanceRegistry implementation is bundled.
+class.registry.accessor=org.apache.airavata.persistance.registry.jpa.impl.AiravataJPARegistry
+
+#
+# Class which implemented Scheduler interface. It will be used to determine a Provider
+#
+scheduler.class= org.apache.airavata.core.gfac.scheduler.impl.SchedulerImpl
+
+#
+# Data Service Plugins classes
+#
+datachain.classes= org.apache.airavata.core.gfac.extension.data.RegistryDataService
+
+#
+# Pre execution Plugins classes. For example, GridFTP Input Staging
+#
+prechain.classes= org.apache.airavata.core.gfac.extension.pre.GridFtpInputStaging
+prechain.classes= org.apache.airavata.core.gfac.extension.pre.HttpInputStaging
+
+#
+# Post execution Plugins classes. For example, GridFTP Output Staging
+#
+postchain.classes= org.apache.airavata.core.gfac.extension.post.GridFtpOutputStaging
+postchain.classes= org.apache.airavata.core.gfac.extension.post.OutputRegister
+
+#
+# Advanced Message Broker Configurations
+#
+
+#socket time out in milliseconds for sending messages. (defaults is 20000)
+broker.socket.timeout=60000
+
+broker.storage.type=persistent
+#broker.storage.type=memory
+
+#specifies wether delivery component should be started or not.
+broker.start.delivery.thread=true
+
+#fixed thread pool based delivery
+#broker.delivery.method=pcrew
+
+#dynamic thread pool based delivery
+#broker.delivery.method=parallel
+
+#single thread delivery
+broker.delivery.method=serial
+
+#number of message delivery failures before a url become black listed (default is 2)
+#broker.msg.delivery.retries=2
+
+#time period (in seconds) a url will be kept blacklisted (default is 5 seconds) 
+#consumer.expiration.time.gap=5 
+
+#maximum number of messages to be send to a one consumer/url at time. 
+#applicable if 'broker.delivery.method' is 'pcrew' . (default is 10)
+
+#sending.batch.size=10
+
+#size of the thread pool. only applicable if 'broker.delivery.method' is 'pcrew'. (default is 4)
+#sending.thread.pool.size=4
+
+#
+# Advanced Message Box Configurations
+# 
+msgBox.usedatabase=true
+messagePreservationDays=2
+messagePreservationHours=0
+messagePreservationMinutes=0
+messagePerservationIntervalDays=0
+messagePerservationIntervalHours=1
+messagePerservationIntervalMinutes=0
+
+
+

Added: airavata/trunk/modules/rest/webapp/src/main/resources/authenticators.xml
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/rest/webapp/src/main/resources/authenticators.xml?rev=1417136&view=auto
==============================================================================
--- airavata/trunk/modules/rest/webapp/src/main/resources/authenticators.xml (added)
+++ airavata/trunk/modules/rest/webapp/src/main/resources/authenticators.xml Tue Dec  4 19:35:25 2012
@@ -0,0 +1,64 @@
+<?xml version="1.0"?>
+
+<!--
+This file contains a sample authenticator configuration. We can define all authenticators in this file. Each authenticator
+configuration has to start with tag "authenticator". The name is the name given to the authenticator. The actual
+authenticator implementation is implemented in the class. There are configurations specific to authenticators.
+Those configurations are reside inside &lt;specificConfigurations&gt; tags.
+
+The "enabled parameter at root level will say whether authenticators are enabled or not.
+-->
+
+<authenticators enabled="true">
+    <authenticator name="sessionAuthenticator" class="org.apache.airavata.services.registry.rest.security.session.SessionAuthenticator"
+                   enabled="true" priority="6" userstore="org.apache.airavata.security.userstore.SessionDBUserStore">
+        <specificConfigurations>
+            <database>
+                <!--jdbcUrl>jdbc:h2:modules/commons/airavata-registry-rest/src/test/resources/testdb/test</jdbcUrl-->
+                <!-- Points to /Users/thejaka/development/apache/airavata/trunk/modules/commons/airavata-registry-rest/target/tomcat6x/. -->
+                <jdbcUrl>jdbc:derby://localhost:1527/persistent_data;create=true;user=airavata;password=airavata</jdbcUrl>
+                <userName>airavata</userName>
+                <password>airavata</password>
+                <databaseDriver>org.apache.derby.jdbc.ClientDriver</databaseDriver>
+                <sessionTable>Persons</sessionTable>
+                <sessionColumn>sessionId</sessionColumn>
+                <comparingColumn>sessionId</comparingColumn>
+            </database>
+        </specificConfigurations>
+    </authenticator>
+
+    <authenticator name="basicAccessAuthenticator" class="org.apache.airavata.services.registry.rest.security.basic.BasicAccessAuthenticator"
+                   enabled="true" priority="8" userstore="org.apache.airavata.security.userstore.JDBCUserStore">
+        <specificConfigurations>
+            <database>
+                <!--jdbcUrl>jdbc:h2:modules/commons/airavata-registry-rest/src/test/resources/testdb/test</jdbcUrl-->
+                <jdbcUrl>jdbc:derby://localhost:1527/persistent_data;create=true;user=airavata;password=airavata</jdbcUrl>
+                <userName>airavata</userName>
+                <password>airavata</password>
+                <databaseDriver>org.apache.derby.jdbc.ClientDriver</databaseDriver>
+                <userTableName>Users</userTableName>
+                <userNameColumnName>user_name</userNameColumnName>
+                <passwordColumnName>password</passwordColumnName>
+            </database>
+        </specificConfigurations>
+    </authenticator>
+
+    <authenticator name="basicAccessAuthenticatorLdap" class="org.apache.airavata.services.registry.rest.security.basic.BasicAccessAuthenticator"
+                   enabled="true" priority="6" userstore="org.apache.airavata.security.userstore.LDAPUserStore">
+        <specificConfigurations>
+            <ldap>
+                <!--
+                url - The URL which LDAP server is listening for requests
+                systemUser - The DN of the LDAP server connection user
+                systemUserPassword - The password of the LDAP server connection user
+                userDNTemplate - The DN structure of the users in LDAP
+            -->
+                <url>ldap://localhost:10389</url>
+                <systemUser>admin</systemUser>
+                <systemUserPassword>secret</systemUserPassword>
+                <userDNTemplate>uid={0},ou=users,ou=system</userDNTemplate>
+            </ldap>
+        </specificConfigurations>
+    </authenticator>
+
+</authenticators>
\ No newline at end of file

Added: airavata/trunk/modules/rest/webapp/src/main/resources/log4j.xml
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/rest/webapp/src/main/resources/log4j.xml?rev=1417136&view=auto
==============================================================================
--- airavata/trunk/modules/rest/webapp/src/main/resources/log4j.xml (added)
+++ airavata/trunk/modules/rest/webapp/src/main/resources/log4j.xml Tue Dec  4 19:35:25 2012
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+
+  $Id$
+-->
+<!DOCTYPE log4j:configuration PUBLIC "-//LOGGER" "log4j.dtd">
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+
+  <!-- Appenders -->
+  <appender name="console" class="org.apache.log4j.ConsoleAppender">
+    <param name="Target" value="System.out" />
+    <layout class="org.apache.log4j.PatternLayout">
+      <param name="ConversionPattern" value="%-5p: %c - %m%n" />
+    </layout>
+  </appender>
+
+  <!-- Jersey logger -->
+  <logger name="com.sun.jersey">
+    <level value="info" />
+  </logger>
+
+  <!-- Airavata logger -->
+  <logger name="org.apache.airavata">
+    <level value="info" />
+  </logger>
+
+  <!-- Root Logger -->
+  <root>
+    <priority value="info" />
+    <appender-ref ref="console" />
+  </root>
+
+</log4j:configuration>
\ No newline at end of file

Added: airavata/trunk/modules/rest/webapp/src/main/resources/registry.properties
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/rest/webapp/src/main/resources/registry.properties?rev=1417136&view=auto
==============================================================================
--- airavata/trunk/modules/rest/webapp/src/main/resources/registry.properties (added)
+++ airavata/trunk/modules/rest/webapp/src/main/resources/registry.properties Tue Dec  4 19:35:25 2012
@@ -0,0 +1,49 @@
+#
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+#
+
+
+###########################################################################
+#
+#  This properties file provides configuration to connect to Registry.
+#  Please do not use this for any server configurations.
+#
+###########################################################################
+
+###---------------------------REGISTRY API IMPLEMENTATION---------------------------###
+
+class.registry.accessor=org.apache.airavata.persistance.registry.jpa.impl.AiravataJPARegistry
+#class.registry.accessor=org.apache.airavata.rest.client.RegistryClient
+
+###---------------------REGISTRY API IMPLEMENTATION - CUSTOM SETTINGS----------------------###
+
+#for mysql [AiravataJPARegistry]
+#registry.jdbc.driver=com.mysql.jdbc.Driver
+#registry.jdbc.url=jdbc:mysql://localhost:3306/persistent_data
+
+#for derby [AiravataJPARegistry]
+registry.jdbc.driver=org.apache.derby.jdbc.ClientDriver
+registry.jdbc.url=jdbc:derby://localhost:1527/persistent_data;create=true;user=airavata;password=airavata
+registry.jdbc.user=airavata
+registry.jdbc.password=airavata
+start.derby.server.mode=true
+
+#for rest [RegistryClient]
+#registry.jdbc.url=http://localhost:9080/airavata-services

Added: airavata/trunk/modules/rest/webapp/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/rest/webapp/src/main/webapp/WEB-INF/web.xml?rev=1417136&view=auto
==============================================================================
--- airavata/trunk/modules/rest/webapp/src/main/webapp/WEB-INF/web.xml (added)
+++ airavata/trunk/modules/rest/webapp/src/main/webapp/WEB-INF/web.xml Tue Dec  4 19:35:25 2012
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- This web.xml file is not required when using Servlet 3.0 container,
+     see implementation details http://jersey.java.net/nonav/documentation/latest/jax-rs.html#d4e194 -->
+<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+    <listener>
+      <listener-class>org.apache.airavata.rest.mappings.utils.RegistryListener</listener-class>
+    </listener>
+
+    <servlet>
+        <servlet-name>Airavata Web Application</servlet-name>
+        <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
+        <init-param>
+            <param-name>com.sun.jersey.config.property.packages</param-name>
+            <param-value>org.apache.airavata.services.registry.rest;org.codehaus.jackson.jaxrs</param-value>
+        </init-param>
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+
+    <!-- ========================= Security Related Configurations go here ================================== -->
+    <filter>
+        <filter-name>AuthenticationFilter</filter-name>
+        <filter-class>org.apache.airavata.services.registry.rest.security.HttpAuthenticatorFilter</filter-class>
+        <init-param>
+            <param-name>authenticatorConfigurations</param-name>
+            <param-value>authenticators.xml</param-value>
+        </init-param>
+    </filter>
+
+    <filter-mapping>
+        <filter-name>AuthenticationFilter</filter-name>
+        <url-pattern>/user-store/*</url-pattern>
+        <url-pattern>/api/*</url-pattern>
+    </filter-mapping>
+
+    <!-- ================================ End Security Related Configurations =============================== -->
+
+    <servlet-mapping>
+        <servlet-name>Airavata Web Application</servlet-name>
+        <url-pattern>/api/*</url-pattern>
+    </servlet-mapping>
+</web-app>

Added: airavata/trunk/modules/rest/webapp/src/main/webapp/index.jsp
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/rest/webapp/src/main/webapp/index.jsp?rev=1417136&view=auto
==============================================================================
--- airavata/trunk/modules/rest/webapp/src/main/webapp/index.jsp (added)
+++ airavata/trunk/modules/rest/webapp/src/main/webapp/index.jsp Tue Dec  4 19:35:25 2012
@@ -0,0 +1,6 @@
+<html>
+<body>
+<h2>Airavata REST API</h2>
+<p>Welcome to Airavata Web Application</p>
+</body>
+</html>

Added: airavata/trunk/modules/rest/webapp/src/main/webapp/user-store/add.jsp
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/rest/webapp/src/main/webapp/user-store/add.jsp?rev=1417136&view=auto
==============================================================================
--- airavata/trunk/modules/rest/webapp/src/main/webapp/user-store/add.jsp (added)
+++ airavata/trunk/modules/rest/webapp/src/main/webapp/user-store/add.jsp Tue Dec  4 19:35:25 2012
@@ -0,0 +1,127 @@
+<%@ page import="org.apache.airavata.services.registry.rest.security.local.LocalUserStore" %>
+
+
+<html>
+
+<head>
+    <script language="javascript" type="text/javascript">
+        function validatePassword(fld1name, regString) {
+            var stringValue = document.getElementsByName(fld1name)[0].value;
+            var errorMessage = "";
+            if(regString != "null" && !stringValue.match(new RegExp(regString))){
+                errorMessage = "Password does not meet minimum requirements. Password length must be at least 6 " +
+                        "characters.";
+                return errorMessage;
+            }else if(regString != "null" && stringValue == ''){
+                return errorMessage;
+            }
+
+            if (stringValue == '') {
+                errorMessage = "Empty passwords are not allowed. Please enter a valid password";
+                return errorMessage;
+            }
+
+            return errorMessage;
+        }
+
+        function validateUsername(fld1name) {
+            var stringValue = document.getElementsByName(fld1name)[0].value;
+            var errorMessage = "";
+
+            if (stringValue == '') {
+                errorMessage = "Empty user names are not allowed. Please enter a valid user name.";
+                return errorMessage;
+            }
+
+            return errorMessage;
+        }
+
+        function checkPasswordsMatching(fld1name, fld2name) {
+
+            var stringValue1 = document.getElementsByName(fld1name)[0].value;
+            var stringValue2 = document.getElementsByName(fld2name)[0].value;
+            var errorMessage = "";
+
+            if (stringValue1 != stringValue2) {
+                errorMessage = "Confirm password does not match with the password. Please re-enter passwords.";
+                return errorMessage;
+            }
+
+            return errorMessage;
+
+        }
+
+        function validate() {
+            var reason = "";
+
+            reason = validateUsername("username");
+
+            if (reason != "") {
+                alert(reason);
+                return false;
+            }
+
+            reason = validatePassword("newPassword", <%=LocalUserStore.getPasswordRegularExpression()%>);
+
+            if (reason != "") {
+                alert(reason);
+                document.getElementsByName("newPassword")[0].clear();
+                return false;
+            }
+
+            reason = checkPasswordsMatching("newPassword", "confirmPassword");
+
+            if (reason != "") {
+                alert(reason);
+                document.getElementsByName("newPassword")[0].clear();
+                document.getElementsByName("confirmPassword")[0].clear();
+                return false;
+            }
+
+            return true;
+        }
+
+        function doProcess() {
+            if (validate() == true) {
+                document.registration.submit();
+            }
+        }
+
+
+    </script>
+</head>
+
+<body>
+<img src="../images/airavata-logo-2.png">
+<h2>Airavata REST API - Local User Store</h2>
+<p><b>Manage Local User Store - Add New User</b></p>
+
+<form action="index.jsp" name="registration" method="POST">
+
+    <input type="hidden" name="operation" value="addUser">
+    <table>
+        <tr>
+            <td>User Name</td>
+            <td><input type="text" name="username" maxlength="150"></td>
+        </tr>
+        <tr>
+            <td>Password</td>
+            <td><input type="password" name="newPassword"/></td>
+        </tr>
+        <tr>
+            <td>Re-Type Password</td>
+            <td><input type="password" name="confirmPassword"/></td>
+        </tr>
+    </table>
+
+    <table>
+        <tr>
+            <td><input type="button" value="Add" onclick= 'doProcess()'></td>
+            <td><a href="index.jsp"><input type="button" value="Cancel" name="Cancel"/> </a> </td>
+        </tr>
+    </table>
+
+</form>
+
+</body>
+</html>
\ No newline at end of file

Added: airavata/trunk/modules/rest/webapp/src/main/webapp/user-store/index.jsp
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/rest/webapp/src/main/webapp/user-store/index.jsp?rev=1417136&view=auto
==============================================================================
--- airavata/trunk/modules/rest/webapp/src/main/webapp/user-store/index.jsp (added)
+++ airavata/trunk/modules/rest/webapp/src/main/webapp/user-store/index.jsp Tue Dec  4 19:35:25 2012
@@ -0,0 +1,120 @@
+<%@ page import = "org.apache.airavata.services.registry.rest.security.local.LocalUserStore" %>
+<%@ page import="org.apache.airavata.services.registry.rest.security.basic.BasicAccessAuthenticator" %>
+<%@ page import="org.apache.airavata.services.registry.rest.security.HttpAuthenticatorFilter" %>
+<%@ page import="java.util.List" %>
+<%
+
+    LocalUserStore localUserStore = (LocalUserStore)session.getAttribute("LocalUserStore");
+
+    if (localUserStore == null) {
+
+        String operatingUser = (String) session.getAttribute(BasicAccessAuthenticator.USER_IN_SESSION);
+
+        if (operatingUser == null || !operatingUser.equals("admin")) {
+            HttpAuthenticatorFilter.sendUnauthorisedError(response, "Insufficient privileges to perform user operations." +
+                    " Only admin user is allowed to perform user operations.");
+
+            return;
+        }
+
+        localUserStore = new LocalUserStore(application);
+
+        session.setAttribute("LocalUserStore", localUserStore);
+    }
+
+    String operation = request.getParameter("operation");
+    if (operation != null) {
+        if (operation.equals("addUser")) {
+            String userName = request.getParameter("username");
+            String password = request.getParameter("newPassword");
+
+            localUserStore.addUser(userName, password);
+        } else if (operation.equals("deleteUser")) {
+            String[] usersToDelete = request.getParameterValues("user-id");
+
+            for (String deleteUser : usersToDelete) {
+                localUserStore.deleteUser(deleteUser);
+            }
+        }
+    }
+
+    List<String> allUsers = localUserStore.getUsers();
+
+%>
+
+<html>
+<head>
+    <script language="javascript" type="text/javascript">
+
+        function validate() {
+            var checkSelected = false;
+            for (var i = 0; i < <%=allUsers.size()%>; i++) {
+                if (document.main["user-id"][i].checked) {
+                    checkSelected = true;
+                }
+            }
+            if (checkSelected) {
+                var answer = confirm("Are you sure you want to delete selected users from the system ?");
+                if (answer) {
+                    return true;
+                }
+            } else {
+                alert("Select at least one user to delete.");
+            }
+            return false;
+        }
+
+        function doProcess() {
+            if (validate() == true) {
+                document.main.submit();
+            }
+        }
+
+    </script>
+</head>
+<body>
+<img src="../images/airavata-logo-2.png">
+<h2>Airavata REST API - Local User Store</h2>
+<p><b>Manage Local User Store</b></p>
+
+
+<form action="index.jsp" name="main" method="POST">
+    <table>
+        <tr>
+            <td>&nbsp;</td>
+            <td>All Users</td>
+        </tr>
+        <%
+            for (String user : allUsers) {
+        %>
+
+        <tr>
+            <td><input type="checkbox" name="user-id" value="<%=user%>"></td>
+            <td><%=user%>
+            </td>
+            <td><a href="password.jsp?username=<%=user%>">Change Password</a></td>
+        </tr>
+
+        <%
+            }
+        %>
+    </table>
+
+    <br>
+
+    <table width="100">
+        <tr>
+            <td>
+                <a href="add.jsp"><input type="button" value="Add" name="Add"/></a>
+            </td>
+            <td>&nbsp;</td>
+            <input type="hidden" name="operation" value="deleteUser">
+            <td><input type="button" value="Delete" onclick="doProcess()"></td>
+        </tr>
+    </table>
+
+</form>
+
+
+</body>
+</html>
\ No newline at end of file

Added: airavata/trunk/modules/rest/webapp/src/main/webapp/user-store/password.jsp
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/rest/webapp/src/main/webapp/user-store/password.jsp?rev=1417136&view=auto
==============================================================================
--- airavata/trunk/modules/rest/webapp/src/main/webapp/user-store/password.jsp (added)
+++ airavata/trunk/modules/rest/webapp/src/main/webapp/user-store/password.jsp Tue Dec  4 19:35:25 2012
@@ -0,0 +1,140 @@
+<%@ page import="org.apache.airavata.services.registry.rest.security.local.LocalUserStore" %>
+
+<%
+    String userName = request.getParameter("username");
+    if (userName == null) {
+        response.sendRedirect("index.jsp");
+    }
+
+    String password = request.getParameter("newPassword");
+    String confirmPassword = request.getParameter("confirmPassword");
+
+    if (password != null && confirmPassword != null && password.equals(confirmPassword)) {
+        LocalUserStore localUserStore = (LocalUserStore)session.getAttribute("LocalUserStore");
+        localUserStore.changePasswordByAdmin(userName, password);
+
+        response.sendRedirect("password.jsp?message=\"Password successfully change for user "
+                + userName + "\"&username=" + userName);
+    }
+
+%>
+
+<html>
+<head>
+    <script language="javascript" type="text/javascript">
+        function validatePassword(fld1name, regString) {
+            var stringValue = document.getElementsByName(fld1name)[0].value;
+            var errorMessage = "";
+            if(regString != "null" && !stringValue.match(new RegExp(regString))){
+                errorMessage = "Password does not meet minimum requirements. Password length must be at least 6 " +
+                        "characters.";
+                return errorMessage;
+            }else if(regString != "null" && stringValue == ''){
+                return errorMessage;
+            }
+
+            if (stringValue == '') {
+                errorMessage = "Empty passwords are not allowed. Please enter a valid password";
+                return errorMessage;
+            }
+
+            return errorMessage;
+        }
+
+        function validateUsername(fld1name) {
+            var stringValue = document.getElementsByName(fld1name)[0].value;
+            var errorMessage = "";
+
+            if (stringValue == '') {
+                errorMessage = "Empty user names are not allowed. Please enter a valid user name.";
+                return errorMessage;
+            }
+
+            return errorMessage;
+        }
+
+        function checkPasswordsMatching(fld1name, fld2name) {
+
+            var stringValue1 = document.getElementsByName(fld1name)[0].value;
+            var stringValue2 = document.getElementsByName(fld2name)[0].value;
+            var errorMessage = "";
+
+            if (stringValue1 != stringValue2) {
+                errorMessage = "Confirm password does not match with the password. Please re-enter passwords.";
+                return errorMessage;
+            }
+
+            return errorMessage;
+
+        }
+
+        function validate() {
+            var reason = "";
+
+            reason = validatePassword("newPassword", <%=LocalUserStore.getPasswordRegularExpression()%>);
+
+            if (reason != "") {
+                alert(reason);
+                document.getElementsByName("newPassword")[0].clear();
+                return false;
+            }
+
+            reason = checkPasswordsMatching("newPassword", "confirmPassword");
+
+            if (reason != "") {
+                alert(reason);
+                document.getElementsByName("newPassword")[0].clear();
+                document.getElementsByName("confirmPassword")[0].clear();
+                return false;
+            }
+
+            return true;
+        }
+
+        function doProcess() {
+            if (validate() == true) {
+                document.passwordForm.submit();
+            }
+        }
+
+        function displayMessage() {
+            var msg = <%=request.getParameter("message")%>;
+            if (msg != null) {
+                alert(msg);
+            }
+        }
+
+
+    </script>
+</head>
+
+<body onload="displayMessage()">
+<img src="../images/airavata-logo-2.png">
+<h2>Airavata REST API - Local User Store</h2>
+<p><b>Manage Local User Store - Change Password of user - <%=userName%></b></p>
+
+<form action="password.jsp" name="passwordForm" method="POST">
+
+    <input type="hidden" name="username" value="<%=userName%>">
+    <table>
+        <tr>
+            <td>New Password</td>
+            <td><input type="password" name="newPassword"/></td>
+        </tr>
+        <tr>
+            <td>Re-Type Password</td>
+            <td><input type="password" name="confirmPassword"/></td>
+        </tr>
+    </table>
+
+    <table>
+        <tr>
+            <td><input type="button" value="Change" onclick= 'doProcess()'></td>
+            <td><a href="index.jsp"><input type="button" value="Cancel" name="Cancel"/> </a> </td>
+        </tr>
+    </table>
+
+</form>
+
+</body>
+</html>
\ No newline at end of file