<html dir="ltr"><head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style title="owaParaStyle"><!--P {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
--></style>
</head>
<body ocsi="x">
<div dir="ltr"><font color="#000000" size="2" face="Tahoma">I am writing this after going through all the archived lists.</font></div>
<div dir="ltr"><font size="2" face="tahoma"></font> </div>
<div dir="ltr"><font size="2" face="tahoma"> 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"><font size="2" face="tahoma"></font> </div>
<div dir="ltr"><font size="2" face="tahoma">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 color="#2a00ff" size="1"><font color="#2a00ff" size="1"></div>
<div dir="ltr">
<p><a href="http://localhost:12212/drools-guvnor/org.drools.guvnor.Guvnor/backup">http://localhost:12212/drools-guvnor/org.drools.guvnor.Guvnor/backup</a>"</p>
</font></font></font></div>
<div dir="ltr"><font size="2" face="tahoma"></font> </div>
<div dir="ltr"><font size="2" face="tahoma">I would like to know if anyone did something similar to this?
</font></div>
<div dir="ltr"><font size="2" face="tahoma"></font> </div>
<div dir="ltr"><font size="2" face="tahoma">This is what I am having right now. </font>
</div>
<div dir="ltr"><font size="2" face="tahoma"></font> </div>
<div dir="ltr"><font size="1">String urlString = "<a 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>
}</div>
</font>
<div dir="ltr"><font size="2" face="tahoma"></font> </div>
<div dir="ltr"><font size="2" face="tahoma"></font> </div>
<div dir="ltr"><font size="2" face="tahoma">Or do we have any Drools API for deployment of repository.xml to the repository? </font></div>
<div dir="ltr"><font size="2" face="tahoma"></font> </div>
<div dir="ltr"> </div>
<div dir="ltr"><font size="2" face="tahoma">Thank you.</font></div>
<div dir="ltr"><font size="2" face="tahoma"></font> </div>
<div class="BodyFragment"><font size="2">
<div class="PlainText">SRINIVAS<br>
</div>
</font></div>
</body>
</html>