Fabio Goncalves · May 2, 2016 go to post

I am really interested in to know if just change my class definition from %Library.GlobalCharacterStream to %Stream.GlobalCharacter is needed considering that it has the same storage mechanism or there is some diferences where is needed to migrate data from %Library.GlobalCharacterStream to %Stream.GlobalCharacter by writing on the new %Stream.GlobalCharacter stream?

Also when using SQL to insert,  update and select %Stream.GlobalCharacter has the same behavior as the %Library.GlobalCharacterStream ? 

Fabio Goncalves · Apr 28, 2016 go to post

Hi Steve,

When working with multiple plugins you may have the same control type on both, in order to resolve the conflicts you can implement the "onResolvePluginConflicts" client method on your Page where you will define which is your main plugin.

Take a look bellow:

/// This event handler callack is called when more than one plugin is registered with a
/// <class>documentView</class> for the same control type.
/// 
/// In this case: $header and $control are registered both with the <class>corePlugin<class> and
/// the <class>jQMPlugin</class>
ClientMethod onResolvePluginConflicts(conflicts) [ Language = javascript ]
{
// Map all components to the jQM plugin,
// the documentView automatically checks if it's possible.
for (cmp in conflicts) {
zenThis.setPluginMapping(cmp, 'jQM');
}
}

I hope it helps.

Best regards.

Fabio Goncalves · Apr 27, 2016 go to post

Hi Alexandre,

I have tested the following and it worked as mentioned above.

Layout object:

{type:'$containerFluid',children:[{type:'$dropdown',id:'dropdown',key:'drop1',buttonGroup:true,content:'Default ',children:[{type:'$dropdownMenuItem',content:'Action',value:'Action',key:'action'},{type:'$dropdownMenuItem',content:'Another action',value:'Another action',key:'another-action'},{type:'$dropdownMenuItem',content:'Something else here',value:'Something else here',key:'something-else-here'},{type:'$dropdownMenuItem',divider:true},{type:'$dropdownMenuItem',content:'A separated link',value:'A separated link'}]},]}

on your "onselect" javascript method you can add:

case 'action':     var selText = $('#dropdownbutton').text();    var value = mainView.getItemByKey(key).$getValue();    $('#dropdownButton .content').html(value+' <span class="caret"></span>');    $('#dropdownMenu').dropdown('toggle');;    break;

Results:

Can you please try this?

Thanks.

Fábio.

Fabio Goncalves · Apr 26, 2016 go to post

Hi,

Another option is try to use the SQL Data Migration Wizard. You can copy just the data and or create the schema as well.

To select the data from a specific Year, Customer, etc. you can create a view on the source side and then use the migration wizard to migrate to importe the data.

I hope it helps.

Fábio.

Fabio Goncalves · Apr 19, 2016 go to post

Sharing with all another example.

Credits to Amir Samary.

Class Sequence.Implementation Extends %RegisteredObject
{
/// SQL Example:
/// select Sequence.NextVal('TEST')
ClassMethod NextVal(pSeqName As %String, pContext As %String = "*") As %Integer [ SqlName = NextVal, SqlProc ]
{
set tSeqName = $ZConvert(pSeqName,"U")
Set tContext = $ZConvert($Select(pContext'="":pContext,1:"*"),"U")
Set seq = ""
    if $Data(^Sequence(tSeqName))
    {
     set seq = $Increment(^Sequence(tSeqName,tContext))
     Set %Sequence(tSeqName,tContext)=seq //For use by CurrVal()
    }
    else 
    {
     throw ##class(%Exception.SQL).CreateFromSQLCODE("-460","Sequence does not exist")
    }
    
Quit seq
}
/// SQL Example:
/// select Sequence.CurrVal('TEST')
/// WARNING: This will not work when called on the Management Portal since different processes
/// on the CSP Gateway pool may be answering to the HTTP request to execute the query.
/// This should work properly vía ODBC/JDBC since a single process is kept open for us and should
/// also work on $System.SQL.Shell().
ClassMethod CurrVal(pSeqName As %String, pContext As %String = "*") As %Integer [ SqlName = CurrVal, SqlProc ]
{
set tSeqName = $ZConvert(pSeqName,"U")
Set tContext = $ZConvert($Select(pContext'="":pContext,1:"*"),"U")
Set seq = ""
    if $Data(%Sequence(tSeqName,tContext))
    {
     set seq = %Sequence(tSeqName,tContext)
    }
    else 
    {
     throw ##class(%Exception.SQL).CreateFromSQLCODE("-460","There is no current value for this sequence. Call NextVal() first.")
    }
    
Quit seq
}
/// Create a new Sequence if it not exist. If the sequence exist, then return an error message
/// Ejemplo de SQL:
/// select Sequence.CreateSequence('TEST')
ClassMethod CreateSequence(pSeqName As %String, pContext As %String = "*") As %String [ SqlName = CreateSequence, SqlProc ]
{
set tSeqName = $ZConvert(pSeqName,"U")
Set tContext = $ZConvert($Select(pContext'="":pContext,1:"*"),"U")
    if $Data(^Sequence(tSeqName))
    {
        throw ##class(%Exception.SQL).CreateFromSQLCODE("-460","Sequence already exists")
    }
    else
    {
        set ^Sequence(tSeqName) = ""
        set ^Sequence(tSeqName,tContext) = 0
    }
    
    Quit 1
}
/// Drop a sequence if this exist, if it not exist, then return an error message
/// Ejemplo de SQL:
/// select Sequence.DropSequence('TEST')
ClassMethod DropSequence(pSeqName As %String) As %String [ SqlName = DropSequence, SqlProc ]
{
set tSeqName = $ZConvert(pSeqName,"U")
    if $Data(^Sequence(tSeqName))
    {
        Kill ^Sequence(tSeqName)
        Kill %Sequence(tSeqName)
    }
    else
    {
        throw ##class(%Exception.SQL).CreateFromSQLCODE("-460","Sequence does not exist")
    }
    
    Quit 1
}
}
 

Fabio Goncalves · Apr 19, 2016 go to post

Not necessary. It was just a copy and paste. You can use a registered for this and just expose your classmethod as sqlproc.

Fabio Goncalves · Apr 19, 2016 go to post

Hi Jue,

I am trying to install AngularJS from http://oss.opensagres.fr/angularjs-eclipse/1.1.0/. I don´t really know if this is the right one if it suits on our Atleier version. However I have searched for some Angular JS pluging on Google and followed the instructions. I am trying to install from Atelier->Help->Install New

This is the error that I am facing out:

Cannot complete the install because of a conflicting dependency.
  Software being installed: AngularJS Eclipse 1.1.0.201511091212 (angularjs-eclipse-feature.feature.group 1.1.0.201511091212)
  Software currently installed: Eclipse Platform 4.5.2.v20160212-1500 (org.eclipse.platform.feature.group 4.5.2.v20160212-1500)
  Only one of the following can be installed at once: 
    International Components for Unicode for Java (ICU4J) 54.1.1.v201501272100 (com.ibm.icu 54.1.1.v201501272100)
    International Components for Unicode for Java (ICU4J) 4.0.1.v20090415 (com.ibm.icu 4.0.1.v20090415)
    International Components for Unicode for Java (ICU4J) 4.0.1.v20090822 (com.ibm.icu 4.0.1.v20090822)
  Cannot satisfy dependency:
    From: AngularJS Eclipse 1.1.0.201511091212 (angularjs-eclipse-feature.feature.group 1.1.0.201511091212)
    To: org.eclipse.angularjs.core [1.1.0.201511091212]
  Cannot satisfy dependency:
    From: Eclipse AngularJS Core 1.1.0.201511091212 (org.eclipse.angularjs.core 1.1.0.201511091212)
    To: bundle org.eclipse.wst.validation 0.0.0
  Cannot satisfy dependency:
    From: Eclipse e4 Rich Client Platform 1.4.1.v20160212-1350 (org.eclipse.e4.rcp.feature.group 1.4.1.v20160212-1350)
    To: com.ibm.icu [54.1.1.v201501272100]
  Cannot satisfy dependency:
    From: Java EMF Model Utilities 2.0.200.v200905140200 (org.eclipse.jem.util 2.0.200.v200905140200)
    To: bundle com.ibm.icu [3.8.1.1,4.1.0)
  Cannot satisfy dependency:
    From: Java EMF Model Utilities 2.0.201.v201001252130 (org.eclipse.jem.util 2.0.201.v201001252130)
    To: bundle com.ibm.icu [3.8.1.1,4.1.0)
  Cannot satisfy dependency:
    From: Eclipse Platform 4.5.2.v20160212-1500 (org.eclipse.platform.feature.group 4.5.2.v20160212-1500)
    To: org.eclipse.rcp.feature.group [4.5.2.v20160212-1500]
  Cannot satisfy dependency:
    From: Eclipse RCP 4.5.2.v20160212-1500 (org.eclipse.rcp.feature.group 4.5.2.v20160212-1500)
    To: org.eclipse.e4.rcp.feature.group [1.4.1.v20160212-1350]
  Cannot satisfy dependency:
    From: Common Frameworks 1.1.300.v200904160730 (org.eclipse.wst.common.frameworks 1.1.300.v200904160730)
    To: bundle org.eclipse.jem.util [2.0.100,3.0.0)
  Cannot satisfy dependency:
    From: Validation Framework 1.2.102.v200905201610 (org.eclipse.wst.validation 1.2.102.v200905201610)
    To: bundle org.eclipse.wst.common.frameworks [1.1.200,2.0.0)
  Cannot satisfy dependency:
    From: Validation Framework 1.2.104.v200911120201 (org.eclipse.wst.validation 1.2.104.v200911120201)
    To: bundle org.eclipse.wst.common.frameworks [1.1.200,2.0.0)

It takes a while longer trying to compute 15 alternative solutions by itself and then pops up the error message above.

 Thanks.

Fabio Goncalves · Apr 15, 2016 go to post

Hi Steffan,

I though about have those header and footer layouts stashed and or loaded dinamically so that it can be  injected the other pages/layouts when needed. 

Could you please provide me more details about how to have this menu logic in a central method, as you mentioned? I have adviced them to use Multiple Templates (Dynamic Dispatch) in order to have the code more organized and easy to maintain. 

Thanks.

Fabio Goncalves · Apr 15, 2016 go to post

I thought about stash the header and footer and inject this code on the layouts when needed . Also they would likje to control the active option, for instance, or have a history bar right bellow the menu. 

I am really interested in advice to them the best approach and I am worried about do not make simple things became a monster in order to get difficult for maintanance, etc.

Fabio Goncalves · Mar 18, 2016 go to post

I have downloaded and installed Cache version is Cache for Windows (x86-64) 2016.2 (Build 613U) Wed Mar 9 2016 19:14:35 EST and Atelier 1.0.116 and it still not working for me. 

I also have tried with the cloud caché Cache for UNIX (Red Hat Enterprise Linux for x86-64) 2016.2 (Build 605U) Thu Feb 25 2016 19:24:57 EST and is not working as well.

Fabio Goncalves · Jan 21, 2016 go to post

Hi Daniel!

Thank you for you help. I got your explanation but my question may be very poor about what I was expecting. 

Considering the same classes that you mentioned above, from SAMPLES (Sample.Company and Sample. Employee) I ran the following code:

USER>zn "samples"
 
SAMPLES>set c = ##class(Sample.Company).%OpenId(1)
 
SAMPLES>w c
1@Sample.Company
SAMPLES>w c.Name
PicoPlex Gmbh.
SAMPLES>w c.Employees
2@%Library.RelationshipObject
SAMPLES>w c.Employees.Count()
5
SAMPLES>w c.Employees.GetAt(1)
3@Sample.Employee
SAMPLES>w c.Employees.GetAt(1).Name
Thompson,Vincent L.
SAMPLES>w c.Employees.GetAt(2).Name
Garcia,Amanda C.
SAMPLES>w c.Employees.GetAt(3).Name
Noodleman,Barbara T.
SAMPLES>w c.Employees.GetAt(4).Name
Smith,Dick A.
SAMPLES>

From the result above you can notice that the employee names, for instance, is not ordered. My question was about choose the order by name, salary or any other property value from the "child class". Is it possible? What would be an alternative for that?

PS: I also have tried to use SetObjectAt method and pass a key parameter value with the value that I want to be ordered. However when I try to retrieve data by using thoses key values, it does not work according to the key order that I tried to use on SetObjectAt key parameter value.

Thanks.

Fabio Goncalves · Jan 14, 2016 go to post

Hi Simon,

I don´t know wich version of Caché or Ensemble you are running but it is available with DeepSee´s feature for predictive analyses that works with a decision tree PMML file created from a external tool. Let me know if you want additional details.

Regards.

Fabio Goncalves · Dec 18, 2015 go to post

I managed to make it work. The problem was related to the generated javascript file during compile time that has been saved as ANSI. I just changed the encoding to UTF-8 through Notepad->Save As and it worked fine.