<%@page import="java.net.URLConnection"%> <%@page import="java.net.URL"%> <%! private static final String cvsId = "$Id: ws_admin_singlesignon.jsp,v 1.1 2012/02/17 02:26:51 steve Exp $"; %> <%@ page language="java" contentType="text/html; charset=UTF-8" %> <%@ page import="com.hof.util.*, java.util.*, java.text.*" %> <%@ page import="com.hof.web.form.*" %> <%@ page import="com.hof.mi.web.service.*" %> <% /* DON'T FORGET TO ADD THE FOLLOWING TO web.xml MISTARTUP servlet section EnableQueryWebservice TRUE DisableQueryWebservicePassword TRUE */ AdministrationServiceResponse rs = null; AdministrationServiceRequest rsr = new AdministrationServiceRequest(); AdministrationServiceServiceLocator asi = new AdministrationServiceServiceLocator(); AdministrationServiceInterface rssbs = asi.getAdministrationService(new URL("http://localhost:7171/services/AdministrationService")); rsr.setLoginId("admin@yellowfin.com.au"); rsr.setPassword("test"); rsr.setOrgId(new Integer(1)); rsr.setFunction("METADATASQLQUERY"); //delete DRAFT reports before July 2018 rsr.setQuery("UPDATE ReportHeader SET ReportStatusCode = 'DELETED' WHERE ReportStatusCode = 'DRAFT' and LastModifiedDate < '2018-07-01',"); //this is your database password //YOU WON'T NEED TO DO THIS IF YOU HAVE ADDED THE web.xml PARAMS at described at the top of this page // rsr.setParameters(new String[] { "" }); rs = rssbs.remoteAdministrationCall(rsr); if ("SUCCESS".equals(rs.getStatusCode()) ) { for (ReportRow r : rs.getQueryResults()) { for (String s: r.getDataValue()) { if (s!=null) out.write(s); out.write(" "); } out.write("
"); } } else { out.write("Failure"); } %>
Done.