יום ראשון, 9 בדצמבר 2012

Standard Interactivity or High Interactivity

With winters approaching hibernation starts and efficiency dips (even though its below par through out the year). But still issues never stop. Recently while working on standard interactivity portal we have written script on BC which was used in both HI as well as SI application. However typical business requirement forced us that this piece should be executed only on SI mode of the application and not on the HI mode.

The real trick here is to identify in which mode of application you are working on. With some support from Google we were able to find its-another-mystery-service-type business service which is used extensively but less talked about. "Web Engine State Properties" is the magic service here. Below piece of code can help you find the mode.

var sInputs = TheApplication().NewPropertySet();
var sOutputs = TheApplication().NewPropertySet();
TheApplication().GetService("Web Engine State Properties").InvokeMethod("IsHighInteractive",sInputs,sOutputs);
var sTest = sOutputs.GetProperty("IsHighInteractive");

The key here is the name of the method and name of output argument is same. There are more methods of this BS. All will return either 1 or 0. This BS is primarily used in SWT tags to determine modes, main example being CCStylesChoice.swt where it directs which CSS file to be used for which mode. Any other method to identify application mode is more than welcome in comments section.

Happy Crunching!!





אין תגובות:

הוסף רשומת תגובה