forked from eclipse/vorto
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: shiv12095 <shiv12095@iiitd.ac.in> * Created information model web editor * Adding references to Information Model and modifying its EObject at backend while adding new Function Blocks. Updating code on the editor with code generated at backend * Added generation of variable names on Function Block addition * Created new module repo-http-models. Moved ModelId, ModelResource and ModelType from repo-core to repo-http-models. Fixed the dependecies in repo-core and repo-ui due to this change * Refactored code to create a generic resource linker * 1 Removed unrequired dependecies from vorto-http-models. 2 Changed version of angular-route from 1.3.14 to CQ approved 1.3.13 * Created application configuration file for devtool. Added vorto.repository.base.path as a configutaion
- Loading branch information
Showing
61 changed files
with
1,800 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
...org/eclipse/vorto/editor/infomodel/web/resource/InformationModelResourceSetProvider.xtend
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package org.eclipse.vorto.editor.infomodel.web.resource | ||
|
||
import java.util.HashSet | ||
import java.util.Set | ||
import org.eclipse.emf.ecore.resource.ResourceSet | ||
import org.eclipse.xtext.web.server.IServiceContext | ||
import org.eclipse.xtext.web.server.model.IWebResourceSetProvider | ||
import com.google.inject.Inject | ||
import com.google.inject.Provider | ||
import com.google.inject.Singleton | ||
|
||
@Singleton | ||
class InformationModelResourceSetProvider implements IWebResourceSetProvider { | ||
|
||
@Inject package Provider<ResourceSet> provider | ||
|
||
override ResourceSet get(String resourceId, IServiceContext serviceContext) { | ||
return getResourceSetFromSession(serviceContext) | ||
} | ||
|
||
def ResourceSet getResourceSetFromSession(IServiceContext serviceContext) { | ||
if (serviceContext.getSession().get("set") === null) { | ||
var ResourceSet resourceSet = provider.get() | ||
serviceContext.getSession().put("set", resourceSet) | ||
return resourceSet | ||
} else { | ||
return serviceContext.getSession().get("set") | ||
} | ||
} | ||
|
||
def Set<String> getReferencedResourcesFromSession(IServiceContext serviceContext) { | ||
if (serviceContext.getSession().get("referenceSet") === null) { | ||
var HashSet<String> referencedResourceSet = new HashSet() | ||
serviceContext.getSession().put("referenceSet", referencedResourceSet) | ||
return referencedResourceSet | ||
} else { | ||
return serviceContext.getSession().get("referenceSet") | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.