Here's an example of some code to do a search through Slide:
---------------------------------------
String path = "/slide/files";
String query =
"<D:searchrequest xmlns:D =\"DAV:\" >" +
"<D:basicsearch>" +
"<D:select>" +
"<D:prop>" +
"<D:getcontentlength/>" +
"</D:prop>" +
"</D:select>" +
"<D:from>" +
"<D:scope>" +
"<D:href>articles</D:href>" +
"<D:depth>infinity</D:depth>" +
"</D:scope>" +
"</D:from>" +
"<D:where>" +
"<D:contains>TERMS</D:contains>" +
"</D:where>" +
"</D:basicsearch>" +
"</D:searchrequest>";
SearchMethod method = new SearchMethod( path, query );
HttpURL httpURL = new HttpURL( "http://localhost:8080/slide/" );
HttpClient client = new HttpClient();
client.setState(new WebdavState());
HostConfiguration hostConfig = client.getHostConfiguration();
hostConfig.setHost(httpURL);Credentials hostCredentials =
new UsernamePasswordCredentials("john","john");if (hostCredentials != null) {
HttpState clientState = client.getState();
clientState.setCredentials(null, httpURL.getHost(),
hostCredentials);
clientState.setAuthenticationPreemptive(true);
}
int state = client.executeMethod(method);
System.out.println( "State: " + state );
Header[] headers = method.getResponseHeaders();
for ( int i = 0; i < headers.length; i++ ) {
System.out.println( headers[i].toString() );
}
Enumeration enum = method.getAllResponseURLs();
while ( enum.hasMoreElements() ) {
System.out.println( enum.nextElement() );
}
---------------------------------James
Stefan Burkard wrote:
hi slide-users
i'm fighting around with the dasl-search in a slide-repository. so first of all i would be glad to find a code-example how to create the http-request with jakarta http-client to do a dasl-search :-)
additionally i was looking around for alternatives. since i'm putting all except content in a jdbc-store, i found all property-values in the database...
would it be a bad idea to search directly in the database for the documents that match on specific property-values?
i get to this because an additional problem is, that the website who provides the search-form is built with macromedia coldfusion. so i would need to build the request and "transform" the response of a dasl-search with this scripting-language.
in contrast the database-connection and sql-based search is very easy.
greetings stefan burkard
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
