Robert Cemper · Mar 31, 2018 go to post

There is no default %PCL.int as mnemonics for PCL printing in Caché.
So according to the link

http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GIOD_intro#GIOD_intro_definemnemomic

you have to write it yourself.

But before this interesting exercise find a document on the control codes for your "low-end HP laser printer and a Brother laser"

Your description is just to vague to google for it. you depend on the type an level of PCL.
I tried and got 2.46 million hits on bold printing for Brother Laser.
This one looked useful but I didn't read all 531 pages and I don't know your printer version.
https://www.brother.com.au/pdf/support/controlcodes/PCL_Tech_Manual.pdf

This looked most useful:

5.2.11. Selecting the stroke weight
Esc(s#B (27)(40)(115)#(66) <1Bh><28h><73h>#<42h>
 This command designates the stroke weight of the primary font.
Esc)s#B (27)(41)(115)#(66) <1Bh><29h><73h>#<42h>
 This command designates the stroke weight of the secondary font
 # is an integer between –7 and 7. A value of 0 signifies a medium stroke weight, negative numbers signify
thin or light stroke weights and positive numbers signify bold stroke weights.
 If you select a light or bold stroke weight the command will only have an effect if the font is available in one of the three font locations.

that means you should try first if your printer is covered:

set bold1on=$c(27,40,115)_7_$c(66)
set bold2on=$c(27,41,115)_7_$c(66)
set bold1off=$c(27,40,115)_0_$c(66)
set bold2off=$c(27,41,115)_0_$c(66)
;; let's test it

open prt use prt  write #
     
write !,"test1 " , bold1on, "text with bold1on ", bold1off, "text with bold1off",!
     write !,"test2 " , bold2on, "text with bold2on ", bold2off, "text with bold12off",!

write # close prt

from the description, it is not clear if 7 and 0 are characters or if this are binaries.
you may need to replace it with $c(7) and $c(0). 
once you know the codes you may decide how to make use of it. 
 

Robert Cemper · Mar 21, 2018 go to post

ok

• property Identifier as %String [ Calculated,Transient,ReadOnly ];
http://docs.intersystems.com/latest/csp/documatic/%25CSP.Documatic.cls?PAGE=CLASS&LIBRARY=ENSLIB&CLASSNAME=EnsLib.HL7.Message#PROPERTY_Identifier

Unique document identification string found at MSH:10 / MessageControlId in document content

You can't set it. It gets calculated and is ReadOnly.

Following http://docs.intersystems.com/latest/csp/documatic/%25CSP.Documatic.cls?PAGE=CLASS&LIBRARY=ENSLIB&CLASSNAME=EnsLib.HL7.Message
you should probably start  with

     set Set HL7Msg=##class(EnsLib.HL7.Message).%New()
 and start to compose the message accordingly.

Robert Cemper · Mar 20, 2018 go to post

OPEN and USE do not consume an additional  license / license slot

Out of a running job you consume an additional license slot only by a JOB command.

Robert Cemper · Mar 19, 2018 go to post

If you didn't correct the other 2 mistakes it's no surprise.

The code should look like this:

 set tSC=$$$OK
 set ^tvalue=1
 set ^tvalue=$INCREMENT(^tvalue)
 
    #dim rs as EnsLib.SQL.GatewayResultSet
    #dim reStream as %Stream.GlobalCharacter
    if $$$ISERR(pRequest) quit pRequest
    set sc=..Adapter.ExecuteQuery(.rs,..GetTheSubmissionData(pRequest.pMonth, pRequest.pApp, pRequest.pRef, pRequest.pInPat))
   
    if $$$ISERR(sc) quit sc
  
   
set reStream=##class(%Stream.GlobalCharacter).%New()
    while rs.Next() {
        set (comma,rec)=""
        for i=1:1:rs.GetColumnCount() {
            set rec=rec_comma_""""_rs.GetData(i)_""""
            set comma=","   
        }
     ;;   set reStream=""   ;; dont kill your stream before using !!! OMG
        set sc=reStream.WriteLine(rec)
        
    }
    do reStream.%Save()

     ;; sc doesn't reflect if there is a content in reStream. check Size instead
   set sc=''reStream.Size

       
       if ($$$ISOK(sc))set pResponse.pReqDetails=reStream
           set reStream=""
        
else {$$$TRACE("There is nothing on the stream")
    
     set tSC=pResponse.%Save()
      
 set tSC=..SendRequestSync(..TargetConfigNames,pResponse,.pOutput)
 Quit tSC

 
Robert Cemper · Mar 16, 2018 go to post

I just can detect.

#dim reStream as %Stream.GlobalCharacter

in your code but nowhere

   set reStream=##class(%Stream.GlobalCharacter).%New()
 

or similar. So no Object.

Robert Cemper · Mar 16, 2018 go to post

Checking some hints for  SMTP.office365.com
https://answers.microsoft.com/en-us/msoffice/forum/msoffice_o365admin-mso_dep365/smtpoffice365com-relay-535-573-authentication/9de8d176-1c07-4e66-b14f-148d3bd51bbf

I see that the require SSL/TLS encryption.

In your code I miss
     Set server.SSLConfiguration = "whatever you named it

This might most likely cause the problem.
 

In anticipation of your next post:  How to setup SSL/TLS configuration.
http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GCAS_ssltls#GCAS_ssltls_createedit
 

Robert Cemper · Mar 16, 2018 go to post

It's indeed incredible simple. You just have to bend your fingers a little bit.
And virtual namespace %ALL allows even to have your own "SYSLIB" like behavior with common code.

Robert Cemper · Mar 15, 2018 go to post

resolving the dependencies in the correct order.

That's probably the weakest spot and requires often manual intervention.

Robert Cemper · Mar 15, 2018 go to post

If DATA and CODE are separated then taking over CACHE.DAT from a final test environment could be an option.

But as the default for a namespace is DATA+CODE  and this is widely spread also in large applications in
real environments recompiling is the only possibility. Many years back even a special change was implemented in
Caché to support compiling during runtime of the code.
I personally dislike both and fought for clear separation of CODE from DATA. With very limited success.sad

Robert Cemper · Mar 13, 2018 go to post

I Googled just a few notes:
GE Healthcare to Acquire IDX Systems Corporation  (2005)
https://www.businesswire.com/news/home/20050929005340/en/GE-Healthcare-Acquire-IDX-Systems-Corporation-Significantly

and  wiki tells me it runs on Caché:
https://en.wikipedia.org/wiki/IDX_Systems

But this doesn't tell us how it communicates with users and external devices.
Caché is definitely not blocking a move to Linux. 
C++ based connections may prevent it if you don't have the sources and a lot of experience to test and debug it.
Eventually, other members of the developers' society have more detailed insight.

But I think GE should know it.

Robert Cemper · Mar 13, 2018 go to post

you code is missing the final  Quit result
to satisfy the

     Set tSC=..CheckRequests(.pRequest,.pResponse)

so you return nothing  or the code you showed to us is incomplete

I also miss the closing  }  of WHILE  in your snippet.

If you have no return value write instead 
    DO ..CheckRequests(.pRequest,.pResponse)

Robert Cemper · Mar 13, 2018 go to post

What about a helper classmethod if the expected result is a string

Classmethod DumpHelper(call as %String ) {

   write @call,!

  quit

Robert Cemper · Mar 12, 2018 go to post

do you look for $System.Util.CreateGUID() ?
http://docs.intersystems.com/latest/csp/documatic/%25CSP.Documatic.cls?PAGE=CLASS&LIBRARY=%25SYS&CLASSNAME=%25SYSTEM.Util#METHOD_CreateGUID

Property myguid As %GUID Required ];

Will not work as %Lbrary.GUID is an abstract utility class and does not extend %DataType.  So it is no DataType and has no Accessors!
http://docs.intersystems.com/latest/csp/documatic/%25CSP.Documatic.cls?PAGE=CLASS&LIBRARY=%25SYS&CLASSNAME=%25Library.GUID

use instead.:

Property myguid As  %String  [Required];

and

S obj.myguid = $System. Util.CreateGUID()

But you are free to define your own data type combining %String and %GUID

Robert Cemper · Mar 9, 2018 go to post

there is an external config file in %cacheroot%/cache.cpf 
that holds your configuration. It is loaded at startup.
You can verify it with any text editor and check especially directories. of your DBs
And you see also NAMESPACE definitions.

The important part is at the beginning.

[ConfigFile]
Version=2017.226
[Databases]
CACHESYS=C:\InterSystems\17E20\mgr\
CACHELIB=C:\InterSystems\17E20\mgr\cachelib\
CACHETEMP=C:\InterSystems\17E20\mgr\cachetemp\
CACHE=C:\InterSystems\17E20\mgr\cache\
CACHEAUDIT=C:\InterSystems\17E20\mgr\cacheaudit\
BLOCKS=C:\opt\blocks\data\
DOCBOOK=C:\InterSystems\17E20\mgr\docbook\
ENSDEMO=C:\InterSystems\17E20\mgr\ensdemo\
ENSEMBLE=C:\InterSystems\17E20\mgr\ensemble\
ENSEMBLEENSTEMP=C:\InterSystems\17E20\mgr\ensemble\ensembleenstemp\
ENSEMBLESECONDARY=C:\InterSystems\17E20\mgr\ensemble\ensemblesecondary\
ENSLIB=C:\InterSystems\17E20\mgr\enslib\
SAMPLES=C:\InterSystems\17E20\mgr\samples\
TEST=C:\opt\blocks\test\
USER=C:\InterSystems\17E20\mgr\user\
[Namespaces]
%SYS=CACHESYS
BLOCKS=BLOCKS
DOCBOOK=DOCBOOK
ENSDEMO=ENSDEMO
ENSEMBLE=ENSEMBLE
SAMPLES=SAMPLES
USER=USER

 
Robert Cemper · Mar 8, 2018 go to post

IF you did a Restore of "%SYS" DB  (.../mgr/CACHE.DAT)
then you may have destroyed essential instance specific installation information
Go back and do a fresh install. And don't touch %SYS during restore.

Robert Cemper · Mar 8, 2018 go to post

IF it was really only permissions you could run ^SECURITY from terminal prompt

USER>zn "%SYS"
%SYS>d ^SECURITY
1) User setup
2) Role setup
3) Service setup
4) Resource setup
5) Application setup
6) Auditing setup
7) Domain setup
8) SSL configuration setup
9) Mobile phone service provider setup
10) OpenAM Identity Services setup
11) Encryption key setup
12) System parameter setup
13) X509 User setup
14) Exit
 
Option? 1
1) Create user
2) Edit user
3) List users
4) Detailed list users
5) Delete user
6) Export users
7) Import users
8) Exit
 
or   Option? 2
1) Create role
2) Edit role
3) List roles
4) Detailed list roles
5) Delete role
6) Export roles
7) Import roles
8) Exit
 
or   Option? 3
1) Edit service
2) List services
3) Detailed list services
4) Export services
5) Import services
6) Exit
 
Option? 4
Export which services? * => *
Export to file name ServicesExport.xml =>
and so on...

and Import on your test server .....
But take care how you handle external connections! 

Robert Cemper · Mar 8, 2018 go to post

backups typically backup a DB in  Cachè but never a full installation. (e.g ref to registry and similar)
Do a fresh installation and next move / restore your DB

Robert Cemper · Mar 8, 2018 go to post

Thanks Vitaly!

My almost first task when I joined ISC was to translate a CSP training developed by "Salva" Jose-Tomas Salvador
from Spanish to German and English.
So I have very personal feelings about this subject.

Robert Cemper · Mar 7, 2018 go to post

Customizing DashboardViewer may take a lot of time for testing with questionable success.

Alternate approach: Trigger your source control manually.

- create a method to export your changes. example:

#; find actual changes
   &SQL(select List(documentname) into :list 
          from  %DeepSee_Dashboard.Definition 
         where timemodified-now()+1>0 )
   set  sc=$system.OBJ.Export(list,"DeepSee.xml")

- next define an Action (in a KPI) that calls you method
http://localhost:57774/csp/docbook/DocBook.UI.Page.cls?KEY=D2IMP_ch_action

- next define a Control "button" to your main Widget and add this Action to activate your source management.
I admit. It's no an automatic & generic solution as directly inside DashboardViewer  (engineering may have a hint howto use it)  
but you get the advantage to decide which dashboard you want to manage and when
since not every change in dashboards may need to go immediately to source control
And it's definitely simpler than to do it our of Studio.

Robert Cemper · Mar 7, 2018 go to post

sorry!

examining the source it turns out that this parameter didn't make it to call parameters (ZENURL) nor to settings.
though I found a bunch of comments  // +DTB103 - source control
with no hint how to use it.
It might be necessary to build a private copy.
Attention on line +7 says:
/// This class should be considered as *internal*; subclassing is not supported. 

Robert Cemper · Mar 7, 2018 go to post

Hi Evgeny,
class %DeepSee.UserPortal.DashboardViewer  has a property saveAction as %ZEN.Datatype.string;

Container for the current save mode for source control.

http://localhost:57774/csp/documatic/%25CSP.Documatic.cls?PAGE=CLASS&LIBRARY=samples&CLASSNAME=%25DeepSee.UserPortal.DashboardViewer#PROPERTY_saveAction

if you combine this with standard $system.OBJ.Export()  this may do it.

SAMPLES>s sc=$system.OBJ.Export("B*.DFI","DeepSee.xml")
 
Exporting to XML started on 03/07/2018 09:36:32
Exporting type : Basic Dashboard Demo.dashboard.DFI
Export finished successfully.
Robert Cemper · Mar 4, 2018 go to post

A good friend of mine provided this solution using also  JSON types and internal $LB() types for more detailed type analysis.
Of course there's no guaranty  for the hidden types in $LB() . 
 

types ; Show COS-Datatypes ; kav ; 2018-03-04
 //
 set obj=##class(Person).%New()
 write "VALUE",?15,"JSON",?22,"$LISTBUILD",! ,$TR($J("",32)," ","-"),!
 for val="453","abcd",1234,"abc"_$c(352), -34, 1.3, -7.9, $double(1.25),obj {
   write val,?15,$$TypeOf1(val),?22,$$TypeOf2(val,.txt),.txt! }
 quit
 // Return JSON datatype by the documented way
 //
TypeOf1(val) Public
{
  quit [(val)].%GetTypeOf(0) }
 // Return datatype by the undocumented $LB() way
 //
TypeOf2(val) Public
 if $length(val)>253
    set typ=$ziswide(val)+1
  else 
    set typ=$a($lb(val),2) }
  set txt=$case(typ
    ,1:" 8bitString"
    ,2:" 16bitString"
    ,4:" nonNegativeInteger"
    ,5:" negativeInteger"
    ,6:" nonNegativeFloat"
    ,7:" negativeFloat"
    ,8:" double"
    , :" ??? never seen before")
 
 quit typ
}
d ^types
VALUE          JSON   $LISTBUILD
--------------------------------
453            string 1 8bitString
abcd           string 1 8bitString
1234           number 4 nonNegativeInteger
abcŠ           string 2 16bitString
-34            number 5 negativeInteger
1.3            number 6 nonNegativeFloat
-7.9           number 7 negativeFloat
1.25           number 8 double
1@User.Person  oref   1 8bitString