JUDDIApiResponse response = new JUDDIApiResponse();
List<Publisher> publishers = new ArrayList<Publisher>();
try {
Transport transport = WebHelper.getTransport(session.getServletContext());
JUDDIApiPortType apiService = transport.getJUDDIApiService();
PublisherDetail publisherDetail = apiService.getPublisherDetail(getPublisherDetail);
//if the publisher is an admin, then return ALL publishers
if ("true".equalsIgnoreCase(publisherDetail.getPublisher().get(0).getIsAdmin())) {
GetAllPublisherDetail getAllPublisherDetail = new GetAllPublisherDetail();
getAllPublisherDetail.setAuthInfo(authToken);
logger.debug("GetAllPublisherDetail " + getAllPublisherDetail + " sending get AllPublisherDetail request..");
publisherDetail = apiService.getAllPublisherDetail(getAllPublisherDetail);
}
for (org.apache.juddi.api_v3.Publisher apiPublisher : publisherDetail.getPublisher()) {
Publisher publisher = new Publisher();
BeanUtils.copyProperties(publisher, apiPublisher);
publishers.add(publisher);
}
response.setSuccess(true);