[rules-dev] Automated deployment of repository.xml to Guvnor

Mark Proctor mproctor at codehaus.org
Fri Feb 12 18:43:43 EST 2010


please ask this question on the user mailing list:
http://www.jboss.org/drools/lists.html

Mark
On 12/02/2010 22:46, Srinivas Doddi wrote:
> I am writing this after going through all the archived lists.
>  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.
> 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 "
>
> http://localhost:12212/drools-guvnor/org.drools.guvnor.Guvnor/backup"
>
> I would like to know if anyone did something similar to this?
> This is what I am having right now.
> String urlString = 
> "http://localhost:12212/drools-guvnor/org.drools.guvnor.Guvnor/backup";
> try{
> URL url = new URL(urlString);
>  conn = (HttpURLConnection) url.openConnection();
>  conn.setDoOutput(true);
>  conn.setDoInput(true);
>  conn.setRequestMethod("POST");
>  conn.setRequestProperty("Content-Type", 
> "text/html,application/xhtml+xml,application/xml");
>  conn.setRequestProperty("packageImport", "true");
>  conn.setRequestProperty("importAsNew", "true");
>  String proxyCredentials = username + ":" + password;
>  // Configure the connection object to
>  String encodedCredentials = new String(new 
> Base64().encode(proxyCredentials.getBytes()), "ASCII");
>  encodedCredentials = encodedCredentials.replaceAll("\n", "");
>  conn.setRequestProperty("Authorization", "Basic " + encodedCredentials);
>  int responseCode = conn.getResponseCode();
>  InputStream in = conn.getErrorStream();
> }
> Or do we have any Drools API for deployment of repository.xml to the 
> repository?
> Thank you.
> SRINIVAS
>
>
> _______________________________________________
> rules-dev mailing list
> rules-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-dev
>    

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-dev/attachments/20100212/e755993c/attachment.html 


More information about the rules-dev mailing list