<!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"> </div>
<div dir="ltr"><font face="tahoma" size="2"> My input will be
the repository.xml file created from the Guvnor(and stored in SVN), and
I have to export it to another(production) guvnor instance. I am
trying to automate the process of "Exporting" the repository.xml file
to the Guvnor. </font></div>
<div dir="ltr"> </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 gwt
based, I am not successful. 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"> </div>
<div dir="ltr"><font face="tahoma" size="2">I would like to know if
anyone did something similar to this?
</font></div>
<div dir="ltr"> </div>
<div dir="ltr"><font face="tahoma" size="2">This is what I am having
right now. </font>
</div>
<div dir="ltr"> </div>
<div dir="ltr"><font size="1">String 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 url = new URL(urlString);</font></div>
<div dir="ltr"><font size="1"> conn = (HttpURLConnection)
url.openConnection();<br>
conn.setDoOutput(true);</font></div>
<div dir="ltr"><font size="1"> conn.setDoInput(true);<br>
conn.setRequestMethod("POST");<br>
conn.setRequestProperty("Content-Type",
"text/html,application/xhtml+xml,application/xml");<br>
conn.setRequestProperty("packageImport", "true");<br>
conn.setRequestProperty("importAsNew", "true");</font></div>
<div dir="ltr"><font size="1"> String proxyCredentials = username +
":" + password;<br>
// Configure the connection object to <br>
String encodedCredentials = new String(new
Base64().encode(proxyCredentials.getBytes()), "ASCII");<br>
encodedCredentials = encodedCredentials.replaceAll("\n", "");<br>
conn.setRequestProperty("Authorization", "Basic " +
encodedCredentials);<br>
int responseCode = conn.getResponseCode();<br>
InputStream in = conn.getErrorStream();<br>
}</font></div>
<div dir="ltr"> </div>
<div dir="ltr"> </div>
<div dir="ltr"><font face="tahoma" size="2">Or do we have any Drools
API for deployment of repository.xml to the repository? </font></div>
<div dir="ltr"> </div>
<div dir="ltr"> </div>
<div dir="ltr"><font face="tahoma" size="2">Thank you.</font></div>
<div dir="ltr"> </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>