Moving calculations.js files to another module

Questions and answers regarding the use of eclipse environment as seen in Servoy Developer

Moving calculations.js files to another module

Postby gdotzlaw » Mon Aug 03, 2009 9:54 pm

I noticed in one of my modules, mContacts, that calculations had been entered for the [contact] table in two additional modules. This means that there are three contact_calculation.js files, one for each module.

What is the best way to now merge the two other contact_calculation.js files so they are part of the desired contact_calculations.js file in the mContacts module? I would like all the calculations for the mContacts module to be stored there.

In the Resource perspective, I saw I could move the file from the one module to the other, but this overwrites the existing file. I need someway of merging them, even if it means copy & paste the code from the two undesired files into the final one, and deleting the undesired contact_calulation.js files using the Project Explorer.

I am using subversion.
Gary
---------------------------------------------
Dotzlaw Consulting
User avatar
gdotzlaw
 
Posts: 106
Joined: Fri Jul 13, 2007 11:17 pm
Location: Winnipeg, MB, Canada

Re: Moving calculations.js files to another module

Postby gdotzlaw » Mon Aug 03, 2009 10:09 pm

I should add, that my main concern is these calcs are used on forms. So, if they are moved and consolidated into one contact_calculations.js file, I want to make certain that the calc's UUID does not change.
Gary
---------------------------------------------
Dotzlaw Consulting
User avatar
gdotzlaw
 
Posts: 106
Joined: Fri Jul 13, 2007 11:17 pm
Location: Winnipeg, MB, Canada

Re: Moving calculations.js files to another module

Postby lvostinar » Tue Aug 04, 2009 12:19 pm

I think copy&paste will work. Of course, make a backup first. If you would like/need a move functionality for calculations you can add a feature request about this in our support system.
Laurian Vostinar
Servoy
lvostinar
 
Posts: 1062
Joined: Tue Feb 19, 2008 10:53 am

Re: Moving calculations.js files to another module

Postby gdotzlaw » Tue Aug 04, 2009 9:44 pm

Nope, copy and paste did not work. As far as I can tell, the subversion client knows that the .js files have been moved from the one datasource folder to the other, but I don't think the Servoy workspace is updated properly, at least the calc definitions do not appear in the new module they were moved to, even after restart.

Here is what I did:
- Moved the table named folder contianing the calculations.js to the same location in the destination module I want (right-mouse Move)
- Copy & pasted code from one other calculations.js file into the calculations.js file in the destination module
- Deleted the table named folder containing the calculations.js file in the old module (right-mouse Delete)

Then, I opened the table and looked at the calculations tabs. None were now showing (in this test, I was trying to move to calculation.js files into a new module's datasources, so where there were two calculation.js files in two modules, there should have been one calculation.js file in a new module). I restarted and tried looking at the calculations tab again, and still none were showing. I checked at the form level and could see none of the calcs. The destination module used for the test was a submodule for the module containing the forms, so it should have had the calcs accessible from their new location.

Restored all files from subversion.

Entered Move/Merge feature request into the support system.
Gary
---------------------------------------------
Dotzlaw Consulting
User avatar
gdotzlaw
 
Posts: 106
Joined: Fri Jul 13, 2007 11:17 pm
Location: Winnipeg, MB, Canada

Re: Moving calculations.js files to another module

Postby jcompagner » Wed Aug 05, 2009 12:02 am

even if we do this through the ui

then this wouldnt really be way different then cut and paste now calculations from 1 solution to the other.

It will be pretty much the same. The only thing i can think of is that you can (multi) select calculations in a tree (outline view or something)
and then say cut and paste them in another module..
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Moving calculations.js files to another module

Postby gdotzlaw » Wed Aug 05, 2009 1:15 am

Well, I guess my problem was more related to the right-mouse MOVE command. I selected the table folder for a calculation.js file in one module, and moved it to another module, in the same location. Problem is that when I look at the table now, there are no calculations for that table, not even on restart.

I will try creating a new calculation.js file in the destination module, then copy & pasting the code from the others into it, thereby avoiding using the MOVE feature.

Thanks for the reassurance that copy and paste should work.
Gary
---------------------------------------------
Dotzlaw Consulting
User avatar
gdotzlaw
 
Posts: 106
Joined: Fri Jul 13, 2007 11:17 pm
Location: Winnipeg, MB, Canada

Re: Moving calculations.js files to another module

Postby gdotzlaw » Wed Aug 05, 2009 5:18 am

Well, I'm having two problems with the copy and paste approach (ignoring the MOVE which I could not get to work, as Servoy did not recognize the moved datasource folder and calc.js file):

1. I do not know how to create a new datasource folder for a table in a module. I can see that I can create a folder and give it the name of a table, but it does not have the little database icon, so I doubt it really is a datasource folder. Creating a "file" inside the folder and giving it a name of "<<table name>>_calculations.js", doesn't seem to work either. How does one create calc definitions for a table inside a specific module? I must be using the wrong view (Navigator).

2. When I try DELETE to remove the old calc.js file (which is now empty, because I copied and pasted the code to a different calc.js file (which works fine by the way)) and then try a subversion commit, it does not like it and says my version is out of date, refusing to let me commit the deletion. I have to leave the blank file there inorder for subsequent commits to work.

Sorry for being a pain, but its a rather large solution, and a couple of developers defined calcs for one module while working in another, and I need to move them into their proper module so updates can be performed properly in the field later.

Thanks for your patience on this.
Gary
---------------------------------------------
Dotzlaw Consulting
User avatar
gdotzlaw
 
Posts: 106
Joined: Fri Jul 13, 2007 11:17 pm
Location: Winnipeg, MB, Canada

Re: Moving calculations.js files to another module

Postby lvostinar » Wed Aug 05, 2009 9:09 am

Well, I'm having two problems with the copy and paste approach (ignoring the MOVE which I could not get to work, as Servoy did not recognize the moved datasource folder and calc.js file):

1. I do not know how to create a new datasource folder for a table in a module. I can see that I can create a folder and give it the name of a table, but it does not have the little database icon, so I doubt it really is a datasource folder. Creating a "file" inside the folder and giving it a name of "<<table name>>_calculations.js", doesn't seem to work either. How does one create calc definitions for a table inside a specific module? I must be using the wrong view (Navigator).


Just create a dummy calculation for that module, open both calculation files for the two solutions(with standard javascript editor from developer), cut and paste from one file to the other. I made a simple test and seemed to work.

2. When I try DELETE to remove the old calc.js file (which is now empty, because I copied and pasted the code to a different calc.js file (which works fine by the way)) and then try a subversion commit, it does not like it and says my version is out of date, refusing to let me commit the deletion. I have to leave the blank file there inorder for subsequent commits to work.


Not sure what you mean here, you should be able to commit a deleted file. Maybe you have to refresh the workspace if you delete the file outside eclipse.
Laurian Vostinar
Servoy
lvostinar
 
Posts: 1062
Joined: Tue Feb 19, 2008 10:53 am

Re: Moving calculations.js files to another module

Postby jcompagner » Wed Aug 05, 2009 9:42 am

gdotzlaw wrote:2. When I try DELETE to remove the old calc.js file (which is now empty, because I copied and pasted the code to a different calc.js file (which works fine by the way)) and then try a subversion commit, it does not like it and says my version is out of date, refusing to let me commit the deletion. I have to leave the blank file there inorder for subsequent commits to work.


out of date means that you have to do an update command first
Because on the server there is a newer revision somehow then you have
it could be that you then get a conflict that you have to resolve first.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Moving calculations.js files to another module

Postby gdotzlaw » Wed Aug 05, 2009 4:07 pm

Okay, thanks guys, my problem is solved.
Gary
---------------------------------------------
Dotzlaw Consulting
User avatar
gdotzlaw
 
Posts: 106
Joined: Fri Jul 13, 2007 11:17 pm
Location: Winnipeg, MB, Canada

Re: Moving calculations.js files to another module

Postby david » Thu Aug 06, 2009 2:00 pm

If you have your solution structured with a number of modules, you may want to think about putting all of your calculations and relationships in one module by themselves. Include this "resource" module in all of your "workflow" modules.

A nice way to keep a handle on what can easily become quite a large amount of calculations and relationships. No duplicates and easy to expand your solution with another workflow module down the line.
David Workman, Kabootit

Image
Everything you need to build great apps with Servoy
User avatar
david
 
Posts: 1727
Joined: Thu Apr 24, 2003 4:18 pm
Location: Washington, D.C.

Re: Moving calculations.js files to another module

Postby gdotzlaw » Thu Aug 06, 2009 4:15 pm

Exactly what I have. Problem is, I had some help from time to time, and not everyone put the calcs, valuelists, or relationships into the module that holds the "resources". Hence the reason for the instructions on how to move things. I have that all worked out now, and everything is back where it belongs in the one module. Thanks.
Gary
---------------------------------------------
Dotzlaw Consulting
User avatar
gdotzlaw
 
Posts: 106
Joined: Fri Jul 13, 2007 11:17 pm
Location: Winnipeg, MB, Canada


Return to Eclipse Environment

Who is online

Users browsing this forum: No registered users and 5 guests