How do I check the default values?

86 views
Skip to first unread message

Mats Rappe

unread,
Aug 30, 2012, 10:30:20 AM8/30/12
Hi,
I discovered this gem this week and have started experimenting with it.
How do I solve the problem with checking for one of Eclipse default values? If I have found a setting that by default is the way I want to recomend users to have, how do I check if they change it?
 
Kind regards
Mats Rappe

Robert Konigsberg

unread,
Aug 30, 2012, 3:15:58 PM8/30/12
I don't understand what problem you're trying to solve.
--
Robert Konigsberg

Mats Rappe

unread,
Aug 30, 2012, 3:28:29 PM8/30/12
I am trying to implement a test if the default preferences is changed or not. If they are changed, the user should be warned and be able to correct them back to default.

Robert Konigsberg

unread,
Aug 30, 2012, 3:43:18 PM8/30/12

I see. That specifically is not supported. However if you know the default you can specify it explicitly.

Mats Rappe

unread,
Aug 30, 2012, 4:20:08 PM8/30/12
Aha. That is a working solution.
Thank you.

Martin Oberhuber

unread,
May 2, 2013, 9:18:58 AM5/2/13
I think I have a related question:

I'm using Workspace Mechanic for rollout of Eclipse to a large team. There is a number of default Preferences that I want all team members to use. I'm using plugin_customization.ini to set these "silently" by default, along with Workspace Mechanic to check if anybody changes the default after the fact. I have a large list of indiivdual Mechanic tasks for individual Preferences to check, such that people who change a Preference (and see the warning) can understand what they are doing.

Now the problem with this setup is, that people who launch Eclipse for the first time see a very large number of Mechanic warnings, for each and every task - although in reality all of these warnings are bogus since the plugin_custimization,ini already specifies proper defaults. This is confusing and I'd like to avoid it.

Has anybody had this problem before ? - I think what I'd like is the Mechanic checker to only report an error if a Preference _exists_ AND has a value other than what the task says. Preferences which do not exist yet (since a respective plugin has not been activated yet, and thus its PreferenceInitializer has not run) should not be warned about. Preferences which do exist but are set to the default value and the default value is proper should also not be warned. If I'm not mistaken, this is the same request as the original submitter Mats had.

This should be a relatively simple change to the checker, shouldn't it ?
If a solution doesn't exist yet I'd be happy contributing if you give me some minimal advice about the approach (eg should I use meta-tags in the task for the new functionality) and where to change things.

Thanks!
Martin

Robert Konigsberg

unread,
May 2, 2013, 1:06:18 PM5/2/13
Martin, you may be looking for the RECONCILE preference type. [1] Note, though, that RECONCILE tasks could be slower than LASTMOD tasks, especially with such a large number -- so -- profile, please.

--
You received this message because you are subscribed to the Google Groups "Workspace Mechanic for Eclipse" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Martin Oberhuber

unread,
May 4, 2013, 12:58:18 PM5/4/13
Thanks Robert,

I see your point and I think you are right.

I had originally thought about deploying team defaults via LASTMOD and then allowing users to have their own modifications on top of that with RECONCILE. But at least for "important" settings where I need to keep users from shooting themselves we'll need RECONCILE tasks on system level anyways (to revert when they accidentally set the preference; independent of the modification time of the task).

The one thing I don't quite understand at this point is, what happens if multiple tasks have overlapping Preferences. Looks like "fixing" one task might then make another one fail. For example, my team settings define "Refresh on access OFF" but a user knows what he's doing and he sets a private usertask "Refresh on access ON" to share across all his Eclipse instances and workspaces.

Is this something that you have experienced, or that you have heard people discuss and what is the general approach here ?

Many thanks for your input !
Martin

Robert Konigsberg

unread,
May 5, 2013, 5:32:04 AM5/5/13
to workspacemechanic
Yep, that can result in a constant failure state. Generally, I suggest that you try not to use the tool to force preferences on them. Set the preferences using plugin_customization.ini.

[1]  says: "The design philosophy of the Workspace Mechanic has always been one centered around user choice. Users get to choose which changes are made to their workspace, and when they are made. This keeps unnecessary or untimely changes from disrupting hard-at-work engineers."

So if you're looking to force preferences on your users, then a constant state of RECONCILE is not it. Don't forget also that tasks can be ignored, so there's no way to lock teams out of changing them.

Martin Oberhuber

unread,
May 5, 2013, 5:48:14 AM5/5/13
Thanks Robin,

I see your point and in fact the "let users choose" philosophy is what I like best about Workspace Mechanic. Still I'd like to notify users when they (accidentally) change a Preference that is recommended to be set differently; thus I believe that RECONCILE is the right task type for settings that are important for overall system sanity and not just cosmetic. In other words, notify users when they are about to shoot themselves.

Unfortunately - coming back to the original topic of this thread - I've noticed that also RECONCILE tasks don't take default values into account on their "compare" step. So when my task wants /instance/foo=false and that Preference happens not to be set but I have default foo=false via plugin_customization.ini, I still get a workspace mechanic popup.

That seems wrong to me, and I want to change the code to allow a comparison to return "OK" when the desired value is unset but the default is proper. I'm ready to change the code (and potentially contribute), I'm just wondering how to best expose the new functionality ... new task type eg RECONCILE_DEFAULT ? Or a new metadata tag eg @allow_default ? Or simply make the new behavior standard ? - Personally I can't see what would be wrong with making the new behavior the standard, but I wanted to hear your opinion.

Thanks!
Martin

Robert Konigsberg

unread,
May 5, 2013, 5:52:32 AM5/5/13
Martin,

I haven't looked at the code for some time, unfortunately. I'm not sure whether another task type is appropriate. Changing the default behavior may also be acceptable.

Note that Workspace Mechanic is in maintenance mode, and I'll only accept high quality patches with quality tests.
--
Reply all
Reply to author
Forward
0 new messages