svn commit: r14260 - cheetah/trunk: . .settings application application/src/main/java/org/mifos/core common common/src common/src/main common/src/m...

0 views
Skip to first unread message

adam...@dev.java.net

unread,
Dec 24, 2008, 3:14:12 PM12/24/08
to com...@mifos.dev.java.net
Author: adamfeuer
Date: 2008-12-24 20:14:11+0000
New Revision: 14260

Added:
cheetah/trunk/application/src/main/java/org/mifos/core/MifosServiceException.java (props changed)
- copied unchanged from r14257, /cheetah/trunk/application/src/main/java/org/mifos/core/MifosServiceException.java
cheetah/trunk/application/src/main/java/org/mifos/core/MifosValidationException.java (props changed)
- copied unchanged from r14257, /cheetah/trunk/application/src/main/java/org/mifos/core/MifosValidationException.java
cheetah/trunk/common/
cheetah/trunk/common/pom.xml
cheetah/trunk/common/src/
cheetah/trunk/common/src/main/
cheetah/trunk/common/src/main/java/
cheetah/trunk/common/src/main/java/org/
cheetah/trunk/common/src/main/java/org/mifos/
cheetah/trunk/common/src/main/java/org/mifos/core/
cheetah/trunk/common/src/main/java/org/mifos/core/ClasspathResource.java (contents, props changed)
cheetah/trunk/common/src/main/java/org/mifos/core/MifosException.java (props changed)
- copied unchanged from r14257, /cheetah/trunk/application/src/main/java/org/mifos/core/MifosException.java
cheetah/trunk/common/src/main/java/org/mifos/core/MifosNotImplementedException.java (props changed)
- copied unchanged from r14257, /cheetah/trunk/application/src/main/java/org/mifos/core/MifosNotImplementedException.java
cheetah/trunk/common/src/main/java/org/mifos/core/MifosRepositoryException.java (props changed)
- copied unchanged from r14257, /cheetah/trunk/application/src/main/java/org/mifos/core/MifosRepositoryException.java
cheetah/trunk/common/src/main/java/org/mifos/core/MifosRuntimeException.java (props changed)
- copied unchanged from r14257, /cheetah/trunk/application/src/main/java/org/mifos/core/MifosRuntimeException.java
Removed:
cheetah/trunk/application/src/main/java/org/mifos/core/MifosException.java
cheetah/trunk/application/src/main/java/org/mifos/core/MifosNotImplementedException.java
cheetah/trunk/application/src/main/java/org/mifos/core/MifosRepositoryException.java
cheetah/trunk/application/src/main/java/org/mifos/core/MifosRuntimeException.java
Modified:
cheetah/trunk/.classpath
cheetah/trunk/.settings/org.eclipse.wst.common.component
cheetah/trunk/application/pom.xml
cheetah/trunk/pom.xml
cheetah/trunk/userInterface/pom.xml

Log:
created common/ module, moved some common files there:

* exceptions
* ClasspathResource.java

also updated Eclipse build system to use common/ module


Modified: cheetah/trunk/.classpath
Url: https://mifos.dev.java.net/source/browse/mifos/cheetah/trunk/.classpath?view=diff&rev=14260&p1=cheetah/trunk/.classpath&p2=cheetah/trunk/.classpath&r1=14259&r2=14260
==============================================================================
--- cheetah/trunk/.classpath (original)
+++ cheetah/trunk/.classpath 2008-12-24 20:14:11+0000
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="acceptanceTests/target/test-classes" path="acceptanceTests/src/test/resources"/>
+ <classpathentry kind="src" output="webapp/target/mifos/WEB-INF/classes" path="common/src/main/java"/>
<classpathentry kind="src" output="testFramework/target/test-classes" path="testFramework/src/test/java"/>
<classpathentry kind="src" output="acceptanceTests/target/test-classes" path="acceptanceTests/src/test/java"/>
<classpathentry kind="src" path="testFramework/src/main/resources"/>

Modified: cheetah/trunk/.settings/org.eclipse.wst.common.component
Url: https://mifos.dev.java.net/source/browse/mifos/cheetah/trunk/.settings/org.eclipse.wst.common.component?view=diff&rev=14260&p1=cheetah/trunk/.settings/org.eclipse.wst.common.component&p2=cheetah/trunk/.settings/org.eclipse.wst.common.component&r1=14259&r2=14260
==============================================================================
--- cheetah/trunk/.settings/org.eclipse.wst.common.component (original)
+++ cheetah/trunk/.settings/org.eclipse.wst.common.component 2008-12-24 20:14:11+0000
@@ -24,6 +24,7 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/testFramework/src/main/resources"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/acceptanceTests/src/test/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/acceptanceTests/src/test/resources"/>
+<wb-resource deploy-path="/WEB-INF/classes" source-path="/common/src/main/java"/>
<property name="java-output-path"/>
<property name="context-root" value="mifos"/>
</wb-module>

Modified: cheetah/trunk/application/pom.xml
Url: https://mifos.dev.java.net/source/browse/mifos/cheetah/trunk/application/pom.xml?view=diff&rev=14260&p1=cheetah/trunk/application/pom.xml&p2=cheetah/trunk/application/pom.xml&r1=14259&r2=14260
==============================================================================
--- cheetah/trunk/application/pom.xml (original)
+++ cheetah/trunk/application/pom.xml 2008-12-24 20:14:11+0000
@@ -48,6 +48,11 @@
<dependencies>
<dependency>
<groupId>org.mifos</groupId>
+ <artifactId>cheetah-common</artifactId>
+ <version>0.0.3-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.mifos</groupId>
<artifactId>cheetah-serviceInterfaces</artifactId>
<version>0.0.3-SNAPSHOT</version>
</dependency>

Removed: cheetah/trunk/application/src/main/java/org/mifos/core/MifosException.java
Url: https://mifos.dev.java.net/source/browse/mifos/cheetah/trunk/application/src/main/java/org/mifos/core/MifosException.java?view=auto&rev=14259

Removed: cheetah/trunk/application/src/main/java/org/mifos/core/MifosNotImplementedException.java
Url: https://mifos.dev.java.net/source/browse/mifos/cheetah/trunk/application/src/main/java/org/mifos/core/MifosNotImplementedException.java?view=auto&rev=14259

Removed: cheetah/trunk/application/src/main/java/org/mifos/core/MifosRepositoryException.java
Url: https://mifos.dev.java.net/source/browse/mifos/cheetah/trunk/application/src/main/java/org/mifos/core/MifosRepositoryException.java?view=auto&rev=14259

Removed: cheetah/trunk/application/src/main/java/org/mifos/core/MifosRuntimeException.java
Url: https://mifos.dev.java.net/source/browse/mifos/cheetah/trunk/application/src/main/java/org/mifos/core/MifosRuntimeException.java?view=auto&rev=14259

Added: cheetah/trunk/common/pom.xml
Url: https://mifos.dev.java.net/source/browse/mifos/cheetah/trunk/common/pom.xml?view=auto&rev=14260
==============================================================================
--- (empty file)
+++ cheetah/trunk/common/pom.xml 2008-12-24 20:14:11+0000
@@ -0,0 +1,125 @@
+<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">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.mifos</groupId>
+ <artifactId>cheetah-common</artifactId>
+ <packaging>jar</packaging>
+ <version>0.0.3-SNAPSHOT</version>
+ <name>Mifos - Cheetah Common</name>
+ <url>http://www.mifos.org</url>
+
+ <properties>
+ <modules.root.dir>${basedir}/..</modules.root.dir>
+ </properties>
+
+ <parent>
+ <groupId>org.mifos</groupId>
+ <artifactId>cheetah-parent</artifactId>
+ <version>0.0.3-SNAPSHOT</version>
+ </parent>
+
+ <dependencies>
+ </dependencies>
+ <build>
+ <finalName>cheetah-common</finalName>
+ <defaultGoal>jar</defaultGoal>
+ <sourceDirectory>src/main/java</sourceDirectory>
+ <outputDirectory>target/classes</outputDirectory>
+ <resources>
+ <resource>
+ <directory>do-not-inherit-from-parent</directory>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <debug>true</debug>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.4.3</version>
+ <configuration>
+ <includedGroups>unit</includedGroups>
+ <excludedGroups>workInProgress</excludedGroups>
+ <reportsDirectory>${project.build.directory}/surefire-reports/unit</reportsDirectory>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>findbugs-maven-plugin</artifactId>
+ <version>2.0-20080806.104243-13</version>
+ <configuration>
+ <debug>true</debug>
+ <failOnError>true</failOnError>
+ <effort>Max</effort>
+ <threshold>Low</threshold>
+ <excludeFilterFile>${modules.root.dir}/findbugs.excludes.xml</excludeFilterFile>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>verify</phase>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-pmd-plugin</artifactId>
+ <version>2.4</version>
+ <configuration>
+ <rulesets>
+ <ruleset>${modules.root.dir}/.ruleset</ruleset>
+ </rulesets>
+ <includeTests>true</includeTests>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>verify</phase>
+ <goals>
+ <goal>check</goal>
+ <goal>cpd-check</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jxr-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-pmd-plugin</artifactId>
+ <version>2.4</version>
+ <configuration>
+ <linkXref>true</linkXref>
+ <sourceEncoding>utf-8</sourceEncoding>
+ <targetJdk>1.6</targetJdk>
+ <includeTests>true</includeTests>
+ <rulesets>
+ <ruleset>${modules.root.dir}/.ruleset</ruleset>
+ </rulesets>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>jdepend-maven-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </reporting>
+</project>

Added: cheetah/trunk/common/src/main/java/org/mifos/core/ClasspathResource.java
Url: https://mifos.dev.java.net/source/browse/mifos/cheetah/trunk/common/src/main/java/org/mifos/core/ClasspathResource.java?view=auto&rev=14260
==============================================================================
--- (empty file)
+++ cheetah/trunk/common/src/main/java/org/mifos/core/ClasspathResource.java 2008-12-24 20:14:11+0000
@@ -0,0 +1,86 @@
+package org.mifos.core;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+
+/**
+ * Load resources from the classpath.
+ *
+ */
+
+public class ClasspathResource {
+
+ public static ClasspathResource getInstance(String path) {
+ return new ClasspathResource(path);
+ }
+
+ /**
+ * Returns the URI for the file name specified.
+ * It tries to load the file using the class loader and then
+ * returns the URI corresponding to the file.
+ *
+ * Returns null if the file is not found (or, perhaps, if we aren't
+ * allowed to see it).
+ */
+ public static URI getURI(String fileName) throws URISyntaxException{
+ ClassLoader parent = ClasspathResource.class.getClassLoader().getParent();
+ ClassLoader current = ClasspathResource.class.getClassLoader();
+ URI uri = null;
+ URL url = parent.getResource(fileName);
+ if(null == url){
+ url = current.getResource(fileName);
+ }
+
+ if(null!= url){
+ // Encoding spaces in URL in order to fix issue 1759 (https://mifos.dev.java.net/issues/show_bug.cgi?id=1759)
+ String encodedURL = url.toString().replaceAll(" ", "%20");
+ uri = new URI(encodedURL);
+ }
+
+ return uri;
+ }
+
+ /**
+ * Works exactly like {@link #getURI(String)} except the
+ * {@link URISyntaxException}, if caught, is wrapped in a
+ * {@link RuntimeException}.
+ */
+ public static URI findResource(String fileName) {
+ try {
+ return getURI(fileName);
+ }
+ catch (URISyntaxException e) {
+ throw new MifosRuntimeException(e);
+ }
+ }
+
+ protected String path;
+
+ public ClasspathResource(String path) {
+ super();
+ this.path = path;
+ }
+
+ public URL getUrl(String name) {
+ String resourcePath = this.path + name;
+ return ClasspathResource.class.getResource(resourcePath);
+ }
+
+ public InputStream getAsStream(String name) throws IOException {
+ return getUrl(name).openStream();
+ }
+
+ public Reader getAsReader(String name) {
+ try {
+ return new BufferedReader(new InputStreamReader(this.getAsStream(name)));
+ } catch (IOException e) {
+ throw new MifosRuntimeException(e);
+ }
+ }
+}

Modified: cheetah/trunk/pom.xml
Url: https://mifos.dev.java.net/source/browse/mifos/cheetah/trunk/pom.xml?view=diff&rev=14260&p1=cheetah/trunk/pom.xml&p2=cheetah/trunk/pom.xml&r1=14259&r2=14260
==============================================================================
--- cheetah/trunk/pom.xml (original)
+++ cheetah/trunk/pom.xml 2008-12-24 20:14:11+0000
@@ -9,6 +9,7 @@
<url>http://www.mifos.org</url>

<modules>
+ <module>common</module>
<module>testFramework</module>
<module>serviceInterfaces</module>
<module>application</module>

Modified: cheetah/trunk/userInterface/pom.xml
Url: https://mifos.dev.java.net/source/browse/mifos/cheetah/trunk/userInterface/pom.xml?view=diff&rev=14260&p1=cheetah/trunk/userInterface/pom.xml&p2=cheetah/trunk/userInterface/pom.xml&r1=14259&r2=14260
==============================================================================
--- cheetah/trunk/userInterface/pom.xml (original)
+++ cheetah/trunk/userInterface/pom.xml 2008-12-24 20:14:11+0000
@@ -21,6 +21,11 @@
<dependencies>
<dependency>
<groupId>org.mifos</groupId>
+ <artifactId>cheetah-common</artifactId>
+ <version>0.0.3-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.mifos</groupId>
<artifactId>cheetah</artifactId>
<version>0.0.3-SNAPSHOT</version>
</dependency>

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-u...@mifos.dev.java.net
For additional commands, e-mail: commit...@mifos.dev.java.net

Reply all
Reply to author
Forward
0 new messages