CRNConnect.java 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827
  1. /**
  2. Licensed Materials - Property of IBM
  3. IBM Cognos Products: DOCS
  4. (C) Copyright IBM Corp. 2005, 2010
  5. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with
  6. IBM Corp.
  7. */
  8. /**
  9. * CRNConnect.java
  10. *
  11. * Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
  12. * Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
  13. *
  14. * Description: This code sample demonstrates how to establish a connection to
  15. * the IBM Cognos services
  16. */
  17. import java.awt.BorderLayout;
  18. import java.awt.Container;
  19. import java.awt.event.ActionEvent;
  20. import java.awt.event.ActionListener;
  21. import java.net.MalformedURLException;
  22. import javax.swing.JButton;
  23. import javax.swing.JDialog;
  24. import javax.swing.JLabel;
  25. import javax.swing.JOptionPane;
  26. import javax.swing.JPanel;
  27. import javax.swing.JTextField;
  28. import javax.xml.rpc.ServiceException;
  29. import org.apache.axis.client.Stub;
  30. import org.apache.axis.message.SOAPHeaderElement;
  31. import com.cognos.developer.schemas.bibus._3.AgentService_PortType;
  32. import com.cognos.developer.schemas.bibus._3.AgentService_ServiceLocator;
  33. import com.cognos.developer.schemas.bibus._3.BatchReportService_PortType;
  34. import com.cognos.developer.schemas.bibus._3.BatchReportService_ServiceLocator;
  35. import com.cognos.developer.schemas.bibus._3.BiBusHeader;
  36. import com.cognos.developer.schemas.bibus._3.ContentManagerService_PortType;
  37. import com.cognos.developer.schemas.bibus._3.ContentManagerService_ServiceLocator;
  38. import com.cognos.developer.schemas.bibus._3.DataIntegrationService_PortType;
  39. import com.cognos.developer.schemas.bibus._3.DataIntegrationService_ServiceLocator;
  40. import com.cognos.developer.schemas.bibus._3.DeliveryService_PortType;
  41. import com.cognos.developer.schemas.bibus._3.DeliveryService_ServiceLocator;
  42. import com.cognos.developer.schemas.bibus._3.DimensionManagementService_PortType;
  43. import com.cognos.developer.schemas.bibus._3.DimensionManagementService_ServiceLocator;
  44. import com.cognos.developer.schemas.bibus._3.Dispatcher_PortType;
  45. import com.cognos.developer.schemas.bibus._3.Dispatcher_ServiceLocator;
  46. import com.cognos.developer.schemas.bibus._3.EventManagementService_PortType;
  47. import com.cognos.developer.schemas.bibus._3.EventManagementService_ServiceLocator;
  48. import com.cognos.developer.schemas.bibus._3.JobService_PortType;
  49. import com.cognos.developer.schemas.bibus._3.JobService_ServiceLocator;
  50. import com.cognos.developer.schemas.bibus._3.MetadataService_PortType;
  51. import com.cognos.developer.schemas.bibus._3.MetadataService_ServiceLocator;
  52. import com.cognos.developer.schemas.bibus._3.MonitorService_PortType;
  53. import com.cognos.developer.schemas.bibus._3.MonitorService_ServiceLocator;
  54. import com.cognos.developer.schemas.bibus._3.PropEnum;
  55. import com.cognos.developer.schemas.bibus._3.QueryOptions;
  56. import com.cognos.developer.schemas.bibus._3.QueryService_PortType;
  57. import com.cognos.developer.schemas.bibus._3.QueryService_ServiceLocator;
  58. import com.cognos.developer.schemas.bibus._3.ReportService_PortType;
  59. import com.cognos.developer.schemas.bibus._3.ReportService_ServiceLocator;
  60. import com.cognos.developer.schemas.bibus._3.SearchPathMultipleObject;
  61. import com.cognos.developer.schemas.bibus._3.Sort;
  62. import com.cognos.developer.schemas.bibus._3.SystemService_PortType;
  63. import com.cognos.developer.schemas.bibus._3.SystemService_ServiceLocator;
  64. public class CRNConnect implements ActionListener
  65. {
  66. // Create the objects that provide the connections to the services.
  67. // sn_dg_prm_smpl_connect_start_0
  68. private AgentService_ServiceLocator agentServiceLocator = null;
  69. // sn_dg_prm_smpl_connect_end_0
  70. private BatchReportService_ServiceLocator batchRepServiceLocator = null;
  71. private ContentManagerService_ServiceLocator cmServiceLocator = null;
  72. private DataIntegrationService_ServiceLocator dataIntServiceLocator = null;
  73. private DeliveryService_ServiceLocator deliveryServiceLocator = null;
  74. private EventManagementService_ServiceLocator eventMgmtServiceLocator = null;
  75. private JobService_ServiceLocator jobServiceLocator = null;
  76. private MonitorService_ServiceLocator monitorServiceLocator = null;
  77. private QueryService_ServiceLocator queryServiceLocator = null;
  78. private ReportService_ServiceLocator reportServiceLocator = null;
  79. private SystemService_ServiceLocator systemServiceLocator = null;
  80. private Dispatcher_ServiceLocator dispatcherServiceLocator = null;
  81. private DimensionManagementService_ServiceLocator dimensionMgmtServiceLocator = null;
  82. private MetadataService_ServiceLocator metadataServiceLocator = null;
  83. // There is an interface class for each service named
  84. // <servicename>_Port. The implementation class for each interface
  85. // is named <servicename>Stub. The stub class implements the methods
  86. // in the interface, and can be used to access the functionality provided
  87. // by the service. However, as it is a common practice, this sample
  88. // programs to the interfaces, instantiating instances of the
  89. // <servicename>_Port classes.
  90. // sn_dg_prm_smpl_connect_start_1
  91. private AgentService_PortType agentService = null;
  92. // sn_dg_prm_smpl_connect_end_1
  93. private BatchReportService_PortType batchRepService = null;
  94. private ContentManagerService_PortType cmService = null;
  95. private DataIntegrationService_PortType dataIntService = null;
  96. private DeliveryService_PortType deliveryService = null;
  97. private EventManagementService_PortType eventMgmtService = null;
  98. private JobService_PortType jobService = null;
  99. private MonitorService_PortType monitorService = null;
  100. private QueryService_PortType queryService = null;
  101. private ReportService_PortType repService = null;
  102. private SystemService_PortType sysService = null;
  103. private Dispatcher_PortType dispatchService = null;
  104. private DimensionManagementService_PortType dimensionMgmtService = null;
  105. private MetadataService_PortType metadataService = null;
  106. // Set the location of the sample reports.
  107. private String curDir = System.getProperty("user.dir");
  108. private String CRN_HOME = curDir.substring(0,curDir.lastIndexOf("sdk")-1);
  109. private String REPORT_PATH = CRN_HOME + "/webcontent/samples";
  110. // Create a variable that contains the default URL for Content Manager.
  111. // sn_dg_prm_smpl_connect_start_2
  112. public static String CM_URL = "http://localhost:9300/p2pd/servlet/dispatch";
  113. // sn_dg_prm_smpl_connect_end_2
  114. private JDialog cmURLDialog = null;
  115. private static String cancel = "cancel";
  116. private static String okay = "okay";
  117. private JTextField cmURLField;
  118. /**
  119. * Use this method to connect to the server. The user will be
  120. * prompted to confirm the Content Manager URL
  121. *
  122. * @return A connection to the server
  123. */
  124. public ContentManagerService_PortType connectToCognosServer()
  125. {
  126. BiBusHeader bibus = null;
  127. while (bibus == null)
  128. {
  129. setCMURL();
  130. // sn_dg_prm_smpl_connect_start_3
  131. // Create the service locators
  132. agentServiceLocator = new AgentService_ServiceLocator();
  133. // sn_dg_prm_smpl_connect_end_3
  134. batchRepServiceLocator = new BatchReportService_ServiceLocator();
  135. cmServiceLocator = new ContentManagerService_ServiceLocator();
  136. dataIntServiceLocator = new DataIntegrationService_ServiceLocator();
  137. deliveryServiceLocator = new DeliveryService_ServiceLocator();
  138. eventMgmtServiceLocator = new EventManagementService_ServiceLocator();
  139. jobServiceLocator = new JobService_ServiceLocator();
  140. monitorServiceLocator = new MonitorService_ServiceLocator();
  141. queryServiceLocator = new QueryService_ServiceLocator();
  142. reportServiceLocator = new ReportService_ServiceLocator();
  143. systemServiceLocator = new SystemService_ServiceLocator();
  144. dispatcherServiceLocator = new Dispatcher_ServiceLocator();
  145. dimensionMgmtServiceLocator = new DimensionManagementService_ServiceLocator();
  146. metadataServiceLocator = new MetadataService_ServiceLocator();
  147. try
  148. {
  149. // sn_dg_prm_smpl_connect_start_4
  150. java.net.URL serverURL = new java.net.URL(CM_URL);
  151. //acquire references to the services
  152. agentService = agentServiceLocator.getagentService(serverURL);
  153. // sn_dg_prm_smpl_connect_end_4
  154. batchRepService = batchRepServiceLocator.getbatchReportService(serverURL);
  155. cmService = cmServiceLocator.getcontentManagerService(serverURL);
  156. dataIntService = dataIntServiceLocator.getdataIntegrationService(serverURL);
  157. deliveryService = deliveryServiceLocator.getdeliveryService(serverURL);
  158. eventMgmtService = eventMgmtServiceLocator.geteventManagementService(serverURL);
  159. jobService = jobServiceLocator.getjobService(serverURL);
  160. monitorService = monitorServiceLocator.getmonitorService(serverURL);
  161. queryService = queryServiceLocator.getqueryService(serverURL);
  162. repService = reportServiceLocator.getreportService(serverURL);
  163. sysService = systemServiceLocator.getsystemService(serverURL);
  164. dispatchService = dispatcherServiceLocator.getdispatcher(serverURL);
  165. dimensionMgmtService = dimensionMgmtServiceLocator.getdimensionManagementService(serverURL);
  166. metadataService = metadataServiceLocator.getmetadataService(serverURL);
  167. } // ... catch expected exceptions after this point
  168. catch (MalformedURLException e)
  169. {
  170. System.out.println("Malformed URL:\n" + e.getMessage());
  171. return null;
  172. }
  173. catch (ServiceException e)
  174. {
  175. System.out.println("Service Exception:\n" + e.getMessage());
  176. return null;
  177. }
  178. try
  179. {
  180. cmService.query(
  181. new SearchPathMultipleObject("/"),
  182. new PropEnum[] {},
  183. new Sort[] {},
  184. new QueryOptions());
  185. }
  186. catch (java.rmi.RemoteException remoteEx)
  187. {
  188. System.out.println("");
  189. //If authentication is required, this will generate an exception
  190. //At this point, this exception can safely be ignored
  191. }
  192. catch (java.lang.NullPointerException nullEx)
  193. {
  194. JOptionPane.showMessageDialog(null, "Unable to connect at the URL: " + CM_URL + ". Please make sure the service is running.");
  195. return null;
  196. }
  197. // Retrieve the biBusHeader SOAP:Header that contains
  198. // the logon information.
  199. SOAPHeaderElement x = ((Stub)cmService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader");
  200. bibus = BIBusHeaderHelper.getHeaderObject(x, true, "");
  201. if (bibus != null)
  202. {
  203. ((Stub)cmService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", bibus);
  204. return cmService;
  205. }
  206. JOptionPane.showMessageDialog(null,"Connect Failed. Try again.");
  207. }
  208. return null;
  209. }
  210. /**
  211. * Use this method to connect to the server, bypassing any prompts.
  212. *
  213. * @param CMURL The URL for the server
  214. * @return A connection to the server
  215. */
  216. public ContentManagerService_PortType connectToCognosServer(String CMURL)
  217. {
  218. CM_URL = CMURL;
  219. // Create the service locators
  220. agentServiceLocator = new AgentService_ServiceLocator();
  221. batchRepServiceLocator = new BatchReportService_ServiceLocator();
  222. cmServiceLocator = new ContentManagerService_ServiceLocator();
  223. dataIntServiceLocator = new DataIntegrationService_ServiceLocator();
  224. deliveryServiceLocator = new DeliveryService_ServiceLocator();
  225. eventMgmtServiceLocator = new EventManagementService_ServiceLocator();
  226. jobServiceLocator = new JobService_ServiceLocator();
  227. monitorServiceLocator = new MonitorService_ServiceLocator();
  228. reportServiceLocator = new ReportService_ServiceLocator();
  229. systemServiceLocator = new SystemService_ServiceLocator();
  230. dispatcherServiceLocator = new Dispatcher_ServiceLocator();
  231. dimensionMgmtServiceLocator = new DimensionManagementService_ServiceLocator();
  232. metadataServiceLocator = new MetadataService_ServiceLocator();
  233. try
  234. {
  235. java.net.URL serverURL = new java.net.URL(CMURL);
  236. //acquire references to services
  237. //
  238. agentService = agentServiceLocator.getagentService(serverURL);
  239. batchRepService = batchRepServiceLocator.getbatchReportService(serverURL);
  240. cmService = cmServiceLocator.getcontentManagerService(serverURL);
  241. dataIntService = dataIntServiceLocator.getdataIntegrationService(serverURL);
  242. deliveryService = deliveryServiceLocator.getdeliveryService(serverURL);
  243. eventMgmtService = eventMgmtServiceLocator.geteventManagementService(serverURL);
  244. jobService = jobServiceLocator.getjobService(serverURL);
  245. monitorService = monitorServiceLocator.getmonitorService(serverURL);
  246. repService = reportServiceLocator.getreportService(serverURL);
  247. sysService = systemServiceLocator.getsystemService(serverURL);
  248. dispatchService = dispatcherServiceLocator.getdispatcher(serverURL);
  249. dimensionMgmtService = dimensionMgmtServiceLocator.getdimensionManagementService(serverURL);
  250. metadataService = metadataServiceLocator.getmetadataService(serverURL);
  251. return cmService;
  252. }
  253. //handle uncaught exceptions
  254. catch (MalformedURLException e)
  255. {
  256. System.out.println("Malformed URL:\n" + e.getMessage());
  257. return null;
  258. }
  259. catch (ServiceException e)
  260. {
  261. System.out.println("Service Exception:\n" + e.getMessage());
  262. return null;
  263. }
  264. }
  265. public ContentManagerService_PortType connectionChange(String endPoint)
  266. {
  267. try
  268. {
  269. java.net.URL endPointURL = new java.net.URL(endPoint);
  270. agentService = agentServiceLocator.getagentService(endPointURL);
  271. batchRepService = batchRepServiceLocator.getbatchReportService(endPointURL);
  272. cmService = cmServiceLocator.getcontentManagerService(endPointURL);
  273. dataIntService = dataIntServiceLocator.getdataIntegrationService(endPointURL);
  274. deliveryService = deliveryServiceLocator.getdeliveryService(endPointURL);
  275. eventMgmtService = eventMgmtServiceLocator.geteventManagementService(endPointURL);
  276. jobService = jobServiceLocator.getjobService(endPointURL);
  277. monitorService = monitorServiceLocator.getmonitorService(endPointURL);
  278. repService = reportServiceLocator.getreportService(endPointURL);
  279. sysService = systemServiceLocator.getsystemService(endPointURL);
  280. dispatchService = dispatcherServiceLocator.getdispatcher(endPointURL);
  281. dimensionMgmtService = dimensionMgmtServiceLocator.getdimensionManagementService(endPointURL);
  282. metadataService = metadataServiceLocator.getmetadataService(endPointURL);
  283. return cmService;
  284. }
  285. catch (MalformedURLException eMalformed)
  286. {
  287. System.out.println(eMalformed.getMessage());
  288. return null;
  289. }
  290. catch (ServiceException eService)
  291. {
  292. System.out.println(eService.getMessage());
  293. return null;
  294. }
  295. }
  296. public String getDefaultSavePath()
  297. {
  298. return REPORT_PATH;
  299. }
  300. public void setDefaultSavePath(String newReportPath)
  301. {
  302. REPORT_PATH = newReportPath;
  303. }
  304. //handle service requests that do not specify new conversation for backwards compatibility
  305. public AgentService_PortType getAgentService() {
  306. return getAgentService(false, "");
  307. }
  308. public AgentService_PortType getAgentService(boolean isNewConversation, String RSGroup)
  309. {
  310. BiBusHeader bibus = null;
  311. bibus =
  312. BIBusHeaderHelper.getHeaderObject(((Stub)agentService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), isNewConversation, RSGroup);
  313. if (bibus == null)
  314. {
  315. BiBusHeader CMbibus = null;
  316. CMbibus =
  317. BIBusHeaderHelper.getHeaderObject(((Stub)cmService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), true, RSGroup);
  318. ((Stub)agentService).clearHeaders();
  319. ((Stub)agentService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", CMbibus);
  320. }
  321. else
  322. {
  323. ((Stub)agentService).clearHeaders();
  324. ((Stub)agentService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", bibus);
  325. }
  326. return agentService;
  327. }
  328. //handle service requests that do not specify new conversation for backwards compatibility
  329. public BatchReportService_PortType getBatchRepService() {
  330. return getBatchRepService(false, "");
  331. }
  332. public BatchReportService_PortType getBatchRepService(boolean isNewConversation, String RSGroup)
  333. {
  334. BiBusHeader bibus = null;
  335. bibus =
  336. BIBusHeaderHelper.getHeaderObject(((Stub)batchRepService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), isNewConversation, RSGroup);
  337. if (bibus == null)
  338. {
  339. BiBusHeader CMbibus = null;
  340. CMbibus =
  341. BIBusHeaderHelper.getHeaderObject(((Stub)cmService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), true, RSGroup);
  342. ((Stub)batchRepService).clearHeaders();
  343. ((Stub)batchRepService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", CMbibus);
  344. }
  345. else
  346. {
  347. ((Stub)batchRepService).clearHeaders();
  348. ((Stub)batchRepService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", bibus);
  349. }
  350. return batchRepService;
  351. }
  352. //handle service requests that do not specify new conversation for backwards compatibility
  353. public ContentManagerService_PortType getCMService() {
  354. return getCMService(false, "");
  355. }
  356. public ContentManagerService_PortType getCMService(boolean isNewConversation, String RSGroup)
  357. {
  358. BiBusHeader bibus = null;
  359. bibus =
  360. BIBusHeaderHelper.getHeaderObject(((Stub)cmService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), isNewConversation, RSGroup);
  361. if (!(bibus == null))
  362. {
  363. ((Stub)cmService).clearHeaders();
  364. ((Stub)cmService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", bibus);
  365. }
  366. return cmService;
  367. }
  368. //handle service requests that do not specify new conversation for backwards compatibility
  369. public DataIntegrationService_PortType getDataIntService() {
  370. return getDataIntService(false, "");
  371. }
  372. public DataIntegrationService_PortType getDataIntService(boolean isNewConversation, String RSGroup)
  373. {
  374. BiBusHeader bibus = null;
  375. bibus =
  376. BIBusHeaderHelper.getHeaderObject(((Stub)dataIntService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), isNewConversation, RSGroup);
  377. if (bibus == null)
  378. {
  379. BiBusHeader CMbibus = null;
  380. CMbibus =
  381. BIBusHeaderHelper.getHeaderObject(((Stub)cmService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), true, RSGroup);
  382. ((Stub)dataIntService).clearHeaders();
  383. ((Stub)dataIntService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", CMbibus);
  384. }
  385. else
  386. {
  387. ((Stub)dataIntService).clearHeaders();
  388. ((Stub)dataIntService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", bibus);
  389. }
  390. return dataIntService;
  391. }
  392. //handle service requests that do not specify new conversation for backwards compatibility
  393. public DeliveryService_PortType getDeliveryService() {
  394. return getDeliveryService(false, "");
  395. }
  396. public DeliveryService_PortType getDeliveryService(boolean isNewConversation, String RSGroup)
  397. {
  398. BiBusHeader bibus = null;
  399. bibus =
  400. BIBusHeaderHelper.getHeaderObject(((Stub)deliveryService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), isNewConversation, RSGroup);
  401. if (bibus == null)
  402. {
  403. BiBusHeader CMbibus = null;
  404. CMbibus =
  405. BIBusHeaderHelper.getHeaderObject(((Stub)cmService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), true, RSGroup);
  406. ((Stub)deliveryService).clearHeaders();
  407. ((Stub)deliveryService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", CMbibus);
  408. }
  409. else
  410. {
  411. ((Stub)deliveryService).clearHeaders();
  412. ((Stub)deliveryService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", bibus);
  413. }
  414. return deliveryService;
  415. }
  416. //handle service requests that do not specify new conversation for backwards compatibility
  417. public DimensionManagementService_PortType getDimensionManagementService() {
  418. return getDimensionManagementService(false, "");
  419. }
  420. public DimensionManagementService_PortType getDimensionManagementService(boolean isNewConversation, String RSGroup)
  421. {
  422. BiBusHeader bibus = null;
  423. bibus =
  424. BIBusHeaderHelper.getHeaderObject(((Stub)dimensionMgmtService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), isNewConversation, RSGroup);
  425. if (bibus == null)
  426. {
  427. BiBusHeader CMbibus = null;
  428. CMbibus =
  429. BIBusHeaderHelper.getHeaderObject(((Stub)cmService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), true, RSGroup);
  430. ((Stub)dimensionMgmtService).clearHeaders();
  431. ((Stub)dimensionMgmtService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", CMbibus);
  432. }
  433. else
  434. {
  435. ((Stub)dimensionMgmtService).clearHeaders();
  436. ((Stub)dimensionMgmtService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", bibus);
  437. }
  438. return dimensionMgmtService;
  439. }
  440. //handle service requests that do not specify new conversation for backwards compatibility
  441. public EventManagementService_PortType getEventMgmtService() {
  442. return getEventMgmtService(false, "");
  443. }
  444. public EventManagementService_PortType getEventMgmtService(boolean isNewConversation, String RSGroup)
  445. {
  446. BiBusHeader bibus = null;
  447. bibus =
  448. BIBusHeaderHelper.getHeaderObject(((Stub)eventMgmtService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), isNewConversation, RSGroup);
  449. if (bibus == null)
  450. {
  451. BiBusHeader CMbibus = null;
  452. CMbibus =
  453. BIBusHeaderHelper.getHeaderObject(((Stub)cmService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), true, RSGroup);
  454. ((Stub)eventMgmtService).clearHeaders();
  455. ((Stub)eventMgmtService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", CMbibus);
  456. }
  457. else
  458. {
  459. ((Stub)eventMgmtService).clearHeaders();
  460. ((Stub)eventMgmtService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", bibus);
  461. }
  462. return eventMgmtService;
  463. }
  464. //handle service requests that do not specify new conversation for backwards compatibility
  465. public JobService_PortType getJobService() {
  466. return getJobService(false, "");
  467. }
  468. public JobService_PortType getJobService(boolean isNewConversation, String RSGroup)
  469. {
  470. BiBusHeader bibus = null;
  471. bibus =
  472. BIBusHeaderHelper.getHeaderObject(((Stub)jobService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), isNewConversation, RSGroup);
  473. if (bibus == null)
  474. {
  475. BiBusHeader CMbibus = null;
  476. CMbibus =
  477. BIBusHeaderHelper.getHeaderObject(((Stub)cmService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), true, RSGroup);
  478. ((Stub)jobService).clearHeaders();
  479. ((Stub)jobService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", CMbibus);
  480. }
  481. else
  482. {
  483. ((Stub)jobService).clearHeaders();
  484. ((Stub)jobService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", bibus);
  485. }
  486. return jobService;
  487. }
  488. //handle service requests that do not specify new conversation for backwards compatibility
  489. public MonitorService_PortType getMonitorService() {
  490. return getMonitorService(false, "");
  491. }
  492. //handle service requests that do not specify new conversation for backwards compatibility
  493. public MetadataService_PortType getMetadataService() {
  494. return getMetadataService(false, "");
  495. }
  496. public MetadataService_PortType getMetadataService(boolean isNewConversation, String RSGroup)
  497. {
  498. BiBusHeader bibus = null;
  499. bibus =
  500. BIBusHeaderHelper.getHeaderObject(((Stub)metadataService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), isNewConversation, RSGroup);
  501. if (bibus == null)
  502. {
  503. BiBusHeader CMbibus = null;
  504. CMbibus =
  505. BIBusHeaderHelper.getHeaderObject(((Stub)cmService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), true, RSGroup);
  506. ((Stub)metadataService).clearHeaders();
  507. ((Stub)metadataService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", CMbibus);
  508. }
  509. else
  510. {
  511. ((Stub)metadataService).clearHeaders();
  512. ((Stub)metadataService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", bibus);
  513. }
  514. return metadataService;
  515. }
  516. public MonitorService_PortType getMonitorService(boolean isNewConversation, String RSGroup)
  517. {
  518. BiBusHeader bibus = null;
  519. bibus =
  520. BIBusHeaderHelper.getHeaderObject(((Stub)monitorService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), isNewConversation, RSGroup);
  521. if (bibus == null)
  522. {
  523. BiBusHeader CMbibus = null;
  524. CMbibus =
  525. BIBusHeaderHelper.getHeaderObject(((Stub)cmService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), true, RSGroup);
  526. ((Stub)monitorService).clearHeaders();
  527. ((Stub)monitorService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", CMbibus);
  528. }
  529. else
  530. {
  531. ((Stub)monitorService).clearHeaders();
  532. ((Stub)monitorService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", bibus);
  533. }
  534. return monitorService;
  535. }
  536. //handle service requests that do not specify new conversation for backwards compatibility
  537. public ReportService_PortType getReportService() {
  538. return getReportService(false, "");
  539. }
  540. // sn_dg_sdk_mng_svc_hdrs_start_1
  541. public ReportService_PortType getReportService(boolean isNewConversation, String RSGroup)
  542. {
  543. BiBusHeader bibus = null;
  544. bibus =
  545. BIBusHeaderHelper.getHeaderObject(((Stub)repService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), isNewConversation, RSGroup);
  546. if (bibus == null)
  547. {
  548. BiBusHeader CMbibus = null;
  549. CMbibus =
  550. BIBusHeaderHelper.getHeaderObject(((Stub)cmService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), true, RSGroup);
  551. ((Stub)repService).clearHeaders();
  552. ((Stub)repService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", CMbibus);
  553. }
  554. else
  555. {
  556. ((Stub)repService).clearHeaders();
  557. ((Stub)repService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", bibus);
  558. }
  559. return repService;
  560. }
  561. //handle service requests that do not specify new conversation for backwards compatibility
  562. public QueryService_PortType getQueryService() {
  563. return getQueryService(false, "");
  564. }
  565. public QueryService_PortType getQueryService(boolean isNewConversation, String RSGroup)
  566. {
  567. BiBusHeader bibus = null;
  568. bibus =
  569. BIBusHeaderHelper.getHeaderObject(((Stub)queryService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), isNewConversation, RSGroup);
  570. if (bibus == null)
  571. {
  572. BiBusHeader CMbibus = null;
  573. CMbibus =
  574. BIBusHeaderHelper.getHeaderObject(((Stub)cmService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), true, RSGroup);
  575. ((Stub)queryService).clearHeaders();
  576. ((Stub)queryService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", CMbibus);
  577. }
  578. else
  579. {
  580. ((Stub)queryService).clearHeaders();
  581. ((Stub)queryService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", bibus);
  582. }
  583. return queryService;
  584. }
  585. //handle service requests that do not specify new conversation for backwards compatibility
  586. public SystemService_PortType getSystemService() {
  587. return getSystemService(false, "");
  588. }
  589. // sn_dg_sdk_mng_svc_hdrs_end_1
  590. public SystemService_PortType getSystemService(boolean isNewConversation, String RSGroup)
  591. {
  592. BiBusHeader bibus = null;
  593. bibus =
  594. BIBusHeaderHelper.getHeaderObject(((Stub)sysService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), isNewConversation, RSGroup);
  595. if (bibus == null)
  596. {
  597. BiBusHeader CMbibus = null;
  598. CMbibus =
  599. BIBusHeaderHelper.getHeaderObject(((Stub)cmService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), true, RSGroup);
  600. ((Stub)sysService).clearHeaders();
  601. ((Stub)sysService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", CMbibus);
  602. }
  603. else
  604. {
  605. ((Stub)sysService).clearHeaders();
  606. ((Stub)sysService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", bibus);
  607. }
  608. return sysService;
  609. }
  610. //handle service requests that do not specify new conversation for backwards compatibility
  611. public Dispatcher_PortType getDispatcherService() {
  612. return getDispatcherService(false, "");
  613. }
  614. public Dispatcher_PortType getDispatcherService(boolean isNewConversation, String RSGroup)
  615. {
  616. BiBusHeader bibus = null;
  617. bibus =
  618. BIBusHeaderHelper.getHeaderObject(((Stub)dispatchService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), isNewConversation, RSGroup);
  619. if (bibus == null)
  620. {
  621. BiBusHeader CMbibus = null;
  622. CMbibus =
  623. BIBusHeaderHelper.getHeaderObject(((Stub)cmService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), true, RSGroup);
  624. ((Stub)dispatchService).clearHeaders();
  625. ((Stub)dispatchService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", CMbibus);
  626. }
  627. else
  628. {
  629. ((Stub)dispatchService).clearHeaders();
  630. ((Stub)dispatchService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", bibus);
  631. }
  632. return dispatchService;
  633. }
  634. public void setCMURL()
  635. {
  636. cmURLDialog = new JDialog();
  637. JPanel cmURLPanel = new JPanel();
  638. cmURLField = new JTextField(CM_URL.length() + 10);
  639. cmURLField.setText(CM_URL);
  640. JLabel cmURLLabel = new JLabel("Server URL:");
  641. cmURLLabel.setLabelFor(cmURLField);
  642. cmURLPanel.add(cmURLLabel, BorderLayout.WEST);
  643. cmURLPanel.add(cmURLField, BorderLayout.EAST);
  644. JPanel buttonPanel = new JPanel();
  645. JButton okayButton = new JButton("OK");
  646. JButton cancelButton = new JButton("Cancel");
  647. okayButton.setActionCommand(okay);
  648. cancelButton.setActionCommand(cancel);
  649. okayButton.addActionListener(this);
  650. cancelButton.addActionListener(this);
  651. buttonPanel.add(okayButton, BorderLayout.WEST);
  652. buttonPanel.add(cancelButton, BorderLayout.EAST);
  653. cmURLDialog.setTitle("Server URL");
  654. Container cmURLContentPane = cmURLDialog.getContentPane();
  655. cmURLContentPane.add(cmURLPanel, BorderLayout.CENTER);
  656. cmURLContentPane.add(buttonPanel, BorderLayout.SOUTH);
  657. cmURLDialog.pack();
  658. cmURLDialog.setResizable(false);
  659. cmURLDialog.setModal(true);
  660. cmURLDialog.setVisible(true);
  661. }
  662. public void actionPerformed(ActionEvent event)
  663. {
  664. String cmd = event.getActionCommand();
  665. if (okay.equals(cmd))
  666. {
  667. CM_URL = new String(cmURLField.getText());
  668. cmURLDialog.dispose();
  669. cmURLDialog = null;
  670. }
  671. else
  672. {
  673. System.exit(0);
  674. }
  675. }
  676. }