WD VC Portal Eventing

Introduction

This page describes a problem we are currently facing with Portal Eventing between a Web Dynpro (Java iView) and a Visual Composer iView. When the event publisher is a iView of type WebDynpro (Java) and the subscriber of iView type Visual Composer, the VC iView fails to see the event data using a Signal In component.

Software Component Versions

Component Version
NWDS 7.0.14 Build 200711171656
Enterprise Portal 7.00 SP12
Browser Info IE 6.0.2900.21800
VC GML 700.12.0027
VC Client 700.12.0.1
VC Server Version 700.12.0.1
Flex Version 700.12.0.1
Portal Content Version 700.12.0.1
Portal Connector Version 700.12.0.1

Full Software and Development Component versions attached as html file with the SAP Note.

Output From SAP NetWeaver Support Component : Version

Component Version
Portal Version File Mon Nov 05 16:28:55 CET 2007 Creation-Date=20071105
Creation-Time=1628
Manifest-Version=1.0
Implementation-Title=Portal version.info
JDK-Version=1.3
Creation-User=jointadm
Implementation-Vendor=SAP AG
Sync-Changelist=27064
Implementation-Vendor-Id=com.sap
version=7.0.12.0.0
Specification-Vendor=SAP AG
Implementation-Version=7.12.0.0.200711051628
Make-Release=NW04S_12_REL
Sync-Timestamp=2007/11/05 14\:59\:25
Portal Version 7.0.12.0.0
DB Provider MS-SQL
J2EE version 7.00 PatchLevel 108458.44 SP 12
JDK version 1.4.2_13-b06
JAVA_HOME C:\j2sdk1.4.2_13-x64\jre
JVM Version 1.4.2_13
OS Version Windows 2003 5.2 amd64

Note 1038511 Info (Error Analysis Info)

Item Info
VC Runtime Flash
Backend Connections None (No backend services involved)
Log files attached as file to the note
Component and Software versions attached as html file to the note
http trace Still Waiting to get the http trace.

Test Setup to illustrate the problem

I created 4 simple iViews in total:

  • WD Java iView (event publisher)
  • WD Java iView (event subscriber)
  • VC iView (event subscriber)
  • VC iView (event publisher)

I then created a sample page containing 2 iViews (1 event publisher and 1 event subscriber)

All iViews publish and subscribe to the same event name and namespace. (the field names passed in the VC form is the same as well)

These were the results that I obtained

iView 1 Type (Publisher) iView 2 Type (Subscriber) Portal Eventing Works?
Web Dynpro Java Web Dynpro Java Yes
Visual Composer Visual Composer Yes
Visual Composer Web Dynpro Java Yes (get a URL encoded string)
Web Dynpro Java Visual Composer No
  • The VC based iView subscriber works with a VC based iView Publisher, the same working VC based iView subscriber does not work with a WD based iView publisher.
  • The WD based iView Subscriberworks with a WD based iView Publisher
  • I can infer from the above matrix that the iViews themselves are working correctly. There is a problem with the way they are communicating.

WebDynpro iView (Event Publisher)

The WebDynpro iView is a stripped down iView with just a Text Input field, TextView element and a context element. Here is the listing code listing. The submit action fires the event.

// ---------------------------------------------------------------------------
// This file has been generated partially by the Web Dynpro Code Generator.
// MODIFY CODE ONLY IN SECTIONS ENCLOSED BY @@begin AND @@end.
// ALL OTHER CHANGES WILL BE LOST IF THE FILE IS REGENERATED.
// ---------------------------------------------------------------------------
package com.cmc.test;
 
// 
// IMPORTANT NOTE: 
// _ALL_ IMPORT STATEMENTS MUST BE PLACED IN THE FOLLOWING SECTION ENCLOSED
// BY @@begin imports AND @@end. FURTHERMORE, THIS SECTION MUST ALWAYS CONTAIN
// AT LEAST ONE IMPORT STATEMENT (E.G. THAT FOR IPrivateEPCMView).
// OTHERWISE, USING THE ECLIPSE FUNCTION "Organize Imports" FOLLOWED BY
// A WEB DYNPRO CODE GENERATION (E.G. PROJECT BUILD) WILL RESULT IN THE LOSS
// OF IMPORT STATEMENTS.
//
//@@begin imports
import com.cmc.test.wdp.IPrivateEPCMView;
import com.sap.dictionary.types.services.SAPStringBuffer;
import com.sap.tc.webdynpro.clientserver.event.api.WDPortalEventing;
import com.sap.tc.webdynpro.clientserver.portal.WDPortalUtils;
import com.sap.tc.webdynpro.clientserver.uielib.bi.api.WDBIMethods;
import com.sap.tc.webdynpro.services.sal.adapter.api.WDProtocolAdapter;
//@@end
 
//@@begin documentation
//@@end
 
public class EPCMView
{
  /**
   * Logging location.
   */
  private static final com.sap.tc.logging.Location logger = 
    com.sap.tc.logging.Location.getLocation(EPCMView.class);
 
  static 
  {
    //@@begin id
    String id = "$Id$";
    //@@end
    com.sap.tc.logging.Location.getLocation("ID.com.sap.tc.webdynpro").infoT(id);
  }
 
  /**
   * Private access to the generated Web Dynpro counterpart 
   * for this controller class.  </p>
   *
   * Use <code>wdThis</code> to gain typed access to the context,
   * to trigger navigation via outbound plugs, to get and enable/disable
   * actions, fire declared events, and access used controllers and/or 
   * component usages.
   *
   * @see com.cmc.test.wdp.IPrivateEPCMView for more details
   */
  private final IPrivateEPCMView wdThis;
 
  /**
   * Root node of this controller's context. </p>
   *
   * Provides typed access not only to the elements of the root node 
   * but also to all nodes in the context (methods node<i>XYZ</i>()) 
   * and their currently selected element (methods current<i>XYZ</i>Element()). 
   * It also facilitates the creation of new elements for all nodes 
   * (methods create<i>XYZ</i>Element()). </p>
   *
   * @see com.cmc.test.wdp.IPrivateEPCMView.IContextNode for more details.
   */
  private final IPrivateEPCMView.IContextNode wdContext;
 
  /**
   * A shortcut for <code>wdThis.wdGetAPI()</code>. </p>
   * 
   * Represents the generic API of the generic Web Dynpro counterpart 
   * for this controller. </p>
   */
  private final com.sap.tc.webdynpro.progmodel.api.IWDViewController wdControllerAPI;
 
  /**
   * A shortcut for <code>wdThis.wdGetAPI().getComponent()</code>. </p>
   * 
   * Represents the generic API of the Web Dynpro component this controller 
   * belongs to. Can be used to access the message manager, the window manager,
   * to add/remove event handlers and so on. </p>
   */
  private final com.sap.tc.webdynpro.progmodel.api.IWDComponent wdComponentAPI;
 
  public EPCMView(IPrivateEPCMView wdThis)
  {
    this.wdThis = wdThis;
    this.wdContext = wdThis.wdGetContext();
    this.wdControllerAPI = wdThis.wdGetAPI();
    this.wdComponentAPI = wdThis.wdGetAPI().getComponent();
  }
 
  //@@begin javadoc:wdDoInit()
  /** Hook method called to initialize controller. */
  //@@end
  public void wdDoInit()
  {
    //@@begin wdDoInit()
    //@@end
  }
 
  //@@begin javadoc:wdDoExit()
  /** Hook method called to clean up controller. */
  //@@end
  public void wdDoExit()
  {
    //@@begin wdDoExit()
    //@@end
  }
 
  //@@begin javadoc:wdDoModifyView
  /**
   * Hook method called to modify a view just before rendering.
   * This method conceptually belongs to the view itself, not to the
   * controller (cf. MVC pattern).
   * It is made static to discourage a way of programming that
   * routinely stores references to UI elements in instance fields
   * for access by the view controller's event handlers, and so on.
   * The Web Dynpro programming model recommends that UI elements can
   * only be accessed by code executed within the call to this hook method.
   *
   * @param wdThis Generated private interface of the view's controller, as
   *        provided by Web Dynpro. Provides access to the view controller's
   *        outgoing controller usages, etc.
   * @param wdContext Generated interface of the view's context, as provided
   *        by Web Dynpro. Provides access to the view's data.
   * @param view The view's generic API, as provided by Web Dynpro.
   *        Provides access to UI elements.
   * @param firstTime Indicates whether the hook is called for the first time
   *        during the lifetime of the view.
   */
  //@@end
  public static void wdDoModifyView(IPrivateEPCMView wdThis, IPrivateEPCMView.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)
  {
    //@@begin wdDoModifyView
    //@@end
  }
 
  //@@begin javadoc:onActionButton(ServerEvent)
  /** Declared validating event handler. */
  //@@end
  public void onActionButton(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
  {
    //@@begin onActionButton(ServerEvent)
    SAPStringBuffer buffer = new SAPStringBuffer();
 
    String cityFrom = wdContext.currentContextElement().getCityFrom();
    buffer.append("AID Value = " + cityFrom + "\n");
    WDPortalEventing.fire("urn:com.sap.vc:epcm","AID",cityFrom);
    buffer.append("Event Raised");
    wdContext.currentContextElement().setMessages(buffer.toString());
    //@@end
  }
 
  /*
   * The following code section can be used for any Java code that is 
   * not to be visible to other controllers/views or that contains constructs
   * currently not supported directly by Web Dynpro (such as inner classes or
   * member variables etc.). </p>
   *
   * Note: The content of this section is in no way managed/controlled
   * by the Web Dynpro Designtime or the Web Dynpro Runtime. 
   */
  //@@begin others
  //@@end
}

Visual Composer iView (Event Subscriber)

Note: The exported GML file is attached with the SAP note.

This VC iView is simple. It has one Signal In component (AID, namespace : com.sap.vc:epcm) that routes its output via a connector to a form with a single textfield: AID.

Here is a screen shot of the Signal In component.

SignalIn.png

Here is a screen shot of the connector properties.

screen1.png

Here is a screen shot of the Form Properties.

Form1.png
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License