Topic
12 replies Latest Post - ‏2012-03-12T22:50:10Z by Stan
KayHunter
KayHunter
3 Posts
ACCEPTED ANSWER

Pinned topic How to use "Business Space powered by WebSphere" System widget events

‏2010-09-30T10:38:17Z |
Good day all.

I was trying to figure out how a user could navigate from one page to another, or hiding/showing widgets based clicked links withing a widget in Business Space powered by WebSphere when I cam across the following following page.

Link: http://www-10.lotus.com/ldd/mashupswiki.nsf/dx/Understanding_how_system_widgets_interact_through_events

This page seems to suggest that one can fire an appropriate system event e.g. com.ibm.mashups.builder.switchPage - to switch a page.

Am I reading this correctly?

If so, what is the type/format of payload that one should use for such event ? Does anyone have an example of using such system events ?

Thanks in advance.
Updated on 2012-03-12T22:50:10Z at 2012-03-12T22:50:10Z by Stan
  • Stan
    Stan
    340 Posts
    ACCEPTED ANSWER

    Re: How to use "Business Space powered by WebSphere" System widget events

    ‏2010-09-30T16:24:18Z  in response to KayHunter
    Hi - this is the Mashup Center forum. It sounds like you should post this question to a Business Space forum?
    However...
    Regarding the page you reference.
    Mashup Center provides the system widgets documented at the page you reference and supports the creation of spaces and pages that can to exported to Business Space. The following page describes setting up the systems and Adding Mashup Center widgets to business spaces:

    http://www-10.lotus.com/ldd/mashupswiki.nsf/dx/Adding_Mashup_Center_widgets_to_business_spaces

    The article "Creating an application with IBM ECM Widgets : ECM Widgets 4.5.2.1" steps you through the application creation process which may be helpful (I am not a Business Space user):

    http://www-10.lotus.com/ldd/mashupswiki.nsf/dx/Creating_an_application_with_IBM_ECM_Widgets__ECM_Widgets_4.5.2.1

    If you wish to pursue using Mashup Center and Busimess Space together please review the information at the links above and post to this forum with questions regarding the Mashup Center objects created to share with Business Space.
  • KayHunter
    KayHunter
    3 Posts
    ACCEPTED ANSWER

    Re: How to use "Business Space powered by WebSphere" System widget events

    ‏2010-09-30T18:01:16Z  in response to KayHunter
    Sorry about that.
    Will go look for anther that seems to be a better fit.

    (I was not finding anything useful from the "Business Space" resources I could find, then I saw 'mashup' in the event name and post here to see if there was a generalized solution that I might be able to apply to my specific issue.)

    Thanks.
  • KayHunter
    KayHunter
    3 Posts
    ACCEPTED ANSWER

    Re: How to use "Business Space powered by WebSphere" System widget events

    ‏2010-10-04T16:01:09Z  in response to KayHunter
    It was suggested I post here as the information is closely aligned to IBM Mashup
  • drdamour
    drdamour
    52 Posts
    ACCEPTED ANSWER

    Re: How to use "Business Space powered by WebSphere" System widget events

    ‏2010-10-05T00:46:32Z  in response to KayHunter
    Hi Kay,

    You are right, most of the Lotus Mashups stuff should work in Business Space (starting with version 7) because they are under the covers mostly the same code.

    You're hitting some pretty low level stuff with the system widgets, and yes you are reading it correctly, you can fire events of a specific type and magically other widgets will listen for them.

    I'd like to quickly point out for your use case about switching pages, if that's all you need, i like to just do a window.open( URL, "_self") call, with the url being of the format /mum/enabler#pid=<PID>& but that's because i prefer to use URL's in most my solutions.

    You are also correct in reasoning that the documentation of these hidden/system widgets is very poor, specifically with missing examples and payload info. if you ever come across a good resource, please post it here and on the wiki as many people would love this!

    i would direct you to your business space's installed codebase's system directory, EG: c\Program Files\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\<cell name>\BSpaceEAR_ETCAeXtWidgetsNode01_server1.ear\BSpace.war\iWidget\widgets\system in there you will find the actual code and widget definition files for most (if not all) of these system widgets. From this you should be able to reason what the payloads are specifically. At least this is generally what i do...
    It looks like the switchPage event is implemented in BSpace by the tabbedNavigation widget, this would be different than Lotus Mashups (different widget, same event though). It's payload seems to be just a text value of the page id, or the PID of the url i said to use.

    finally i would mention that some of the "widgets" are really iWidgets even though they claim to be. They hook into the underlying dojo event model in order to "hear" these specific events. IE the spaceSelector "widget". You can usually tell they of this flavour when there isn't an accompanying XML iWidget def file. these "widgets" really confuse me, and i'm not sure how they are included in a page/space/theme. Hopefully one day there's better dev documentation about how to construct a theme and include system widgets.

    Hope this helps. please include your feedback and stuff you discover, we're all trying to figure this stuff out.

    I am Just a new Boy,
    A Stranger in this Town,
    Where are All the Good Times,
    Who's Gonna Show this Stranger Around?
    • drdamour
      drdamour
      52 Posts
      ACCEPTED ANSWER

      Re: How to use "Business Space powered by WebSphere" System widget events

      ‏2010-10-05T00:48:25Z  in response to drdamour
      ack! big typo in there, when i said:

      "finally i would mention that some of the "widgets" are really iWidgets even though they claim to be."

      i meant to say:
      "finally i would mention that some of the "widgets" are NOT really iWidgets even though they claim to be."


      I am Just a new Boy,
      A Stranger in this Town,
      Where are All the Good Times,
      Who's Gonna Show this Stranger Around?
      • wudongf
        wudongf
        2 Posts
        ACCEPTED ANSWER

        Re: How to use "Business Space powered by WebSphere" System widget events

        ‏2010-10-14T03:18:01Z  in response to drdamour
        Hi Kay & Chris

        Thanks for your feedback on the docs.

        I'll work with our information developer to see how can we refine this page with examples on payloads, and how to fire these events.
        http://www-10.lotus.com/ldd/mashupswiki.nsf/dx/Understanding_how_system_widgets_interact_through_events

        Before my work is done, you can post your questions about any events here, and I'll watch this topic.

        To hide a widget, you can run this javascript:
        com.ibm.mashups.services.ServiceManager.getService("eventService").broadcastEvent("com.ibm.mashups.builder.hideWidget", iwidgetId);

        BTW. I think spaceSelector is a widget in mashups. In my mashups, spaceSelector.js is accompanied with spaceSelector.xml
        • wudongf
          wudongf
          2 Posts
          ACCEPTED ANSWER

          Re: How to use "Business Space powered by WebSphere" System widget events

          ‏2010-10-14T03:47:27Z  in response to wudongf
          to display a widget, you can use
          com.ibm.mashups.services.ServiceManager.getService("eventService").broadcastEvent("com.ibm.mashups.builder.displayWidget", iwidgetId);
    • PoonamSona
      PoonamSona
      3 Posts
      ACCEPTED ANSWER

      Re: How to use "Business Space powered by WebSphere" System widget events

      ‏2011-11-15T03:57:36Z  in response to drdamour
      Hi any idea how to switch page, looks like you worked on this
      • Stan
        Stan
        340 Posts
        ACCEPTED ANSWER

        Re: How to use "Business Space powered by WebSphere" System widget events

        ‏2011-11-15T22:02:30Z  in response to PoonamSona
        The switchPage widget may do what you need. A publicly available copy can be downloaded from Greenhouse. The following premalink should access the widget entry in the catalog:

        http://greenhouse.lotus.com/mashuphub/public/permalink?entryid=9244

        If you run into authentication problems you can register at:
        https://greenhouse.lotus.com/gh_next/lotusgreenhouserequests.nsf/MainDocumentSelf?openForm
        • PoonamSona
          PoonamSona
          3 Posts
          ACCEPTED ANSWER

          Re: How to use "Business Space powered by WebSphere" System widget events

          ‏2011-11-17T00:29:41Z  in response to Stan
          I am using

          var pid1 = 'M0ACA787AB3578083890E9E4ED2BE11000213';
          var evtSvc = com.ibm.mashups.iwidget.services.ServiceManager.getService('eventService').broadcastEvent('com.ibm.mashups.builder.switchPage',pid1);

          error occurs and says undefined object
          not sure how to pass page id
          • SergeShikov
            SergeShikov
            1 Post
            ACCEPTED ANSWER

            Re: How to use "Business Space powered by WebSphere" System widget events

            ‏2012-03-12T07:08:33Z  in response to PoonamSona
            I have the same issue.

            Can't find where to get com.ibm.mashups.iwidget.services.ServiceManager object instance within my iWidget.
            • Stan
              Stan
              340 Posts
              ACCEPTED ANSWER

              Re: How to use "Business Space powered by WebSphere" System widget events

              ‏2012-03-12T22:50:10Z  in response to SergeShikov
              I've not done this myself but here are some referenced you may find helpful:

              The ServiceManager javadoc:
              http://public.dhe.ibm.com/software/dw/lotus/mashups/javadoc30/SPI/spi/index.html

              Examples of migrating widgets to Mashup Center 2.0 API / SPI:
              http://www-10.lotus.com/ldd/mashupswiki.nsf/dx/Migrating_widgets_to_Mashup_Center_2.0__Mashup_Center_2.0