123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827 |
- /**
- Licensed Materials - Property of IBM
- IBM Cognos Products: DOCS
- (C) Copyright IBM Corp. 2005, 2010
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with
- IBM Corp.
- */
- /**
- * CRNConnect.java
- *
- * Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
- * Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
- *
- * Description: This code sample demonstrates how to establish a connection to
- * the IBM Cognos services
- */
- import java.awt.BorderLayout;
- import java.awt.Container;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import java.net.MalformedURLException;
- import javax.swing.JButton;
- import javax.swing.JDialog;
- import javax.swing.JLabel;
- import javax.swing.JOptionPane;
- import javax.swing.JPanel;
- import javax.swing.JTextField;
- import javax.xml.rpc.ServiceException;
- import org.apache.axis.client.Stub;
- import org.apache.axis.message.SOAPHeaderElement;
- import com.cognos.developer.schemas.bibus._3.AgentService_PortType;
- import com.cognos.developer.schemas.bibus._3.AgentService_ServiceLocator;
- import com.cognos.developer.schemas.bibus._3.BatchReportService_PortType;
- import com.cognos.developer.schemas.bibus._3.BatchReportService_ServiceLocator;
- import com.cognos.developer.schemas.bibus._3.BiBusHeader;
- import com.cognos.developer.schemas.bibus._3.ContentManagerService_PortType;
- import com.cognos.developer.schemas.bibus._3.ContentManagerService_ServiceLocator;
- import com.cognos.developer.schemas.bibus._3.DataIntegrationService_PortType;
- import com.cognos.developer.schemas.bibus._3.DataIntegrationService_ServiceLocator;
- import com.cognos.developer.schemas.bibus._3.DeliveryService_PortType;
- import com.cognos.developer.schemas.bibus._3.DeliveryService_ServiceLocator;
- import com.cognos.developer.schemas.bibus._3.DimensionManagementService_PortType;
- import com.cognos.developer.schemas.bibus._3.DimensionManagementService_ServiceLocator;
- import com.cognos.developer.schemas.bibus._3.Dispatcher_PortType;
- import com.cognos.developer.schemas.bibus._3.Dispatcher_ServiceLocator;
- import com.cognos.developer.schemas.bibus._3.EventManagementService_PortType;
- import com.cognos.developer.schemas.bibus._3.EventManagementService_ServiceLocator;
- import com.cognos.developer.schemas.bibus._3.JobService_PortType;
- import com.cognos.developer.schemas.bibus._3.JobService_ServiceLocator;
- import com.cognos.developer.schemas.bibus._3.MetadataService_PortType;
- import com.cognos.developer.schemas.bibus._3.MetadataService_ServiceLocator;
- import com.cognos.developer.schemas.bibus._3.MonitorService_PortType;
- import com.cognos.developer.schemas.bibus._3.MonitorService_ServiceLocator;
- import com.cognos.developer.schemas.bibus._3.PropEnum;
- import com.cognos.developer.schemas.bibus._3.QueryOptions;
- import com.cognos.developer.schemas.bibus._3.QueryService_PortType;
- import com.cognos.developer.schemas.bibus._3.QueryService_ServiceLocator;
- import com.cognos.developer.schemas.bibus._3.ReportService_PortType;
- import com.cognos.developer.schemas.bibus._3.ReportService_ServiceLocator;
- import com.cognos.developer.schemas.bibus._3.SearchPathMultipleObject;
- import com.cognos.developer.schemas.bibus._3.Sort;
- import com.cognos.developer.schemas.bibus._3.SystemService_PortType;
- import com.cognos.developer.schemas.bibus._3.SystemService_ServiceLocator;
- public class CRNConnect implements ActionListener
- {
- // Create the objects that provide the connections to the services.
- // sn_dg_prm_smpl_connect_start_0
- private AgentService_ServiceLocator agentServiceLocator = null;
- // sn_dg_prm_smpl_connect_end_0
- private BatchReportService_ServiceLocator batchRepServiceLocator = null;
- private ContentManagerService_ServiceLocator cmServiceLocator = null;
- private DataIntegrationService_ServiceLocator dataIntServiceLocator = null;
- private DeliveryService_ServiceLocator deliveryServiceLocator = null;
- private EventManagementService_ServiceLocator eventMgmtServiceLocator = null;
- private JobService_ServiceLocator jobServiceLocator = null;
- private MonitorService_ServiceLocator monitorServiceLocator = null;
- private QueryService_ServiceLocator queryServiceLocator = null;
- private ReportService_ServiceLocator reportServiceLocator = null;
- private SystemService_ServiceLocator systemServiceLocator = null;
- private Dispatcher_ServiceLocator dispatcherServiceLocator = null;
- private DimensionManagementService_ServiceLocator dimensionMgmtServiceLocator = null;
- private MetadataService_ServiceLocator metadataServiceLocator = null;
-
- // There is an interface class for each service named
- // <servicename>_Port. The implementation class for each interface
- // is named <servicename>Stub. The stub class implements the methods
- // in the interface, and can be used to access the functionality provided
- // by the service. However, as it is a common practice, this sample
- // programs to the interfaces, instantiating instances of the
- // <servicename>_Port classes.
- // sn_dg_prm_smpl_connect_start_1
- private AgentService_PortType agentService = null;
- // sn_dg_prm_smpl_connect_end_1
- private BatchReportService_PortType batchRepService = null;
- private ContentManagerService_PortType cmService = null;
- private DataIntegrationService_PortType dataIntService = null;
- private DeliveryService_PortType deliveryService = null;
- private EventManagementService_PortType eventMgmtService = null;
- private JobService_PortType jobService = null;
- private MonitorService_PortType monitorService = null;
- private QueryService_PortType queryService = null;
- private ReportService_PortType repService = null;
- private SystemService_PortType sysService = null;
- private Dispatcher_PortType dispatchService = null;
- private DimensionManagementService_PortType dimensionMgmtService = null;
- private MetadataService_PortType metadataService = null;
-
- // Set the location of the sample reports.
- private String curDir = System.getProperty("user.dir");
- private String CRN_HOME = curDir.substring(0,curDir.lastIndexOf("sdk")-1);
- private String REPORT_PATH = CRN_HOME + "/webcontent/samples";
- // Create a variable that contains the default URL for Content Manager.
- // sn_dg_prm_smpl_connect_start_2
- public static String CM_URL = "http://localhost:9300/p2pd/servlet/dispatch";
- // sn_dg_prm_smpl_connect_end_2
- private JDialog cmURLDialog = null;
- private static String cancel = "cancel";
- private static String okay = "okay";
- private JTextField cmURLField;
- /**
- * Use this method to connect to the server. The user will be
- * prompted to confirm the Content Manager URL
- *
- * @return A connection to the server
- */
- public ContentManagerService_PortType connectToCognosServer()
- {
- BiBusHeader bibus = null;
- while (bibus == null)
- {
- setCMURL();
- // sn_dg_prm_smpl_connect_start_3
- // Create the service locators
-
- agentServiceLocator = new AgentService_ServiceLocator();
- // sn_dg_prm_smpl_connect_end_3
- batchRepServiceLocator = new BatchReportService_ServiceLocator();
- cmServiceLocator = new ContentManagerService_ServiceLocator();
- dataIntServiceLocator = new DataIntegrationService_ServiceLocator();
- deliveryServiceLocator = new DeliveryService_ServiceLocator();
- eventMgmtServiceLocator = new EventManagementService_ServiceLocator();
- jobServiceLocator = new JobService_ServiceLocator();
- monitorServiceLocator = new MonitorService_ServiceLocator();
- queryServiceLocator = new QueryService_ServiceLocator();
- reportServiceLocator = new ReportService_ServiceLocator();
- systemServiceLocator = new SystemService_ServiceLocator();
- dispatcherServiceLocator = new Dispatcher_ServiceLocator();
- dimensionMgmtServiceLocator = new DimensionManagementService_ServiceLocator();
- metadataServiceLocator = new MetadataService_ServiceLocator();
- try
- {
- // sn_dg_prm_smpl_connect_start_4
- java.net.URL serverURL = new java.net.URL(CM_URL);
-
- //acquire references to the services
-
- agentService = agentServiceLocator.getagentService(serverURL);
- // sn_dg_prm_smpl_connect_end_4
- batchRepService = batchRepServiceLocator.getbatchReportService(serverURL);
- cmService = cmServiceLocator.getcontentManagerService(serverURL);
- dataIntService = dataIntServiceLocator.getdataIntegrationService(serverURL);
- deliveryService = deliveryServiceLocator.getdeliveryService(serverURL);
- eventMgmtService = eventMgmtServiceLocator.geteventManagementService(serverURL);
- jobService = jobServiceLocator.getjobService(serverURL);
- monitorService = monitorServiceLocator.getmonitorService(serverURL);
- queryService = queryServiceLocator.getqueryService(serverURL);
- repService = reportServiceLocator.getreportService(serverURL);
- sysService = systemServiceLocator.getsystemService(serverURL);
- dispatchService = dispatcherServiceLocator.getdispatcher(serverURL);
- dimensionMgmtService = dimensionMgmtServiceLocator.getdimensionManagementService(serverURL);
- metadataService = metadataServiceLocator.getmetadataService(serverURL);
-
- } // ... catch expected exceptions after this point
- catch (MalformedURLException e)
- {
- System.out.println("Malformed URL:\n" + e.getMessage());
- return null;
- }
- catch (ServiceException e)
- {
- System.out.println("Service Exception:\n" + e.getMessage());
- return null;
- }
- try
- {
- cmService.query(
- new SearchPathMultipleObject("/"),
- new PropEnum[] {},
- new Sort[] {},
- new QueryOptions());
- }
- catch (java.rmi.RemoteException remoteEx)
- {
- System.out.println("");
- //If authentication is required, this will generate an exception
- //At this point, this exception can safely be ignored
- }
- catch (java.lang.NullPointerException nullEx)
- {
- JOptionPane.showMessageDialog(null, "Unable to connect at the URL: " + CM_URL + ". Please make sure the service is running.");
- return null;
- }
- // Retrieve the biBusHeader SOAP:Header that contains
- // the logon information.
- SOAPHeaderElement x = ((Stub)cmService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader");
- bibus = BIBusHeaderHelper.getHeaderObject(x, true, "");
-
- if (bibus != null)
- {
- ((Stub)cmService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", bibus);
- return cmService;
- }
-
- JOptionPane.showMessageDialog(null,"Connect Failed. Try again.");
- }
- return null;
- }
- /**
- * Use this method to connect to the server, bypassing any prompts.
- *
- * @param CMURL The URL for the server
- * @return A connection to the server
- */
- public ContentManagerService_PortType connectToCognosServer(String CMURL)
- {
- CM_URL = CMURL;
- // Create the service locators
-
- agentServiceLocator = new AgentService_ServiceLocator();
- batchRepServiceLocator = new BatchReportService_ServiceLocator();
- cmServiceLocator = new ContentManagerService_ServiceLocator();
- dataIntServiceLocator = new DataIntegrationService_ServiceLocator();
- deliveryServiceLocator = new DeliveryService_ServiceLocator();
- eventMgmtServiceLocator = new EventManagementService_ServiceLocator();
- jobServiceLocator = new JobService_ServiceLocator();
- monitorServiceLocator = new MonitorService_ServiceLocator();
- reportServiceLocator = new ReportService_ServiceLocator();
- systemServiceLocator = new SystemService_ServiceLocator();
- dispatcherServiceLocator = new Dispatcher_ServiceLocator();
- dimensionMgmtServiceLocator = new DimensionManagementService_ServiceLocator();
- metadataServiceLocator = new MetadataService_ServiceLocator();
-
- try
- {
- java.net.URL serverURL = new java.net.URL(CMURL);
-
- //acquire references to services
- //
-
- agentService = agentServiceLocator.getagentService(serverURL);
- batchRepService = batchRepServiceLocator.getbatchReportService(serverURL);
- cmService = cmServiceLocator.getcontentManagerService(serverURL);
- dataIntService = dataIntServiceLocator.getdataIntegrationService(serverURL);
- deliveryService = deliveryServiceLocator.getdeliveryService(serverURL);
- eventMgmtService = eventMgmtServiceLocator.geteventManagementService(serverURL);
- jobService = jobServiceLocator.getjobService(serverURL);
- monitorService = monitorServiceLocator.getmonitorService(serverURL);
- repService = reportServiceLocator.getreportService(serverURL);
- sysService = systemServiceLocator.getsystemService(serverURL);
- dispatchService = dispatcherServiceLocator.getdispatcher(serverURL);
- dimensionMgmtService = dimensionMgmtServiceLocator.getdimensionManagementService(serverURL);
- metadataService = metadataServiceLocator.getmetadataService(serverURL);
-
- return cmService;
- }
- //handle uncaught exceptions
- catch (MalformedURLException e)
- {
- System.out.println("Malformed URL:\n" + e.getMessage());
- return null;
- }
- catch (ServiceException e)
- {
- System.out.println("Service Exception:\n" + e.getMessage());
- return null;
- }
- }
-
- public ContentManagerService_PortType connectionChange(String endPoint)
- {
- try
- {
- java.net.URL endPointURL = new java.net.URL(endPoint);
-
- agentService = agentServiceLocator.getagentService(endPointURL);
- batchRepService = batchRepServiceLocator.getbatchReportService(endPointURL);
- cmService = cmServiceLocator.getcontentManagerService(endPointURL);
- dataIntService = dataIntServiceLocator.getdataIntegrationService(endPointURL);
- deliveryService = deliveryServiceLocator.getdeliveryService(endPointURL);
- eventMgmtService = eventMgmtServiceLocator.geteventManagementService(endPointURL);
- jobService = jobServiceLocator.getjobService(endPointURL);
- monitorService = monitorServiceLocator.getmonitorService(endPointURL);
- repService = reportServiceLocator.getreportService(endPointURL);
- sysService = systemServiceLocator.getsystemService(endPointURL);
- dispatchService = dispatcherServiceLocator.getdispatcher(endPointURL);
- dimensionMgmtService = dimensionMgmtServiceLocator.getdimensionManagementService(endPointURL);
- metadataService = metadataServiceLocator.getmetadataService(endPointURL);
-
- return cmService;
- }
- catch (MalformedURLException eMalformed)
- {
- System.out.println(eMalformed.getMessage());
- return null;
- }
- catch (ServiceException eService)
- {
- System.out.println(eService.getMessage());
- return null;
- }
- }
- public String getDefaultSavePath()
- {
- return REPORT_PATH;
- }
- public void setDefaultSavePath(String newReportPath)
- {
- REPORT_PATH = newReportPath;
- }
-
- //handle service requests that do not specify new conversation for backwards compatibility
- public AgentService_PortType getAgentService() {
-
- return getAgentService(false, "");
-
- }
- public AgentService_PortType getAgentService(boolean isNewConversation, String RSGroup)
- {
- BiBusHeader bibus = null;
- bibus =
- BIBusHeaderHelper.getHeaderObject(((Stub)agentService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), isNewConversation, RSGroup);
- if (bibus == null)
- {
- BiBusHeader CMbibus = null;
- CMbibus =
- BIBusHeaderHelper.getHeaderObject(((Stub)cmService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), true, RSGroup);
- ((Stub)agentService).clearHeaders();
- ((Stub)agentService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", CMbibus);
- }
- else
- {
- ((Stub)agentService).clearHeaders();
- ((Stub)agentService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", bibus);
- }
- return agentService;
- }
-
- //handle service requests that do not specify new conversation for backwards compatibility
- public BatchReportService_PortType getBatchRepService() {
-
- return getBatchRepService(false, "");
-
- }
- public BatchReportService_PortType getBatchRepService(boolean isNewConversation, String RSGroup)
- {
- BiBusHeader bibus = null;
- bibus =
- BIBusHeaderHelper.getHeaderObject(((Stub)batchRepService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), isNewConversation, RSGroup);
- if (bibus == null)
- {
- BiBusHeader CMbibus = null;
- CMbibus =
- BIBusHeaderHelper.getHeaderObject(((Stub)cmService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), true, RSGroup);
- ((Stub)batchRepService).clearHeaders();
- ((Stub)batchRepService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", CMbibus);
- }
- else
- {
- ((Stub)batchRepService).clearHeaders();
- ((Stub)batchRepService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", bibus);
- }
- return batchRepService;
- }
-
- //handle service requests that do not specify new conversation for backwards compatibility
- public ContentManagerService_PortType getCMService() {
-
- return getCMService(false, "");
-
- }
- public ContentManagerService_PortType getCMService(boolean isNewConversation, String RSGroup)
- {
- BiBusHeader bibus = null;
- bibus =
- BIBusHeaderHelper.getHeaderObject(((Stub)cmService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), isNewConversation, RSGroup);
- if (!(bibus == null))
- {
- ((Stub)cmService).clearHeaders();
- ((Stub)cmService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", bibus);
- }
- return cmService;
- }
- //handle service requests that do not specify new conversation for backwards compatibility
- public DataIntegrationService_PortType getDataIntService() {
-
- return getDataIntService(false, "");
-
- }
-
- public DataIntegrationService_PortType getDataIntService(boolean isNewConversation, String RSGroup)
- {
- BiBusHeader bibus = null;
- bibus =
- BIBusHeaderHelper.getHeaderObject(((Stub)dataIntService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), isNewConversation, RSGroup);
- if (bibus == null)
- {
- BiBusHeader CMbibus = null;
- CMbibus =
- BIBusHeaderHelper.getHeaderObject(((Stub)cmService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), true, RSGroup);
-
- ((Stub)dataIntService).clearHeaders();
- ((Stub)dataIntService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", CMbibus);
- }
- else
- {
- ((Stub)dataIntService).clearHeaders();
- ((Stub)dataIntService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", bibus);
- }
- return dataIntService;
- }
-
- //handle service requests that do not specify new conversation for backwards compatibility
- public DeliveryService_PortType getDeliveryService() {
-
- return getDeliveryService(false, "");
-
- }
-
- public DeliveryService_PortType getDeliveryService(boolean isNewConversation, String RSGroup)
- {
- BiBusHeader bibus = null;
- bibus =
- BIBusHeaderHelper.getHeaderObject(((Stub)deliveryService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), isNewConversation, RSGroup);
- if (bibus == null)
- {
- BiBusHeader CMbibus = null;
- CMbibus =
- BIBusHeaderHelper.getHeaderObject(((Stub)cmService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), true, RSGroup);
- ((Stub)deliveryService).clearHeaders();
- ((Stub)deliveryService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", CMbibus);
- }
- else
- {
- ((Stub)deliveryService).clearHeaders();
- ((Stub)deliveryService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", bibus);
- }
- return deliveryService;
- }
-
- //handle service requests that do not specify new conversation for backwards compatibility
- public DimensionManagementService_PortType getDimensionManagementService() {
-
- return getDimensionManagementService(false, "");
-
- }
-
- public DimensionManagementService_PortType getDimensionManagementService(boolean isNewConversation, String RSGroup)
- {
- BiBusHeader bibus = null;
- bibus =
- BIBusHeaderHelper.getHeaderObject(((Stub)dimensionMgmtService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), isNewConversation, RSGroup);
- if (bibus == null)
- {
- BiBusHeader CMbibus = null;
- CMbibus =
- BIBusHeaderHelper.getHeaderObject(((Stub)cmService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), true, RSGroup);
- ((Stub)dimensionMgmtService).clearHeaders();
- ((Stub)dimensionMgmtService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", CMbibus);
- }
- else
- {
- ((Stub)dimensionMgmtService).clearHeaders();
- ((Stub)dimensionMgmtService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", bibus);
- }
- return dimensionMgmtService;
- }
-
-
- //handle service requests that do not specify new conversation for backwards compatibility
- public EventManagementService_PortType getEventMgmtService() {
-
- return getEventMgmtService(false, "");
-
- }
-
- public EventManagementService_PortType getEventMgmtService(boolean isNewConversation, String RSGroup)
- {
- BiBusHeader bibus = null;
- bibus =
- BIBusHeaderHelper.getHeaderObject(((Stub)eventMgmtService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), isNewConversation, RSGroup);
- if (bibus == null)
- {
- BiBusHeader CMbibus = null;
- CMbibus =
- BIBusHeaderHelper.getHeaderObject(((Stub)cmService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), true, RSGroup);
- ((Stub)eventMgmtService).clearHeaders();
- ((Stub)eventMgmtService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", CMbibus);
- }
- else
- {
- ((Stub)eventMgmtService).clearHeaders();
- ((Stub)eventMgmtService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", bibus);
- }
- return eventMgmtService;
- }
-
- //handle service requests that do not specify new conversation for backwards compatibility
- public JobService_PortType getJobService() {
-
- return getJobService(false, "");
-
- }
-
- public JobService_PortType getJobService(boolean isNewConversation, String RSGroup)
- {
- BiBusHeader bibus = null;
- bibus =
- BIBusHeaderHelper.getHeaderObject(((Stub)jobService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), isNewConversation, RSGroup);
- if (bibus == null)
- {
- BiBusHeader CMbibus = null;
- CMbibus =
- BIBusHeaderHelper.getHeaderObject(((Stub)cmService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), true, RSGroup);
- ((Stub)jobService).clearHeaders();
- ((Stub)jobService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", CMbibus);
- }
- else
- {
- ((Stub)jobService).clearHeaders();
- ((Stub)jobService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", bibus);
- }
- return jobService;
- }
-
- //handle service requests that do not specify new conversation for backwards compatibility
- public MonitorService_PortType getMonitorService() {
-
- return getMonitorService(false, "");
-
- }
-
- //handle service requests that do not specify new conversation for backwards compatibility
- public MetadataService_PortType getMetadataService() {
-
- return getMetadataService(false, "");
-
- }
-
- public MetadataService_PortType getMetadataService(boolean isNewConversation, String RSGroup)
- {
- BiBusHeader bibus = null;
- bibus =
- BIBusHeaderHelper.getHeaderObject(((Stub)metadataService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), isNewConversation, RSGroup);
- if (bibus == null)
- {
- BiBusHeader CMbibus = null;
- CMbibus =
- BIBusHeaderHelper.getHeaderObject(((Stub)cmService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), true, RSGroup);
- ((Stub)metadataService).clearHeaders();
- ((Stub)metadataService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", CMbibus);
- }
- else
- {
- ((Stub)metadataService).clearHeaders();
- ((Stub)metadataService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", bibus);
- }
- return metadataService;
- }
-
- public MonitorService_PortType getMonitorService(boolean isNewConversation, String RSGroup)
- {
- BiBusHeader bibus = null;
- bibus =
- BIBusHeaderHelper.getHeaderObject(((Stub)monitorService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), isNewConversation, RSGroup);
- if (bibus == null)
- {
- BiBusHeader CMbibus = null;
- CMbibus =
- BIBusHeaderHelper.getHeaderObject(((Stub)cmService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), true, RSGroup);
- ((Stub)monitorService).clearHeaders();
- ((Stub)monitorService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", CMbibus);
- }
- else
- {
- ((Stub)monitorService).clearHeaders();
- ((Stub)monitorService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", bibus);
- }
- return monitorService;
- }
-
- //handle service requests that do not specify new conversation for backwards compatibility
- public ReportService_PortType getReportService() {
-
- return getReportService(false, "");
-
- }
-
- // sn_dg_sdk_mng_svc_hdrs_start_1
- public ReportService_PortType getReportService(boolean isNewConversation, String RSGroup)
- {
-
- BiBusHeader bibus = null;
- bibus =
- BIBusHeaderHelper.getHeaderObject(((Stub)repService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), isNewConversation, RSGroup);
-
- if (bibus == null)
- {
- BiBusHeader CMbibus = null;
- CMbibus =
- BIBusHeaderHelper.getHeaderObject(((Stub)cmService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), true, RSGroup);
- ((Stub)repService).clearHeaders();
- ((Stub)repService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", CMbibus);
- }
- else
- {
- ((Stub)repService).clearHeaders();
- ((Stub)repService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", bibus);
- }
-
- return repService;
- }
-
- //handle service requests that do not specify new conversation for backwards compatibility
- public QueryService_PortType getQueryService() {
-
- return getQueryService(false, "");
-
- }
-
- public QueryService_PortType getQueryService(boolean isNewConversation, String RSGroup)
- {
-
- BiBusHeader bibus = null;
- bibus =
- BIBusHeaderHelper.getHeaderObject(((Stub)queryService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), isNewConversation, RSGroup);
-
- if (bibus == null)
- {
- BiBusHeader CMbibus = null;
- CMbibus =
- BIBusHeaderHelper.getHeaderObject(((Stub)cmService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), true, RSGroup);
- ((Stub)queryService).clearHeaders();
- ((Stub)queryService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", CMbibus);
- }
- else
- {
- ((Stub)queryService).clearHeaders();
- ((Stub)queryService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", bibus);
- }
-
- return queryService;
- }
-
- //handle service requests that do not specify new conversation for backwards compatibility
- public SystemService_PortType getSystemService() {
-
- return getSystemService(false, "");
-
- }
-
- // sn_dg_sdk_mng_svc_hdrs_end_1
- public SystemService_PortType getSystemService(boolean isNewConversation, String RSGroup)
- {
- BiBusHeader bibus = null;
- bibus =
- BIBusHeaderHelper.getHeaderObject(((Stub)sysService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), isNewConversation, RSGroup);
- if (bibus == null)
- {
- BiBusHeader CMbibus = null;
- CMbibus =
- BIBusHeaderHelper.getHeaderObject(((Stub)cmService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), true, RSGroup);
- ((Stub)sysService).clearHeaders();
- ((Stub)sysService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", CMbibus);
- }
- else
- {
- ((Stub)sysService).clearHeaders();
- ((Stub)sysService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", bibus);
- }
- return sysService;
- }
- //handle service requests that do not specify new conversation for backwards compatibility
- public Dispatcher_PortType getDispatcherService() {
-
- return getDispatcherService(false, "");
-
- }
-
- public Dispatcher_PortType getDispatcherService(boolean isNewConversation, String RSGroup)
- {
- BiBusHeader bibus = null;
- bibus =
- BIBusHeaderHelper.getHeaderObject(((Stub)dispatchService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), isNewConversation, RSGroup);
- if (bibus == null)
- {
- BiBusHeader CMbibus = null;
- CMbibus =
- BIBusHeaderHelper.getHeaderObject(((Stub)cmService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader"), true, RSGroup);
- ((Stub)dispatchService).clearHeaders();
- ((Stub)dispatchService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", CMbibus);
- }
- else
- {
- ((Stub)dispatchService).clearHeaders();
- ((Stub)dispatchService).setHeader("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", bibus);
- }
- return dispatchService;
- }
-
-
- public void setCMURL()
- {
- cmURLDialog = new JDialog();
- JPanel cmURLPanel = new JPanel();
- cmURLField = new JTextField(CM_URL.length() + 10);
- cmURLField.setText(CM_URL);
- JLabel cmURLLabel = new JLabel("Server URL:");
- cmURLLabel.setLabelFor(cmURLField);
- cmURLPanel.add(cmURLLabel, BorderLayout.WEST);
- cmURLPanel.add(cmURLField, BorderLayout.EAST);
- JPanel buttonPanel = new JPanel();
- JButton okayButton = new JButton("OK");
- JButton cancelButton = new JButton("Cancel");
- okayButton.setActionCommand(okay);
- cancelButton.setActionCommand(cancel);
- okayButton.addActionListener(this);
- cancelButton.addActionListener(this);
- buttonPanel.add(okayButton, BorderLayout.WEST);
- buttonPanel.add(cancelButton, BorderLayout.EAST);
- cmURLDialog.setTitle("Server URL");
- Container cmURLContentPane = cmURLDialog.getContentPane();
- cmURLContentPane.add(cmURLPanel, BorderLayout.CENTER);
- cmURLContentPane.add(buttonPanel, BorderLayout.SOUTH);
- cmURLDialog.pack();
- cmURLDialog.setResizable(false);
- cmURLDialog.setModal(true);
- cmURLDialog.setVisible(true);
- }
- public void actionPerformed(ActionEvent event)
- {
- String cmd = event.getActionCommand();
- if (okay.equals(cmd))
- {
- CM_URL = new String(cmURLField.getText());
- cmURLDialog.dispose();
- cmURLDialog = null;
- }
- else
- {
- System.exit(0);
- }
- }
-
- }
|