PDA

View Full Version : TIP Adding Menu Items to the Adapter Section of the B2B Server Administrator GUI


11-29-2001, 10:12
B2B Server 4.0.1
Trading Networks: N/A

PROBLEM:
For an integration, the end user must be able to use the B2B Server Administration GUI to view (/i{and sometimes edit}) Integration documentation, prior transactions, system properties, and other features.

How can we simplify the process for the end user (customer OR internal employee) to launch this Integration GUI.

SOLUTION:
Add a menu item to the B2B Server Administration GUI that launches the Integration GUI. This is same process by which a Database is configured, or Routing Rules are configured, or MySAP parameters are configured, etc.

Attached below is the code to add a menu item to the B2B Server Administration GUI in the section "Adapters".

To use this code, create a Java service and give it any name that makes sense (i.e. "addPackageToAdministrator"). Then, add this new service to the Startup Services for your integration package. This will ensure that every time that the integration package is loaded by the B2B Server, the new menu item will be incorporated into the "Adapters" section of the B2B Server Administration GUI.

Be sure to replace the text in [brackets] with your appropriate text.

[begin code]
// IMPORTS
// com.wm.lang.ns.NSName
// java.io.*
// java.util.*
// java.lang.String


// Build the menu items Object for the Integration GUI. This will be the left-side menu on your Integration GUI.
Object guiMenu[][][] =
{
{
{ "name", "[Section 1]" } ,
{ "url", "[Section 1 URL]" }
},
{
{ "name", "[Section 2]" } ,
{ "url", "[Section 2 URL]" }
},

{
{ "name", "[Section 3]" } ,
{ "url", "[Section 3 URL]" }
},

{
{ "name", "[Section 4]" },
{ "url", "[Section 4 URL]" }
}
};

Values args[] = new Values[guiMenu.length];
for(int i = 0; i < guiMenu.length; i++)
args[i] = new Values(guiMenu[i]);

// Build the added menu item in the B2B Server Administration GUI. This will be the menu item that launches your Integration GUI.
Object adminNewItem[][] =
{
{ "name", "[Your Integration GUI]" },
{ "url", "[Your Integration GUI URL]" },

{ "tabs", args },
{ "highlight", "Home" }
};

Values v = new Values(adminNewItem);

// Add the menu item to the B2B Server Administration GUI
try
{
Service.doInvoke(NSName.create("wm.server.ui:addMenu"), v);
}
catch (Exception e)
{
System.out.println("ERROR occurred while adding [Your Integration GUI] package to the webMethods B2B Server Administrator");
}
[end code]

11-29-2001, 13:50
You can also invoke "wm.server.ui:addMenu" from a flow service and provide the inputs in the graphical environment (ie. no java code)...

SOLUTION 1:
Create a flow service...
Add an Invoke of ANY service...
Go to the properties tab for the newly added service...change the "service name" field to "wm.server.ui:addMenu"...

SOLUTION 2:
Using the admin webpages, edit the extended settings and add "watt.server.ns.hideWmRoot=False".
Restart B2B server. Now WmRoot package will appear in the B2B Integrator and you can use the standard service browser to add "wm.server.ui:addMenu" to your flow.

11-29-2001, 14:02
watt.server.ns.hideWmRoot=False? That is neat little trick! Thanks.

Now, I have to ask: Is there a system configuration setting that will unhide the "Source not available" code and WmRoot flows?

11-29-2001, 17:47
Dan - the answer is no. The Java source is not provided with the software distribution, only the class files.

11-30-2001, 15:49
But of course, that's where the java decompiler comes in ;)