ProjectLoaderAPI [ALPHA 0.0.1]

Post your nifty GP projects here!

Moderator: MSandro

Post Reply
MSandro
Posts: 124
Joined: Jul 26th, '17, 21:12

ProjectLoaderAPI [ALPHA 0.0.1]

Post by MSandro » Apr 13th, '18, 16:46

This is the first attempt to create an art API for installing and managing projects, in the future this tool should allow very flexible update functions. Importing sound and images besides GP classes is also planned. At the moment this script only downloads a demo class as installer. This, in turn, would perform the downloading and saving of the required project data through future interfaces from this API.

What makes it possible at the moment?
At the moment the program sequence looks as follows: At first it is checked if the data has already been stored locally. If not, the installation routine is started. This first checks if the server is reachable and tries to locate the installer online. This installer will then be downloaded and imported. Then a defined broadcast is sent to start the installation. In this case, only a green text will be displayed on a black background.

Error and problem:
> Port 100 of the server could be blocked by a firewall
> It is not possible to export this project as an app, otherwise it would be impossible to import classes


I am always open to ideas and suggestions. I have a lot of plans for this project.
Please do not be surprised: Originally, this script was created for my "GP Settings App".
Attachments
ProjectLoaderAPI.gpp
(10.81 KiB) Downloaded 8 times

User avatar
Picochilla
Posts: 18
Joined: Sep 23rd, '17, 17:44

Re: ProjectLoaderAPI [ALPHA 0.0.1]

Post by Picochilla » Apr 17th, '18, 09:09

Seems interesting. It could be very usefull to manage and update projects.
How could I create my own server to provide projects for this API?
I suspect it is an ordinary Apache2?

It would be very usefull if you could find a solution to use it in a exported app.

MSandro
Posts: 124
Joined: Jul 26th, '17, 21:12

Re: ProjectLoaderAPI [ALPHA 0.0.1]

Post by MSandro » Apr 22nd, '18, 15:46

I've found a solution (it's more like a work-around): I had to change some code in the AppMaker Class:

Code: Select all

method startupFile AppMaker {
  return '
to startup {
  setGlobal ''vectorTrails'' false
  openProjectEditorApp
}
'
}

to openProjectEditorApp {
  tryRetina = true
  devMode = false 
  setGlobal 'alanMode' false
  setGlobal 'vectorTrails' false
  if (and ('Browser' == (platform)) (browserIsMobile)) {
	page = (newPage 1024 640)
  } else {
	page = (newPage 1120 700)
  }
  setDevMode page devMode
  setGlobal 'page' page
  open page tryRetina
  editor = (initialize (new 'ProjectEditor') (emptyProject))
  addPart page editor
  if (notNil (global 'initialProject')) {
	dataAndURL = (global 'initialProject')
  	openProject editor (first dataAndURL) (last dataAndURL)
  }
  pageResized editor
  developerModeChanged editor
  enterPresentation editor
  openProjectFromFile (last (allInstances 'Stage')) 'project.gpp'
  startSteppingSafely page true
  broadcast 'go'
}
I've created my own "openProjectEditorApp" to open the project in the exported app and broadcast "go".
Because I'm using classes of the Stage, the API's code can not be edited. But the imported classes. I am currently not sure if it is posible to prevent the user from accessing the ProjectEditor.

I am working on a solution.

Here is my AppMaker class:
Attachments
AppMaker.gp
(5.7 KiB) Downloaded 6 times

Post Reply