jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r468981 - in /jackrabbit/trunk/contrib/jackrabbit-net: ./ DerbySimpleTest/ DerbySimpleTest/DerbySimpleTest/ DerbySimpleTest/DerbySimpleTest/Properties/ JackRabbitHops/ JackRabbitHops/JackRabbitHops/ JackRabbitHops/JackRabbitHops/Properties/
Date Sun, 29 Oct 2006 20:42:40 GMT
Author: jukka
Date: Sun Oct 29 12:42:39 2006
New Revision: 468981

URL: http://svn.apache.org/viewvc?view=rev&rev=468981
Log:
JCR-418: Added the Jackrabbit .NET build scripts contributed by Hugo Burm.

Added:
    jackrabbit/trunk/contrib/jackrabbit-net/
    jackrabbit/trunk/contrib/jackrabbit-net/DerbySimpleTest/
    jackrabbit/trunk/contrib/jackrabbit-net/DerbySimpleTest/DerbySimpleTest/
    jackrabbit/trunk/contrib/jackrabbit-net/DerbySimpleTest/DerbySimpleTest.sln
    jackrabbit/trunk/contrib/jackrabbit-net/DerbySimpleTest/DerbySimpleTest/DerbySimpleTest.csproj
    jackrabbit/trunk/contrib/jackrabbit-net/DerbySimpleTest/DerbySimpleTest/Program.cs
    jackrabbit/trunk/contrib/jackrabbit-net/DerbySimpleTest/DerbySimpleTest/Properties/
    jackrabbit/trunk/contrib/jackrabbit-net/DerbySimpleTest/DerbySimpleTest/Properties/AssemblyInfo.cs
    jackrabbit/trunk/contrib/jackrabbit-net/JackRabbitHops/
    jackrabbit/trunk/contrib/jackrabbit-net/JackRabbitHops/JackRabbitHops/
    jackrabbit/trunk/contrib/jackrabbit-net/JackRabbitHops/JackRabbitHops.sln
    jackrabbit/trunk/contrib/jackrabbit-net/JackRabbitHops/JackRabbitHops/JackRabbitHops.csproj
    jackrabbit/trunk/contrib/jackrabbit-net/JackRabbitHops/JackRabbitHops/JackRabbitHops.csproj.user
    jackrabbit/trunk/contrib/jackrabbit-net/JackRabbitHops/JackRabbitHops/Program.cs
    jackrabbit/trunk/contrib/jackrabbit-net/JackRabbitHops/JackRabbitHops/Properties/
    jackrabbit/trunk/contrib/jackrabbit-net/JackRabbitHops/JackRabbitHops/Properties/AssemblyInfo.cs
    jackrabbit/trunk/contrib/jackrabbit-net/JackRabbitHops/JackRabbitHops/log4j.properties
  (with props)
    jackrabbit/trunk/contrib/jackrabbit-net/JackRabbitHops/JackRabbitHops/test.xml   (with
props)
    jackrabbit/trunk/contrib/jackrabbit-net/jackrabbit-net.txt   (with props)
    jackrabbit/trunk/contrib/jackrabbit-net/readme.txt   (with props)

Added: jackrabbit/trunk/contrib/jackrabbit-net/DerbySimpleTest/DerbySimpleTest.sln
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-net/DerbySimpleTest/DerbySimpleTest.sln?view=auto&rev=468981
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-net/DerbySimpleTest/DerbySimpleTest.sln (added)
+++ jackrabbit/trunk/contrib/jackrabbit-net/DerbySimpleTest/DerbySimpleTest.sln Sun Oct 29
12:42:39 2006
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DerbySimpleTest", "DerbySimpleTest\DerbySimpleTest.csproj",
"{3BBED2FB-73F4-48B0-92A3-7CA8638D5FDC}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{3BBED2FB-73F4-48B0-92A3-7CA8638D5FDC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{3BBED2FB-73F4-48B0-92A3-7CA8638D5FDC}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{3BBED2FB-73F4-48B0-92A3-7CA8638D5FDC}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{3BBED2FB-73F4-48B0-92A3-7CA8638D5FDC}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal

Added: jackrabbit/trunk/contrib/jackrabbit-net/DerbySimpleTest/DerbySimpleTest/DerbySimpleTest.csproj
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-net/DerbySimpleTest/DerbySimpleTest/DerbySimpleTest.csproj?view=auto&rev=468981
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-net/DerbySimpleTest/DerbySimpleTest/DerbySimpleTest.csproj
(added)
+++ jackrabbit/trunk/contrib/jackrabbit-net/DerbySimpleTest/DerbySimpleTest/DerbySimpleTest.csproj
Sun Oct 29 12:42:39 2006
@@ -0,0 +1,55 @@
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>8.0.50727</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{3BBED2FB-73F4-48B0-92A3-7CA8638D5FDC}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>DerbySimpleTest</RootNamespace>
+    <AssemblyName>DerbySimpleTest</AssemblyName>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="derby, Version=0.0.0.0, Culture=neutral">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\Desktop\DivDevelop\ikvm\ikvmbin-0.26.0.1\ikvm-0.26.0.1\bin\derby.dll</HintPath>
+    </Reference>
+    <Reference Include="IKVM.GNU.Classpath, Version=0.26.0.1, Culture=neutral, PublicKeyToken=13235d27fcbfff58">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\Desktop\DivDevelop\ikvm\ikvmbin-0.26.0.1\ikvm-0.26.0.1\bin\IKVM.GNU.Classpath.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and
uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>
\ No newline at end of file

Added: jackrabbit/trunk/contrib/jackrabbit-net/DerbySimpleTest/DerbySimpleTest/Program.cs
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-net/DerbySimpleTest/DerbySimpleTest/Program.cs?view=auto&rev=468981
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-net/DerbySimpleTest/DerbySimpleTest/Program.cs (added)
+++ jackrabbit/trunk/contrib/jackrabbit-net/DerbySimpleTest/DerbySimpleTest/Program.cs Sun
Oct 29 12:42:39 2006
@@ -0,0 +1,242 @@
+/*
+   Copyright 2001, 2006 The Apache Software Foundation or its licensors, as applicable.
+
+   Licensed 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.
+ */
+ 
+using System;
+using java.lang;
+using java.sql;
+using Exception = System.Exception;
+using String = System.String;
+
+
+using org.apache.derby.jdbc;
+
+namespace DerbySimpleTest
+{
+	class Program
+	{
+		static void Main(string[] args)
+		{
+
+			// The line below is needed if we want to use 
+			// Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance();
+			// We need the now unused 
+			// using org.apache.derby.jdbc;
+			// if we want to use 
+			// EmbeddedDriver dummy = new EmbeddedDriver();
+			AppDomain.CurrentDomain.Load("derby");
+
+			new SimpleApp().go(args);
+		}
+	}
+
+
+	public class SimpleApp
+	{
+		/* the default framework is embedded*/
+		public String framework = "embedded";
+		public String driver = "org.apache.derby.jdbc.EmbeddedDriver";
+		public String protocol = "jdbc:derby:";
+
+		public static void main(String[] args)
+		{
+			new SimpleApp().go(args);
+		}
+
+		public void go(String[] args)
+		{
+			/* parse the arguments to determine which framework is desired*/
+			parseArguments(args);
+
+			Console.WriteLine("SimpleApp starting in " + framework + " mode.");
+
+			try
+			{
+
+				/*
+				   The driver is installed by loading its class.
+				   In an embedded environment, this will start up Derby, since it is not already running.
+				*/
+				Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance();
+				//EmbeddedDriver dummy = new EmbeddedDriver();
+
+				Console.WriteLine("Loaded the appropriate driver.");
+
+				Connection conn = null;
+				java.util.Properties props = new java.util.Properties();
+				props.put("user", "user1");
+				props.put("password", "user1");
+
+				/*
+				   The connection specifies create=true to cause
+				   the database to be created. To remove the database,
+				   remove the directory derbyDB and its contents.
+				   The directory derbyDB will be created under
+				   the directory that the system property
+				   derby.system.home points to, or the current
+				   directory if derby.system.home is not set.
+				 */
+				conn = DriverManager.getConnection(protocol +
+						"derbyDB;create=true", props);
+
+				Console.WriteLine("Connected to and created database derbyDB");
+
+				conn.setAutoCommit(false);
+
+				/*
+				   Creating a statement lets us issue commands against
+				   the connection.
+				 */
+				Statement s = conn.createStatement();
+
+				/*
+				   We create a table, add a few rows, and update one.
+				 */
+				s.execute("create table derbyDB(num int, addr varchar(40))");
+				Console.WriteLine("Created table derbyDB");
+				s.execute("insert into derbyDB values (1956,'Webster St.')");
+				Console.WriteLine("Inserted 1956 Webster");
+				s.execute("insert into derbyDB values (1910,'Union St.')");
+				Console.WriteLine("Inserted 1910 Union");
+				s.execute(
+					"update derbyDB set num=180, addr='Grand Ave.' where num=1956");
+				Console.WriteLine("Updated 1956 Webster to 180 Grand");
+
+				s.execute(
+					"update derbyDB set num=300, addr='Lakeshore Ave.' where num=180");
+				Console.WriteLine("Updated 180 Grand to 300 Lakeshore");
+
+				/*
+				   We select the rows and verify the results.
+				 */
+				ResultSet rs = s.executeQuery(
+						"SELECT num, addr FROM derbyDB ORDER BY num");
+
+				if (!rs.next())
+				{
+					throw new Exception("Wrong number of rows");
+				}
+
+				if (rs.getInt(1) != 300)
+				{
+					throw new Exception("Wrong row returned");
+				}
+
+				if (!rs.next())
+				{
+					throw new Exception("Wrong number of rows");
+				}
+
+				if (rs.getInt(1) != 1910)
+				{
+					throw new Exception("Wrong row returned");
+				}
+
+				if (rs.next())
+				{
+					throw new Exception("Wrong number of rows");
+				}
+
+				Console.WriteLine("Verified the rows");
+
+				s.execute("drop table derbyDB");
+				Console.WriteLine("Dropped table derbyDB");
+
+				/*
+				   We release the result and statement resources.
+				 */
+				rs.close();
+				s.close();
+				Console.WriteLine("Closed result set and statement");
+
+				/*
+				   We end the transaction and the connection.
+				 */
+				conn.commit();
+				conn.close();
+				Console.WriteLine("Committed transaction and closed connection");
+
+				/*
+				   In embedded mode, an application should shut down Derby.
+				   If the application fails to shut down Derby explicitly,
+				   the Derby does not perform a checkpoint when the JVM shuts down, which means
+				   that the next connection will be slower.
+				   Explicitly shutting down Derby with the URL is preferred.
+				   This style of shutdown will always throw an "exception".
+				 */
+				bool gotSQLExc = false;
+
+				if (framework.Equals("embedded"))
+				{
+					try
+					{
+						DriverManager.getConnection("jdbc:derby:;shutdown=true");
+					}
+					catch (SQLException se)
+					{
+						gotSQLExc = true;
+					}
+
+					if (!gotSQLExc)
+					{
+						Console.WriteLine("Database did not shut down normally");
+					}
+					else
+					{
+						Console.WriteLine("Database shut down normally");
+					}
+				}
+			}
+			catch (Throwable e)
+			{
+				Console.WriteLine("exception thrown:");
+				e.printStackTrace();
+			}
+
+			Console.WriteLine("SimpleApp finished");
+		}
+
+		static void printSQLError(SQLException e)
+		{
+			while (e != null)
+			{
+				Console.WriteLine(e.toString());
+				e = e.getNextException();
+			}
+		}
+
+		private void parseArguments(String[] args)
+		{
+			int length = args.Length;
+
+			for (int index = 0; index < length; index++)
+			{
+				if (args[index].Equals("jccjdbcclient"))
+				{
+					framework = "jccjdbc";
+					driver = "com.ibm.db2.jcc.DB2Driver";
+					protocol = "jdbc:derby:net://localhost:1527/";
+				}
+				if (args[index].Equals("derbyclient"))
+				{
+					framework = "derbyclient";
+					driver = "org.apache.derby.jdbc.ClientDriver";
+					protocol = "jdbc:derby://localhost:1527/";
+				}
+			}
+		}
+	}
+	
+}

Added: jackrabbit/trunk/contrib/jackrabbit-net/DerbySimpleTest/DerbySimpleTest/Properties/AssemblyInfo.cs
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-net/DerbySimpleTest/DerbySimpleTest/Properties/AssemblyInfo.cs?view=auto&rev=468981
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-net/DerbySimpleTest/DerbySimpleTest/Properties/AssemblyInfo.cs
(added)
+++ jackrabbit/trunk/contrib/jackrabbit-net/DerbySimpleTest/DerbySimpleTest/Properties/AssemblyInfo.cs
Sun Oct 29 12:42:39 2006
@@ -0,0 +1,33 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("DerbySimpleTest")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("dg")]
+[assembly: AssemblyProduct("DerbySimpleTest")]
+[assembly: AssemblyCopyright("Copyright © dg 2006")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("7f34a0a2-84f7-4bc6-b5dd-e622837439fe")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

Added: jackrabbit/trunk/contrib/jackrabbit-net/JackRabbitHops/JackRabbitHops.sln
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-net/JackRabbitHops/JackRabbitHops.sln?view=auto&rev=468981
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-net/JackRabbitHops/JackRabbitHops.sln (added)
+++ jackrabbit/trunk/contrib/jackrabbit-net/JackRabbitHops/JackRabbitHops.sln Sun Oct 29 12:42:39
2006
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JackRabbitHops", "JackRabbitHops\JackRabbitHops.csproj",
"{46793893-19A1-471B-A5F9-7F21D8A4A22A}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{46793893-19A1-471B-A5F9-7F21D8A4A22A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{46793893-19A1-471B-A5F9-7F21D8A4A22A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{46793893-19A1-471B-A5F9-7F21D8A4A22A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{46793893-19A1-471B-A5F9-7F21D8A4A22A}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal

Added: jackrabbit/trunk/contrib/jackrabbit-net/JackRabbitHops/JackRabbitHops/JackRabbitHops.csproj
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-net/JackRabbitHops/JackRabbitHops/JackRabbitHops.csproj?view=auto&rev=468981
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-net/JackRabbitHops/JackRabbitHops/JackRabbitHops.csproj
(added)
+++ jackrabbit/trunk/contrib/jackrabbit-net/JackRabbitHops/JackRabbitHops/JackRabbitHops.csproj
Sun Oct 29 12:42:39 2006
@@ -0,0 +1,81 @@
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>8.0.50727</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{46793893-19A1-471B-A5F9-7F21D8A4A22A}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>JackRabbitHops</RootNamespace>
+    <AssemblyName>JackRabbitHops</AssemblyName>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="derby, Version=0.0.0.0, Culture=neutral">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\Desktop\DivDevelop\ikvm\ikvmbin-0.26.0.1\ikvm-0.26.0.1\bin\derby.dll</HintPath>
+    </Reference>
+    <Reference Include="IKVM.GNU.Classpath, Version=0.26.0.1, Culture=neutral, PublicKeyToken=13235d27fcbfff58">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\Desktop\DivDevelop\ikvm\ikvmbin-0.26.0.1\ikvm-0.26.0.1\bin\IKVM.GNU.Classpath.dll</HintPath>
+    </Reference>
+    <Reference Include="jackrabbit-core-1.0, Version=0.0.0.0, Culture=neutral">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\Desktop\DivDevelop\ikvm\ikvmbin-0.26.0.1\ikvm-0.26.0.1\bin\jackrabbit-core-1.0.dll</HintPath>
+    </Reference>
+    <Reference Include="jcr-1.0, Version=0.0.0.0, Culture=neutral">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\Desktop\DivDevelop\ikvm\ikvmbin-0.26.0.1\ikvm-0.26.0.1\bin\jcr-1.0.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+    <Reference Include="xalan, Version=0.0.0.0, Culture=neutral">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\Desktop\DivDevelop\ikvm\ikvmbin-0.26.0.1\ikvm-0.26.0.1\bin\xalan.dll</HintPath>
+    </Reference>
+    <Reference Include="xercesImpl, Version=0.0.0.0, Culture=neutral">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\Desktop\DivDevelop\ikvm\ikvmbin-0.26.0.1\ikvm-0.26.0.1\bin\xercesImpl.dll</HintPath>
+    </Reference>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="log4j.properties">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="test.xml">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+  </ItemGroup>
+  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and
uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>
\ No newline at end of file

Added: jackrabbit/trunk/contrib/jackrabbit-net/JackRabbitHops/JackRabbitHops/JackRabbitHops.csproj.user
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-net/JackRabbitHops/JackRabbitHops/JackRabbitHops.csproj.user?view=auto&rev=468981
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-net/JackRabbitHops/JackRabbitHops/JackRabbitHops.csproj.user
(added)
+++ jackrabbit/trunk/contrib/jackrabbit-net/JackRabbitHops/JackRabbitHops/JackRabbitHops.csproj.user
Sun Oct 29 12:42:39 2006
@@ -0,0 +1,5 @@
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <ProjectView>ShowAllFiles</ProjectView>
+  </PropertyGroup>
+</Project>
\ No newline at end of file

Added: jackrabbit/trunk/contrib/jackrabbit-net/JackRabbitHops/JackRabbitHops/Program.cs
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-net/JackRabbitHops/JackRabbitHops/Program.cs?view=auto&rev=468981
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-net/JackRabbitHops/JackRabbitHops/Program.cs (added)
+++ jackrabbit/trunk/contrib/jackrabbit-net/JackRabbitHops/JackRabbitHops/Program.cs Sun Oct
29 12:42:39 2006
@@ -0,0 +1,198 @@
+/*
+   Copyright 2001, 2006 The Apache Software Foundation or its licensors, as applicable.
+
+   Licensed 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.
+ */
+ 
+
+using System;
+using java.io;
+using javax.jcr;
+using org.apache.jackrabbit.core;
+
+namespace JackRabbitHops
+{
+	class Program
+	{
+		static void Main(string[] args)
+		{
+
+			AppDomain.CurrentDomain.Load("xercesImpl");
+			AppDomain.CurrentDomain.Load("xalan");
+			AppDomain.CurrentDomain.Load("derby");
+
+			java.lang.System.setProperty(
+					"javax.xml.parsers.DocumentBuilderFactory",
+					"org.apache.xerces.jaxp.DocumentBuilderFactoryImpl");
+
+			java.lang.System.setProperty(
+				"javax.xml.transform.TransformerFactory",
+				"org.apache.xalan.processor.TransformerFactoryImpl");
+
+			FirstHop();
+			
+			// If you run into trouble, comment out two lines below,
+			// and make sure FirstHop is working ok.
+			SecondHop();
+			ThirdHop();		
+		}
+
+		public static void FirstHop()
+		{
+			Session session = null;
+			try
+			{
+				Repository repository = new TransientRepository();
+				session = repository.login();
+
+				String user = session.getUserID();
+				String name = repository.getDescriptor(Repository.__Fields.REP_NAME_DESC);
+				Console.WriteLine("Logged in as " + user + " to " + name + " repository.");
+			}
+			catch (Exception e)
+			{
+				Console.WriteLine("Excetion: " + e.InnerException);
+			}
+			finally
+			{
+				if (session != null) 
+					session.logout();
+			}
+
+		}
+
+
+
+
+
+		public static void SecondHop()
+		{
+			Repository repository = new TransientRepository();
+
+			// Login to the default workspace as a dummy user
+			Session session = repository.login(
+				new SimpleCredentials("username", "password".ToCharArray()));
+			try
+			{
+				// Use the root node as a starting point
+				Node root = session.getRootNode();
+
+				// Create a test node unless it already exists
+				if (!root.hasNode("testnode"))
+				{
+					Console.WriteLine("Creating testnode... ");
+					// Create an unstructured node called "testnode"
+					Node node = root.addNode("testnode", "nt:unstructured");
+					// Add a string property called "testprop"
+					node.setProperty("testprop", "Hello, World!");
+					// Save the changes to the repository
+					session.save();
+					Console.WriteLine("done.");
+				}
+
+				// Use the property path to get and print the added property
+				Property property = root.getProperty("testnode/testprop");
+				Console.WriteLine(property.getString());
+			}
+			finally
+			{
+				session.logout();
+			}
+
+		}
+
+
+		public static void ThirdHop()
+		{
+			// Set up a Jackrabbit repository with the specified
+			// configuration file and repository directory
+			Repository repository = new TransientRepository();
+
+			// Login to the default workspace as a dummy user
+			Session session = repository.login(
+				new SimpleCredentials("username", "password".ToCharArray()));
+			try
+			{
+				// Use the root node as a starting point
+				Node root = session.getRootNode();
+
+				// Import the XML file unless already imported
+				if (!root.hasNode("importxml"))
+				{
+					Console.WriteLine("Importing xml... ");
+					// Create an unstructured node under which to import the XML
+					Node node = root.addNode("importxml", "nt:unstructured");
+					// Import the file "test.xml" under the created node
+
+					String s = System.IO.Directory.GetCurrentDirectory();
+
+					FileInputStream xml = new FileInputStream("test.xml");
+					session.importXML(
+						"/importxml", xml, ImportUUIDBehavior.__Fields.IMPORT_UUID_CREATE_NEW);
+					xml.close();
+					// Save the changes to the repository
+					session.save();
+					Console.WriteLine("done.");
+				}
+
+				dump(root);
+			}
+			finally
+			{
+				session.logout();
+			}
+		}
+		/** Recursively outputs the contents of the given node. */
+		private static void dump(Node node)
+		{
+			// First output the node path
+			Console.WriteLine(node.getPath());
+			// Skip the virtual (and large!) jcr:system subtree
+			if (node.getName().Equals("jcr:system"))
+			{
+				return;
+			}
+
+			// Then output the properties
+			PropertyIterator properties = node.getProperties();
+			while (properties.hasNext())
+			{
+				Property property = properties.nextProperty();
+				if (property.getDefinition().isMultiple())
+				{
+					// A multi-valued property, print all values
+					Value[] values = property.getValues();
+					for (int i = 0; i < values.Length; i++)
+					{
+						Console.WriteLine(
+							property.getPath() + " = " + values[i].getString());
+					}
+				}
+				else
+				{
+					// A single-valued property
+					Console.WriteLine(
+						property.getPath() + " = " + property.getString());
+				}
+			}
+
+			// Finally output all the child nodes recursively
+			NodeIterator nodes = node.getNodes();
+			while (nodes.hasNext())
+			{
+				dump(nodes.nextNode());
+			}
+		}
+
+	}
+}

Added: jackrabbit/trunk/contrib/jackrabbit-net/JackRabbitHops/JackRabbitHops/Properties/AssemblyInfo.cs
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-net/JackRabbitHops/JackRabbitHops/Properties/AssemblyInfo.cs?view=auto&rev=468981
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-net/JackRabbitHops/JackRabbitHops/Properties/AssemblyInfo.cs
(added)
+++ jackrabbit/trunk/contrib/jackrabbit-net/JackRabbitHops/JackRabbitHops/Properties/AssemblyInfo.cs
Sun Oct 29 12:42:39 2006
@@ -0,0 +1,33 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("JackRabbitHops")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("dg")]
+[assembly: AssemblyProduct("JackRabbitHops")]
+[assembly: AssemblyCopyright("Copyright © dg 2006")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("b6a08f00-17c7-4be0-9808-47b6af88052b")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

Added: jackrabbit/trunk/contrib/jackrabbit-net/JackRabbitHops/JackRabbitHops/log4j.properties
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-net/JackRabbitHops/JackRabbitHops/log4j.properties?view=auto&rev=468981
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-net/JackRabbitHops/JackRabbitHops/log4j.properties
(added)
+++ jackrabbit/trunk/contrib/jackrabbit-net/JackRabbitHops/JackRabbitHops/log4j.properties
Sun Oct 29 12:42:39 2006
@@ -0,0 +1,3 @@
+log4j.logger.org.apache.jackrabbit=WARN,stdout
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.SimpleLayout
\ No newline at end of file

Propchange: jackrabbit/trunk/contrib/jackrabbit-net/JackRabbitHops/JackRabbitHops/log4j.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/contrib/jackrabbit-net/JackRabbitHops/JackRabbitHops/test.xml
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-net/JackRabbitHops/JackRabbitHops/test.xml?view=auto&rev=468981
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-net/JackRabbitHops/JackRabbitHops/test.xml (added)
+++ jackrabbit/trunk/contrib/jackrabbit-net/JackRabbitHops/JackRabbitHops/test.xml Sun Oct
29 12:42:39 2006
@@ -0,0 +1,50 @@
+<xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml"
+            xmlns:mathml="http://www.w3.org/1998/Math/MathML">
+  <xhtml:head><xhtml:title>Three Namespaces</xhtml:title></xhtml:head>
+  <xhtml:body>
+    <xhtml:h1 align="center">An Ellipse and a Rectangle</xhtml:h1>
+    <svg:svg xmlns:svg="http://www.w3.org/2000/svg"
+             width="12cm" height="10cm">
+      <svg:ellipse rx="110" ry="130" />
+      <svg:rect x="4cm" y="1cm" width="3cm" height="6cm" />
+    </svg:svg>
+    <xhtml:p>The equation for ellipses</xhtml:p>
+<mathml:math>
+  <mathml:apply>
+    <mathml:eq/>
+    <mathml:cn> 1 </mathml:cn>
+    <mathml:apply>
+      <mathml:plus/>
+      <mathml:apply>
+        <mathml:divide/>
+        <mathml:apply>
+          <mathml:power/>
+          <mathml:ci> x </mathml:ci>
+          <mathml:cn> 2 </mathml:cn>
+        </mathml:apply>
+        <mathml:apply>
+          <mathml:power/>
+          <mathml:ci> a </mathml:ci>
+          <mathml:cn> 2 </mathml:cn>
+        </mathml:apply>
+      </mathml:apply>
+      <mathml:apply>
+        <mathml:divide/>
+        <mathml:apply>
+          <mathml:power/>
+          <mathml:ci> y </mathml:ci>
+          <mathml:cn> 2 </mathml:cn>
+        </mathml:apply>
+        <mathml:apply>
+          <mathml:power/>
+          <mathml:ci> b </mathml:ci>
+          <mathml:cn> 2 </mathml:cn>
+        </mathml:apply>
+      </mathml:apply>
+    </mathml:apply>
+ </mathml:apply>
+</mathml:math>
+    <xhtml:hr/>
+    <xhtml:p>Last Modified January 10, 2002</xhtml:p>
+  </xhtml:body>
+</xhtml:html>
\ No newline at end of file

Propchange: jackrabbit/trunk/contrib/jackrabbit-net/JackRabbitHops/JackRabbitHops/test.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/contrib/jackrabbit-net/jackrabbit-net.txt
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-net/jackrabbit-net.txt?view=auto&rev=468981
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-net/jackrabbit-net.txt (added)
+++ jackrabbit/trunk/contrib/jackrabbit-net/jackrabbit-net.txt Sun Oct 29 12:42:39 2006
@@ -0,0 +1,46 @@
+Step 1: Download ikvm
+========================
+Download ikvm from http://www.ikvm.net/download.html (bin version) and extract.
+
+Step 2: Xerces and Xalan
+=========================
+Download xerces (2.8.0) and Xalan (2.7.0  2jars), put the jars in a lib directory and excute
xml.bat to compile
+xercesImpl.jar, xalan.jar, xml-apis.jar, resolver.jar, serializer.jar into dll's. I put all
the jars in a lib directory within the bin directory of ikvm. If you do not like this, you
must adjust the pathnames in the script.
+This script should generate no errors.
+
+Step 3: Download Derby
+======================
+Download Derby (10.1.2.1) from Sourceforge and put derby.jar into the lib directory
+
+Step 4: Jackrabbit
+==================
+Download the  Jackrabbit  server war. Extract the jar files into the lib directory.
+Execute the jcr.bat script. Look into the script to find out what jar's you exactly need.
+This script generates a few errors on log4j about JMS. Ignore them (unless you want to send
email with log4j)
+
+Step 5: Execute JackRabbitHops.sln from Visual Studio 2005
+==========================================================
+- Make sure you update the paths of the references to the dll's you created in the previous
steps.
+- If something goes wrong: check your bin directory. If you have a valid repository.xml and
a repository map of 0 bytes; you have to remove both, before trying again to create both in
FirstHop().
+- If you get exceptions about invalid repository.xml, you may have a problem with xerces.
+- If your repository\workspaces\default\workspace.xml is created, but is 0 bytes, you may
have a problem with xalan.
+
+Step 6: Optional: check Derby
+=============================
+To check Derby, I converted the "Simple" demo from the Derby distribution into a .NET version.
 Look into SimpleDerbyTest and start the Visual Studio 2005 solution.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

Propchange: jackrabbit/trunk/contrib/jackrabbit-net/jackrabbit-net.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/contrib/jackrabbit-net/readme.txt
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-net/readme.txt?view=auto&rev=468981
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-net/readme.txt (added)
+++ jackrabbit/trunk/contrib/jackrabbit-net/readme.txt Sun Oct 29 12:42:39 2006
@@ -0,0 +1,20 @@
+Summary
+=======
+This contribution shows you how you can compile the jar's of the binary Jackrabbit distribution
into .NET assemblies using the ikvmc.exe bytestream compiler (http://www.ikvm.net/)
+Usage of the assemblies (dll's) is illustrated by converting the three "first hops" java
demo's into C# code and starting this code from within a VS 2005 project.
+
+Steps
+=====
+Check "jackrabbit-net.txt" for the steps involved.
+
+Although the demos are working, this work is too premature to tell you anything about the
usability, stability, or performance of this contribution.  
+
+License
+=======
+This contribution is licensed under the Apache License, Version 2.0 (the "License");
+
+
+
+
+
+

Propchange: jackrabbit/trunk/contrib/jackrabbit-net/readme.txt
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message