<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
please ask this question on the user mailing list:<br>
<a class="moz-txt-link-freetext" href="http://www.jboss.org/drools/lists.html">http://www.jboss.org/drools/lists.html</a><br>
<br>
Mark<br>
On 12/02/2010 22:46, Srinivas Doddi wrote:
<blockquote
 cite="mid:AE8FA5338575514DA7113F551B328CFC4971C6E143@029-NAMSG-01.029d.mgd.msft.net"
 type="cite">
  <meta http-equiv="Content-Type"
 content="text/html; charset=ISO-8859-1">
  <style title="owaParaStyle"><!--P {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
--></style>
  <div dir="ltr"><font color="#000000" face="Tahoma" size="2">I am
writing this after going through all the archived lists.</font></div>
  <div dir="ltr">&nbsp;</div>
  <div dir="ltr"><font face="tahoma" size="2">&nbsp;My input will be
the&nbsp;repository.xml file created from the Guvnor(and stored in SVN), and
I have to export it to another(production)&nbsp;guvnor instance.&nbsp; I am
trying to automate the process of "Exporting" the&nbsp;repository.xml file
to the Guvnor. </font></div>
  <div dir="ltr">&nbsp;</div>
  <div dir="ltr"><font face="tahoma" size="2">I tried using the Browser
testing tools like HttpUnit, Selenium but since the front-end is&nbsp;gwt
based, I am not successful.&nbsp;&nbsp; Now I am trying to use HttpURLConnection,
but the server is just returning me a status of "500" when I am trying
to hit "</font></div>
  <div dir="ltr">
  <p><font face="tahoma" size="2"><font color="#2a00ff" size="1"><font
 color="#2a00ff" size="1"><a moz-do-not-send="true"
 href="http://localhost:12212/drools-guvnor/org.drools.guvnor.Guvnor/backup">http://localhost:12212/drools-guvnor/org.drools.guvnor.Guvnor/backup</a>"</font></font></font></p>
  </div>
  <div dir="ltr">&nbsp;</div>
  <div dir="ltr"><font face="tahoma" size="2">I would like to know if
anyone did something similar to this?&nbsp;
  </font></div>
  <div dir="ltr">&nbsp;</div>
  <div dir="ltr"><font face="tahoma" size="2">This is what I am having
right now.&nbsp; </font>
  </div>
  <div dir="ltr">&nbsp;</div>
  <div dir="ltr"><font size="1">String&nbsp;urlString = "<a
 moz-do-not-send="true"
 href="http://localhost:12212/drools-guvnor/org.drools.guvnor.Guvnor/backup">http://localhost:12212/drools-guvnor/org.drools.guvnor.Guvnor/backup</a>";</font></div>
  <div dir="ltr"><font size="1">try{</font></div>
  <div dir="ltr"><font size="1">URL&nbsp;url = new URL(urlString);</font></div>
  <div dir="ltr"><font size="1">&nbsp;conn = (HttpURLConnection)
url.openConnection();<br>
&nbsp;conn.setDoOutput(true);</font></div>
  <div dir="ltr"><font size="1">&nbsp;conn.setDoInput(true);<br>
&nbsp;conn.setRequestMethod("POST");<br>
&nbsp;conn.setRequestProperty("Content-Type",
"text/html,application/xhtml+xml,application/xml");<br>
&nbsp;conn.setRequestProperty("packageImport", "true");<br>
&nbsp;conn.setRequestProperty("importAsNew", "true");</font></div>
  <div dir="ltr"><font size="1">&nbsp;String&nbsp;proxyCredentials = username +
":" + password;<br>
&nbsp;// Configure the connection object to <br>
&nbsp;String&nbsp;encodedCredentials = new String(new
Base64().encode(proxyCredentials.getBytes()), "ASCII");<br>
&nbsp;encodedCredentials = encodedCredentials.replaceAll("\n", "");<br>
&nbsp;conn.setRequestProperty("Authorization", "Basic " +
encodedCredentials);<br>
&nbsp;int&nbsp;responseCode = conn.getResponseCode();<br>
&nbsp;InputStream in = conn.getErrorStream();<br>
}</font></div>
  <div dir="ltr">&nbsp;</div>
  <div dir="ltr">&nbsp;</div>
  <div dir="ltr"><font face="tahoma" size="2">Or do we have any Drools
API for deployment of&nbsp;repository.xml to the repository?&nbsp;</font></div>
  <div dir="ltr">&nbsp;</div>
  <div dir="ltr">&nbsp;</div>
  <div dir="ltr"><font face="tahoma" size="2">Thank you.</font></div>
  <div dir="ltr">&nbsp;</div>
  <div class="BodyFragment"><font size="2">
  <div class="PlainText">SRINIVAS<br>
  </div>
  </font></div>
  <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
rules-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-dev">https://lists.jboss.org/mailman/listinfo/rules-dev</a>
  </pre>
</blockquote>
<br>
</body>
</html>