TIP: Team Support basics

Eclipse offers Team Support. Team Support is the Eclipse way to allow multiple developers to work on the same project. Each developer works on a local copy of code in the so-called workspace and “syncs” his/her changes back to a central repository. Such a repository can be a SVN, a CVS or a Servoy Repository.

To do the syncing of your local copy to the centralized Repository, you need a Team Provider in Eclipse. Each type of central repository has it’s own implementation of a Team Provider:

  • for CVS: built into Eclipse
  • for SVN: Subversive, Subclipse (See: viewtopic.php?f=38&t=11052)
  • for Servoy Repository: Servoy Team Provider (comes with Servoy in Eclipse (aka “Serclipse”))

The typical LifeCycle of a Solution using a Team Provider is the following:
For a New Solution:
A1- Create new solution in Serclipse: the solution will live only in your local workspace
A2- Share the solution with a central repository: A solution can be shared (=linked) to only 1 central repository. Once connected to a repository, you can always unshare again, if needed.
A3- Commit the solution: since it’s the first commit of a new solution, you commit everything
A4- Continue development
A5- from here, the lifecycle continues below at B3

Existing solution in Repository:
B1- Checkout solution from Repository into your local workspace
B2- Continue development locally.
B3- Call synchronize to see differences between local copy and Repository (other developers might have committed changes to the central repository since you checked out the solution)
B4a- Update to get all non conflicting changes from the Repository into your local workspace
B4b- If there are conflicts:

  • Overwrite: to copy the version of the Repository over to your local workspace, overwriting your local version
  • Merge: to copy the Repository version of the code for one conflict over to your local environment, overwriting just that one conflict
  • Mark as Merged: to manually mark the entire local copy as merged with the repository version. When you have called this on a local file, you basically mark the local file as leading and when you then commit the local version, it will disregard conflicts and update the Repository version, overwritting the changes other developers have did in the repositoryB5- Commit to push all local changes to the Repository
    B6- Continue development locally and the lifecycle continues at B3
    [/list:u]

Two statements to make things crystal clear:- The only thing to ever update the Repository (either SVN/CVS/Servoy) from Eclipse is a commit command. All other actions do NOT update the Repository.

  • When synchronizing, conflicts only arise when the central repository was updated by another developer since the last time you have been in sync with the Repository

Servoy and Team Support:
In Eclipse, you work on projects. In Servoy terms you work on Solutions, which can be modules. When using Serclipse an Eclipse project equals a Servoy solution. Besides that, there is also a Resource Project in Serclipse, that contains all info not related to a specific Servoy Solution, but more to a development server (can be localhost).

Resource projects:
A Resources project is a project in Eclipse in which all information is stored that is not specific to a particular Servoy Solution/Module, so for example info on columns of tables, Security info (groups, users and security settings on table level) and StyleSheets

Natures:
For projects in Eclipse to be recognized as a solution or module by Serclipse, the project needs to have a “Servoy solution” nature. When you create a new Solution through Serclipse or checkout a Solution from the Servoy Repository, this behavior gets added automatically. The behavior is stored in the (hidden) .project file on each project in Eclipse. Also see the note under “Using SVN/CVS/Other, instead of Servoy Repository Team provider“

For projects in Eclipse to be recognized as a Servoy Resources project, the project needs to have a “Servoy Resources” nature. When you create a new Solution through Serclipse or checkout a Solution from the Servoy Repository, the Resources project is automatically created/checked out as well and this behavior gets added automatically. The behavior is stored in the (hidden) .project file on each project in Eclipse. Also see the note under “Using SVN/CVS/Other, instead of Servoy Repository Team provider“

Servoy Team Provider:
The Servoy Team Provider is designed to work specifically with Serclipse and offers some features that other Team Providers do not offer:- The Servoy Team Provider automatically takes into account modules of a Solution when performing Team actions like syncronize/commit/update

  • The Servoy Team Provider automatically takes into account the Resources project of a Solution when performing Team actions like syncronize/commit/update
  • The Servoy Team Provider automatically updates the Resources project when you check out a solution/module from the Servoy Repository.
    The Servoy Team Provider has some settings, accessible under window – Preferences – Team – Servoy Team Provider to disable/enable the behaviors described above.- “When synchronize/commit/update solution, also do it on resources”: By default, this flag is on and therefore, the Resources project stays in sync. When not working on the datamodel, security or styles, you can turn off this flag for quicker Team Support actions
  • “When synchronize/commit/update solution, also do it on Modules”: By default, this flag is on. You can uncheck this option if you want to work on a specific solution only, not taking it’s modules into account.
  • “When checkout solution, also update resources”: Speaks for itself, based on explanation on the previous item

Using the Servoy Repository with the Servoy Team Provider with multiple developers:
The Servoy Repository and Servoy Application Server that are part of your local Servoy Development environment are not suiteable to act as the central repository for team development. To use the Servoy Repository with multiple developers, you need to setup a dedicated Servoy Application Server and set the servoy.application_server.startRepositoryAsTeamProvider property on the Admin pages to “true”.

TIP: set the property to “false” on your local developer: it saves startup time

Using SVN/CVS/Other, instead of Servoy Repository Team provider:
When not using the Servoy Repository as the central repository you both loose and gain functionality and there are a couple of things that you need to take into account:

  • Other team providers than the Servoy Team Provider do not know about the relation between solutions, their modules and the link to the Resources project. Therefor, you as a developer have to manually perform all team actions on each project separately
  • The team providers for SVN and CVS offer rich functionality in the area of maintaining multiple versions and branches of the same solution, with a full history of who changed what when.
  • Make sure .project files are also added to the Repository of your choice, because that stores the Natures attached to projects that Serclipse needs to work properly.
    [/list:u]

Hope this will get you some more insight in team development and that it will jumpstart your development in 4.0.

Regards,

Paul

Excellent post, thanks Paul.

Question: Are there any known issues using a version control system outside of the Eclipse environment? Either using SVN from the command line instead of using Subclipse, or using another system entirely?

I’ve been using Git locally in my workspace, and have not yet run into any issues – but, I also haven’t started using it with any large solutions.

greg.

Question: Are there any known issues using a version control system outside of the Eclipse environment? Either using SVN from the command line instead of using Subclipse, or using another system entirely?

May I counter this question, why would you use any other tool that is outside Eclipse?
What would be your benefit?

Well, here’s a good place to start: http://git.or.cz/gitwiki/GitSvnComparsion

I much prefer Git. I know the tools. I like the distributed nature of it. It’s much more trivial to manage branches, etc., etc…but, it doesn’t integrate with Eclipse at this time.

It also has very easy to use hooks for things like automatically committing the resource project and modules on a project, if you want to…and, once you start using GitNub (http://github.com/Caged/gitnub/wikis) and GitK (http://lwn.net/Articles/140350/) it’s hard to go back to SVN.

It’s just a personal preference…and, yes, I’m a weirdo. I’m sure I’ll be the only person out there using this setup. :-)

greg.

Greg, I sure did not want to suggest you are a weirdo. Maybe I say otherwise when we met :)
I was simply intested to understand what I might miss…

Hi Greg,

No, as far as I know there are no known issues when using a version control system outside of the Eclipse environment.

Basically, a workspace is just a directory structure with files in it, whether is be a Servoy solution, a Java project or anything else. So, any version control system that can work with directories and files would work, I’d say.

Paul

Using a version control system outside of the Eclipse environment is OK, but in case you change files outside eclipse (for example after update) you might want to do a refresh in Eclipse (either using solution explorer or the navigator view) so that it sees all the changes (Eclipse does not automatically refresh resources changed with an outside tool).

That’s pretty much what I figured. Good tip on the ‘refresh’, however, I’ll keep that in mind.

greg.

Is there anyway to use another port than 1099 for checking in/out in Serclipse ? I wanted to setup a teamserver on a machine that already has port 1099 in use so I changed it in the admin pages. But in Developer I can’t tell it to use another port. Or can I?

Did you try “[host]:[port]” in the connection dialog? I haven’t but that seems like it should work.

Hi Greg,

agiletortoise:
Did you try “[host]:[port]” in the connection dialog? I haven’t but that seems like it should work.

Yes I tried that and the timeout error shows it just adds another port to it.
So you end up with [host]:[port]:1099. :|

Are you in 4.0? Yesterday we couldn’t sync because of port conflict. We ended up going to admin/network page scrolling to the bottom and changing RMI port to 1100 from 1099, then in each developer copy under Window/Preferences/Servoy/Services we changed the RMI ports to 1100. After that we got passed the timeouts and were able to sync to repository again from each machine.

Gary
TMA

Hi Gary,

Yes this is 4.0.1. What I try to do is use a remote teamserver. I can access it through other means but my local Developer still insists on adding the 1099 port.

Hi Robert,

I think this is exactly what Gary was trying to point out.

  1. change teamserver:

going to admin/network page scrolling to the bottom and changing RMI port to 1100 from 1099

  1. change the preferences in eclipse:

in each developer copy under Window/Preferences/Servoy/Services we changed the RMI ports to 1100

I must admit: didn’t try this myself, but I can imagine this is the way it should work…

Good luck!

Hi Marc,

Ah yes, I tried that already and no go. It seems port 1099 is hardcoded in there… :|

Have you made sure it is changing the setting in the servoy.properties file. It should, but you never know. We had a hard coded line referencing port 1100 because of a conflict in our properties file. That line was out of sync with the settings on the admin/network page and the developer copies settings. Once we got everything in sync we could talk to our repository server again, but not until.

It only became a problem in a pre-release build 635.

Gary

Robert

Try putting this line in servoy.properties for your team server:

usedRMIRegistryPort=1234

Rob

Hi Rob,

rgansevles:
Try putting this line in servoy.properties for your team server:

usedRMIRegistryPort=1234

That did the trick, thanks Rob. Seems this particular property is not editable via a GUI ?
Also these settings are not per workspace are they. I would love to simply switch workspaces and use a different Serclipse server and it’s settings. I guess the same goes for the database connections although this is of much less of a concern.

Anyway, I tried to share a solution to my remote serclipse teamserver and it didn’t work. First it tried to share it and didn’t give any messages. Then I commited the solution but that resulted in an error telling me that my user/password was incorrect. Turns out my user settings are completely gone in my teamserver while I had to login with these same credentials into the admin pages 1 minute before :!: .

So I added a user again, added it to the administrators group.
Unshared the solution, shared it again to the teamserver, poof user gone… :evil:

Okay, I added the user again and didn’t unshare the solution. Now I committed the solution and it worked (and my user is still there)

It seems that adding a user into the repository in 4 (and keep it there!) has quite some issues/constraints. First it requires that at least 1 solution is in the repository or it doesn’t hold any users (gave me a lot of headaches before…). But I did that.
But now it seems sharing a solution to the teamserver kills it again.

Anyone else is seeing this ?

Hi Robert,

I’ve seen users dissapear constantly when I first started off using 4.0.
This was to blame on users not being in serclipse (rightclick onthe security-node and select ‘edit users/groups’)
As soon as I created my users there, everything synced with the teamserver and never had the problems again.
So it seems that users created in the admin-pages are not synced so well to developer.

I would love to simply switch workspaces and use a different Serclipse server and it’s settings. I guess the same goes for the database connections although this is of much less of a concern.

You can use about the same trick as before: create a shortcut which executes the following line:

"C:\Program Files\Servoy 4\developer\servoy.exe" -data "<WORKSPACE_LOCATION>" -vmargs -Xms40m -Xmx256m -XX:MaxPermSize=256M -Dproperty-file=<SERVOY_PROPERTIES_FILE>

in the line above, <WORKSPACE_LOCATION> is a full-path to the workspace you’d like to use (please note the quotes around the location). <SERVOY_PROPERTIES_FILE> is the name of the properties file you’d like to use.
I guess you can figure out that the executable location of serclipse maybe different from the one I use…

I work with different settings in the office (local ip adresses, central db server), outside the office (external ip adresses, local db server) and testenvironment (complete local).
This works really great (credits to Paul Bakker, who passed me the trick… )

It’s all back to ‘newbie’ again so it seems. It takes some time to find the ‘new way’ to do your ‘old habits’ ;-)
I hope this can help you getting around some issues.

Hi Marc,

mboegem:
I’ve seen users dissapear constantly when I first started off using 4.0.

Ditto here.

mboegem:
This was to blame on users not being in serclipse (rightclick onthe security-node and select ‘edit users/groups’)
As soon as I created my users there, everything synced with the teamserver and never had the problems again.
So it seems that users created in the admin-pages are not synced so well to developer.

In my case the teamserver was remote and the Developer in question had very little to do with it other then being able to login using a user/password.
Maybe the issues are related. I will file a bug report on this.

mboegem:
You can use about the same trick as before: create a shortcut which executes the following line:

"C:\Program Files\Servoy 4\developer\servoy.exe" -data "<WORKSPACE_LOCATION>" -vmargs -Xms40m -Xmx256m -XX:MaxPermSize=256M -Dproperty-file=<SERVOY_PROPERTIES_FILE>

in the line above, <WORKSPACE_LOCATION> is a full-path to the workspace you’d like to use (please note the quotes around the location). <SERVOY_PROPERTIES_FILE> is the name of the properties file you’d like to use.
I guess you can figure out that the executable location of serclipse maybe different from the one I use…

Nice! On Mac that means you duplicate the Servoy.app, right-click and select ‘Show Package Contents’.
And edit the Servoy.ini in the Contents/MacOS/ directory:

-vmargs
-Xdock:icon=../Resources/serv.icns
-XstartOnFirstThread
-Xms64m
-Xmx384m
-XX:MaxPermSize=256M
-Dosgi.requiredJavaVersion=1.5
-Dorg.eclipse.swt.internal.carbon.smallFonts
-Dservoy.application_server.dir=/Applications/Servoy 4.0.1/application_server
-Dproperty-file=/Path/To/Other/servoy.propertiesfile

Not sure if the -data (workspace) argument is needed since you can easily switch workspaces in Eclipse already.

mboegem:
It’s all back to ‘newbie’ again so it seems. It takes some time to find the ‘new way’ to do your ‘old habits’ ;-)
I hope this can help you getting around some issues.

New features makes us newbies again indeed. Especially with such a big overhaul in Developer with version 4.
Anyway, I dropped the Serclipse teamserver approach and started using the lightweight svnserve server with multiple repositories.