SALT

Learning APL or new to Dyalog? Ask "silly" questions here, without fear...

SALT

Postby Jinny on Wed Sep 12, 2018 2:22 pm

Hi there! I'm struggling to bring script files with MiServer page templates in and out of APL and would be very grateful for some advice:

]LOAD 'c:\MyMiSite\index.mipage'
*** Could not bring in : DOMAIN ERROR There were errors processing the script

Status:
line(0,18) : error AC0528: only interfaces can be declared after the base class " :Class index : MiPageTemplate"
Jinny
 
Posts: 31
Joined: Sun Jul 01, 2018 10:15 am

Re: SALT

Postby Brian|Dyalog on Thu Sep 13, 2018 3:08 pm

Hi Jinny,

Thanks for using MiServer and your question!

First, I'll give you a a bit of background about what causes the behavior...
MiServer uses classes to implement many of its features. Some of those classes are based on lower level classes. Prior to Dyalog v17.0, those lower level classes needed to be present in order to load (and then edit) the higher level classes. For instance, your index.mipage looks like it's based on the class MiPageTemplate, which is (I'm guessing) based on the MiPage class which is based on the HtmlPage class which ultimately is based on the HtmlElement class.

If you're running Dyalog v17.0, you can use ⎕FIX to bring in the code and then edit it. (⎕FIX requires the 'file://' prefix to load code from a file)
      ⎕FIX 'file://c:\MyMiSite\index.mipage'
)ed index

There are a couple other ways to bring in the script files that will work with Dyalog v17.0 and earlier versions, and they depend on whether you're actually running MiServer in the workspace at the time.

If MiServer is not currently running, you can load the MiServer development environment and any templates or other code in your MiSite by using the Load function in the MiServer workspace:
      Load 'c:\MyMiSite\'

That will bring in all the necessary classes/templates so that you can then load and edit your MiPage.
      ]load c:\MyMiSite\index.mipage
)ed index

If MiServer is currently running AND you've opened index.mipage (the default homepage) in a browser, then the page is located in #.Pages and you can edit it using
      )ed #.Pages.index

I hope this helps!
/Brian
User avatar
Brian|Dyalog
 
Posts: 116
Joined: Thu Nov 26, 2009 4:02 pm
Location: West Henrietta, NY

Re: SALT

Postby Jinny on Thu Sep 13, 2018 8:09 pm

Hi Brian,

Thank you for your detailed reply - it gave me lots to try but sadly none of it has worked.
I am getting the same problem whether I use ⎕FIX or ]Load. ('Load' simply fails to find my scripted files at all)

It is occurring when I try to import scripted files (containing classes) for provided examples of web pages (eg MyMiSite\Corporate.mipage) or if I try to ]SAVE this file described at the start of the MiServer manual:

:Class helloworld : MildPage
∇ Render req
:Access Public
req.Return '<h1>Hello World!</h1>'

:EndClass


The error refers to the fact that 'only interfaces can be declared after the base class'.

I can import and export (]LOAD and ]SAVE) scripted files that do not specify a template on their header line. I cannot do anythings with scripted files that have a template as above.

Maybe templates are declared in a different position nowadays?

With best wishes, Jinny
Jinny
 
Posts: 31
Joined: Sun Jul 01, 2018 10:15 am

Re: SALT

Postby Brian|Dyalog on Fri Sep 14, 2018 1:36 pm

Hi Jinny,

I think we need to know a bit more about your environment...
  • What version of Dyalog APL are you running?
  • What operating system are you using?
  • Where did you get MiServer from? It looks like you're using MiServer v2; however we introduced MiServer v3 a few years ago. If possible, you should grab the latest MiServer from GitHub at https://github.com/dyalog/miserver/
Thanks!
/Brian
User avatar
Brian|Dyalog
 
Posts: 116
Joined: Thu Nov 26, 2009 4:02 pm
Location: West Henrietta, NY

Re: SALT

Postby Jinny on Wed Sep 19, 2018 1:11 pm

Hi there!

I'm running the following versions:
Dyalog APL/W-64 Version 16.0.30781
Miserver 3.0
Windows 10

Thank you again, Jinny
Jinny
 
Posts: 31
Joined: Sun Jul 01, 2018 10:15 am

Re: SALT

Postby Jinny on Wed Sep 19, 2018 5:22 pm

I'm afraid I've another query...

I've got to grips with the ⎕WC family of commands - very satisfying. However they've suddenly changed into Add _. functions when I look at examples of Miserver sites.

It looks like an APL function but I can't find it in templates/⎕SE/miserver workspace/etc. I can't find it as an HTML command/Javascript/etc. Where does it come from?!?

Thanks!
Jinny
 
Posts: 31
Joined: Sun Jul 01, 2018 10:15 am

Re: SALT

Postby Jinny on Mon Oct 01, 2018 8:59 am

:-(
Jinny
 
Posts: 31
Joined: Sun Jul 01, 2018 10:15 am

Re: SALT

Postby Michael|Dyalog on Mon Oct 01, 2018 9:43 am

Hi Jinny,
sorry your query went unanswered. The MiServer-Content approach to building a page is (historically) a bit different than ⎕WC - but we are trying to move the WC2-Framework a bit, so that changing fro ⎕WC does not get a too foreign experience.
The "_"-namespace has all classes from the #._DC, #._JQ, #._JS and #.SF-namespaces that correspond to the subdirectories of MiServer/HTML. (Their names give a hint about the origin of the various controls: Dyalog Controls, JQuery-widgets, JavaScript-controls and Syncfusion-Controls.)
MiServer.dws when loaded is just a small bootstrap-workspace which loads is functions from the various .dyalog-files that you find in the subdirectories of its "home"-folder. (We tend to move away from using workspaces for distribution of code, these .dyalog-files are plain text-files in Uniocode-format that you can open with any modern editor (outside the dyalog-environment) and that are distributed and version-controlled through GitHub.)
Last edited by Michael|Dyalog on Mon Oct 01, 2018 10:54 am, edited 1 time in total.
Michael|Dyalog
 
Posts: 23
Joined: Thu Mar 02, 2017 4:29 pm

Re: SALT

Postby Michael|Dyalog on Mon Oct 01, 2018 9:48 am

BTW, more about this at the UserMeeting and in workshop SP1 ;-)
Michael|Dyalog
 
Posts: 23
Joined: Thu Mar 02, 2017 4:29 pm

Re: SALT

Postby Jinny on Mon Oct 01, 2018 10:07 am

thank you!
Jinny
 
Posts: 31
Joined: Sun Jul 01, 2018 10:15 am

Next

Return to New to Dyalog?

Who is online

Users browsing this forum: No registered users and 1 guest