Robert Cemper · Dec 21, 2017 go to post

is  Enable %Service_Telnet set ?
in  the Management Portal (http:///csp/sys/sec/%25CSP.UI.Portal.Services.zen)
 

My Caché runs on Win .(I'm not sure if this works also for Caché on Unix )

It does NOT work for Unix:

%Service_Telnet Yes Yes Unauthenticated Unrestricted Controls Telnet sessions on a Windows server

So on UNIX you go to bash and have to start via csession....

Robert Cemper · Dec 21, 2017 go to post

so what you are looking for is something similar to XML IGNORENULL = 1
short time ago I ended up with export to XML and then convert XML to JSON.
Not so impressive but better than chasing unwanted  "".   
 

Robert Cemper · Dec 21, 2017 go to post

Right: if you don't establish TELNET connection it's just bash or MS-DOS depending on your local OS.
Also for local localhost access !
so from Help:

Using the Terminal Plug-in
Telnet Connection
If your Caché instance is on a remote Windows server, you will need to connect using Telnet.
  1. Enable %Service_Telnet from the Management Portal (http:///csp/sys/sec/%25CSP.UI.Portal.Services.zen)
  2. In the main menu, select Show View > Other > Terminal > Terminal, or click this link to open the Opens the new Class file wizardTerminal View.
  3. Select the Open a Terminal button on the Terminal view toolbar.
  4. Select Telnet Terminal from the Choose terminal drop down menu.
  5. Complete the Telnet session configuration and click "OK"
  6. If csession isn't in your PATH, navigate to your instance's bin directory. For example, cd C:\InterSystems\Cache\bin.
  7. Launch a Caché terminal session. For example, csession Cache.

Setup Connection

And you get your Caché Terminal

HTH

Robert Cemper · Dec 21, 2017 go to post

Funny to meet amCharts again as I presented it first to customers as alternative to ZEN graphics
around  2011/12 with Caché 2011.1
smiley

Robert Cemper · Dec 20, 2017 go to post

and keep quiet  when it installs. 
this is not Caché and it takes it's time  crying

(I just spent 25 min for an Update/Upgrade)  

Robert Cemper · Dec 20, 2017 go to post

It is. I have used it some time ago.
You need a  suitable plug in and connect to port 23 of your server 
(provided it is not blocked by Win* firewall.

plugin from the following update repository: http://download.eclipse.org/tm/terminal/marketplace/.

  1. From your Eclipse/Atelier workspace, navigate to command linkHelp > Install New Software from the main menu.
  2. Enter the URL for the Terminal plugin update site in the Work with field. Ensure that the Group items by category check box is selected.
  3. Once the groups are displayed, select the check box by the newest version.
  4. Click Next to open the Install Details page. Review your installation choices.
  5. Click Next to open the Review Licenses page. Accept the license terms and click Finish.
  6. To open the Terminal view, select Window > Show View > Other on the main menu and type "terminal" in the filter box. Select Terminal and OK.
Robert Cemper · Dec 20, 2017 go to post

Because it's so easy I've added a solution for those readers that don't refuse to work with Caché Objects & Classes .

Class Definition

Class DC.productListing Extends (%RegisteredObject, %XML.Adaptor)                            
{                                                                                                                                                                          
Property product As %String(CONTENT = "MIXED", XMLPROJECTION = "CONTENT");
}                                                                                                                                                                          

Simple display method

ClassMethod Show(xml As %String(MAXLEN=""))
{
 set rd=##class(%XML.Reader).%New()
    ,sc=rd.OpenString(xml)
 do rd.Correlate("product","DC.productListing")
 while rd.Next(.obj) {
    write !,"######"_$i(cnt)_"#########",$replace(obj.product,$c(10),$C(13,10))
 }
}

Extended test data

USER>write xml
<productListing title="ABC Products">
 <product>
   <name>Product One</name>
   <description>Product One is an exciting new widget that will simplify your life.</description>
   <cost>$19.95</cost>
   <shipping>$2.95</shipping>
 </product>
 <product>
   <name>Product 2</name>
   <description>Product 2 is an exciti</description>
   <cost>$19.95</cost>
   <shipping>$2.95</shipping>
 </product>
 <product>
   <name>Product 3</name>
   <description>Product 3 is simplify your life.</description>
   <cost>$19.95</cost>
   <shipping>$2.95</shipping>
 </product>
</productListing>
USER>

Result

USER>do ##class(DC.productListing).Show(xml)
 
######1#########
  <name>Product One</name>
  <description>Product One is an exciting new widget that will simplify your life.</description>
  <cost>$19.95</cost>
  <shipping>$2.95</shipping>
 
######2#########
  <name>Product 2</name>
  <description>Product 2 is an exciti</description>
  <cost>$19.95</cost>
  <shipping>$2.95</shipping>
 
######3#########
  <name>Product 3</name>
  <description>Product 3 is simplify your life.</description>
  <cost>$19.95</cost>
  <shipping>$2.95</shipping>
 
USER>
Robert Cemper · Dec 20, 2017 go to post

what's wrong with Caché Objects and Classes ?

I remember, you had a similar fear some time ago wink

Robert Cemper · Dec 19, 2017 go to post

Class not found + Win7 makes me think you should check your System Variable CLASSPATH ?

just a guess.

Robert Cemper · Dec 19, 2017 go to post

This is one of my personal reasons to use PuTTY or WebTerminal or anything else than TERMINAL.
 

Robert Cemper · Dec 18, 2017 go to post

Kevin,

if you call a ClassMethod() it will return whatever the type of return value is like.
some variants:

- your Classmethod generates the CSV file as you do and the return value is the filename

ClassMethod Kevin1() as %String [SqlProc]
{                                        
....... generate CVS File                
 quit Filename                           
}                                        

- instead of a file you generate a 2 dimensional $Piece String (, as field separator and ^ as record separator)

ClassMethod Kevin2() as %String(MAXLEN="") [SqlProc]
{                                                   
....... setup ResultSet                             
    set output=""                                   
    while rs.Next() {                               
        for col=1:1:rcws.GetColumnCount() { set output=output_rs.GetData(col)_"," }
        set output=output_"^"                       
        }                                           
    quit output                                     
}                                                   

- a similar thing could be rows as a list of JSON sets

ClassMethod Kevin3() as %String(MAXLEN="") [SqlProc]
{                                                   
    set output=""
    &SQL( SELECT LIST(line) into :output FROM (
             Select top 3 JSON_OBJECT('Name':Name
                                      ,'ZIP':Home_ZIP
                                      ,'State':Home_State) as line
                      from sample.Person where name [ 'A' )
             )
         )                                      
    quit output                                     

///  {"Name":"Xiang,Agnes O.","ZIP":56604,"State":"MT"},{"Name":"Zubik,Bill A.","ZIP":78872,"State":"NV"},"Name":"Schaefer,Alvin X.","ZIP":63607,"State":"ME"}                                                 

in all cases you have to disassemble the result on the EXCEL end.

BUT as this is MS-EXCEL

my personal preference would be anyhow  to connect to Cache over ODBC with a local DSN
and just call your data via SQL and get back a full working XLS table that feeds the rest in your XLS.
This is standard in EXCEL and except for the DSN the same for ACCESS  or real DBs.
(as I don't own and use EXCEL any more  I can't offer an example)
- your initial question didn't mention CSV nor MS-EXCEL
so my Article on Light weight EXCEL Download may apply
https://community.intersystems.com/post/light-weight-excel-download

or  Tips & Tricks - SQL to Excel
https://community.intersystems.com/post/tips-tricks-sql-excel

HTH,
Robert

Robert Cemper · Dec 15, 2017 go to post

An alternate approach to SOAP:

a) you run your query over  JDBC on your DataServer
     so you can query what ever you like

b) slightly more sophisticated
    you create a ClassMethod with [SqlProc] parameter and also call it over JDBC
    like this.  SELECT Pkg.Class_ClassMethod()  
    It's totally up to you what the content of your return value is.   

I personally prefer JDBC as it's platform independent

in fact b) is pretty much the same as SOAP just with a different transport that avoids %CSP and its side effects.......

Robert Cemper · Dec 13, 2017 go to post

Proposal:

Store your JSON String as %String(MAXLEN="")  like a log file

for the typical components  type, age, firstname, lastname, ...
create calculated properties that find its content by $piece,  $find or some JSON specific stuff.
setup an  index on those calculated properties to find your record.

With this approach you keep the origin as you get it and get te indices you may require.
It's pretty similar to what I did to mimic an XML DB with Caché
so 1) =NO  2) =see above 3) =YES 4) = it's just another challenge

Robert Cemper · Dec 11, 2017 go to post

Hi Tim,

I'm highly interested to see this result.
I tried to do something similar recently to to be able to feed back  to the sender what  was wrong if something was wrong.
I failed to get the combinations of params for XERCES parser right. XMLIGNORE* worked OK but was not so useful.

You might have a shorter link to contact Marvin Tenner then me.  wink  yes

Robert Cemper · Dec 10, 2017 go to post

As we see your ID is combined by 3 properties
for the sake of this example I name them id01, id02, id03

so your ID is this combination ID = id01_"||"_id02,_"||"_id03

so you may reformulate your query to make it readable 

SELECT * FROM TafnitCore_Logistics_TransferPackage_DB.PackageData  
WHERE id01=1 AND id02=1 and id03  IN (9852553062, 9852553061 )
ORDER BY Building
Robert Cemper · Dec 9, 2017 go to post

I'd suggest you apply as Support Engineer @ InterSystems
and over the years you might learn all the secrets of Caché.
I doubt what you ask for is subject for a public forum.

Robert Cemper · Dec 8, 2017 go to post

check side conditions of the related column.

from docs:

property onclick as %ZEN.Datatype.eventHandler;
onclick event handler: This event is fired when the mouse is clicked within a cell in this column. If the column does not have data associated with it you will have to set the linkCaption property.
Note that this callback is called before the new row in the table is selected so you will not have the current selectedIndex for the table when this callback is fired. If you need that, use the tablePane's onselectrow callback.
Robert Cemper · Dec 8, 2017 go to post

See details here:

http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY…

especially:

Sample Global Names and Their Uses

The following are examples of the various kinds of global names and how each is used:
your case
2) is a broken call for a label in a routine and has nothing to to with globals
probably        do a^myroutine
3) looks like a  broken condition on variable a also no globals around
a|  could be the beginning of a OR ....
Robert Cemper · Dec 7, 2017 go to post

If your connection is not stable enough I'd suggest to take a closer look to good old Shadowing.

It's really jungle proof.
I used it in past to transfer data from an oil drill platform  somewhere out on the ocean over a satellite link with just 64k bd bandwidth without any data loss. And this link was far from whatever you would expect from a wired connection on ground.
Shadowing did id with incredible stability and no loss.
Cascading of shadowing is also almost unlimited with no  issue. 
 

Robert Cemper · Dec 1, 2017 go to post

It's a rare case in combination with %Persistent,
but it makes sense also to exclude any class with Property Abstract=1 in your Query

Robert Cemper · Dec 1, 2017 go to post

Firefox Quantum 57.0 (64-bit) worked immediately
Chrome Version 62.0.3202.94 (Offizieller Build) (64-Bit) had troubles.

Robert Cemper · Dec 1, 2017 go to post

Thanks Stephen,

Its the same link but works from course page + in different browser

Robert Cemper · Nov 30, 2017 go to post

Example WebService:

/// My.SOAP
Class My.SOAP Extends %SOAP.WebService [ ProcedureBlock ]
{
/// Name des WebService.
Parameter SERVICENAME = "MyService";
/// SOAP Namespace für den WebService
Parameter NAMESPACE = "http://tempuri.org";
/// Namespaces von referenzierten Klassen werden in der WSDL verwendet.
Parameter USECLASSNAMESPACES = 1;
Method GetCustomerInfo(schema1 As My.Schema1) As My.Schema2 [ WebMethod ]
{
 set max   =schema1.MaxResult
    ,home  =schema1.HomeState
    ,office=schema1.OfficeState
    ,start =schema1.NameStartswith
 set:'max max=1
 set:office="" office=home
 set schema2=##class(My.Schema2).%New()
    ,rs=##class(%ResultSet).%New()
    ,sql="SELECT top ? %ID FROM Sample.Employee "
        _"WHERE Home_State = ? "
        _"AND Office_state = ? "
        _"AND Name %STARTSWITH ? "
       ,tSC=rs.Prepare(sql)
 set:tSC tSC=rs.Execute(max,home,office,start)
 while rs.Next()&&tSC {
   set employee=rs.GetObject()
      ,res=##class(My.Schema2Result).%New()
      ,res.HomeAddress=employee.Home
      ,res.OfficeAddress=employee.Office
      ,res.Name=employee.Name
      ,res.pid=employee.%Id()
   do schema2.Results.Insert(res)
  }
 quit schema2
}
}
Robert Cemper · Nov 30, 2017 go to post

Example Schema1
<?xml version="1.0" encoding="UTF-8"?>
<s:schema xmlns:s="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<s:complexType name="Schema1">
    <s:sequence>
        <s:element name="Max_Results">
            <s:simpleType>
                <s:restriction base="s:long">
                    <s:minInclusive value="1"/>
                </s:restriction>
            </s:simpleType>
        </s:element>
        <s:element name="Home-State">
            <s:simpleType>
                <s:restriction base="s:string">
                    <s:maxLength value="2"/>
                    <s:minLength value="2"/>
                </s:restriction>
            </s:simpleType>
        </s:element>
        <s:element minOccurs="0" name="Office-State" type="s:string"/>
        <s:element minOccurs="0" name="Name-Startswith" type="s:string"/>
    </s:sequence>
</s:complexType>
</s:schema>

Robert Cemper · Nov 30, 2017 go to post

Example Schema2

<?xml version="1.0" encoding="UTF-8"?>
<s:schema xmlns:s="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
    <s:complexType name="Schema2">
    <s:sequence>
        <s:element minOccurs="0" name="Results" type="ArrayOfSchema2Result"/>
    </s:sequence>
</s:complexType>
<s:complexType name="ArrayOfSchema2Result">
    <s:sequence>
        <s:element maxOccurs="unbounded" minOccurs="0" name="Schema2Result" nillable="true" type="Schema2Result"/>
    </s:sequence>
</s:complexType>
<s:complexType name="Schema2Result">
    <s:sequence>
        <s:element minOccurs="0" name="Home-Address" type="Address"/>
        <s:element minOccurs="0" name="Office-Address" type="Address"/>
        <s:element minOccurs="0" name="Person-Name" type="s:string"/>
        <s:element minOccurs="0" name="Person-ID" type="s:long"/>
    </s:sequence>
</s:complexType>
<s:complexType name="Address">
    <s:sequence>
        <s:element minOccurs="0" name="Street">
            <s:simpleType>
                <s:restriction base="s:string">
                    <s:maxLength value="80"/>
                </s:restriction>
            </s:simpleType>
        </s:element>
        <s:element minOccurs="0" name="City">
            <s:simpleType>
                <s:restriction base="s:string">
                    <s:maxLength value="80"/>
                </s:restriction>
            </s:simpleType>
        </s:element>
        <s:element minOccurs="0" name="State">
            <s:simpleType>
                <s:restriction base="s:string">
                    <s:maxLength value="2"/>
                </s:restriction>
            </s:simpleType>
        </s:element>
        <s:element minOccurs="0" name="Zip">
            <s:simpleType>
                <s:restriction base="s:string">
                    <s:maxLength value="5"/>
                </s:restriction>
            </s:simpleType>
        </s:element>
    </s:sequence>
</s:complexType>
</s:schema>