Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
Examples
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TDT4250
2021
Examples
Commits
c6ad63ca
Commit
c6ad63ca
authored
5 years ago
by
Hallvard Trætteberg
Browse files
Options
Downloads
Patches
Plain Diff
Register AQL validation.
parent
344c00be
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
emf-ws/tdt4250.ra.resource/bnd.bnd
+2
-1
2 additions, 1 deletion
emf-ws/tdt4250.ra.resource/bnd.bnd
emf-ws/tdt4250.ra.resource/src/tdt4250/ra/resource/SampleResource.java
+6
-0
6 additions, 0 deletions
...0.ra.resource/src/tdt4250/ra/resource/SampleResource.java
with
8 additions
and
1 deletion
emf-ws/tdt4250.ra.resource/bnd.bnd
+
2
−
1
View file @
c6ad63ca
...
...
@@ -7,7 +7,8 @@
org.eclipse.emf.common,\
org.eclipse.emf.ecore,\
org.eclipse.emf.ecore.xmi,\
tdt4250.emf.servletsupport.impl;version=latest
tdt4250.emf.servletsupport.impl;version=latest,\
org.eclipse.acceleo.query
-testpath: \
${junit},\
...
...
This diff is collapsed.
Click to expand it.
emf-ws/tdt4250.ra.resource/src/tdt4250/ra/resource/SampleResource.java
+
6
−
0
View file @
c6ad63ca
...
...
@@ -2,7 +2,10 @@ package tdt4250.ra.resource;
import
java.net.URL
;
import
org.eclipse.acceleo.query.ast.AstPackage
;
import
org.eclipse.acceleo.query.delegates.AQLValidationDelegate
;
import
org.eclipse.emf.common.util.URI
;
import
org.eclipse.emf.ecore.EValidator.ValidationDelegate
;
import
org.eclipse.emf.ecore.resource.ResourceSet
;
import
org.osgi.framework.BundleContext
;
import
org.osgi.service.component.annotations.Activate
;
...
...
@@ -18,6 +21,9 @@ public class SampleResource extends ResourceProvider implements IResourceProvide
@Activate
public
void
activate
(
BundleContext
bc
)
{
// register AQL (an OCL implementation) constraint support
ValidationDelegate
.
Registry
.
INSTANCE
.
put
(
AstPackage
.
eNS_URI
,
new
AQLValidationDelegate
());
URL
resource
=
bc
.
getBundle
().
getResource
(
"/tdt4250/ra/resource/sample.ra"
);
setUri
(
URI
.
createURI
(
resource
.
toString
()));
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment