Hello Bita,

The client would send something like:



<?xml version="1.0" encoding="UTF-8"?>
<batch processInOneTransaction="true" >

<request>
<command>MKCOL  test </command>
<header>Accept-Language: en-us</header>
<header>Translate: f</header>
<header>User-Agent: Jakarta HTTP Client/1.0</header>
</request>

<request>
<command>PROPPATCH  test </command>
<header>Content-Type: text/xml; charset=utf-8</header>
<header>User-Agent: Jakarta HTTP Client/1.0</header>
<header>Accept-Language: en-us</header>
<header>Translate: f</header>
<header>Pragma: no-cache</header>
<body><![CDATA[<?xml version="1.0" encoding="utf-8" ?>
<D:propertyupdate xmlns:D="DAV:" >
<D:set>
<D:prop>
<D:displayname>displayvalue</D:displayname>
</D:prop>
</D:set>        
</D:propertyupdate>]]>
</body>
</request>

</batch>




The server would send back something like:

<?xml version="1.0" encoding="UTF-8"?>
<batch>
<response>
<command>HTTP/1.0 201 Created</command>
<header>Content-Type: text/html; charset=UTF-8</header>
<header>Transfer-Encoding: chunked</header>
<header>Server: Apache Tomcat/4.0-b6 (HTTP/1.1 Connector)</header>
</response>
<response>
<command>HTTP/1.0 207 Multi-Status</command>
<header>Content-Language: en</header>
<header>Server: Apache Tomcat/4.0-b6 (HTTP/1.1 Connector)</header>
<body>
<![CDATA[<?xml version="1.0" encoding="utf-8" ?>
<d:multistatus xmlns:d="DAV"><d:response>
<d:href>test</d:href>
<d:propstat><d:prop><displayname/></d:prop>
<d:status>HTTP/1.1 200
OK</d:status></d:propstat></d:response></d:multistatus>]]>
</body>
</response>

</batch>


This would be the first step of implementation. After this we could add
something like (and more). This would add scripting possibilities to the
server. I believe this feature is very powerful and advanced.


<?xml version="1.0" encoding="UTF-8"?>
<batch processInOneTransaction="true" >

<request>
<command>MKCOL  test </command>
<header>Accept-Language: en-us</header>
<header>Translate: f</header>
<header>User-Agent: Jakarta HTTP Client/1.0</header>
</request>

<if condition="LastResponse=201">
<request>
<command>PROPPATCH  test </command>
<header>Content-Type: text/xml; charset=utf-8</header>
<header>User-Agent: Jakarta HTTP Client/1.0</header>
<header>Accept-Language: en-us</header>
<header>Translate: f</header>
<header>Pragma: no-cache</header>
<body><![CDATA[<?xml version="1.0" encoding="utf-8" ?>
<D:propertyupdate xmlns:D="DAV:" >
<D:set>
<D:prop>
<D:displayname>displayvalue</D:displayname>
</D:prop>
</D:set>        
</D:propertyupdate>]]>
</body>
</request>
</if>

</batch>


The connection header within the steps - as you mentioned - has no special
meaning/advantage, for all the commands are already sent to the server.
Possibly we should allow the user the specify header at the root level,
which are valid for all steps. Here the connection header would make sense.

If you download the sources the t-processor sources are automatically
included. Just go to the testsuite directory and do a build.

best regards

juergen


 -----Original Message-----
From:   Bita Shadgar [mailto:[EMAIL PROTECTED]] 
Sent:   Thursday, February 28, 2002 15.08 PM
To:     Slide Users Mailing List
Subject:        Re: Batch methods

Hello Juergen,

Now, I know more about what you suggest me. Please correct me if I'm wrong.
As
I found out, If I want to send a batch sequence of Mkcol and Proppatch
method
to server, my BatchMethod.java program in client part should create an xml
stream like following and pass it to the server:

<?xml version="1.0" encoding="UTF-8"?>
<batch>
    <specification>
       <abstract> Checks if batch Method with Status code 207 works fine.
</abstract>
       <description> The batch method consist of following major steps :
                               1-Creates the collection test,
                               2-If the creation of test succeed, then
proppach
a property to the test.
       </description>
      <expectedResult> Status code returned by proppatch must be 207
</expectedResult>
 </specification>

<step>
  <request>
   <command
varUsage="globalVariableCollection,globalVariableServerName">MKCOL
/%globalVariableServerName%/%globalVariableCollection%/test
HTTP/1.1</command>
   <header>Accept-Language: en-us</header>
   <header>Translate: f</header>
   <header>User-Agent: Jakarta HTTP Client/1.0</header>
   <header>Connection: Keep-Alive</header>
 </request>
 <response>
      <command>HTTP/1.0 201 Created</command>
      <header>Content-Type: text/html; charset=UTF-8</header>
      <header>Transfer-Encoding: chunked</header>
      <header>Server: Apache Tomcat/4.0-b6 (HTTP/1.1 Connector)</header>
 </response>
</step>
<step>
<request>
   <command
varUsage="globalVariableCollection,globalVariableServerName">PROPPATCH
/%globalVariableServerName%/%globalVariableCollection%/test
HTTP/1.1</command>
   <header>Content-Type: text/xml; charset=utf-8</header>
   <header>User-Agent: Jakarta HTTP Client/1.0</header>
   <header>Accept-Language: en-us</header>
   <header>Translate: f</header>
   <header>Pragma: no-cache</header>
   <header>Connection: close</header>
   <body><![CDATA[<?xml version="1.0" encoding="utf-8" ?>
      <D:propertyupdate xmlns:D="DAV:" >
         <D:set>
            <D:prop>
               <D:displayname>displayvalue</D:displayname>
            </D:prop>
         </D:set>
      </D:propertyupdate>]]>
   </body>
  </request>
  <response>
     <command>HTTP/1.0 207 Multi-Status</command>
     <header>Content-Language: en</header>
     <header>Server: Apache Tomcat/4.0-b6 (HTTP/1.1 Connector)</header>
     <body varUsage="globalVariableCollection,globalVariableServerName">
        <![CDATA[<?xml version="1.0" encoding="utf-8" ?>
         <d:multistatus xmlns:d="DAV"><d:response>

<d:href>/%globalVariableServerName%/%globalVariableCollection%/test</d:href>
           <d:propstat><d:prop><displayname/></d:prop>
           <d:status>HTTP/1.1 200
OK</d:status></d:propstat></d:response></d:multistatus>]]>
     </body>
  </response>
 </step>

</batch>


In server part I have to write my BatchMethod.java so that take the first
step
part, and try to handle its request part and if the response of server is
the
same as response part of that step, the program can continue to process next
step. Other wise it should return the server's response to the client.
Meanwhile, I couldn't understand  how can I say server that all process on
the
request is one TA. In other word, where should be placed the flag of TA.
Indeed, to create the above xml stream, I filled the headers by what is
echoed
in client  program when its debug is set on. In my case I have no headers
like:

   <header> Accept-Language: en-us</header>
   <header>Translate: f</header>
   <header>Pragma: no-cache</header>
   <header>Connection: close</header>
   <header>Connection: Keep-Alive</header>
Is that necessary to mention those or it's optional. Especially I'm taking
about Connection headers. Do they have special meaning regarding batch
method?

And finally, how I can download the Tprocessor.class and its relevant files
to
test my samples.

I'm sorry if I ask silly questions but I had no way.

Regards,
Bita.



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to