How to make EMF remove generated code for removed attributes - eclipse-emf

After removing an attribute from an ecore model, I re-generate the code, but the methods from the removed attributes remains in the generated code. Is there an automatic way to remove this code?
Edit - the code is removed from the interface, but not from the implementation. I would like to remove it from the implementation.

If your implementation classes have the #generated tag in the javadoc of the attributes, they should be removed too.

That does not always work, the only way I know is to delete the impl classes and re-generate the code based on the new ecore model.

Related

Ember Blueprint skip confirmation

I use the ember blueprint.Install(options) method to create files based on blueprint, but this causes overwrite questions for existing and not identical files. I allways want to skip that kind of questions, is that possible?
Is it maybe possible to override a public method from blueprint.js somehow?
That is currently (ember-cli#2.15) not possible. Ember CLI will always ask the user if he really wants to overwrite files unless the new file is identical to the old file.

How to get list of methods in Odoo Models?

I'm using odooV10.
I want to know every model's methods without searching it manually, but I couldn't find anywhere to achieve this. Is anyone have any idea?
well you can simply dir(model)
ie.
any_method_on_your_model(self):
print dir(self)
you will see all the properties included in the object.
Activate the Developer Mode in OdooV10.
Then go Setting(odoo Main Settings)--> Technical -->Models.
Here you can find all models, fields, views and constraints. I hope this will work for you.
if not explain what you want trying to do.?
In python you can get method of class
get methods of class
but the problem here odoo inherits mechanism prevent you from doing
this. when you call a method a very complicated operation to create
an object with that method from the inherited classes

Conditional fields using web forms for marketers?

I need to show/hide a field based on the value entered in another field. The field that is conditionally made visible also needs to be a mandatory field.
Is this possible using WFFM? Will I need to do it using custom fields?
Thanks!
You would need to build a custom complex type to do this. You might be able to re-use existing field types in your custom type, but it would probably be simpler to create them specifically for the new complex type.
You can use JQuery for this and also you can create custom field for this you just simply copy and paste previous one and reflect Sitecore.Forms.Core.dll and see the code how you can achieve this. But I generally use JQuery if I can manage via this

Customizing Dojo Widgets

How do I customize an existing Dojo widget? I'm using dojo version 1.3. In the previous versions we had the html file under templates folder. Do I need to edit the source code directly.
I need to add an image to Accordion widget. Can someone please help me in customizing it?
Thanks in advance.
First, grab the existing template from the dojo library. This'll be your starting point.
Then, create your own widget that inherits from AccordionContainer, but specify your own html template:
dojo.declare("MyWidgets.Accordion", dijit.layout.AccordionContainer, {
templatePath: dojo.moduleUrl("MyWidgets","Accordion.html");
});
(dojo.moduleUrl is a nice way of specifying folder paths so the dojo library can find and inline them when you package up your final product).
This way, you leave the original source intact, but can set your own html and override any methods as needed.
That HTML template is still there in the templates folders. You just need to download the source release. Depending on your needs you could 1) set the content by adding children, 2) write custom widget inheriting it or 3) use it as a part of compound widget. Inheritance in Dojo way is simple:
dojo.declare("my.Accordion", dijit.layout.AccordionContainer, {
// your methods...
});
I think you could extend the existing widget rather than modifying it.

Using JET with EMF

I need to run JET templates on a EMF model metadata - i.e. the model itself (not data) is input to my JET template.
More practically - I want generate non java code, based on EMF templates.
How I do it?
Thank you
I'm not sure I get you right, but you can pass your model just like any other object into the JET template (as described in the JET tutorial). Also, it makes no difference if you generate Java or any other text with JET. As an additional pointer, you might want to consider using Xpand (part of openArchitectureWare) for very comfortable model to text generation (including things like content assist for your model in the template editor).
For code generation, you could use Acceleo. That is like Xpand very comfortable model to text generation (Acceleo language is very intuitive for model browsing) and also less painful than JET.