1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- using System;
- using System.Text;
- using System.Web.Services.Protocols;
- using System.Threading;
- using System.Windows.Forms;
- using SamplesCommon;
- using cognosdotnet_10_2;
- namespace ViewPackages
- {
-
-
-
- class ViewPackages
- {
- public ViewPackages(){}
- static void Main(string[] args)
- {
- string cBIUrl = "";
- contentManagerService1 cBIServer = null;
- SamplesConnect connectDlg = new SamplesConnect();
- ViewPackagesDlg ViewPackagesDlgObject = new ViewPackagesDlg();
- if (args.GetLength(0) == 0 )
- {
-
- connectDlg.ShowDialog();
- if (connectDlg.IsConnectedToCBI() == true)
- {
- cBIServer = connectDlg.CBICMS;
- cBIUrl = connectDlg.CBIURL;
- ViewPackagesDlgObject.setConnection(cBIServer, cBIUrl);
- ViewPackagesDlgObject.ShowDialog();
- }
- }
- }
- public bool doViewPackages( contentManagerService1 cBICMS, ref string resultMessage )
- {
- if (cBICMS == null)
- {
- resultMessage = "The Server connection provided is not valid.";
- return false;
- }
- StringBuilder output = new StringBuilder();
-
- propEnum[] props = new propEnum[] { propEnum.searchPath, propEnum.defaultName };
- sort[] s = new sort[]{ new sort() };
- s[0].order = orderEnum.ascending;
- s[0].propName = propEnum.defaultName;
- queryOptions qo = new queryOptions();
- searchPathMultipleObject packagePath = new searchPathMultipleObject();
- packagePath.Value = "/content//package";
- baseClass[] packageList = cBICMS.query( packagePath, props, s, qo );
- if( packageList.Length > 0 )
- {
- foreach( baseClass pack_item in packageList )
- {
- output.AppendFormat( "\n {0}\n", pack_item.defaultName.value );
- output.AppendFormat( " {0}\n", pack_item.searchPath.value );
- }
- }
- else
- {
- output.Append( "There are currently no published packages.\n" );
- }
- resultMessage = output.ToString();
- return true;
- }
- }
- }
|