Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » No EObjectDescription could be found in Scope
No EObjectDescription could be found in Scope [message #1071133] Fri, 19 July 2013 12:15 Go to next message
junior developer is currently offline junior developerFriend
Messages: 335
Registered: January 2013
Senior Member
Hi all,

I work two Xtext editor. When I create an element in the X editör ,created element's related elements must create in the Y editör. actually,I can do this : When I create one element in the X editör, its related elements are created in the Y editor automatically.
But, I am wanted : after elements created in the Y editor ,I want to referance this element to another editor element automatically .( User must not select reference element). I receive an error ("No EObjectDescription could be found in Scope") .

X editor grammar:
Web returns Web:
	'Web'
	name=QualifiedName
	'{'
		'guID' '=' guID=STRING
		'displayName' '=' displayName=STRING
		('description' '=' description=STRING)?
		('sitePermission' '=' sitePermission = [user::SitePermission|QualifiedName])?
		('lists' '{' ownedList+=CustomList (ownedList+=CustomList)* '}' )?
		('contentRoleAssignments' '(' contentRoleAssignments+=[user::RoleAssignment|QualifiedName] ( "," contentRoleAssignments+=[user::RoleAssignment|QualifiedName])* ')' )?
		('Webs' '{' ownedWeb+=Web (ownedWeb+=Web)* '}' )?
	'}';
	



------------------------------------------
Y editor grammar:

UserModel returns UserModel:
	'UserModel' name = QualifiedName '{'
	('users' '{' users+=User (users+=User)* '}' )?
	('sitePermissions' '{' sitePermissions+=SitePermission (sitePermissions+=SitePermission)* '}' )?
	'}'
;

SitePermission returns SitePermission:
	'sitePermission' name = QualifiedName '{'
		'webGUID' '=' webGUID=STRING
		('groups' '{' (ownedGroup+=Group)* '}' )?
		('roleDefinitions' '{' (ownedRoleDefinition+=RoleDefinition)* '}' )?
		('roleAssignments' '{' (ownedRoleAssignments+=RoleAssignment)* '}' )?
	'}'
;

Principle returns Principle:
	User | Group
;





-------------------------------------------


public class SitePermissionUtil {

	public static File userFile;

	public static SitePermission createDefaultSitePermission(String webName,
			String webGuID, UserModel userModel) {
		// Initialize the model
		UserPackage.eINSTANCE.eClass();
		// Retrieve the default factory singleton
		UserFactory factory = UserFactory.eINSTANCE;
		// SitePermission
		SitePermission sitePermission = factory.createSitePermission();
		sitePermission.setName(webName);
		sitePermission.setWebGUID(webGuID);

		// Owners Group
		Group ownerGroup = UserFactory.eINSTANCE.createGroup();
		ownerGroup.setName("Owners");
		sitePermission.getOwnedGroup().add(ownerGroup);
		// Members Group
		Group memberGroup = UserFactory.eINSTANCE.createGroup();
		memberGroup.setName("Members");
		sitePermission.getOwnedGroup().add(memberGroup);
		// Visitors Group
		Group visitorsGroup = UserFactory.eINSTANCE.createGroup();
		visitorsGroup.setName("Visitors");
		sitePermission.getOwnedGroup().add(visitorsGroup);
		// Viewers Group
		Group viewersGroup = UserFactory.eINSTANCE.createGroup();
		viewersGroup.setName("Viewers");
		sitePermission.getOwnedGroup().add(viewersGroup);
		// viewersRoleDefinitions
		RoleDefinition viewerRole = UserFactory.eINSTANCE.createRoleDefinition();
		viewerRole.setName("viewerRoleDefinition");
		viewerRole.getBasePermissions().add(BasePermission.VIEW_LIST_ITEMS);
		viewerRole.getBasePermissions().add(BasePermission.VIEW_VERSIONS);
		viewerRole.getBasePermissions().add(BasePermission.CREATE_ALERTS);
		viewerRole.getBasePermissions().add(BasePermission.VIEW_FORM_PAGES);
		viewerRole.getBasePermissions().add(BasePermission.BROWSE_USER_INFO);
		viewerRole.getBasePermissions().add(BasePermission.USE_REMOTE_AP_IS);
		viewerRole.getBasePermissions().add(
				BasePermission.USE_CLIENT_INTEGRATION);
		viewerRole.getBasePermissions().add(BasePermission.OPEN);
		sitePermission.getOwnedRoleDefinition().add(viewerRole);
		// ownerRoleDefinitions
		RoleDefinition ownerRole = UserFactory.eINSTANCE.createRoleDefinition();
		ownerRole.setName("ownerRoleDefinition");
		List<BasePermission> permissions = BasePermission.VALUES;
		for (Iterator<BasePermission> iterator = permissions.iterator(); iterator
				.hasNext();) {
			BasePermission basePermission = (BasePermission) iterator.next();
			ownerRole.getBasePermissions().add(basePermission);
		}
		sitePermission.getOwnedRoleDefinition().add(ownerRole);
		// memberRoleDefinition
		RoleDefinition memberRole = UserFactory.eINSTANCE.createRoleDefinition();
		memberRole.setName("memberRoleDefinition");
		memberRole.getBasePermissions().add(BasePermission.ADD_LIST_ITEMS);
		memberRole.getBasePermissions().add(BasePermission.EDIT_LIST_ITEMS);
		memberRole.getBasePermissions().add(BasePermission.DELETE_LIST_ITEMS);
		memberRole.getBasePermissions().add(BasePermission.VIEW_LIST_ITEMS);
		memberRole.getBasePermissions().add(BasePermission.OPEN_ITEMS);
		memberRole.getBasePermissions().add(BasePermission.VIEW_VERSIONS);
		memberRole.getBasePermissions().add(BasePermission.CREATE_ALERTS);
		memberRole.getBasePermissions().add(BasePermission.BROWSE_DIRECTORIES);
		memberRole.getBasePermissions().add(BasePermission.VIEW_FORM_PAGES);
		memberRole.getBasePermissions().add(BasePermission.BROWSE_USER_INFO);
		memberRole.getBasePermissions().add(BasePermission.USE_REMOTE_AP_IS);
		memberRole.getBasePermissions().add(
				BasePermission.USE_CLIENT_INTEGRATION);
		memberRole.getBasePermissions().add(BasePermission.OPEN);
		memberRole.getBasePermissions().add(BasePermission.EDIT_MY_USER_INFO);
		memberRole.getBasePermissions().add(
				BasePermission.MANAGE_PERSONAL_VIEWS);
		memberRole.getBasePermissions().add(
				BasePermission.ADD_DEL_PRIVATE_WEB_PARTS);
		memberRole.getBasePermissions().add(
				BasePermission.UPDATE_PERSONAL_WEB_PARTS);
		sitePermission.getOwnedRoleDefinition().add(memberRole);
		// visitor Role Definition.
		RoleDefinition VisitorsRole = UserFactory.eINSTANCE.createRoleDefinition();
		VisitorsRole.setName("visitorsRoleDefinition");
		VisitorsRole.getBasePermissions().add(BasePermission.VIEW_LIST_ITEMS);
		VisitorsRole.getBasePermissions().add(BasePermission.OPEN_ITEMS);
		VisitorsRole.getBasePermissions().add(BasePermission.VIEW_VERSIONS);
		VisitorsRole.getBasePermissions().add(BasePermission.CREATE_ALERTS);
		VisitorsRole.getBasePermissions().add(BasePermission.VIEW_FORM_PAGES);
		VisitorsRole.getBasePermissions().add(BasePermission.VIEW_LIST_ITEMS);
		VisitorsRole.getBasePermissions().add(BasePermission.BROWSE_USER_INFO);
		VisitorsRole.getBasePermissions().add(BasePermission.USE_REMOTE_AP_IS);
		VisitorsRole.getBasePermissions().add(
				BasePermission.USE_CLIENT_INTEGRATION);
		VisitorsRole.getBasePermissions().add(BasePermission.OPEN);
		sitePermission.getOwnedRoleDefinition().add(VisitorsRole);
		// Full Control Assignment
		RoleAssignment ownerRoleAssignment = UserFactory.eINSTANCE
				.createRoleAssignment();
		ownerRoleAssignment.setName("FullControl");
		ownerRoleAssignment.setMember(ownerGroup);
		ownerRoleAssignment.getRoleDefinitionBindings().add(ownerRole);
		sitePermission.getOwnedRoleAssignments().add(ownerRoleAssignment);
		// Contribute Assignment
		RoleAssignment memeberRoleAssignment = UserFactory.eINSTANCE
				.createRoleAssignment();
		memeberRoleAssignment.setName("Contribute");
		memeberRoleAssignment.setMember(memberGroup);
		memeberRoleAssignment.getRoleDefinitionBindings().add(memberRole);
		sitePermission.getOwnedRoleAssignments().add(memeberRoleAssignment);
		// Read Assignment
		RoleAssignment visitorsRoleAssignment = UserFactory.eINSTANCE
				.createRoleAssignment();
		visitorsRoleAssignment.setName("Read");
		visitorsRoleAssignment.setMember(visitorsGroup);
		visitorsRoleAssignment.getRoleDefinitionBindings().add(VisitorsRole);
		sitePermission.getOwnedRoleAssignments().add(visitorsRoleAssignment);
		// Full Control Assignment
		RoleAssignment viewersRoleAssignment = UserFactory.eINSTANCE
				.createRoleAssignment();
		viewersRoleAssignment.setName("ViewOnly");
		viewersRoleAssignment.setMember(viewersGroup);
		viewersRoleAssignment.getRoleDefinitionBindings().add(viewerRole);
		sitePermission.getOwnedRoleAssignments().add(viewersRoleAssignment);
		// Add Role Assignment to web
		sitePermission.getOwnedRoleAssignments().add(visitorsRoleAssignment);
		sitePermission.getOwnedRoleAssignments().add(ownerRoleAssignment);
		sitePermission.getOwnedRoleAssignments().add(memeberRoleAssignment);
		sitePermission.getOwnedRoleAssignments().add(visitorsRoleAssignment);
		sitePermission.getOwnedRoleAssignments().add(viewersRoleAssignment);

		userModel.getSitePermissions().add(sitePermission);
		
		return sitePermission;
	}

	public static SitePermission loadForCreateSitePermission(String webName,
			String webGuID) {
		
		//new UserStandaloneSetup().createInjectorAndDoEMFRegistration();
		SitePermission sitePermission = null;
		Injector injector = Guice.createInjector(new UserRuntimeModule());
	
		XtextResourceSet resourceSet = injector.getInstance(XtextResourceSet.class);
		resourceSet.addLoadOption(XtextResource.OPTION_RESOLVE_ALL, Boolean.TRUE);
		
		getUserFilePath(getProjectName(), UserConstant.USER_FILE_NAME);
		
		if (getUserFile() != null) {
			
			Resource resource = resourceSet.getResource(
				    URI.createURI(userFile.toURI().toString()), true);
			
			UserModel eobject = (UserModel) resource.getContents().get(0);
			//Default fieldlar yaratılır.
			sitePermission = createDefaultSitePermission(webName, webGuID, eobject);
			//Burada file save edilir.
			try {
				Map options = new HashMap();
			    SaveOptions.defaultOptions().addTo(options);
			    resource.save(options);
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			
			// Kullanıldıktan sonra sıfırlanır cunku kullanıcı dosyayı sılmıs
			// olabılır yada yerını degıstırmıs olabilir.
			setUserFile(null);
			resource.unload();
			resourceSet = null;
		}
		
		return sitePermission;
	}

	public static IProject getProjectName() {
		IEditorPart editorPart = PlatformUI.getWorkbench()
				.getActiveWorkbenchWindow().getActivePage().getActiveEditor();
		IProject activeProject = null;
		if (editorPart != null) {
			IFileEditorInput input = (IFileEditorInput) editorPart
					.getEditorInput();
			IFile file = input.getFile();
			activeProject = file.getProject();
		}
		return activeProject;
	}

	public static void getUserFilePath(IProject project, String name) {
		File[] files = project.getLocation().toFile().listFiles();
		showFiles(files, name);
	}

	public static void showFiles(File[] files, String name) {
		if (getUserFile() == null) {
			for (File file : files) {
				if (name.equals(file.getName())) {
					setUserFile(file);
					break;
				} else {
					if (file.isDirectory()) {
						showFiles(file.listFiles(), name); // Calls same method again.
					}
				}
			}
		}
	}

	public static File getUserFile() {
		return userFile;
	}

	public static void setUserFile(File userFile) {
		SitePermissionUtil.userFile = userFile;
	}
}









Best regards
Re: No EObjectDescription could be found in Scope [message #1071149 is a reply to message #1071133] Fri, 19 July 2013 12:53 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 26237
Registered: July 2009
Senior Member
The following code looks a little suspicious. When working in an
Eclipse workspace, you need to be careful to use platform:/resource URIs
not file:/ URIs.

On 19/07/2013 2:16 PM, junior developer wrote:
> Resource resource = resourceSet.getResource(
> URI.createURI(userFile.toURI().toString()), true);

You're probably already going wrong here:

public static void getUserFilePath(IProject project, String name) {
File[] files = project.getLocation().toFile().listFiles();
showFiles(files, name);
}

You should be using the IProject APIs to locate things in the IProject.
Have a look at
http://wiki.eclipse.org/index.php/EMF-FAQ#How_do_I_map_between_an_EMF_Resource_and_an_Eclipse_IFile.3F
as well.
Re: No EObjectDescription could be found in Scope [message #1072655 is a reply to message #1071149] Tue, 23 July 2013 08:12 Go to previous messageGo to next message
junior developer is currently offline junior developerFriend
Messages: 335
Registered: January 2013
Senior Member
Hi Ed,

I reach my file ,I do not understand my error Sad if I use IProject APIs ,No EObjectDescription could be found in Scope error is solved ?


Ed Merks wrote on Fri, 19 July 2013 08:53
The following code looks a little suspicious. When working in an
Eclipse workspace, you need to be careful to use platform:/resource URIs
not file:/ URIs.

On 19/07/2013 2:16 PM, junior developer wrote:
> Resource resource = resourceSet.getResource(
> URI.createURI(userFile.toURI().toString()), true);

You're probably already going wrong here:

public static void getUserFilePath(IProject project, String name) {
File[] files = project.getLocation().toFile().listFiles();
showFiles(files, name);
}

You should be using the IProject APIs to locate things in the IProject.
Have a look at
http://wiki.eclipse.org/index.php/EMF-FAQ#How_do_I_map_between_an_EMF_Resource_and_an_Eclipse_IFile.3F
as well.
Re: No EObjectDescription could be found in Scope [message #1072682 is a reply to message #1072655] Tue, 23 July 2013 09:13 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 26237
Registered: July 2009
Senior Member
Comments below.

On 23/07/2013 10:12 AM, junior developer wrote:
> Hi Ed,
>
> I reach my file ,I do not understand my error :( if I use IProject
> APIs ,No EObjectDescription could be found in Scope error is solved ?
Locating EObject descriptions depends on the resources in the workspace
and in jars/folders on the classpath of the workspace projects being
indexed. That typically boils down to being able to locate the
JavaProject for the IProject in which the file resides. And that's
typically done by using the URIs of the resources in the resource set to
determine their location in the workspace, which only works well if they
are platform:/resource URIs.
>
>
> Ed Merks wrote on Fri, 19 July 2013 08:53
>> The following code looks a little suspicious. When working in an
>> Eclipse workspace, you need to be careful to use platform:/resource
>> URIs not file:/ URIs.
>>
>> On 19/07/2013 2:16 PM, junior developer wrote:
>> > Resource resource = resourceSet.getResource(
>> > URI.createURI(userFile.toURI().toString()), true);
>> You're probably already going wrong here:
>>
>> public static void getUserFilePath(IProject project, String name) {
>> File[] files = project.getLocation().toFile().listFiles();
>> showFiles(files, name);
>> }
>>
>> You should be using the IProject APIs to locate things in the
>> IProject. Have a look at
>> http://wiki.eclipse.org/index.php/EMF-FAQ#How_do_I_map_between_an_EMF_Resource_and_an_Eclipse_IFile.3F
>> as well.
>
Re: No EObjectDescription could be found in Scope [message #1072767 is a reply to message #1072682] Tue, 23 July 2013 13:04 Go to previous messageGo to next message
junior developer is currently offline junior developerFriend
Messages: 335
Registered: January 2013
Senior Member
Hi Ed ,

I change my code :

	if (getUserFile() != null) {
			Resource resource = resourceSet.getResource(
				    URI.createURI("platform:/resource/deneme/user.user"), true);
			


but When I save the document I receive an error:
-------Save Failed
Attempted to beginRule: L/deneme/user.user, does not match outer scope rule: L/deneme/contentdeneme.content------


Ps:I want to one elements is created (such as Web ) ,its default fields are created in the other user editor)


Best regards,
Re: No EObjectDescription could be found in Scope [message #1072783 is a reply to message #1072767] Tue, 23 July 2013 13:38 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 26237
Registered: July 2009
Senior Member
So you get a different error now (and the code you show is completely
hard coded). I can't comment on your new error without more context.
Perhaps you're trying to save an object which isn't allowed as the root
object of a resource.


On 23/07/2013 3:04 PM, junior developer wrote:
> Hi Ed ,
>
> I change my code :
>
>
> if (getUserFile() != null) {
> Resource resource = resourceSet.getResource(
> URI.createURI("platform:/resource/deneme/user.user"), true);
>
>
>
> but When I save the document I receive an error:
> -------Save Failed
> Attempted to beginRule: L/deneme/user.user, does not match outer scope
> rule: L/deneme/contentdeneme.content------
>
>
> Ps:I want to one elements is created (such as Web ) ,its default
> fields are created in the other user editor)
>
>
> Best regards,
Re: No EObjectDescription could be found in Scope [message #1072793 is a reply to message #1072783] Tue, 23 July 2013 14:03 Go to previous messageGo to next message
junior developer is currently offline junior developerFriend
Messages: 335
Registered: January 2013
Senior Member
Hi Ed,
I share my complete code and where I call this util class I share it.



package com.mdd4cca.msf.user.user.util;

import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IFileEditorInput;
import org.eclipse.ui.PlatformUI;
import org.eclipse.xtext.resource.SaveOptions;
import org.eclipse.xtext.resource.XtextResource;
import org.eclipse.xtext.resource.XtextResourceSet;
import com.google.inject.Guice;
import com.google.inject.Inject;
import com.google.inject.Injector;
import com.mdd4cca.msf.user.UserRuntimeModule;
import com.mdd4cca.msf.user.user.BasePermission;
import com.mdd4cca.msf.user.user.Group;
import com.mdd4cca.msf.user.user.RoleAssignment;
import com.mdd4cca.msf.user.user.RoleDefinition;
import com.mdd4cca.msf.user.user.SitePermission;
import com.mdd4cca.msf.user.user.UserFactory;
import com.mdd4cca.msf.user.user.UserModel;
import com.mdd4cca.msf.user.user.UserPackage;

public class SitePermissionUtil {

	public static File userFile;

	public static SitePermission createDefaultSitePermission(String webName,
			String webGuID, UserModel userModel) {
		// Initialize the model
		UserPackage.eINSTANCE.eClass();
		// Retrieve the default factory singleton
		UserFactory factory = UserFactory.eINSTANCE;
		// SitePermission
		SitePermission sitePermission = factory.createSitePermission();
		sitePermission.setName(webName);
		sitePermission.setWebGUID(webGuID);

		// Owners Group
		Group ownerGroup = UserFactory.eINSTANCE.createGroup();
		ownerGroup.setName("Owners");
		sitePermission.getOwnedGroup().add(ownerGroup);
		// Members Group
		Group memberGroup = UserFactory.eINSTANCE.createGroup();
		memberGroup.setName("Members");
		sitePermission.getOwnedGroup().add(memberGroup);
		// Visitors Group
		Group visitorsGroup = UserFactory.eINSTANCE.createGroup();
		visitorsGroup.setName("Visitors");
		sitePermission.getOwnedGroup().add(visitorsGroup);
		// Viewers Group
		Group viewersGroup = UserFactory.eINSTANCE.createGroup();
		viewersGroup.setName("Viewers");
		sitePermission.getOwnedGroup().add(viewersGroup);
		// viewersRoleDefinitions
		RoleDefinition viewerRole = UserFactory.eINSTANCE.createRoleDefinition();
		viewerRole.setName("viewerRoleDefinition");
		viewerRole.getBasePermissions().add(BasePermission.VIEW_LIST_ITEMS);
		viewerRole.getBasePermissions().add(BasePermission.VIEW_VERSIONS);
		viewerRole.getBasePermissions().add(BasePermission.CREATE_ALERTS);
		viewerRole.getBasePermissions().add(BasePermission.VIEW_FORM_PAGES);
		viewerRole.getBasePermissions().add(BasePermission.BROWSE_USER_INFO);
		viewerRole.getBasePermissions().add(BasePermission.USE_REMOTE_AP_IS);
		viewerRole.getBasePermissions().add(
				BasePermission.USE_CLIENT_INTEGRATION);
		viewerRole.getBasePermissions().add(BasePermission.OPEN);
		sitePermission.getOwnedRoleDefinition().add(viewerRole);
		// ownerRoleDefinitions
		RoleDefinition ownerRole = UserFactory.eINSTANCE.createRoleDefinition();
		ownerRole.setName("ownerRoleDefinition");
		List<BasePermission> permissions = BasePermission.VALUES;
		for (Iterator<BasePermission> iterator = permissions.iterator(); iterator
				.hasNext();) {
			BasePermission basePermission = (BasePermission) iterator.next();
			ownerRole.getBasePermissions().add(basePermission);
		}
		sitePermission.getOwnedRoleDefinition().add(ownerRole);
		// memberRoleDefinition
		RoleDefinition memberRole = UserFactory.eINSTANCE.createRoleDefinition();
		memberRole.setName("memberRoleDefinition");
		memberRole.getBasePermissions().add(BasePermission.ADD_LIST_ITEMS);
		memberRole.getBasePermissions().add(BasePermission.EDIT_LIST_ITEMS);
		memberRole.getBasePermissions().add(BasePermission.DELETE_LIST_ITEMS);
		memberRole.getBasePermissions().add(BasePermission.VIEW_LIST_ITEMS);
		memberRole.getBasePermissions().add(BasePermission.OPEN_ITEMS);
		memberRole.getBasePermissions().add(BasePermission.VIEW_VERSIONS);
		memberRole.getBasePermissions().add(BasePermission.CREATE_ALERTS);
		memberRole.getBasePermissions().add(BasePermission.BROWSE_DIRECTORIES);
		memberRole.getBasePermissions().add(BasePermission.VIEW_FORM_PAGES);
		memberRole.getBasePermissions().add(BasePermission.BROWSE_USER_INFO);
		memberRole.getBasePermissions().add(BasePermission.USE_REMOTE_AP_IS);
		memberRole.getBasePermissions().add(
				BasePermission.USE_CLIENT_INTEGRATION);
		memberRole.getBasePermissions().add(BasePermission.OPEN);
		memberRole.getBasePermissions().add(BasePermission.EDIT_MY_USER_INFO);
		memberRole.getBasePermissions().add(
				BasePermission.MANAGE_PERSONAL_VIEWS);
		memberRole.getBasePermissions().add(
				BasePermission.ADD_DEL_PRIVATE_WEB_PARTS);
		memberRole.getBasePermissions().add(
				BasePermission.UPDATE_PERSONAL_WEB_PARTS);
		sitePermission.getOwnedRoleDefinition().add(memberRole);
		// visitor Role Definition.
		RoleDefinition VisitorsRole = UserFactory.eINSTANCE.createRoleDefinition();
		VisitorsRole.setName("visitorsRoleDefinition");
		VisitorsRole.getBasePermissions().add(BasePermission.VIEW_LIST_ITEMS);
		VisitorsRole.getBasePermissions().add(BasePermission.OPEN_ITEMS);
		VisitorsRole.getBasePermissions().add(BasePermission.VIEW_VERSIONS);
		VisitorsRole.getBasePermissions().add(BasePermission.CREATE_ALERTS);
		VisitorsRole.getBasePermissions().add(BasePermission.VIEW_FORM_PAGES);
		VisitorsRole.getBasePermissions().add(BasePermission.VIEW_LIST_ITEMS);
		VisitorsRole.getBasePermissions().add(BasePermission.BROWSE_USER_INFO);
		VisitorsRole.getBasePermissions().add(BasePermission.USE_REMOTE_AP_IS);
		VisitorsRole.getBasePermissions().add(
				BasePermission.USE_CLIENT_INTEGRATION);
		VisitorsRole.getBasePermissions().add(BasePermission.OPEN);
		sitePermission.getOwnedRoleDefinition().add(VisitorsRole);
		// Full Control Assignment
		RoleAssignment ownerRoleAssignment = UserFactory.eINSTANCE
				.createRoleAssignment();
		ownerRoleAssignment.setName("FullControl");
		ownerRoleAssignment.setMember(ownerGroup);
		ownerRoleAssignment.getRoleDefinitionBindings().add(ownerRole);
		sitePermission.getOwnedRoleAssignments().add(ownerRoleAssignment);
		// Contribute Assignment
		RoleAssignment memeberRoleAssignment = UserFactory.eINSTANCE
				.createRoleAssignment();
		memeberRoleAssignment.setName("Contribute");
		memeberRoleAssignment.setMember(memberGroup);
		memeberRoleAssignment.getRoleDefinitionBindings().add(memberRole);
		sitePermission.getOwnedRoleAssignments().add(memeberRoleAssignment);
		// Read Assignment
		RoleAssignment visitorsRoleAssignment = UserFactory.eINSTANCE
				.createRoleAssignment();
		visitorsRoleAssignment.setName("Read");
		visitorsRoleAssignment.setMember(visitorsGroup);
		visitorsRoleAssignment.getRoleDefinitionBindings().add(VisitorsRole);
		sitePermission.getOwnedRoleAssignments().add(visitorsRoleAssignment);
		// Full Control Assignment
		RoleAssignment viewersRoleAssignment = UserFactory.eINSTANCE
				.createRoleAssignment();
		viewersRoleAssignment.setName("ViewOnly");
		viewersRoleAssignment.setMember(viewersGroup);
		viewersRoleAssignment.getRoleDefinitionBindings().add(viewerRole);
		sitePermission.getOwnedRoleAssignments().add(viewersRoleAssignment);
		// Add Role Assignment to web
		sitePermission.getOwnedRoleAssignments().add(visitorsRoleAssignment);
		sitePermission.getOwnedRoleAssignments().add(ownerRoleAssignment);
		sitePermission.getOwnedRoleAssignments().add(memeberRoleAssignment);
		sitePermission.getOwnedRoleAssignments().add(visitorsRoleAssignment);
		sitePermission.getOwnedRoleAssignments().add(viewersRoleAssignment);

		userModel.getSitePermissions().add(sitePermission);
		
		return sitePermission;
	}

	public static SitePermission loadForCreateSitePermission(String webName,
			String webGuID) {
		
		//new UserStandaloneSetup().createInjectorAndDoEMFRegistration();
		SitePermission sitePermission = null;
		Injector injector = Guice.createInjector(new UserRuntimeModule());
	
		XtextResourceSet resourceSet = injector.getInstance(XtextResourceSet.class);
		resourceSet.addLoadOption(XtextResource.OPTION_RESOLVE_ALL, Boolean.TRUE);
		
		getUserFilePath(getProjectName(), UserConstant.USER_FILE_NAME);
		
		if (getUserFile() != null) {
			Resource resource = resourceSet.getResource(
				    URI.createURI("platform:/resource/deneme/user.user"), true);
			
			
			UserModel eobject = (UserModel) resource.getContents().get(0);
			//Default fieldlar yaratılır.
			sitePermission = createDefaultSitePermission(webName, webGuID, eobject);
			//Burada file save edilir.
			try {
				Map options = new HashMap();
			    SaveOptions.defaultOptions().addTo(options);
			    resource.save(options);
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			
			// Kullanıldıktan sonra sıfırlanır cunku kullanıcı dosyayı sılmıs
			// olabılır yada yerını degıstırmıs olabilir.
			setUserFile(null);
			resource.unload();
			resourceSet = null;
		}
		
		return sitePermission;
	}

	public static IProject getProjectName() {
		IEditorPart editorPart = PlatformUI.getWorkbench()
				.getActiveWorkbenchWindow().getActivePage().getActiveEditor();
		IProject activeProject = null;
		if (editorPart != null) {
			IFileEditorInput input = (IFileEditorInput) editorPart
					.getEditorInput();
			IFile file = input.getFile();
			activeProject = file.getProject();
		}
		return activeProject;
	}

	public static void getUserFilePath(IProject project, String name) {
		File[] files = project.getLocation().toFile().listFiles();
		showFiles(files, name);
	}

	public static void showFiles(File[] files, String name) {
		if (getUserFile() == null) {
			for (File file : files) {
				if (name.equals(file.getName())) {
					setUserFile(file);
					break;
				} else {
					if (file.isDirectory()) {
						showFiles(file.listFiles(), name); // Calls same method again.
					}
				}
			}
		}
	}

	public static File getUserFile() {
		return userFile;
	}

	public static void setUserFile(File userFile) {
		SitePermissionUtil.userFile = userFile;
	}
}




I call below code in here :

XtextDocumentProvider class : call loadForCreateSitePermission in the doSaveDocument(IProgressMonitor monitor, Object element,
IDocument document, boolean overwrite) throws CoreException
part of XtextDocumentProvider
((IXtextDocument) document)
				.modify(new IUnitOfWork<Void, XtextResource>() {
@Override
					public java.lang.Void exec(XtextResource state)
							throws Exception {
						int index = 0;
						ContentModel mymodel = (ContentModel) state
								.getContents().get(0);
						// System.out.println(mymodel.getName());
						if (mymodel.getDisplayName() == null
								|| mymodel.getDisplayName().equals(""))
							mymodel.setDisplayName(contentUnitNames.get(index));
						mymodel.setName(contentUnitNames.get(index).trim()
								.replace(" ", ""));
						index++;
Web rootWeb = mymodel.getOwnedWeb();

						if (rootWeb.getDisplayName() == null
								|| rootWeb.getDisplayName().equals("")){
							rootWeb.setDisplayName(contentUnitNames.get(index));
						rootWeb.setName(contentUnitNames.get(index).trim()
								.replace(" ", ""));
                         String guid =rootWeb.getGuID();
						 SitePermissionUtil.loadForCreateSitePermission(contentUnitNames.get(index),
						 guid);
						// System.out.println(rootWeb.getName());
						}
						index++;









Ed Merks wrote on Tue, 23 July 2013 09:38
So you get a different error now (and the code you show is completely
hard coded). I can't comment on your new error without more context.
Perhaps you're trying to save an object which isn't allowed as the root
object of a resource.


On 23/07/2013 3:04 PM, junior developer wrote:
> Hi Ed ,
>
> I change my code :
>
>
> if (getUserFile() != null) {
> Resource resource = resourceSet.getResource(
> URI.createURI("platform:/resource/deneme/user.user"), true);
>
>
>
> but When I save the document I receive an error:
> -------Save Failed
> Attempted to beginRule: L/deneme/user.user, does not match outer scope
> rule: L/deneme/contentdeneme.content------
>
>
> Ps:I want to one elements is created (such as Web ) ,its default
> fields are created in the other user editor)
>
>
> Best regards,

Re: No EObjectDescription could be found in Scope [message #1072820 is a reply to message #1072793] Tue, 23 July 2013 15:16 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 26237
Registered: July 2009
Senior Member
Junior.

I obviously can't run this code without all the dependencies so I'm not
sure what you want me to do with this or what your question is. Use the
debugger and ask more specifically focused questions.


On 23/07/2013 4:03 PM, junior developer wrote:
> Hi Ed,
> I share my complete code and where I call this util class I share it.
>
>
>
>
> package com.mdd4cca.msf.user.user.util;
>
> import java.io.File;
> import java.io.IOException;
> import java.util.HashMap;
> import java.util.Iterator;
> import java.util.List;
> import java.util.Map;
>
> import org.eclipse.core.resources.IFile;
> import org.eclipse.core.resources.IProject;
> import org.eclipse.emf.common.util.URI;
> import org.eclipse.emf.ecore.resource.Resource;
> import org.eclipse.emf.ecore.resource.ResourceSet;
> import org.eclipse.ui.IEditorPart;
> import org.eclipse.ui.IFileEditorInput;
> import org.eclipse.ui.PlatformUI;
> import org.eclipse.xtext.resource.SaveOptions;
> import org.eclipse.xtext.resource.XtextResource;
> import org.eclipse.xtext.resource.XtextResourceSet;
> import com.google.inject.Guice;
> import com.google.inject.Inject;
> import com.google.inject.Injector;
> import com.mdd4cca.msf.user.UserRuntimeModule;
> import com.mdd4cca.msf.user.user.BasePermission;
> import com.mdd4cca.msf.user.user.Group;
> import com.mdd4cca.msf.user.user.RoleAssignment;
> import com.mdd4cca.msf.user.user.RoleDefinition;
> import com.mdd4cca.msf.user.user.SitePermission;
> import com.mdd4cca.msf.user.user.UserFactory;
> import com.mdd4cca.msf.user.user.UserModel;
> import com.mdd4cca.msf.user.user.UserPackage;
>
> public class SitePermissionUtil {
>
> public static File userFile;
>
> public static SitePermission createDefaultSitePermission(String
> webName,
> String webGuID, UserModel userModel) {
> // Initialize the model
> UserPackage.eINSTANCE.eClass();
> // Retrieve the default factory singleton
> UserFactory factory = UserFactory.eINSTANCE;
> // SitePermission
> SitePermission sitePermission = factory.createSitePermission();
> sitePermission.setName(webName);
> sitePermission.setWebGUID(webGuID);
>
> // Owners Group
> Group ownerGroup = UserFactory.eINSTANCE.createGroup();
> ownerGroup.setName("Owners");
> sitePermission.getOwnedGroup().add(ownerGroup);
> // Members Group
> Group memberGroup = UserFactory.eINSTANCE.createGroup();
> memberGroup.setName("Members");
> sitePermission.getOwnedGroup().add(memberGroup);
> // Visitors Group
> Group visitorsGroup = UserFactory.eINSTANCE.createGroup();
> visitorsGroup.setName("Visitors");
> sitePermission.getOwnedGroup().add(visitorsGroup);
> // Viewers Group
> Group viewersGroup = UserFactory.eINSTANCE.createGroup();
> viewersGroup.setName("Viewers");
> sitePermission.getOwnedGroup().add(viewersGroup);
> // viewersRoleDefinitions
> RoleDefinition viewerRole =
> UserFactory.eINSTANCE.createRoleDefinition();
> viewerRole.setName("viewerRoleDefinition");
> viewerRole.getBasePermissions().add(BasePermission.VIEW_LIST_ITEMS);
> viewerRole.getBasePermissions().add(BasePermission.VIEW_VERSIONS);
> viewerRole.getBasePermissions().add(BasePermission.CREATE_ALERTS);
> viewerRole.getBasePermissions().add(BasePermission.VIEW_FORM_PAGES);
> viewerRole.getBasePermissions().add(BasePermission.BROWSE_USER_INFO);
> viewerRole.getBasePermissions().add(BasePermission.USE_REMOTE_AP_IS);
> viewerRole.getBasePermissions().add(
> BasePermission.USE_CLIENT_INTEGRATION);
> viewerRole.getBasePermissions().add(BasePermission.OPEN);
> sitePermission.getOwnedRoleDefinition().add(viewerRole);
> // ownerRoleDefinitions
> RoleDefinition ownerRole =
> UserFactory.eINSTANCE.createRoleDefinition();
> ownerRole.setName("ownerRoleDefinition");
> List<BasePermission> permissions = BasePermission.VALUES;
> for (Iterator<BasePermission> iterator =
> permissions.iterator(); iterator
> .hasNext();) {
> BasePermission basePermission = (BasePermission)
> iterator.next();
> ownerRole.getBasePermissions().add(basePermission);
> }
> sitePermission.getOwnedRoleDefinition().add(ownerRole);
> // memberRoleDefinition
> RoleDefinition memberRole =
> UserFactory.eINSTANCE.createRoleDefinition();
> memberRole.setName("memberRoleDefinition");
> memberRole.getBasePermissions().add(BasePermission.ADD_LIST_ITEMS);
> memberRole.getBasePermissions().add(BasePermission.EDIT_LIST_ITEMS);
> memberRole.getBasePermissions().add(BasePermission.DELETE_LIST_ITEMS);
> memberRole.getBasePermissions().add(BasePermission.VIEW_LIST_ITEMS);
> memberRole.getBasePermissions().add(BasePermission.OPEN_ITEMS);
> memberRole.getBasePermissions().add(BasePermission.VIEW_VERSIONS);
> memberRole.getBasePermissions().add(BasePermission.CREATE_ALERTS);
> memberRole.getBasePermissions().add(BasePermission.BROWSE_DIRECTORIES);
> memberRole.getBasePermissions().add(BasePermission.VIEW_FORM_PAGES);
> memberRole.getBasePermissions().add(BasePermission.BROWSE_USER_INFO);
> memberRole.getBasePermissions().add(BasePermission.USE_REMOTE_AP_IS);
> memberRole.getBasePermissions().add(
> BasePermission.USE_CLIENT_INTEGRATION);
> memberRole.getBasePermissions().add(BasePermission.OPEN);
> memberRole.getBasePermissions().add(BasePermission.EDIT_MY_USER_INFO);
> memberRole.getBasePermissions().add(
> BasePermission.MANAGE_PERSONAL_VIEWS);
> memberRole.getBasePermissions().add(
> BasePermission.ADD_DEL_PRIVATE_WEB_PARTS);
> memberRole.getBasePermissions().add(
> BasePermission.UPDATE_PERSONAL_WEB_PARTS);
> sitePermission.getOwnedRoleDefinition().add(memberRole);
> // visitor Role Definition.
> RoleDefinition VisitorsRole =
> UserFactory.eINSTANCE.createRoleDefinition();
> VisitorsRole.setName("visitorsRoleDefinition");
> VisitorsRole.getBasePermissions().add(BasePermission.VIEW_LIST_ITEMS);
> VisitorsRole.getBasePermissions().add(BasePermission.OPEN_ITEMS);
> VisitorsRole.getBasePermissions().add(BasePermission.VIEW_VERSIONS);
> VisitorsRole.getBasePermissions().add(BasePermission.CREATE_ALERTS);
> VisitorsRole.getBasePermissions().add(BasePermission.VIEW_FORM_PAGES);
> VisitorsRole.getBasePermissions().add(BasePermission.VIEW_LIST_ITEMS);
> VisitorsRole.getBasePermissions().add(BasePermission.BROWSE_USER_INFO);
> VisitorsRole.getBasePermissions().add(BasePermission.USE_REMOTE_AP_IS);
> VisitorsRole.getBasePermissions().add(
> BasePermission.USE_CLIENT_INTEGRATION);
> VisitorsRole.getBasePermissions().add(BasePermission.OPEN);
> sitePermission.getOwnedRoleDefinition().add(VisitorsRole);
> // Full Control Assignment
> RoleAssignment ownerRoleAssignment = UserFactory.eINSTANCE
> .createRoleAssignment();
> ownerRoleAssignment.setName("FullControl");
> ownerRoleAssignment.setMember(ownerGroup);
> ownerRoleAssignment.getRoleDefinitionBindings().add(ownerRole);
> sitePermission.getOwnedRoleAssignments().add(ownerRoleAssignment);
> // Contribute Assignment
> RoleAssignment memeberRoleAssignment = UserFactory.eINSTANCE
> .createRoleAssignment();
> memeberRoleAssignment.setName("Contribute");
> memeberRoleAssignment.setMember(memberGroup);
> memeberRoleAssignment.getRoleDefinitionBindings().add(memberRole);
> sitePermission.getOwnedRoleAssignments().add(memeberRoleAssignment);
> // Read Assignment
> RoleAssignment visitorsRoleAssignment = UserFactory.eINSTANCE
> .createRoleAssignment();
> visitorsRoleAssignment.setName("Read");
> visitorsRoleAssignment.setMember(visitorsGroup);
> visitorsRoleAssignment.getRoleDefinitionBindings().add(VisitorsRole);
> sitePermission.getOwnedRoleAssignments().add(visitorsRoleAssignment);
> // Full Control Assignment
> RoleAssignment viewersRoleAssignment = UserFactory.eINSTANCE
> .createRoleAssignment();
> viewersRoleAssignment.setName("ViewOnly");
> viewersRoleAssignment.setMember(viewersGroup);
> viewersRoleAssignment.getRoleDefinitionBindings().add(viewerRole);
> sitePermission.getOwnedRoleAssignments().add(viewersRoleAssignment);
> // Add Role Assignment to web
> sitePermission.getOwnedRoleAssignments().add(visitorsRoleAssignment);
> sitePermission.getOwnedRoleAssignments().add(ownerRoleAssignment);
> sitePermission.getOwnedRoleAssignments().add(memeberRoleAssignment);
> sitePermission.getOwnedRoleAssignments().add(visitorsRoleAssignment);
> sitePermission.getOwnedRoleAssignments().add(viewersRoleAssignment);
>
> userModel.getSitePermissions().add(sitePermission);
>
> return sitePermission;
> }
>
> public static SitePermission loadForCreateSitePermission(String
> webName,
> String webGuID) {
>
> //new UserStandaloneSetup().createInjectorAndDoEMFRegistration();
> SitePermission sitePermission = null;
> Injector injector = Guice.createInjector(new
> UserRuntimeModule());
>
> XtextResourceSet resourceSet =
> injector.getInstance(XtextResourceSet.class);
> resourceSet.addLoadOption(XtextResource.OPTION_RESOLVE_ALL,
> Boolean.TRUE);
>
> getUserFilePath(getProjectName(), UserConstant.USER_FILE_NAME);
>
> if (getUserFile() != null) {
> Resource resource = resourceSet.getResource(
> URI.createURI("platform:/resource/deneme/user.user"), true);
>
>
> UserModel eobject = (UserModel)
> resource.getContents().get(0);
> //Default fieldlar yaratılır.
> sitePermission = createDefaultSitePermission(webName,
> webGuID, eobject);
> //Burada file save edilir.
> try {
> Map options = new HashMap();
> SaveOptions.defaultOptions().addTo(options);
> resource.save(options);
> } catch (IOException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> }
>
> // Kullanıldıktan sonra sıfırlanır cunku kullanıcı dosyayı
> sılmıs
> // olabılır yada yerını degıstırmıs olabilir.
> setUserFile(null);
> resource.unload();
> resourceSet = null;
> }
>
> return sitePermission;
> }
>
> public static IProject getProjectName() {
> IEditorPart editorPart = PlatformUI.getWorkbench()
> .getActiveWorkbenchWindow().getActivePage().getActiveEditor();
> IProject activeProject = null;
> if (editorPart != null) {
> IFileEditorInput input = (IFileEditorInput) editorPart
> .getEditorInput();
> IFile file = input.getFile();
> activeProject = file.getProject();
> }
> return activeProject;
> }
>
> public static void getUserFilePath(IProject project, String name) {
> File[] files = project.getLocation().toFile().listFiles();
> showFiles(files, name);
> }
>
> public static void showFiles(File[] files, String name) {
> if (getUserFile() == null) {
> for (File file : files) {
> if (name.equals(file.getName())) {
> setUserFile(file);
> break;
> } else {
> if (file.isDirectory()) {
> showFiles(file.listFiles(), name); // Calls
> same method again.
> }
> }
> }
> }
> }
>
> public static File getUserFile() {
> return userFile;
> }
>
> public static void setUserFile(File userFile) {
> SitePermissionUtil.userFile = userFile;
> }
> }
>
>
>
>
> I call below code in here :
>
> XtextDocumentProvider class : call loadForCreateSitePermission in the
> doSaveDocument(IProgressMonitor monitor, Object element,
> IDocument document, boolean overwrite) throws CoreException part of
> XtextDocumentProvider
>
> ((IXtextDocument) document)
> .modify(new IUnitOfWork<Void, XtextResource>() {
> @Override
> public java.lang.Void exec(XtextResource state)
> throws Exception {
> int index = 0;
> ContentModel mymodel = (ContentModel) state
> .getContents().get(0);
> // System.out.println(mymodel.getName());
> if (mymodel.getDisplayName() == null
> || mymodel.getDisplayName().equals(""))
> mymodel.setDisplayName(contentUnitNames.get(index));
> mymodel.setName(contentUnitNames.get(index).trim()
> .replace(" ", ""));
> index++;
> Web rootWeb = mymodel.getOwnedWeb();
>
> if (rootWeb.getDisplayName() == null
> || rootWeb.getDisplayName().equals("")){
> rootWeb.setDisplayName(contentUnitNames.get(index));
> rootWeb.setName(contentUnitNames.get(index).trim()
> .replace(" ", ""));
> String guid =rootWeb.getGuID();
> SitePermissionUtil.loadForCreateSitePermission(contentUnitNames.get(index),
> guid);
> // System.out.println(rootWeb.getName());
> }
> index++;
>
>
>
>
>
>
>
>
>
> Ed Merks wrote on Tue, 23 July 2013 09:38
>> So you get a different error now (and the code you show is completely
>> hard coded). I can't comment on your new error without more
>> context. Perhaps you're trying to save an object which isn't allowed
>> as the root object of a resource.
>>
>>
>> On 23/07/2013 3:04 PM, junior developer wrote:
>> > Hi Ed ,
>> >
>> > I change my code :
>> >
>> >
>> > if (getUserFile() != null) {
>> > Resource resource = resourceSet.getResource(
>> > URI.createURI("platform:/resource/deneme/user.user"), true);
>> >
>> >
>> >
>> > but When I save the document I receive an error:
>> > -------Save Failed
>> > Attempted to beginRule: L/deneme/user.user, does not match outer
>> scope > rule: L/deneme/contentdeneme.content------
>> >
>> >
>> > Ps:I want to one elements is created (such as Web ) ,its default >
>> fields are created in the other user editor)
>> >
>> >
>> > Best regards,
>
>
Re: No EObjectDescription could be found in Scope [message #1073096 is a reply to message #1072820] Wed, 24 July 2013 06:08 Go to previous messageGo to next message
junior developer is currently offline junior developerFriend
Messages: 335
Registered: January 2013
Senior Member
Hi Ed,

My real problem : I do not reach creation element of runtime with programatically.

When I create an instance in the Xtext Editor,How can I control this instance creation
programatically.I want to reach this class is it possible .

I do not control instance creation programatically so , I use save action one element is created ,and then save the editor ->(I do some action related element)

Best regards
Re: No EObjectDescription could be found in Scope [message #1073114 is a reply to message #1073096] Wed, 24 July 2013 07:02 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 26237
Registered: July 2009
Senior Member
Comments below.

On 24/07/2013 8:08 AM, junior developer wrote:
> Hi Ed,
>
> My real problem : I do not reach creation element of runtime with
> programatically.
I can't parse that sentence.
>
> When I create an instance in the Xtext Editor,How can I control this
> instance creation
> programatically.I want to reach this class is it possible .
The editor works on text. Things are created by the parser as the user
enters characters in the text. So it's not clear what instance
creation you're talking about.
>
> I do not control instance creation programatically so , I use save
> action one element is created ,and then save the editor ->(I do some
> action related element)
So the model is modified on save...
>
> Best regards

So you've told me a bunch of things, but I don't see a specific question.
Re: No EObjectDescription could be found in Scope [message #1073124 is a reply to message #1073114] Wed, 24 July 2013 07:24 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 6499
Registered: July 2009
Senior Member
Hi Ed we had this in another topic before: the question is. Is there
a hook into Xtext Object Creation (parsing) that allows me to create
other (explicit) objects (maybe in other fikes )

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de
Re: No EObjectDescription could be found in Scope [message #1073125 is a reply to message #1073114] Wed, 24 July 2013 07:25 Go to previous messageGo to next message
junior developer is currently offline junior developerFriend
Messages: 335
Registered: January 2013
Senior Member
Hi Ed,
you're right, I done project with Xtext and GMF .My project is synchron (GMF-XTEXT).

I reach creation instance programatically in the GMF .But in the Xtext, I do not reach creation instance programatically because you said Xtext has a parser.you see beelow code ,I will change it (it is a my util class for Xtext and GMF) but I wanted to work for Xtext and GMF .So I having problems. I could be told very disorganized,sorry this.Thanks for help

Ed Merks wrote on Wed, 24 July 2013 03:02
Comments below.

On 24/07/2013 8:08 AM, junior developer wrote:
> Hi Ed,
>
> My real problem : I do not reach creation element of runtime with
> programatically.
I can't parse that sentence.
>
> When I create an instance in the Xtext Editor,How can I control this
> instance creation
> programatically.I want to reach this class is it possible .
The editor works on text. Things are created by the parser as the user
enters characters in the text. So it's not clear what instance
creation you're talking about.
>
> I do not control instance creation programatically so , I use save
> action one element is created ,and then save the editor ->(I do some
> action related element)
So the model is modified on save...
>
> Best regards

So you've told me a bunch of things, but I don't see a specific question.
Re: No EObjectDescription could be found in Scope [message #1073141 is a reply to message #1073125] Wed, 24 July 2013 07:55 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 26237
Registered: July 2009
Senior Member
This thread no longer has anything to do with the subject line. So if
you have a question, state a clear subject and provide a full context
and include specific a question.

On 24/07/2013 9:25 AM, junior developer wrote:
> Hi Ed,
> you're right, I done project with Xtext and GMF .My project is
> synchron (GMF-XTEXT).
>
> I reach creation instance programatically in the GMF .But in the
> Xtext, I do not reach creation instance programatically because you
> said Xtext has a parser.you see beelow code ,I will change it (it is
> a my util class for Xtext and GMF) but I wanted to work for Xtext and
> GMF .So I having problems. I could be told very disorganized,sorry
> this.Thanks for help
>
> Ed Merks wrote on Wed, 24 July 2013 03:02
>> Comments below.
>>
>> On 24/07/2013 8:08 AM, junior developer wrote:
>> > Hi Ed,
>> >
>> > My real problem : I do not reach creation element of runtime with
>> > programatically.
>> I can't parse that sentence.
>> >
>> > When I create an instance in the Xtext Editor,How can I control
>> this > instance creation
>> > programatically.I want to reach this class is it possible .
>> The editor works on text. Things are created by the parser as the
>> user enters characters in the text. So it's not clear what
>> instance creation you're talking about.
>> >
>> > I do not control instance creation programatically so , I use save
>> > action one element is created ,and then save the editor ->(I do
>> some > action related element)
>> So the model is modified on save...
>> >
>> > Best regards
>>
>> So you've told me a bunch of things, but I don't see a specific
>> question.
>
Previous Topic:about adding a package
Next Topic:64K limit on InternalParser
Goto Forum:
  


Current Time: Fri Nov 28 18:29:23 GMT 2014

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

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