migrating to miserver/apl16

MiServer is Dyalog's APL-based web development framework

migrating to miserver/apl16

Postby Gantois on Sun Jul 09, 2017 1:27 pm

Hi,

I- What should I do to use apl16/miserver (downloads / customization)?
My current version is:
Version: 14.1.27360.0 64 Unicode
Created: May 5 2016 at 18:19:18
Build ID: a3f2c7b1

)load mserver
C:\MiServer\mserver.dws saved Tue Jun 07 13:20:42 2016
Start 'Intro' ⍝ Run the MiServer v2.1 sample site
Start 'appu'
MiServer for "appu" started on port: 8088


II- After only apl16 has been downloaded ..... value error (using localhost):
Version: 16.0.30270.0 64 Unicode
Created: Jun 28 2017 at 11:17:14
Build ID: d33b8ab7

)load mserver
C:\MiServer\mserver.dws saved Tue Jun 7 13:20:42 2016
Start 'Intro' ⍝ Run the MiServer v2.1 sample site
Start 'appu'
MiServer for "appu" started on port: 8088
2:VALUE ERROR
HandleRequest[122] res.Bytes←startsize length

Thanks,
Marco
Gantois
 
Posts: 70
Joined: Thu Apr 17, 2014 9:44 am

Re: migrating to miserver/apl16

Postby MBaas on Wed Jul 12, 2017 7:16 am

Hi Marco,

my personal feeling is that it'll be a painful process trying to make this ("MiServer 2.1 & Customizations") run with 16. If possible, I would look at migrating your web-app to MiServer3 first and then switch to 16 which should be smooth. But then I do not know the extent of your customisations etc., so it's hard to give a better reply for your specific case.

Cheers

Michael
User avatar
MBaas
 
Posts: 156
Joined: Thu Oct 16, 2008 1:17 am
Location: Gründau / Germany

Re: migrating to miserver/apl16

Postby woody on Wed Jul 12, 2017 11:12 am

Michael,

I also have several MServer 2.x sites and pages that I'd like to migrate to the new MServer 3.x platform.

Is there a basic "how to upgrade from MS2 to MS3" cheat-sheet somewhere?

Where do we start?

Thanks for the help !
Woodley Butler
Automatonics, Inc.
"Find your head in the APL Cloud"
http://www.APLcloud.com
User avatar
woody
 
Posts: 110
Joined: Tue Dec 28, 2010 12:54 am
Location: Atlanta, Georgia USA

Re: migrating to miserver/apl16

Postby woody on Wed Jul 12, 2017 8:02 pm

Here's a START toward developing a quick MS2 to MS3 migration cheat-sheet.

The TEST URL:
http://gomockup.com/helloworld.dyalog

The TEST MiPage code (MS 2.x):
Code: Select all
:Class helloworld: MiPage

    :Include #.HTMLInput              ⍝ Useful functions for creating HTML pages
   
    ∇ Render req;primer;session;inp;right;html;form;toggle;Data
      :Access Public
 
      DoAction   
    ∇


    ∇ DoAction;html
    html←'hello world from DyalogAPL v15 and MServer v2.4'
     req.Response.(NoWrap HTML)←1 html 
    ∇

:EndClass


Michael,

Please provide the same for MServer 3.x

Thanks!
Woodley Butler
Automatonics, Inc.
"Find your head in the APL Cloud"
http://www.APLcloud.com
User avatar
woody
 
Posts: 110
Joined: Tue Dec 28, 2010 12:54 am
Location: Atlanta, Georgia USA

Re: migrating to miserver/apl16

Postby woody on Wed Jul 12, 2017 8:02 pm

Here's a START toward developing a quick MS2 to MS3 migration cheat-sheet.

The TEST URL:
http://gomockup.com/helloworld.dyalog

The TEST MiPage code (MS 2.x):
Code: Select all
:Class helloworld: MiPage

    :Include #.HTMLInput              ⍝ Useful functions for creating HTML pages
   
    ∇ Render req;primer;session;inp;right;html;form;toggle;Data
      :Access Public
 
      DoAction   
    ∇


    ∇ DoAction;html
    html←'hello world from DyalogAPL v15 and MServer v2.4'
     req.Response.(NoWrap HTML)←1 html 
    ∇

:EndClass


Michael,

Please provide the same for MServer 3.x

Thanks!
Woodley Butler
Automatonics, Inc.
"Find your head in the APL Cloud"
http://www.APLcloud.com
User avatar
woody
 
Posts: 110
Joined: Tue Dec 28, 2010 12:54 am
Location: Atlanta, Georgia USA

Re: migrating to miserver/apl16

Postby MBaas on Wed Jul 12, 2017 9:18 pm

I'm a late starter with MiServer, never worked with MiServer2, so I couldn't start a cheatsheet from a blank page. But this initiave looks like a great idea - let's see how far we can take this! :-)

Code: Select all
:Class helloworld: MiPage

    ⍝:Include #.HTMLInput              ⍝ Useful functions for creating HTML pages
    ⍝ may not be needed any more, let's see...
   
    ∇ Compose
      :Access Public
       ⍝ Render is now called "Compose"!
      DoAction   
    ∇


    ∇ DoAction;html
   ⍝ Add'hello world from DyalogAPL v16 and MServer v3'
   ⍝↑↑ "Add" adds "things" to the composed page. In the simplest case,
   ⍝    you can add straight HTML

  ⍝  Add #._html.p 'hello world from DyalogAPL v16 and MServer v3'
  ⍝ this adds a <p>-Tag containing the "thing" on the right
  ⍝ NB: controls are distributed in the namespaces _html, _DC (Dyalog Controls),
  ⍝     _JQ (jQuery), _JS, JSS and _Sf (Syncfucsion)

    Add _.p 'hello world from DyalogAPL v16 and MServer v3'
   ⍝ "_" serves as a convenient shortcut and saves you from having to know
   ⍝ exactly where the control you're looking for is stored. So this is
   ⍝ the preferred format. 

 
    ∇

:EndClass
User avatar
MBaas
 
Posts: 156
Joined: Thu Oct 16, 2008 1:17 am
Location: Gründau / Germany

Re: migrating to miserver/apl16

Postby MBaas on Thu Jul 13, 2017 7:06 am

Oh, and I forgot to mention: "knowing" to use "p" for a <p>-Tag is nothing mystical, there are 238 controls available and the list as well as documentation for every control can be viewed under miserver.dyalog.com (or if you installed it, on the MS3-Site locally), then goto "Samples" or "Controls" and browse around. And the source for every page is immediately accessible "View APL Code" in top-right corner.
User avatar
MBaas
 
Posts: 156
Joined: Thu Oct 16, 2008 1:17 am
Location: Gründau / Germany

Re: migrating to miserver/apl16

Postby woody on Thu Jul 13, 2017 4:28 pm

Very cool, Michael!

I downloaded MiServer 3 (MS3) from GetHub, and installed it in just a few minutes (great).

I am going to "convert" a few of my current MiServer 2.0 pages to the new MS3 format.

I see the page name has changed.. so page.dyalog now becomes page.mipage

And, the leading function has changed (as you pointed out).

Can you please explain these top level folders I see under MS3 ?

Which ones are KEY to running MS3 ... and which ones are applications or sub-folders that hold applications?

Thanks for the help!!!

//W

MS3-Folders.PNG
Woodley Butler
Automatonics, Inc.
"Find your head in the APL Cloud"
http://www.APLcloud.com
User avatar
woody
 
Posts: 110
Joined: Tue Dec 28, 2010 12:54 am
Location: Atlanta, Georgia USA

Re: migrating to miserver/apl16

Postby woody on Thu Jul 13, 2017 4:35 pm

Michael and Marco,

I spotted this special MS3/MS2 folder...

When I start MS3 ... and use this folder path:

Start './SampleMiSites/MS2'

I see this MS2 style look running under MS3 !

What is this.. and how do we use it to help migrate our MS2 pages to run under MS3 ?

I will continue to explore and test !

Cheers,

//W

MS3-MS2.PNG
Woodley Butler
Automatonics, Inc.
"Find your head in the APL Cloud"
http://www.APLcloud.com
User avatar
woody
 
Posts: 110
Joined: Tue Dec 28, 2010 12:54 am
Location: Atlanta, Georgia USA

Re: migrating to miserver/apl16

Postby Michael|Dyalog on Thu Jul 13, 2017 5:00 pm

As a general rule of thumb, I would not touch MiServer or anything below it. Personally, I have put MiServer into the root-folder of H:\ and my apps are in h:\MyMiSites - not an overwhelmingly clever name, I admit. But the idea is to keep them apart from each other, so you can update MiServer w/o having to think about your apps - and you can move/update/delete your apps w/o running the risk of accidentally touching anything in MiServer's engine.

Below MiServer, you have: (key-folders that are required are in bold)
  • COMMONPAGES - 404-pages etc.
  • CONFIG- guess what ;-) XML-Configuration-Files. You can also create a Config-Folder as a subfolder of your web-app-folder and it will take precendence over the defaults from MiServers folder.
  • CORE - contains some essential classes
  • DOCUMENTATION SOURCES - WYWIWYG
  • EXTENSIONS - additional classes, less "cory" than CORE
  • HTML - the various "widgets" that can be Added to a .mipage, further distributed among 4 subfolders
  • PLUGINS - holds the .JS/.CSS-Sources of various widgets. Typically, these folders are mapped (through CONFIG\Virtual.xml) to virtual folders, so that a website can reference them.
  • QA - QA-Scripts. (In general, QA for a class will launch a demo-page for that class and
  • SAMPLEMISITES - as you noticed, there is something for the MS2-Users. MS3-Folder has all
    the samples, so this is useful stuff to explore! And STARTERMISITE could be copied into the separate path for your apps (as discussed above) and be filled with the content of your site.
  • UTILS - again, various utilities. These will be auto-loaded on start of MiServer and be available for your code. The {MyApp}\CODE-Folder servers a similar purpose: all .dyalog-files there will be brought into the WS when the app starts, so you can store general tools there.
Michael|Dyalog
 
Posts: 12
Joined: Thu Mar 02, 2017 4:29 pm

Next

Return to MiServer

Who is online

Users browsing this forum: No registered users and 1 guest