You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ar...@apache.org on 2008/11/12 15:25:04 UTC
svn commit: r713378 - in
/incubator/qpid/trunk/qpid/dotnet/client-010/addins: ./ ExcelAddIn/
ExcelAddIn/Properties/ ExcelAddInMessageProcessor/
ExcelAddInMessageProcessor/Properties/ ExcelAddInProducer/
ExcelAddInProducer/Properties/
Author: arnaudsimon
Date: Wed Nov 12 06:25:03 2008
New Revision: 713378
URL: http://svn.apache.org/viewvc?rev=713378&view=rev
Log:
Qpid-1146: Added doc + samples
Added:
incubator/qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddInMessageProcessor/
incubator/qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddInMessageProcessor/ExcelAddInMessageProcessor.csproj
incubator/qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddInMessageProcessor/Processor.cs
incubator/qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddInMessageProcessor/Properties/
incubator/qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddInMessageProcessor/Properties/AssemblyInfo.cs
incubator/qpid/trunk/qpid/dotnet/client-010/addins/README.txt
Modified:
incubator/qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddIn/Excel.exe.config
incubator/qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddIn/ExcelAddIn.cs
incubator/qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddIn/ExcelAddIn.csproj
incubator/qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddIn/Properties/AssemblyInfo.cs
incubator/qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddInProducer/ExcelAddInProducer.csproj
incubator/qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddInProducer/Properties/AssemblyInfo.cs
Modified: incubator/qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddIn/Excel.exe.config
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddIn/Excel.exe.config?rev=713378&r1=713377&r2=713378&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddIn/Excel.exe.config (original)
+++ incubator/qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddIn/Excel.exe.config Wed Nov 12 06:25:03 2008
@@ -6,5 +6,7 @@
<add key="VirtualHost" value="test" />
<add key="UserName" value="guest" />
<add key="Password" value="guest" />
+ <!-- <add key="ProcessorAssembly" value="C:\Project\qpid\dotnet\client-010\addins\ExcelAddInMessageProcessor\bin\Debug\ExcelAddInMessageProcessor.dll"/>
+ <add key="ProcessorClass" value="ExcelAddInMessageProcessor.Processor"/> -->
</appSettings>
</configuration>
\ No newline at end of file
Modified: incubator/qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddIn/ExcelAddIn.cs
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddIn/ExcelAddIn.cs?rev=713378&r1=713377&r2=713378&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddIn/ExcelAddIn.cs (original)
+++ incubator/qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddIn/ExcelAddIn.cs Wed Nov 12 06:25:03 2008
@@ -250,8 +250,7 @@
byte[] body = new byte[m.Body.Length - m.Body.Position];
reader.Read(body, 0, body.Length);
ASCIIEncoding enc = new ASCIIEncoding();
- res = enc.GetString(body);
- res = res + " price: " + m.ApplicationHeaders["price"];
+ res = enc.GetString(body);
return res;
}
Modified: incubator/qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddIn/ExcelAddIn.csproj
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddIn/ExcelAddIn.csproj?rev=713378&r1=713377&r2=713378&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddIn/ExcelAddIn.csproj (original)
+++ incubator/qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddIn/ExcelAddIn.csproj Wed Nov 12 06:25:03 2008
@@ -1,4 +1,4 @@
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -11,6 +11,11 @@
<AssemblyName>Qpid Excel AddIn</AssemblyName>
<StartupObject>
</StartupObject>
+ <FileUpgradeFlags>
+ </FileUpgradeFlags>
+ <UpgradeBackupLocation>
+ </UpgradeBackupLocation>
+ <OldToolsVersion>2.0</OldToolsVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -21,6 +26,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<RegisterForComInterop>true</RegisterForComInterop>
+ <DocumentationFile>bin\Debug\Qpid Excel AddIn.XML</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -48,6 +54,9 @@
<Name>Client</Name>
</ProjectReference>
</ItemGroup>
+ <ItemGroup>
+ <None Include="Excel.exe.config" />
+ </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.
Modified: incubator/qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddIn/Properties/AssemblyInfo.cs
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddIn/Properties/AssemblyInfo.cs?rev=713378&r1=713377&r2=713378&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddIn/Properties/AssemblyInfo.cs (original)
+++ incubator/qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddIn/Properties/AssemblyInfo.cs Wed Nov 12 06:25:03 2008
@@ -1,4 +1,4 @@
-using System.Reflection;
+using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
@@ -6,11 +6,11 @@
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Qpid Excel AddIn")]
-[assembly: AssemblyDescription("")]
+[assembly: AssemblyDescription("Built from svn revision number: ")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Apache Software Foundation")]
[assembly: AssemblyProduct("Qpid Excel AddIn")]
-[assembly: AssemblyCopyright("Copyright © Apache Software Foundation 2008")]
+[assembly: AssemblyCopyright("Apache Software Foundation")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -31,5 +31,5 @@
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
-[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyVersion("0.10.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Added: incubator/qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddInMessageProcessor/ExcelAddInMessageProcessor.csproj
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddInMessageProcessor/ExcelAddInMessageProcessor.csproj?rev=713378&view=auto
==============================================================================
--- incubator/qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddInMessageProcessor/ExcelAddInMessageProcessor.csproj (added)
+++ incubator/qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddInMessageProcessor/ExcelAddInMessageProcessor.csproj Wed Nov 12 06:25:03 2008
@@ -0,0 +1,57 @@
+<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>{C2AE83A3-D5D1-469D-8611-A4738B9997CF}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>ExcelAddInMessageProcessor</RootNamespace>
+ <AssemblyName>ExcelAddInMessageProcessor</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="System" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Processor.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\client\Client.csproj">
+ <Project>{B911FFD7-754F-4735-A188-218D5065BE79}</Project>
+ <Name>Client</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\ExcelAddIn\ExcelAddIn.csproj">
+ <Project>{85EFD719-39F6-4471-90FF-9E621430344B}</Project>
+ <Name>ExcelAddIn</Name>
+ </ProjectReference>
+ </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: incubator/qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddInMessageProcessor/Processor.cs
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddInMessageProcessor/Processor.cs?rev=713378&view=auto
==============================================================================
--- incubator/qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddInMessageProcessor/Processor.cs (added)
+++ incubator/qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddInMessageProcessor/Processor.cs Wed Nov 12 06:25:03 2008
@@ -0,0 +1,44 @@
+/*
+*
+* 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.
+*
+*/
+
+using System.IO;
+using System.Text;
+using org.apache.qpid.client;
+
+namespace ExcelAddInMessageProcessor
+{
+ class Processor : ExcelAddIn.MessageProcessor
+ {
+ public string ProcessMessage(IMessage m)
+ {
+ BinaryReader reader = new BinaryReader(m.Body, Encoding.UTF8);
+ byte[] body = new byte[m.Body.Length - m.Body.Position];
+ reader.Read(body, 0, body.Length);
+ ASCIIEncoding enc = new ASCIIEncoding();
+ string res = enc.GetString(body);
+ if (m.ApplicationHeaders.ContainsKey("price"))
+ {
+ res = res + ": price: " + m.ApplicationHeaders["price"];
+ }
+ return res;
+ }
+ }
+}
\ No newline at end of file
Added: incubator/qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddInMessageProcessor/Properties/AssemblyInfo.cs
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddInMessageProcessor/Properties/AssemblyInfo.cs?rev=713378&view=auto
==============================================================================
--- incubator/qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddInMessageProcessor/Properties/AssemblyInfo.cs (added)
+++ incubator/qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddInMessageProcessor/Properties/AssemblyInfo.cs Wed Nov 12 06:25:03 2008
@@ -0,0 +1,35 @@
+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("ExcelAddInMessageProcessor")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Apache Software Foundation")]
+[assembly: AssemblyProduct("ExcelAddInMessageProcessor")]
+[assembly: AssemblyCopyright("Copyright Apache Software Foundation 2008")]
+[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("d20b2d75-7b8b-4f7d-8a81-40a4cce94195")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
Modified: incubator/qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddInProducer/ExcelAddInProducer.csproj
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddInProducer/ExcelAddInProducer.csproj?rev=713378&r1=713377&r2=713378&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddInProducer/ExcelAddInProducer.csproj (original)
+++ incubator/qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddInProducer/ExcelAddInProducer.csproj Wed Nov 12 06:25:03 2008
@@ -33,6 +33,7 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
+ <Compile Include="Processor.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
Modified: incubator/qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddInProducer/Properties/AssemblyInfo.cs
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddInProducer/Properties/AssemblyInfo.cs?rev=713378&r1=713377&r2=713378&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddInProducer/Properties/AssemblyInfo.cs (original)
+++ incubator/qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddInProducer/Properties/AssemblyInfo.cs Wed Nov 12 06:25:03 2008
@@ -1,4 +1,4 @@
-using System.Reflection;
+using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
@@ -6,11 +6,11 @@
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Qpid Excel AddIn Producer")]
-[assembly: AssemblyDescription("")]
+[assembly: AssemblyDescription("Built from svn revision number: ")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Apache Software Foundation")]
[assembly: AssemblyProduct("Qpid Excel AddIn Producer")]
-[assembly: AssemblyCopyright("Copyright © Apache Software Foundation 2008")]
+[assembly: AssemblyCopyright("Apache Software Foundation")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -29,5 +29,5 @@
// Build Number
// Revision
//
-[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyVersion("0.10.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Added: incubator/qpid/trunk/qpid/dotnet/client-010/addins/README.txt
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/dotnet/client-010/addins/README.txt?rev=713378&view=auto
==============================================================================
--- incubator/qpid/trunk/qpid/dotnet/client-010/addins/README.txt (added)
+++ incubator/qpid/trunk/qpid/dotnet/client-010/addins/README.txt Wed Nov 12 06:25:03 2008
@@ -0,0 +1,29 @@
+This project contains three sub-projects:
+- The RTD excell Addin
+- A sample client sending messages to queue1
+- A ample message processor
+
+RDT AddIn
+Excel provides a function called RTD (real-time data) that lets you specify a COM server via its ProgId here "Qpid" so that you can push qpid messages into Excel.
+For using the Qpid RTD follows those steps:
+
+1) Copy the configuration Excel.exe.config into C:\Program Files\Microsoft Office\Office12
+2) Edit Excel.exe.xml and set the targeted Qpid broker host, port number
+3) Select the cell or cell range to contain the information
+4) enter the following formula =rtd("Qpid",,"myQueue") Where MyQueue is the queue from which you wish to receive messages from
+
+Note: The Qpid RTD is a COM-AddIn that must be registered with Excel. This is done automatically when compiling the Addin with visual studio.
+
+The default behavior of the RDT AddIn is to display the message payload. This could be altered by specifying your own message processor.
+A Message processor is a class that implements the API ExcelAddIn.MessageProcessor. For example, the provided processor in client-010\addins\ExcelAddInMessageProcessor displays the message body and the the header price when specified.
+
+To use you own message processor follows those steps:
+1) Write your own message processor that extends ExcelAddIn.MessageProcessor
+2) Edit Excel.exe.config and uncomment the entries:
+ <add key="ProcessorAssembly" value="<path>\qpid\dotnet\client-010\addins\ExcelAddInMessageProcessor\bin\Debug\ExcelAddInMessageProcessor.dll"/>
+ <add key="ProcessorClass" value="ExcelAddInMessageProcessor.Processor"/>
+- ProcessorAssembly is the path on the Assembly that contains your processor class
+- ProcessorClass is your processor class name
+3) run excel and define a rtd function
+
+Note: the provided ExcelAddInProducer can be used for testing the provided message processor. As messages are sent to queue1 the following rtd fucntion should be used =rtd("Qpiud",,"queue1")
\ No newline at end of file