Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Comment message for CDO(CDO Commit)
Comment message for CDO [message #1841315] Wed, 12 May 2021 05:11 Go to next message
Karelun Huang is currently offline Karelun HuangFriend
Messages: 1
Registered: May 2021
Junior Member
There is no user interface for writing down the commit message before the transaction was committed , and I think this feature is so useful,
Like SVN or GIT, before committing you can write down the commit message。
Could be added this feature in the future version?
Re: Comment message for CDO [message #1841429 is a reply to message #1841315] Sun, 16 May 2021 10:50 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6681
Registered: July 2009
Senior Member
I've implemented a CDOCommitCommentPrompter now, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=573563 and https://bugs.eclipse.org/bugs/show_bug.cgi?id=573562

To automatically create and use an instance during CDOUtil.configureView() you need to implement a custom CDOViewConfigurator:

	public class CheckoutViewConfigurator implements CDOViewConfigurator
	{
		@Override
		public void configureView(CDOView view)
		{
			view.options().setLockNotificationEnabled(true);

			if (view instanceof CDOTransaction)
			{
				new CDOCommitCommentPrompter((CDOTransaction)view);
			}
		}

		public static final class Factory extends CDOViewConfigurator.Factory
		{
			public Factory()
			{
				super("checkout");
			}

			@Override
			public CDOViewConfigurator create(String description) throws ProductCreationException
			{
				return new CheckoutViewConfigurator();
			}
		}
	}


The factory must be contributed via your plugin.xml:

	<extension point="org.eclipse.net4j.util.factories">
		<factory
					productGroup="org.eclipse.emf.cdo.viewConfigurators"
					type="checkout"
					class="x.y.z.CheckoutViewConfigurator$Factory"/>
	</extension>


Alternatively register it programmatically soon after startup:

	static
	{
		IPluginContainer.INSTANCE.registerFactory(new CheckoutViewConfigurator.Factory());
	}


The build I20210516-0645 with this new feature should be available soon on the download page: https://www.eclipse.org/cdo/downloads/index.php#integration_weekly

In the future we might provide some UI (a checkbox) in the CDO Explorer to do that automatically...


Previous Topic:[CDO] Updates to model objects creates new table entry instead of incrementing the revision?
Next Topic:[CDO] Facing troubles when trying to use lock mechanism
Goto Forum:
  


Current Time: Sat Nov 11 09:26:26 GMT 2023

Powered by FUDForum. Page generated in 0.01712 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top