Hi David

Defining the SQL Gateway connection is only one part of the problem solved.

Once you have ano SQL gateway defined, you can then create 'proxy' classes in Cache that  know something about, and represent the tables in the remote database system.

With these proxy classes on hand, you can then use them to query and update data as you would with any other persistant Cache vlass yout have.

Thanks Bernd,

I see that onkeypress works- just as I expected it to firing onevent(). you're right.-

But - I was trying to capture onkeyup - which does not get fired into the onevent().

For onkeyup, and probably other events, we need to implement this manually. We would need to resolve the element id of the layout object, then, register an event listener for the event occurring on that element  - which when fired, would invoke onevent() in the template class.    (as per Steve Whitemen's next post)

thanks - 

Thanks Bernd.

My issue is actually managing to get the onevent() method in the template class to be fired at all.  

I'm currently trying to determine what code is required to register onKeyUp() events to be captured for specific layout objects -  that would result in the onevent() in my template class gets invoked (with the evt, key, value and docViewId arguments passed).

Have you use the onevent method callback in the template class ?

Steve

Hi Stefan,

I guess that's not how it is described under 'Event Handling' here:  http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=...  which incorrectly implies that that Zen Mojo will call onevent for anything other than onselect or onchange.  

So: in my ZENPage, I've overridden onkeydownhandler(evt), and I intend to call the onevent() method in my template class, which will have all the logic for all the events other than onsearch and onclick.

The zenPage onkeyuphandler gives me evt, which I can use to get the HTML DOM id of the component that raised the event.  (id=evt.srcElement .id).

How do I go about finding the layout object's  key attribute, given the DOM id ?

Steve

Hi.

I have made a correction to the post, and associated sample code, to indicate the correct way that long-handed versions of custom commands, functions and variables need to developed.  Code that is implemented as a function with arguments needs to explicitly invoke the short-hand logic, or the functionality will not get invoked when using the long-handed command.

Thanks

Steve

excellent - thanks !...

But what about collections, say, a property 'b' that is a collection (with b1, and b2 keys)

>set objFromJSON = {}.$fromJSON("{""a"":""1"",""b"":[{""b1"":""x""},{""b2"":""y""}]}")
>write objFromJSON.a
1
>write objFromJSON.b
24@%Library.Array

>set arr=objFromJSON.b

 

I can only get to each item in 'b' by instantiating an iterator (using arr.$getIterator()), and looping through the list with the $getNext() method of the resulting iterator.   I can remove, get the last, add to the end and set an item in the collection.

I'm assuming there is no concept of getting the item #1 from the collection - using '1' as the key, indicating the first in the collection, or getting #2, indicating the second item - something like

set bObject=arr[1] or  set bObject=arr.GetAt(1) or bObject=arr.Get(1) ?

Steve

Hi,

just starting to look at it.  From a UI perspective - if you do not select an Instance, or Namespace filter in the display, the Name column fully qualifies the component by adding Instance:Namespace - which is great.  This make the column wider, pushing "Avg Que Time" and "Queue Trend" columns outside of the display are and invisible.  

There is no horizontal scroll bar to bring them back in.

Steve

Hi 

Thanks Eduard for trying and for John's comments.

Brendan - Actually... - I tried using the SaveToClass() method as you described before I posted my question to the community, but, it my initial tests showed it deleting the entire contents of my XDATA block.  I was not confident that was the way to go - hence the question, thinking there might have been another API.

However - spurred on again today by yourself coming to the same idea I already had, I decided to give it another look - and - I have solved the problem.

For all - I want to re-iterate - this is how to set the Enabled configuration status of a business host by modifying the XML in the production class's XDATA block.  For run-time enabling/disabling, use EnableConfigItem method of Ens.Director.

If the enabled status changes you want to make are to the production's configuration, then - here is the solution:

 

/// productionName = Package.Classname
/// 
Items(ConfigItem)=startupStatus 
///

/// ConfigItem = must contain the fully qualified reference of: ConfigName|ClassNameOfComponent
///                            due to config items, that can be defined as the same name multiple times in a production
/// startupStatus = 1 or 0 (true or false respectively)
/// 
ClassMethod UpdateClassEnabledStatuses(productionName As %String, ByRef Items As %String) As %Status
{
set tSC=$$$OK 

Try {
set statProdRunning=##class(Ens.Director).IsProductionRunning(productionName)
if statProdRunning=1 {
  // Stop Production
  set tSC=##class(Ens.Director).StopProduction()
  if $$$ISERR(tSC) {
    write !,"Unable to stop production. Exiting without changes."
    quit 
   }
}

// take out an exclusive lock on the class to avoid being edited remotely.
lock +^oddDEF(productionName)#"E":5
if '$t {
 write !,"Unable to lock production class. Exiting without changes."
 quit 
}

// iterate through items.
set objProd=##class(Ens.Config.Production).%OpenId(productionName)
if '$IsObject(objProd) {
  write !,"Production configuration for production: "_productionName_". couldn't be found. Existing without changes."
  quit
}
set ci=""
for  {
  set ci=$order(Items(ci)) quit:ci=""
  set fqConfigItem=productionName_"||"_ci

  // change the status in the class.
  set objConfigItem=objProd.FindItemByConfigName(fqConfigItem)

  set objConfigItem.Enabled=Items(ci)
  write !,"Updating item: "_$piece(ci,"|")_" ("_$piece(ci,"|",2)_")"_" to: "_$select(Items(ci):"True",1:"False")
 
  set err=objProd.SaveToClass(objConfigItem) if $$$ISERR(err) write " - Failed" continue
  set err=objProd.%Save() if $$$ISERR(err) write " - Failed" continue

}

// release exclusive lock the class
lock -^oddDEF(productionName)#"E"

// Reset the running status of the production
if statProdRunning=1 {
  do ##class(Ens.Director).StartProduction(productionName)
}

catch exceptionvar {
  lock -^oddDEF(productionName)#"E"
  set tSC=exceptionvar.AsStatus()
}
  quit tSC
}
 

 

 

Steve.

Hi Scott,

As far as I'm aware, you do not need a license to use the DeepSee User Portal, as long as you don't need to use DeepSee Cubes, or DeepSee Queries (which needs to be licensed).

So if the information you want to present in a DeepSee User Portal type dashboard, can be sought directly via SQL Queries, etc - you can use iether:

(a) Ensemble DeepSee Dashboards (receiving data from Business Metric classes). See http://docs.intersystems.com/ens20152/csp/docbook/DocBook.UI.Page.cls?KEY=EGDV_bmetric#EGDV_bmetric_dashboard 

or

(b) DeepSee Dashboards based on KPI Class which are designed to use only SQL to extract a result set.

See:  http://docs.intersystems.com/ens20152/csp/docbook/DocBook.UI.Page.cls?KEY=D2MODADV_ch_kpi

Of course if you want more control over the UI, then go down the ZEN, ZEN Mojo, etc route.

Steve

Hi,

What I was hoping to do is programatically set the 'default' Enabled/Disabled status of a configuration item,  - ie - editing the XML in the production class.  We do this from the Management Portal so that when a I disable a component, stop the production and re-start it, the component is still disabled.

I don't want to run the risk of messages starting to flow into the production namespace, by starting the production, then, OnStart - (which presumably kicks off after all queues have been setup and business services start 'listening'),  subsequently start disabling some components.

Steve

Yes this is a great feature to have.

Just a small clarification. To enable the alternative component to run, you need to select it (now it's configuration settings show up) and Enable it from settings

Enabling the alternative component automatically disable the previous running version and starts the one that currently selected (the one in the drop down). 

Steve 

Hi David, 

The type %ListOfObjects implements GetAt (), not Get () to return an object from the list.

Also, this will return an object. I would have expected you to need to specify the property of the returned object, for the condition 

Something that will eventually look like

...   condition='Document.myList. GetAt(1).myProperty="AA"'

Steve