Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF Parsley » CDO View with Branching
CDO View with Branching [message #1852745] Thu, 02 June 2022 16:16 Go to next message
Claas Ziemke is currently offline Claas ZiemkeFriend
Messages: 2
Registered: June 2022
Junior Member
Hello,

I have an EMF based project in which i am storing my EMF model in CDO in order to allow branching. I have to actively maintain different branches. Until now i have not implemented this feature in my Parsley based UI.

I have implemented a AuthenticatedCDOSessionManager which extends CDOSessionManager in order to allow me to use the CDO Authentication mechanism (the Parsley example does not support Authentication). This works flawlessly.

Now the idea was to also implement a BranchCDOResourceLoader which extends ResourceLoader. This also kind of works, as i can fetch the branch ID from a preference store during startup, and open a transaction with the correct branch. This mechanism however does not allow me to easily switch between the CDO branches without restarting Eclipse.

What is the correct way to trigger a reloading of the Parsley based View that also reloads the CDO Resource/Transaction?

Thanks in Advance!
Re: CDO View with Branching [message #1852819 is a reply to message #1852745] Mon, 06 June 2022 11:37 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
Hi

currently, in Parsley there's no such an automatic mechanism to deal with transactions in general on resources.


Re: CDO View with Branching [message #1852849 is a reply to message #1852745] Tue, 07 June 2022 15:52 Go to previous message
Claas Ziemke is currently offline Claas ZiemkeFriend
Messages: 2
Registered: June 2022
Junior Member
Dear Lorenzo,

thanks for the quick reply, i think this would be a really usefull feature for many Parsley users, What I have done as a workaround/hack:

1. Implemeted a "BranchCDOResourceLoader", basically the same as the CDOResourceLoader but:

private CDOTransaction openTransaction(URI resourceURI){

Net4jUtil.prepareContainer(IPluginContainer.INSTANCE);
TCPUtil.prepareContainer(IPluginContainer.INSTANCE);

CDOURIData data = CDOURIData.parse(resourceURI);

String server = data.getServer();
String repository = data.getRepository();

CDOSession cdoSession = sessionManager.getSession(server,repository);

CDOTransaction transaction = cdoSession.openTransaction();
transaction.options().addChangeSubscriptionPolicy(CDOAdapterPolicy.ALL);

CDOBranchManager branchManager = cdoSession.getBranchManager();
transaction.setBranch(branchManager.getBranch(branchId));

return transaction;
}

2. Implemented a "BranchView" that shows all CDO branches and on double-click: Sets the "branchId" of the "BranchCDOResourceLoader", programatically closes the transaction, closes all Parsley Views, reopens all Parsley views.

This is quite an ugly workaround IMHO but it does what i need...

Hope this helps someone!
Previous Topic:Customize default SaveableTreeView edit action
Next Topic:[CDO] conflict merge
Goto Forum:
  


Current Time: Fri Apr 26 23:12:47 GMT 2024

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

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

Back to the top