Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Illegal Name of EWL
Illegal Name of EWL [message #1053752] Tue, 07 May 2013 13:54 Go to next message
serhat gezgin is currently offline serhat gezginFriend
Messages: 242
Registered: January 2013
Location: Izmir
Senior Member
Hi all,

i make wizards for my metamodel but i see problem on illegal names.

My metamodel Hava class with name = 'List' and on EWL dont recognize its type. it see

this a built-in type. So how can i state this is my metamodel type.

(Sample scenario on attached Picture)

Regards
Re: Illegal Name of EWL [message #1053772 is a reply to message #1053752] Tue, 07 May 2013 14:29 Go to previous messageGo to next message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 310
Registered: January 2010
Senior Member
Have you tried putting List in backticks, as in `List`? That's what we usually need to do whenever an identifier conflicts with a reserved keyword in EOL.
Re: Illegal Name of EWL [message #1053806 is a reply to message #1053772] Tue, 07 May 2013 16:15 Go to previous messageGo to next message
serhat gezgin is currently offline serhat gezginFriend
Messages: 242
Registered: January 2013
Location: Izmir
Senior Member
no its not work i use '' and then `` but not work my ewl is;

wizard Rename {
	
	guard : self.isKindOf(ContentUnit) and self.name.isDefined()

	title : 'Rename File ' + self.name	
	
	do {
	
		var newName : String;
 		var message : String := "Please provide a name for the file";
 		newName := UserInput.prompt(message, self.name.firstToUpperCase());
		if(newName.isDefined()){
			// Prompt the user for confirmation of the rename
			if (UserInput.confirm("Rename " + self.name + " to " + newName + "?")) { // Perform the rename
				self.name = newName;
			}
		}
	}

}

wizard CreateLookUp {
	
	guard : self.isTypeOf(`List`) and self.name.isDefined()

	title : 'Create a new LookUp Field...'

	do {
	
		var newName : String;
 		var message : String := "Please provide a name for the LookUp Field";
 		newName := UserInput.prompt(message, "LookUp" + self.name);
		
		if(newName.isDefined() or newName <> ""){	
			// Prompt the user for confirmation of the rename
			var contentType = UserInput.choose('Select ContentType', ContentType.all);
			if(contentType <> null){
				var field = UserInput.choose('Select Field for Show', contentType.ownedField);
				if(field <> null){
					if (UserInput.confirm("Are u Sure to create LookUp with name : " + newName + "?")) { // Perform the rename
						var l : new LookUp;
						l.name := newName;
						l.contentType = contentType;
						l.showField = field;
						self.ownedField.add(l);
					}
				}
			}
		}
	}
}

wizard MoveToList {

	guard : self.isKindOf(Field) and self.name.isDefined() and LookUp.all.select( l | l.showField = self).isEmpty()

 	title : "Move " + "to selected List." 

 	do {
		var message : String := "Please select a Folder for moving.";
		var parent := self.eContainer();
		var targetList = UserInput.choose(message,  `List`.all().flatten().select(f | (f <> parent) ) );
		
		if(targetFile <> null){
			//Bunu gösteren ContentTye bulunur ve oradan bu field silinir.
			var contentType = parent.ownedContentType.collect(c | c.field.includes(self));
			if(contentType <> null){
				contentType.first.field.remove(self);
			}
			targetList.ownedFields.add(self);
		}
	}
 }

  wizard createSampleContentModel {
	//For start point.
	guard : self.isTypeOf(ContentModel) and WebApplication.all.isEmpty() and self.name.isDefined()

 	title : "Create Default Content Model" 

 	do { 	 			
 			var webApp = new WebApplication;
			webApp.name = "WebApp";
			webApp.guID = "serhat";
			
			if(ContentModel.all.first() <> null){
				self.ownedWebApplication.add(webApp);
				var siteColl = new SiteCollection;
				siteColl.name = "SiteColl";
				siteColl.guID = "serhat";
				webApp.ownedSiteCollection.add(siteColl);
			
				var web = new Web;
				web.name = "rootWeb";
				web.guID = "serhat";
				webApp.ownedWeb.add(web);
			}
	}
 }
Re: Illegal Name of EWL [message #1053840 is a reply to message #1053806] Tue, 07 May 2013 19:41 Go to previous messageGo to next message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 310
Registered: January 2010
Senior Member
How about prepending it with the name of your model, like M!List?
Re: Illegal Name of EWL [message #1053845 is a reply to message #1053840] Tue, 07 May 2013 19:59 Go to previous message
serhat gezgin is currently offline serhat gezginFriend
Messages: 242
Registered: January 2013
Location: Izmir
Senior Member
i tried but not working when i use content!List i have;

no viable alternative at input ! error

when i use 'content!List' not work again

[Updated on: Tue, 07 May 2013 20:01]

Report message to a moderator

Previous Topic:Qualified names on referance labels
Next Topic:Automatically add child-nodes upon creation
Goto Forum:
  


Current Time: Tue Dec 23 02:21:54 GMT 2014

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

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