summaryrefslogtreecommitdiff
path: root/doc/book/src/Excel-AddIn.xml
blob: e38f620bd8c29e5236689b21c54b7adbcf373368 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<?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.
 
-->
<section>
  <title>
    Excel AddIn
  </title>
  <section role="h1" id="ExcelAddIn-ExcelAddIn">
    <title>
      Excel AddIn
    </title>
    <para>
      Qpid .net comes with Excel AddIns that are located in:
    </para>
    <para>
      <filename>&lt;project-root&gt;\qpid\dotnet\client-010\addins</filename>
    </para>

    <para>
      There are currently three projects:
    </para>
    <variablelist>
      <varlistentry>
	<term>ExcelAddIn</term>
	<listitem>
	  <para>An RTD excel Addin</para>
	</listitem>
      </varlistentry>
      <varlistentry>
	<term>ExcelAddInProducer
	</term>
	<listitem>
	  <para>A sample client to demonstrate the RTD AddIn</para>
	</listitem>
      </varlistentry>
      <varlistentry>
	<term>ExcelAddInMessageProcessor
	</term>
	<listitem>
	  <para>A sample message processor for the RTD AddIn</para>
	</listitem>
      </varlistentry>
    </variablelist>

    <section role="h2" id="ExcelAddIn-QpidRDTAddIn">
      <title>
	Qpid RDT AddIn
      </title>
      <section role="h3" id="ExcelAddIn-DeployingtheRTDAddIn">
	<title>
	  Deploying the RTD
	  AddIn
	</title>
	<para>
	  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.
	</para>
	<para>
	  The provided RTD AddIn consumes messages from one queue and
	  process them through a provided message processor.
	</para>
	<para>
	  For using the Qpid RTD follows those steps:
	</para>

	<procedure>
	  <step><para>
            Copy the configuration Excel.exe.config into <filename>Drive\Program Files\Microsoft Office\Office12</filename>.
          </para></step>
	  <step><para>
            Edit <filename>Excel.exe.xml</filename> and set the targeted Qpid broker host, port
            number, username and password.
          </para></step>
	  <step> <para>
            Select the cell or cell range to contain the RTD information
          </para></step>
	  <step><para>
            Enter the following formula <command>=rtd("Qpid",,"myQueue")</command>. Where
            MyQueue is the queue from which you wish to receive messages from.
          </para></step>
	</procedure>
	<para>
	  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.
	</para>
	<!--h3-->
      </section>


  <section role="h3" id="ExcelAddIn-Definingamessageprocessor">
    <title>
            Defining a message processor
    </title>

    <para>
      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
            <command>ExcelAddIn.MessageProcessor</command>. For example, the provided processor
            in <filename>client-010\addins\ExcelAddInMessageProcessor</filename> displays the
            message body and the the header price when specified.
          </para>
	  <para> 
            To use you own message processor follows those steps:
	  </para>
	  <procedure>
	    <step><para>Write your own message processor that extends ExcelAddIn.MessageProcessor</para></step>
	    <step><para>Edit Excel.exe.config and uncomment the entries:</para>
            <programlisting>
&lt;add key="ProcessorAssembly"
value="&lt;path&gt;\qpid\dotnet\client-010\addins\ExcelAddInMessageProcessor\bin\Debug\ExcelAddInMessageProcessor.dll"/&gt;
	    </programlisting>
	    <programlisting>
            &lt;add key="ProcessorClass"
            value="ExcelAddInMessageProcessor.Processor"/&gt;
	    </programlisting>
	    <itemizedlist>
	      <listitem>
		<para>ProcessorAssembly is the path on the Assembly that contains
		your processor class
		</para>
	      </listitem>
	      <listitem>
		<para>ProcessorClass is your processor class name
		</para>
	      </listitem>
	    </itemizedlist>
	    </step>
	    <step><para>run excel and define a rtd function</para></step>
	  </procedure>
	  <para>
            Note: the provided ExcelAddInProducer can be used for
            testing the provided message processor. As messages are
            sent to queue1 the following rtd function should be used
            <command>=rtd("Qpid",,"queue1")</command>.
          </para>

    <!--h3-->
  </section>

    <!--h2-->
  </section>

    <!--h1-->
  </section>

</section>