Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [EMFForms 1.7] Problem Creating an Editable Form
[EMFForms 1.7] Problem Creating an Editable Form [message #1735236] Thu, 16 June 2016 14:04 Go to next message
Peter Hermsdorf is currently offline Peter HermsdorfFriend
Messages: 44
Registered: August 2011
Member
Hi,

I'm trying to create an EMFForm for the attached model, but serveral things seem to be missing:

1. my view model does not seem to be used by the running application (the plugin with the extension point is in the run config)

2. the displayed form does not include these little "add" and "delete" buttons shown in one of the emfform blog posts to add models at runtime, but there are some link and unlink incons which produce nullpointer exceptions when clicking on them

background:
the approval levels should be pre filled (lets say 3 level) - model instances should be produced via java code.
the emfform should allow to configure each of them with their attributes and assign the corresponding roles.
the available roles are also pre filled by java code.

i thought of a table or a master/detail view for the UI.

I think i've done something seriously wrong. (maybe at design time of the model?)

i'm starting that with:

model = EcoreUtil.create(ApprovalPackage.eINSTANCE.getAvailableApprovalLevels())
render = ECPSWTViewRenderer.INSTANCE.render(parent, model);

thanks for any hints on what could be wrong.


PS: i renamed the model files before upload....
Re: [EMFForms 1.7] Problem Creating an Editable Form [message #1735291 is a reply to message #1735236] Fri, 17 June 2016 06:46 Go to previous messageGo to next message
Peter Hermsdorf is currently offline Peter HermsdorfFriend
Messages: 44
Registered: August 2011
Member
BTW: these are the emfforms related bundles i use in my launch config:

		"org.eclipse.emfforms.common"
		"org.eclipse.emfforms.core.services"
		"org.eclipse.emfforms.core.services.editsupport"
		"org.eclipse.emfforms.core.services.emfspecificservice"
		"org.eclipse.emfforms.localization"
		"org.eclipse.emf.ecp.ui.view.swt"
		"org.eclipse.emfforms.swt.core"
		"org.eclipse.emfforms.swt.core.di"
		"org.eclipse.e4.core.contexts"
		"org.eclipse.e4.core.di"
		"org.eclipse.e4.core.di.annotations"
		"org.eclipse.emf.ecp.core"
		"org.eclipse.emf.ecp.ui"
		"org.eclipse.emf.ecp.ui.view"
		"org.eclipse.emf.ecp.view.validation"
		"org.eclipse.emf.ecp.view.util.swt"
		"org.eclipse.emfforms.swt.core.plugin"
		"org.eclipse.emf.ecp.view.model"
		"org.eclipse.emf.ecp.view.model.common"
		"org.eclipse.emf.ecp.view.context"
		"org.eclipse.emf.ecp.view.core.swt"
		"org.eclipse.emf.ecp.view.template.model"
		"org.eclipse.emf.ecp.view.migrator"
		"org.eclipse.emf.ecp.view.model.provider.xmi"
		"org.eclipse.emf.ecp.view.model.provider.generator"
		"org.eclipse.emf.ecp.view.custom.model"
		"org.eclipse.emf.ecp.view.label.model"
		"org.eclipse.emf.ecp.view.rule.model"
		"org.eclipse.emf.ecp.view.stack.model"
		"org.eclipse.emf.ecp.view.table.model"
		"org.eclipse.emf.ecp.view.treemasterdetail.model"
		"org.eclipse.emf.ecp.view.treemasterdetail.ui.swt"
		 "org.eclipse.emf.ecp.workspace.core"
		"org.eclipse.emfforms.core.services.emf"
		"org.eclipse.emf.ecp.ide.view.service"
		"org.eclipse.core.resources"
		"org.eclipse.emf.ecp.ui.view.editor.controls"
		"org.eclipse.emfforms.core.services.locale.default"
		"org.eclipse.emf.ecp.ide.util"
		"org.eclipse.emf.ecore.edit"
		"org.eclipse.net4j.util"
		"org.eclipse.emf.ecp.view.template.service"
		"org.eclipse.emf.ecp.common"
		"org.eclipse.emf.ecp.common.ui"
		"org.eclipse.emf.ecp.edit"
		"org.eclipse.emf.ecp.edit.swt"
		"org.eclipse.emf.edit"
		"org.eclipse.emf.edit.ui"
		"org.eclipse.emf.ecp.view.swt.layout"
		"org.eclipse.emf.common"
		"org.eclipse.emf.common.ui"
		"org.eclipse.emf.ecore"
		"org.eclipse.emf.ecore.xmi"
		"org.eclipse.emf.databinding"
		"org.eclipse.emf.databinding.edit"
		"org.eclipse.ui.views"
		"org.eclipse.emfforms.core.services.databinding.featurepath"
		"org.eclipse.emfforms.view.model.localization"
		"javax.inject"

Re: [EMFForms 1.7] Problem Creating an Editable Form [message #1735362 is a reply to message #1735291] Fri, 17 June 2016 16:04 Go to previous messageGo to next message
Eugen Neufeld is currently offline Eugen NeufeldFriend
Messages: 174
Registered: May 2015
Senior Member
Hi Peter,

first a question to the used EMFForms version, why don't you use 1.8 oder even better 1.9.0 (part of Neon).

1) As far as I can see you are missing some plugins in you run configuration:
- add everything that has table in its name (especially org.eclipse.emf.ecp.view.table.ui.swt and org.eclipse.emfforms.core.services.databindg.table
- add org.eclipse.emfforms.core.services.emf

2) Can you add a link to the blogpost which shows those buttons?

In your model you use subpackges. Subpackages are eval see: here .
I also don't see the reason for those subpackages, at least not in the provided model.
EMFForms doesn't work with the subpackages. This is the reason, that the view is not loaded.
Otherwise everything should work as you expect it to work, eg the table should show some of the information (like defined in the view model) for each approvallevel.

If your view model is still not used after the removal of the sub packages please also post a console output here.

Cheers,
Eugen


--
Eugen Neufeld

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Re: [EMFForms 1.7] Problem Creating an Editable Form [message #1739204 is a reply to message #1735362] Thu, 28 July 2016 10:30 Go to previous messageGo to next message
Peter Hermsdorf is currently offline Peter HermsdorfFriend
Messages: 44
Registered: August 2011
Member
Hi,

sorry for being late with the reply.

thanks for your suggestions, i'll look at the points you mentioned and report back my result.

the mentioned blogpost is

http://eclipsesource.com/blogs/tutorials/emf-forms-view-model-elements/

and the referenced screenshot is under the "Table Control" headline and in there the last screenshot (little + and - buttons instead of "unlink" etc.)

the usage of subpackages was not by intention - i'll look at that.

Thanks, Bye Peter
Re: [EMFForms 1.7] Problem Creating an Editable Form [message #1739413 is a reply to message #1739204] Mon, 01 August 2016 07:20 Go to previous messageGo to next message
Peter Hermsdorf is currently offline Peter HermsdorfFriend
Messages: 44
Registered: August 2011
Member
i switched to emfforms 1.9

i reviewed my launch configuration, but i can't find the suggested bundle org.eclipse.emfforms.core.services.databinding.table. I used P2 Browser to inspect the emf update site

http://download.eclipse.org/ecp/releases/releases_target_19/

but there seems to be no bundle (or similar bundle ...)

so far no progress, but an exception:

Caused by: org.eclipse.emf.ecp.ui.view.ECPRendererException: No fitting EMFFormsRendererService for View available!
at org.eclipse.emf.ecp.view.internal.swt.ECPSWTViewRendererImpl.render(ECPSWTViewRendererImpl.java:95) ~[na:na]
at org.eclipse.emf.ecp.view.internal.swt.ECPSWTViewRendererImpl.render(ECPSWTViewRendererImpl.java:78) ~[na:na]
at org.eclipse.emf.ecp.view.internal.swt.ECPSWTViewRendererImpl.render(ECPSWTViewRendererImpl.java:65) ~[na:na]
at com.godyo.p5.workflow.ui.formgenerator.impl.EMFFormGenerator.show(EMFFormGenerator.java:46) ~[na:na]

i'm looking into this and try to understand the subpackage problem in the model mentioned above.
Re: [EMFForms 1.9] Problem Creating an Editable Form [message #1739439 is a reply to message #1739413] Mon, 01 August 2016 12:46 Go to previous messageGo to next message
Peter Hermsdorf is currently offline Peter HermsdorfFriend
Messages: 44
Registered: August 2011
Member
I upgraded to emfforms 1.9

to avoid "the sub package" problem, i moved the corresponding eclass definition to an own .ecore file (see attached .model, .genmodel and view model).

The view model is (for now) just the default generated one - the preview shows something. If i could get the same in my application that would be a start Wink

additionally i added the following bundles to my launch config:
org.eclipse.emfforms.swt.table
org.eclipse.emf.ecp.view.table.ui.swt

org.eclipse.emfforms.core.services.structuralchange
org.eclipse.emfforms.core.services.structuralchange.default
org.eclipse.emfforms.core.services.structuralchange.table

org.eclipse.emfforms.core.services.domainexpander.default
org.eclipse.emfforms.core.services.domainexpander.table

org.eclipse.emfforms.core.services.mappingprovider.default
org.eclipse.emfforms.core.services.mappingprovider.table


When trying to render the form the following log messages appear in the console:

!ENTRY org.eclipse.emf.ecp.view.model 4 0 2016-08-01 14:19:05.099
!MESSAGE No view service of type 'org.eclipse.emfforms.spi.swt.core.di.EMFFormsContextProvider' found.
14:19:05.099 ERROR [model] No view service of type 'org.eclipse.emfforms.spi.swt.core.di.EMFFormsContextProvider' found.

!ENTRY org.eclipse.emf.ecp.view.model 4 0 2016-08-01 14:19:05.100
!MESSAGE The given ViewModelContext does not have a EMFFormsContextProvider. Hence, no renderer instance can be created.
14:19:05.100 ERROR [model] The given ViewModelContext does not have a EMFFormsContextProvider. Hence, no renderer instance can be created.


I debugged the form creation process, the error messages comes from:

EMFFormsDIRendererFactory
final AbstractSWTRenderer<VElement> rendererInstance = bestService.getRendererInstance(vElement,
viewModelContext);
-> resolve to
EMFFormsDIRendererFactory.getRendererInstance
which exit's at
final EMFFormsContextProvider contextProvider = viewModelContext.getService(EMFFormsContextProvider.class);
		if (contextProvider == null) {
			reportService
				.report(new AbstractReport(
					"The given ViewModelContext does not have a EMFFormsContextProvider. Hence, no renderer instance can be created.")); //$NON-NLS-1$
			return null;
		}



I wasn't able to understand, why there is no contextProvider available.

Any suggestions and hints are more than welcome!

thx, bye Peter
Re: [EMFForms 1.9] Problem Creating an Editable Form [message #1739467 is a reply to message #1739439] Tue, 02 August 2016 07:19 Go to previous messageGo to next message
Eugen Neufeld is currently offline Eugen NeufeldFriend
Messages: 174
Registered: May 2015
Senior Member
Hi Peter,
in EMFForms 1.9 there is a bundle called org.eclipse.emfforms.setup.base . If you add this bundle to your run config, you will get all the dependencies you need to get emfforms running.

Could you also check that the bundle "org.eclipse.emfforms.core.services.legacy" is part of your run configuration.

Cheers,
Eugen


--
Eugen Neufeld

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Re: [EMFForms 1.9] Problem Creating an Editable Form [message #1739497 is a reply to message #1739467] Tue, 02 August 2016 12:51 Go to previous messageGo to next message
Peter Hermsdorf is currently offline Peter HermsdorfFriend
Messages: 44
Registered: August 2011
Member
Thanks for the hint to the bundle org.eclipse.emfforms.setup.base, that helped sorting out the missing dependencies a lot!

and the end it turned out that i had to add some features to my target platform and launch config.

the missing festures are:
	org.eclipse.emf.ecp.view.indexdmr.feature.feature.group
	org.eclipse.emf.ecp.view.mappingdmr.feature.feature.group
	org.eclipse.emfforms.swt.control.multiattribute.feature.feature.group



Is there any special reason that they are not contained in the base feature ? ( org.eclipse.emf.ecp.sdk.feature or the runtime feature) - that makes it a little hard to get all required bundles together in one place (also for deployment)

For now i get a view rendered and have some basic model creation functions - i'll need to customize that some more but at least it seems to work now!

thanks for the help!


Re: [EMFForms 1.9] Problem Creating an Editable Form [message #1739499 is a reply to message #1739497] Tue, 02 August 2016 13:01 Go to previous message
Eugen Neufeld is currently offline Eugen NeufeldFriend
Messages: 174
Registered: May 2015
Senior Member
Hi Peter,
the index dmr and mapping dmr are not in the ecp.sdk feature as we see them as more advanced features which are not needed for the base case. (we should remove them from the setup.base bundle also).
The same goes for the multiattribute feature.

Glad that it works.

Cheers,
Eugen


--
Eugen Neufeld

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Previous Topic:UI - Search of a model element inside ecore file
Next Topic:Ecore model support for .net
Goto Forum:
  


Current Time: Thu Mar 28 20:33:34 GMT 2024

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

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

Back to the top