private DocPageRenderer parser;
public DocGenerator(String baseUrl, String spaceKey, String docBase,
String startPage, String username, String password, String template) {
ConfluenceSoapServiceProxy service = new ConfluenceSoapServiceProxy();
// derive service URL from base URL
if (baseUrl != null) {
if (baseUrl.endsWith("/")) {
baseUrl = baseUrl.substring(0, baseUrl.length() - 1);
}
String endpoint = baseUrl + ENDPOINT_SUFFIX;
service.setEndpoint(endpoint);
}
// service base URL from service default URL
else if (service.getEndpoint().endsWith(ENDPOINT_SUFFIX)) {
String endpoint = service.getEndpoint();
baseUrl = endpoint.substring(0, endpoint.length()
- ENDPOINT_SUFFIX.length());
} else {
throw new IllegalArgumentException(
"Null base url and invalid service URL");