Which Module are the Styles in???

Doubtless I’m the only numpty (old English word 8) ) still working - but I’m taking the opportunity whilst the office is quiet to do some housekeeping in the solution. Look forward to some feedback after Crimbo! :D

I’m reconciling the module structure of our app with the intent of reducing the number of modules. What we have at the moment is historical and we can do it better. So, I was about to reconcile the Global Vars and the Styles and then realised I cant tell which Modules the styles are actually native to the solution???

I’ve realised that the vars are in fact held separately so that’s not a problem, I can reconcile them now - however the styles are held in a resource.

Is there a property to indicate which solution / module a resource is stored in or do I need to delete the module to find out if it stays in the resource file structure?

Hi Ian,

is a numpty related to humpty-dumpty?

I would guess that even if you delete all you modules, the styles will still be in the resources project.
The resources project has a live of its own, and solutions and modules can point to it, but deleting the solutions and modules won’t delete the styles.
Why don’t you use a search in Servoy to check which forms use which styles?

Have a happy one! ;-)

ptalbot:
Hi Ian,
is a numpty related to humpty-dumpty?
Have a happy one! ;-)

Its closely related to Idiot :lol:

Most of my forms use a particular style that came into the system from a module I imported. I need to reconcile that to the main solution so I can remove that module. I have so far recreated a new style and copied the content from the old one - and I’ll replace the ‘style’ in the forms with this new one.

Merry Christmas Patrick - hope the snow is’nt as bad there as it is here! - There again Christmas is all the better with snow IMHO :D

Hi Ian,

You can move the global vars into new modules (I tend to have 1 ‘Model’ (as from MVC) module where I have all my global variables and more).
Just make sure you keep the same UUID’s for these variables (in the source). When you have them referenced like fields they are referenced by UUID.

As for changing modules to a new stylesheet that is fairly easy. Just set the form property “stylesheet” to the new stylesheet name. Just make sure you have the same stylenames in this new stylesheet.

Hope this helps.

Merry Christmas!

ROCLASI:
Hi Ian,

You can move the global vars into new modules (I tend to have 1 ‘Model’ (as from MVC) module where I have all my global variables and more).
Just make sure you keep the same UUID’s for these variables (in the source). When you have them referenced like fields they are referenced by UUID.

As for changing modules to a new stylesheet that is fairly easy. Just set the form property “stylesheet” to the new stylesheet name. Just make sure you have the same stylenames in this new stylesheet.

Hope this helps.

Merry Christmas!

Merry Christmas Robert - I’m just back from the Family Santa run.

I managed to do the styles transfer without pain (Christmas vino probably helped on that score :wink: ) however your comment on moving the vars is very timely.

Are you suggesting I simply copy the var - including the UUID comments - and paste them into the new module? Or is there a better way.

I’m surprised to learn that they are referenced by UUID - thats a real gotcha if I’d simply recreated them in the other module!

Hi Ian,

Kahuna:
Are you suggesting I simply copy the var - including the UUID comments - and paste them into the new module? Or is there a better way.

Yes, copy the variables AND their UUID info. But I am not sure if you can simply copy/paste them into another module. For instance, when you save the new .js file then the old .js file needs to have the old vars removed and saved before you save the new one to make sure Servoy won’t assign new UUID’s.
In fact I think I would use an external editor like BBEdit on the Mac (I am sure there are very capable editors on Windows as well) and edit the .js files that way. This way you don’t have to worry about the above scenario.
And when you launch Servoy it will tell you if you forgot to remove the old vars because you will have duplicate UUID’s :) .

Kahuna:
I’m surprised to learn that they are referenced by UUID - thats a real gotcha if I’d simply recreated them in the other module!

Like all objects in Servoy that are referenced in forms/form elements/relations/etc. are referenced by their UUID. Only the code in methods will reference objects by name.
The only exception I am aware of are the styles, these are referenced by name.

Great feedback thanks Robert - I’ll use an external editor.

Just to be clear my process is:

  1. Copy the Globals to transfer to External Editor.
  2. Delete the Globals from Servoy and Save the deprecated module globals.js
  3. Paste from the External Editor to current globals.js the globals and save.

Sounds reasonable - which means I’ll prolly find some way to screw it up :oops: LOL

ian

Hi Ian,

Kahuna:

  1. Copy the Globals to transfer to External Editor.
  2. Delete the Globals from Servoy and Save the deprecated module globals.js
  3. Paste from the External Editor to current globals.js the globals and save.

I would actually do all 3 steps in the external editor.
But your process works too I guess :)

And before you do anything, close Servoy and duplicate your workspace directory. When you screw up just delete the workspace and rename the duplicate one.