Home

  The MOS Story

  Sample Program

  Protocol Info

  Soap Sample

  About

  Contact us

 

Click this link to download the sample / test programs

NewsGatewaySamples.zip

------------------------------------------------------------------------------------------------------------------------------

NewsGateway Protocol Sample Installation Instructions

 

Two sample applications are provided with both executable and source codes.

Unzip file NewsGatewaySample and copy the contents (preserving the directory structure) to the Drive/Directory of your choice.  An example would be C:\NewsGatewaySample\.  There will be two folders below. The folder named Csharp contains both the source and comiled executible demonstration program written in C Sharp. The folder named VB.NET contains both the source and compiled executible demonstration program written in Visual Basic.

To run the already compiled program execute either \Csharp\Bin\Debug\NewsGatewaySample.exe or \VB.NET\NewsGatewaySample\Bin\Debug\NewsGatewaySample.exe.

The C Sharp version is a .NET application written in C#, and Visual Basic version was created with the aid of a source translator (SharpDevelop 3.1 an Open source development IDE). Each version of the source code has a solution file NewsGatewaySample.sln that will open in Microsoft Visual Studio 2008, Microsoft Visual C# Express (Free), Microsoft Visual Basic Express (Free) and SharpDevelop 3.x (Free).

You should then be able to build and run the application, set breakpoints, examine variables etc.

To create your own application using any modern IDE that knows how to consume web services, direct it to http://newsmaker.no-ip.org:8408/SOAP?WSDL and it should automatically create a wrapper for the methods provided by NewsGateway. You can then call these methods as if they are local to your application.

The sample shows a simple tree navigation of the Newsroom system(s) connected to a copy of our NewsGateway running in our lab. We typically have at least an ENPS system on-line, which systems are on-line may vary from time to time due to customer need and our testing.

You can also access the desktop of the client running the ENPS session via a virtual network client. To access you will need to install a VNC client. We recommend either UltraVNC or TightVNC.

Execute the VNV client and connect to newsmaker.no-ip.org:1

Note: :1 adds 1 port to the standard VNC, causing the client to use port 5901 rather than 5900.

Password is “enps”

This is the live system that the demo program is accessing via the NewsGateway.  Please be gently in your access. This is a system that is used by fellow developers to test.

 

Start the application.

You should see that the Host field is preset to newsmaker.no-ip.org and the port to 8408. That will connect to our demo NewsGateway in California. If you were running your own copy of the gateway, you would change the Host to be the name or IP of the computer where it is located.

 

Press Connect.

This should fill in the Newsroom Systems column with a list of systems connected to the demo NewsGateway. The first should typically be our ENPS system. Click on the ENPS line, this should fill in the Active Rundowns column with a list of rundowns currently active.

 

Click on the Gateway Demo rundown

This should fill in the Stories column with a list of stories in that rundown.

 

Click on a story

Both the Items column and the script window will display the items contained within this story (if any). Items are the clips, graphics etc. that have been placed into the story by the producer or journalist using either a list provided to the NCS via the NewsGateway or by using your ActiveX plugin. Some systems support passing a list of your itemsfor display and selection natively within the NCS.  The NCS then creates and inserts the MOS Object within the script for you. An expamle of using the PutObject call is provided within the demo program source.

 

Belpw are Sample calls to NewsGateway. These examples are in C# and VB.NET but are similar in Java, C++, Pascal etc.  Refer to the sample program NewsGatewaySample for a working example:

 

1. Log In to the NewsGateway.

This opens a session with its own event queue and returns a handle to be passed in all subsequent calls. Once Logout has been called, this handle is no longer valid.
  
   gateway.Url = "http://" + NewsGatewayHost + ":" + Port + "/SOAP";  // for the demo, use "newsmaker.no-ip.org" as NewsGatewayHost
// Sample URL: "http://localhost:8008/SOAP"
   String Gateway_Handle = gateway.Login("TestUser", "", "Demo App");

   Sample Response:

      <handle>{0D98DADC-76CB-40A6-A57D-9B05493E42D0}</handle>

 

  
2. Get list of Domains (Newsroom Computer Systems) attached to the NewsGateway

   String Domains = gateway.getDomainList(Gateway_Handle);
  
   Sample response:
          
   <domainlist>
      <count>1</count>
         <domain>
         <description>
           <![CDATA[ ENPS Server ]]>
         </description>
         <name>
           <![CDATA[ MOS_ENPS_Adapter.dll ]]>
         </name>
         <version>
           <![CDATA[ 1.1.6.51 5/8/2009 2:19:06 PM NewsMaker Technologies Inc. ]]>
         </version>
         <id>1</id>
       </domain>
     </domainlist
            
  
  
   Note: Strings that potentially contain illegal XML characters are enclosed in CDATA sections. Most XML parsers can handle this construct.

 

 

3. Set the domain for subsequent calls. You can switch between domains easily using this call.

   NOTE: In the normal case where there is only one Newsroom computer system attached, you do not need to make this call as the first domain is selected by default
  
   gateway.setDomain(Gateway_Handle, id); // id = 1, 2 etc.
  

 

4. Get a list of active rundowns. This will be all of the rundowns that the Newsroom Computer system has decided to make publicly available
  
   String Rundowns = gateway.getRundownList(Gateway_Handle);
  
   Sample Response:
            
   <objectlist>
     <count>2</count>
         <object>
           <title>6:58PM Cut-In</title>
           <id>DEMOENPS50VPC;P_NEWS\W;E4E4765B-4CCB-4718-8703E5BE32D4F477</id>
           <objecttype>otrundown</objecttype>
         </object>
         <object>
           <title>Gateway Demo</title>
           <id>DEMOENPS50VPC;P_NEWS\W;A49F71BF-08FD-42FC-99E8D63FE43E4F2A</id>
           <objecttype>otrundown</objecttype>
         </object>
     </objectlist>
            

 

   
5. Get a list of stories from a rundown. The ID is as returned in the getRundownList call

   String Stories = gateway.getStoriesFromRundown(Gateway_Handle, id, "");
  
   Sample response:
            
   <objectlist>
     <count>1</count>
         <object>
             <title>Show Open</title>
             <id>DEMOENPS50VPC;P_NEWS\W\R_A49F71BF-08FD-42FC-99E8D63FE43E4F2A;1F027776-ED5C-47F8-B23759859E451B35</id>
             <objecttype>otstory</objecttype>
             <slug>Show Open</slug>
         </object>
   </objectlist>
            
  

 

  
6. Get a list of Automation items from a story

   String ItemList = gateway.getItemsFromStory(Gateway_Handle, id, "");
  
   Sample response:
              
   <object>
     <title>Show Open</title>
     <id>DEMOENPS50VPC;P_NEWS\W\R_A49F71BF-08FD-42FC-99E8D63FE43E4F2A;1F027776-ED5C-47F8-B23759859E451B35</id>
     <slug>Show Open</slug>
     <objecttype>otstory</objecttype>
     <automation>
         <count>1</count>
         <automationitem>
         <id>Headline Roundup</id>
         <itemslug>Show Open-2</itemslug>
         <itemid>2</itemid>
         <abstract>any text abstract</abstract>
         <duration>0</duration>
         <storyslug>Show Open</storyslug>
         <slug>Object Headline Roundup</slug>
         <channel />
         </automationitem>
     </automation>
     <body>
     <![CDATA[ <p>
    </p><p>
    </p>
    <p>
    </p>
    <p>Good Afternoon, here's what's happening at the noon hour today</p>]]>
     </body>
     </object>            
             
  

  

  

 

 
   
  

 











Web site and all contents © Copyright NewsMaker Technologies, Inc., 2010, All rights reserved.