}
11 |
12 | endpoint type TargetEndpoint
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.tests/test-data/standalone/hello-world.mdsl:
--------------------------------------------------------------------------------
1 | API description HelloWorldAPI
2 |
3 | endpoint type HelloWorldEndpoint
4 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.ui.tests/META-INF/MANIFEST.MF:
--------------------------------------------------------------------------------
1 | Manifest-Version: 1.0
2 | Automatic-Module-Name: io.mdsl.ui.tests
3 | Bundle-ManifestVersion: 2
4 | Bundle-Name: io.mdsl.ui.tests
5 | Bundle-Vendor: MDSL Project
6 | Bundle-Version: 6.0.0.qualifier
7 | Bundle-SymbolicName: io.mdsl.ui.tests; singleton:=true
8 | Bundle-ActivationPolicy: lazy
9 | Require-Bundle: io.mdsl.ui,
10 | org.junit.jupiter.api;bundle-version="[5.0.0,6.0.0)",
11 | org.eclipse.xtext.testing,
12 | org.eclipse.xtext.xbase.testing,
13 | org.eclipse.xtext.xbase.junit,
14 | org.eclipse.core.runtime,
15 | org.eclipse.xtext.ui.testing,
16 | org.eclipse.ui.workbench;resolution:=optional,
17 | org.eclipse.xtext.xbase.ui.testing
18 | Bundle-RequiredExecutionEnvironment: JavaSE-1.8
19 | Export-Package: io.mdsl.ui.tests;x-internal=true
20 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.ui.tests/build.properties:
--------------------------------------------------------------------------------
1 | source.. = src/,\
2 | src-gen/,\
3 | xtend-gen/
4 | bin.includes = .,\
5 | META-INF/
6 | bin.excludes = **/*.xtend
7 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.ui.tests/pom.xml:
--------------------------------------------------------------------------------
1 |
3 | 4.0.0
4 |
5 | io.mdsl
6 | io.mdsl.parent
7 | 6.0.0-SNAPSHOT
8 |
9 | io.mdsl.ui.tests
10 | eclipse-test-plugin
11 |
12 |
13 |
14 |
15 | org.eclipse.xtend
16 | xtend-maven-plugin
17 |
18 |
19 | org.eclipse.tycho
20 | tycho-surefire-plugin
21 |
22 | true
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.ui/META-INF/MANIFEST.MF:
--------------------------------------------------------------------------------
1 | Manifest-Version: 1.0
2 | Automatic-Module-Name: io.mdsl.ui
3 | Bundle-ManifestVersion: 2
4 | Bundle-Name: io.mdsl.ui
5 | Bundle-Vendor: My Company
6 | Bundle-Version: 6.0.0.qualifier
7 | Bundle-SymbolicName: io.mdsl.ui; singleton:=true
8 | Bundle-ActivationPolicy: lazy
9 | Require-Bundle: io.mdsl,
10 | io.mdsl.ide,
11 | org.eclipse.xtext.ui,
12 | org.eclipse.xtext.ui.shared,
13 | org.eclipse.xtext.ui.codetemplates.ui,
14 | org.eclipse.ui.editors;bundle-version="3.14.300",
15 | org.eclipse.ui.ide;bundle-version="3.18.500",
16 | org.eclipse.ui,
17 | org.eclipse.compare,
18 | org.eclipse.xtext.builder,
19 | io.github.microservice-api-patterns.protobufgen,
20 | com.google.guava
21 | Import-Package: org.apache.log4j
22 | Bundle-RequiredExecutionEnvironment: JavaSE-17
23 | Export-Package: io.mdsl.ui.quickfix,
24 | io.mdsl.ui.contentassist,
25 | io.mdsl.ui.internal
26 | Bundle-Activator: io.mdsl.ui.internal.MdslActivator
27 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.ui/build.properties:
--------------------------------------------------------------------------------
1 | source.. = src/,\
2 | src-gen/,\
3 | xtend-gen/
4 | bin.includes = .,\
5 | META-INF/,\
6 | plugin.xml
7 | bin.excludes = **/*.xtend
8 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.ui/pom.xml:
--------------------------------------------------------------------------------
1 |
3 | 4.0.0
4 |
5 | io.mdsl
6 | io.mdsl.parent
7 | 6.0.0-SNAPSHOT
8 |
9 | io.mdsl.ui
10 | eclipse-plugin
11 |
12 |
13 |
14 |
15 | org.eclipse.xtend
16 | xtend-maven-plugin
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.ui/src/io/mdsl/ui/APIDescriptionUiModule.java:
--------------------------------------------------------------------------------
1 | /*
2 | * generated by Xtext 2.35.0
3 | */
4 | package io.mdsl.ui;
5 |
6 | import org.eclipse.ui.plugin.AbstractUIPlugin;
7 |
8 | /**
9 | * Use this class to register components to be used within the Eclipse IDE.
10 | */
11 | public class APIDescriptionUiModule extends AbstractAPIDescriptionUiModule {
12 |
13 | public APIDescriptionUiModule(AbstractUIPlugin plugin) {
14 | super(plugin);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.ui/src/io/mdsl/ui/contentassist/APIDescriptionProposalProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * generated by Xtext 2.20.0
3 | */
4 | package io.mdsl.ui.contentassist;
5 |
6 | /**
7 | * See https://www.eclipse.org/Xtext/documentation/310_eclipse_support.html#content-assist
8 | * on how to customize the content assistant.
9 | */
10 | public class APIDescriptionProposalProvider extends AbstractAPIDescriptionProposalProvider {
11 | }
12 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.ui/src/io/mdsl/ui/editor/MDSLEditor.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.ui.editor;
2 |
3 | import org.eclipse.jface.action.IMenuManager;
4 | import org.eclipse.ui.actions.ActionContext;
5 | import org.eclipse.ui.actions.ActionGroup;
6 | import org.eclipse.xtext.ui.editor.XtextEditor;
7 |
8 | import io.mdsl.ui.actions.GeneratorsActionGroup;
9 |
10 | public class MDSLEditor extends XtextEditor {
11 |
12 | private ActionGroup generatorsGroup;
13 |
14 | @Override
15 | protected void createActions() {
16 | super.createActions();
17 |
18 | generatorsGroup = new GeneratorsActionGroup(this);
19 | }
20 |
21 | @Override
22 | protected void editorContextMenuAboutToShow(IMenuManager menu) {
23 | super.editorContextMenuAboutToShow(menu);
24 |
25 | ActionContext context = new ActionContext(getSelectionProvider().getSelection());
26 | generatorsGroup.setContext(context);
27 | generatorsGroup.fillContextMenu(menu);
28 | generatorsGroup.setContext(null);
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.ui/src/io/mdsl/ui/editor/MDSLQuickMenuCreator.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.ui.editor;
2 |
3 | import org.eclipse.core.commands.AbstractHandler;
4 | import org.eclipse.core.commands.ExecutionEvent;
5 | import org.eclipse.core.commands.ExecutionException;
6 | import org.eclipse.core.commands.IHandler;
7 | import org.eclipse.ui.actions.QuickMenuCreator;
8 |
9 | public abstract class MDSLQuickMenuCreator extends QuickMenuCreator {
10 |
11 | public IHandler createHandler() {
12 | return new AbstractHandler() {
13 | @Override
14 | public Object execute(ExecutionEvent event) throws ExecutionException {
15 | createMenu();
16 | return null;
17 | }
18 | };
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.ui/src/io/mdsl/ui/handler/ALPSGenerationHandler.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.ui.handler;
2 |
3 | import org.eclipse.xtext.generator.IGenerator2;
4 |
5 | import com.google.inject.Inject;
6 |
7 | import io.mdsl.generator.ALPSGenerator;
8 |
9 | public class ALPSGenerationHandler extends AbstractGenerationHandler {
10 |
11 | @Inject
12 | private ALPSGenerator generator;
13 |
14 | @Override
15 | protected IGenerator2 getGenerator() {
16 | return generator;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.ui/src/io/mdsl/ui/handler/AsyncAPIGenerationHandler.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.ui.handler;
2 |
3 | import org.eclipse.core.commands.ExecutionEvent;
4 | import org.eclipse.xtext.generator.IGenerator2;
5 | import com.google.inject.Inject;
6 | import io.mdsl.generator.asyncapi.AsyncApiGenerator;
7 |
8 | public class AsyncAPIGenerationHandler extends AbstractGenerationHandler {
9 |
10 | @Inject
11 | private AsyncApiGenerator generator;
12 |
13 | @Override
14 | protected IGenerator2 getGenerator() {
15 | return generator;
16 | }
17 |
18 | @Override
19 | protected void postGeneration(ExecutionEvent event) {
20 |
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.ui/src/io/mdsl/ui/handler/AsyncMDSLGenerationHandler.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.ui.handler;
2 |
3 | import org.eclipse.xtext.generator.IGenerator2;
4 | import com.google.inject.Inject;
5 | import io.mdsl.generator.AsyncMDSLGenerator;
6 |
7 | public class AsyncMDSLGenerationHandler extends AbstractGenerationHandler {
8 |
9 | @Inject
10 | private AsyncMDSLGenerator generator;
11 |
12 | @Override
13 | protected IGenerator2 getGenerator() {
14 | return generator;
15 | }
16 | }
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.ui/src/io/mdsl/ui/handler/GenModelJSONExporterHandler.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.ui.handler;
2 |
3 | import org.eclipse.xtext.generator.IGenerator2;
4 |
5 | import com.google.inject.Inject;
6 |
7 | import io.mdsl.generator.GenModelJSONExporter;
8 |
9 | public class GenModelJSONExporterHandler extends AbstractGenerationHandler {
10 |
11 | @Inject
12 | private GenModelJSONExporter generator;
13 |
14 | @Override
15 | protected IGenerator2 getGenerator() {
16 | return generator;
17 | }
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.ui/src/io/mdsl/ui/handler/GenModelYAMLExporterHandler.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.ui.handler;
2 |
3 | import org.eclipse.xtext.generator.IGenerator2;
4 |
5 | import com.google.inject.Inject;
6 |
7 | import io.mdsl.generator.GenModelYAMLExporter;
8 |
9 | public class GenModelYAMLExporterHandler extends AbstractGenerationHandler {
10 |
11 | @Inject
12 | private GenModelYAMLExporter generator;
13 |
14 | @Override
15 | protected IGenerator2 getGenerator() {
16 | return generator;
17 | }
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.ui/src/io/mdsl/ui/handler/GraphQLGenerationHandler.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.ui.handler;
2 |
3 | import org.eclipse.xtext.generator.IGenerator2;
4 |
5 | import com.google.inject.Inject;
6 |
7 | import io.mdsl.generator.GraphQLGenerator;
8 |
9 | public class GraphQLGenerationHandler extends AbstractGenerationHandler {
10 |
11 | @Inject
12 | private GraphQLGenerator generator;
13 |
14 | @Override
15 | protected IGenerator2 getGenerator() {
16 | return generator;
17 | }
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.ui/src/io/mdsl/ui/handler/JavaGenerationHandler.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.ui.handler;
2 |
3 | import org.eclipse.xtext.generator.IGenerator2;
4 |
5 | import com.google.inject.Inject;
6 |
7 | import io.mdsl.generator.JavaGenerator;
8 |
9 | public class JavaGenerationHandler extends AbstractGenerationHandler {
10 |
11 | @Inject
12 | private JavaGenerator generator;
13 |
14 | @Override
15 | protected IGenerator2 getGenerator() {
16 | return generator;
17 | }
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.ui/src/io/mdsl/ui/handler/JolieGenerationHandler.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.ui.handler;
2 |
3 | import org.eclipse.xtext.generator.IGenerator2;
4 |
5 | import com.google.inject.Inject;
6 |
7 | import io.mdsl.generator.JolieGenerator;
8 |
9 | public class JolieGenerationHandler extends AbstractGenerationHandler {
10 |
11 | @Inject
12 | private JolieGenerator generator;
13 |
14 | @Override
15 | protected IGenerator2 getGenerator() {
16 | return generator;
17 | }
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.ui/src/io/mdsl/ui/handler/QDARTransformationHandler.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.ui.handler;
2 |
3 | import org.eclipse.xtext.generator.IGenerator2;
4 |
5 | import com.google.inject.Inject;
6 |
7 | // TODO rename or remove/disable (also supported as Quick Fix)
8 | import io.mdsl.ui.handler.refactoring.MoveOperationRefactoring;
9 |
10 | public class QDARTransformationHandler extends AbstractGenerationHandler {
11 |
12 | @Inject
13 | private MoveOperationRefactoring generator;
14 |
15 | @Override
16 | protected IGenerator2 getGenerator() {
17 | return generator;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.ui/src/io/mdsl/ui/handler/SketchMinerGenerationHandler.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.ui.handler;
2 |
3 | import org.eclipse.xtext.generator.IGenerator2;
4 |
5 | import com.google.inject.Inject;
6 |
7 | import io.mdsl.generator.SketchMinerGenerator;
8 |
9 | public class SketchMinerGenerationHandler extends AbstractGenerationHandler {
10 |
11 | @Inject
12 | private SketchMinerGenerator generator;
13 |
14 | @Override
15 | protected IGenerator2 getGenerator() {
16 | return generator;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.ui/src/io/mdsl/ui/handler/wizard/TextFileGenerationWizardContext.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.ui.handler.wizard;
2 |
3 | import org.eclipse.core.resources.IFile;
4 |
5 | /**
6 | * Input data for text file generation (Freemarker generator).
7 | */
8 | public class TextFileGenerationWizardContext {
9 |
10 | private IFile freemarkerTemplateFile;
11 | private String targetFileName;
12 |
13 | public void setFreemarkerTemplateFile(IFile freemarkerTemplateFile) {
14 | this.freemarkerTemplateFile = freemarkerTemplateFile;
15 | }
16 |
17 | public IFile getFreemarkerTemplateFile() {
18 | return freemarkerTemplateFile;
19 | }
20 |
21 | public void setTargetFileName(String targetFileName) {
22 | this.targetFileName = targetFileName;
23 | }
24 |
25 | public String getTargetFileName() {
26 | return targetFileName;
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.ui/src/io/mdsl/ui/handler/wizard/components/FreemarkerFileChooser.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.ui.handler.wizard.components;
2 |
3 | import org.eclipse.swt.widgets.Composite;
4 |
5 | /**
6 | * Component to choose a Freemarker template file.
7 | */
8 | public class FreemarkerFileChooser extends FileByExtensionChooser {
9 |
10 | public FreemarkerFileChooser(Composite parent) {
11 | super(parent, "ftl");
12 | }
13 |
14 | @Override
15 | protected String getDialogTitle() {
16 | return "Choose Freemarker (*.ftl) file";
17 | }
18 |
19 | @Override
20 | protected String getDialogMessage() {
21 | return "Select the *.ftl file you want to use for generation:";
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.ui/src/io/mdsl/ui/handler/wizard/page/MDSLWizardPage.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.ui.handler.wizard.page;
2 |
3 | import org.eclipse.jface.wizard.WizardPage;
4 | import org.eclipse.swt.program.Program;
5 |
6 | public abstract class MDSLWizardPage extends WizardPage {
7 |
8 | public MDSLWizardPage(String title) {
9 | super(title);
10 | }
11 |
12 | @Override
13 | public void performHelp() {
14 | Program.launch("https://microservice-api-patterns.github.io/MDSL-Specification/");
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.ui/src/io/mdsl/ui/labeling/APIDescriptionDescriptionLabelProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * generated by Xtext 2.20.0
3 | */
4 | package io.mdsl.ui.labeling;
5 |
6 | import org.eclipse.xtext.ui.label.DefaultDescriptionLabelProvider;
7 |
8 | /**
9 | * Provides labels for IEObjectDescriptions and IResourceDescriptions.
10 | *
11 | * https://www.eclipse.org/Xtext/documentation/310_eclipse_support.html#label-provider
12 | */
13 | public class APIDescriptionDescriptionLabelProvider extends DefaultDescriptionLabelProvider {
14 |
15 | // Labels and icons can be computed like this:
16 |
17 | // String text(IEObjectDescription ele) {
18 | // return ele.getName().toString();
19 | // }
20 | //
21 | // String image(IEObjectDescription ele) {
22 | // return ele.getEClass().getName() + ".gif";
23 | // }
24 | }
25 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.ui/src/io/mdsl/ui/labeling/APIDescriptionLabelProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * generated by Xtext 2.20.0
3 | */
4 | package io.mdsl.ui.labeling;
5 |
6 | import com.google.inject.Inject;
7 | import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
8 | import org.eclipse.xtext.ui.label.DefaultEObjectLabelProvider;
9 |
10 | /**
11 | * Provides labels for EObjects.
12 | *
13 | * See https://www.eclipse.org/Xtext/documentation/310_eclipse_support.html#label-provider
14 | */
15 | public class APIDescriptionLabelProvider extends DefaultEObjectLabelProvider {
16 |
17 | @Inject
18 | public APIDescriptionLabelProvider(AdapterFactoryLabelProvider delegate) {
19 | super(delegate);
20 | }
21 |
22 | // Labels and icons can be computed like this:
23 |
24 | // String text(Greeting ele) {
25 | // return "A greeting to " + ele.getName();
26 | // }
27 | //
28 | // String image(Greeting ele) {
29 | // return "Greeting.gif";
30 | // }
31 | }
32 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.ui/src/io/mdsl/ui/outline/APIDescriptionOutlineTreeProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * generated by Xtext 2.20.0
3 | */
4 | package io.mdsl.ui.outline;
5 |
6 | import org.eclipse.xtext.ui.editor.outline.impl.DefaultOutlineTreeProvider;
7 |
8 | /**
9 | * Customization of the default outline structure.
10 | *
11 | * See https://www.eclipse.org/Xtext/documentation/310_eclipse_support.html#outline
12 | */
13 | public class APIDescriptionOutlineTreeProvider extends DefaultOutlineTreeProvider {
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.ui/src/io/mdsl/ui/quickfix/AddApplicationFlowForScenario.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.ui.quickfix;
2 |
3 | import org.eclipse.emf.ecore.EObject;
4 | import org.eclipse.xtext.ui.editor.model.edit.IModificationContext;
5 |
6 | import io.mdsl.apiDescription.IntegrationScenario;
7 | import io.mdsl.transformations.FlowTransformations;
8 |
9 | class AddApplicationFlowForScenario extends QuickfixSemanticModification {
10 |
11 | @Override
12 | public void performQuickfix(EObject element, IModificationContext context) {
13 | IntegrationScenario scenario = (IntegrationScenario) element;
14 | FlowTransformations ft = new FlowTransformations();
15 | ft.addApplicationFlowForScenario(scenario);
16 | }
17 | }
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.ui/src/io/mdsl/ui/quickfix/AddApplicationFlowStep.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.ui.quickfix;
2 |
3 | import org.eclipse.emf.ecore.EObject;
4 | import org.eclipse.xtext.ui.editor.model.edit.IModificationContext;
5 |
6 | import io.mdsl.transformations.FlowTransformations;
7 |
8 | class AddApplicationFlowStep extends QuickfixSemanticModification {
9 | private String stepType;
10 |
11 | public AddApplicationFlowStep(String stepType) {
12 | this.stepType = stepType;
13 | }
14 |
15 | @Override
16 | public void performQuickfix(EObject element, IModificationContext context) {
17 | FlowTransformations ft = new FlowTransformations();
18 |
19 | if (stepType.equals(FlowTransformations.CIS_STEP)) {
20 | ft.addCisStep(element);
21 | } else if (stepType.equals(FlowTransformations.DEP_STEP)) {
22 | ft.addDepStep(element);
23 | }
24 | }
25 | }
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.ui/src/io/mdsl/ui/quickfix/AddBranchWithMerge.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.ui.quickfix;
2 |
3 | import org.eclipse.emf.ecore.EObject;
4 | import org.eclipse.xtext.ui.editor.model.edit.IModificationContext;
5 |
6 | import io.mdsl.transformations.FlowTransformations;
7 |
8 | class AddBranchWithMerge extends QuickfixSemanticModification {
9 | private String branchingType;
10 |
11 | public AddBranchWithMerge(String branchingType) {
12 | this.branchingType = branchingType;
13 | }
14 |
15 | @Override
16 | public void performQuickfix(EObject element, IModificationContext context) {
17 | FlowTransformations ft = new FlowTransformations();
18 | ft.addBranchesWithMerge(element, branchingType);
19 | }
20 | }
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.ui/src/io/mdsl/ui/quickfix/AddEndpointTypeForScenario.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.ui.quickfix;
2 |
3 | import org.eclipse.emf.ecore.EObject;
4 | import org.eclipse.xtext.ui.editor.model.edit.IModificationContext;
5 |
6 | import io.mdsl.apiDescription.IntegrationScenario;
7 | import io.mdsl.transformations.ScenarioTransformations;
8 | import io.mdsl.transformations.TransformationHelpers;
9 |
10 | public class AddEndpointTypeForScenario extends QuickfixSemanticModification {
11 |
12 | private boolean generateOperations;
13 |
14 | AddEndpointTypeForScenario(boolean withOperations) {
15 | this.generateOperations = withOperations;
16 | }
17 |
18 | @Override
19 | public void performQuickfix(EObject element, IModificationContext context) {
20 | if (!(element instanceof IntegrationScenario)) {
21 | TransformationHelpers.reportError("AddEndpointTypeForScenario expects an IntegrationScenario as input");
22 | }
23 | IntegrationScenario scenario = (IntegrationScenario) element;
24 | ScenarioTransformations et = new ScenarioTransformations();
25 | et.addEndpointForScenario(scenario, generateOperations);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.ui/src/io/mdsl/ui/quickfix/AddEndpointTypeSupportingFlow.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.ui.quickfix;
2 |
3 | import org.eclipse.emf.ecore.EObject;
4 | import org.eclipse.xtext.ui.editor.model.edit.IModificationContext;
5 |
6 | import io.mdsl.apiDescription.Orchestration;
7 | import io.mdsl.transformations.FlowTransformations;;
8 |
9 | class AddEndpointTypeSupportingFlow extends QuickfixSemanticModification {
10 | @Override
11 | public void performQuickfix(EObject element, IModificationContext context) {
12 | Orchestration flow = (Orchestration) element;
13 | FlowTransformations ft = new FlowTransformations();
14 | ft.addEndpointTypeSupportingFlow(flow);
15 | }
16 | }
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.ui/src/io/mdsl/ui/quickfix/AddEndpointTypeWithPatternSupport.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.ui.quickfix;
2 |
3 | import org.eclipse.emf.ecore.EObject;
4 | import org.eclipse.xtext.ui.editor.model.edit.IModificationContext;
5 |
6 | import io.mdsl.apiDescription.IntegrationScenario;
7 | import io.mdsl.transformations.TransformationChains;
8 | import io.mdsl.transformations.TransformationHelpers;
9 |
10 | public class AddEndpointTypeWithPatternSupport extends QuickfixSemanticModification {
11 |
12 | private String desiredQuality;
13 |
14 | AddEndpointTypeWithPatternSupport(String desiredQuality) {
15 | this.desiredQuality = desiredQuality;
16 | }
17 |
18 | @Override
19 | public void performQuickfix(EObject element, IModificationContext context) {
20 | if (!(element instanceof IntegrationScenario)) {
21 | TransformationHelpers.reportError("AddEndpointTypeWithPatternSupport expects an IntegrationScenario as input");
22 | }
23 | TransformationChains tc = new TransformationChains();
24 | tc.applyEntireChainToScenariosAndItsStories((IntegrationScenario) element, desiredQuality);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.ui/src/io/mdsl/ui/quickfix/AddHttpParameterBindingsForElements.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.ui.quickfix;
2 |
3 | import org.eclipse.emf.ecore.EObject;
4 | import org.eclipse.xtext.ui.editor.model.edit.IModificationContext;
5 |
6 | import io.mdsl.apiDescription.HTTPOperationBinding;
7 | import io.mdsl.transformations.HTTPBindingTransformations;
8 | import io.mdsl.transformations.TransformationHelpers;
9 |
10 | class AddHttpParameterBindingsForElements extends QuickfixSemanticModification {
11 |
12 | public AddHttpParameterBindingsForElements() {
13 | }
14 |
15 | @Override
16 | public void performQuickfix(EObject element, IModificationContext context) {
17 |
18 | if (!(element instanceof HTTPOperationBinding)) {
19 | TransformationHelpers.reportError("AddHttpParameterBinding expects an HTTP Operation Binding.");
20 | return;
21 | }
22 |
23 | HTTPOperationBinding opb = (HTTPOperationBinding) element;
24 | HTTPBindingTransformations hbts = new HTTPBindingTransformations();
25 | hbts.addHttpParameterBindingsForElements(opb);
26 | }
27 | }
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.ui/src/io/mdsl/ui/quickfix/AddOperationForFlowStep.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.ui.quickfix;
2 |
3 | import org.eclipse.emf.ecore.EObject;
4 | import org.eclipse.xtext.ui.editor.model.edit.IModificationContext;
5 |
6 | import io.mdsl.transformations.FlowTransformations;
7 |
8 | class AddOperationForFlowStep extends QuickfixSemanticModification {
9 | private String stepType;
10 |
11 | public AddOperationForFlowStep(String stepType) {
12 | this.stepType = stepType;
13 | }
14 |
15 | @Override
16 | public void performQuickfix(EObject element, IModificationContext context) {
17 | FlowTransformations ft = new FlowTransformations();
18 | ft.addOperationForFlowStep(element, stepType);
19 | }
20 | }
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.ui/src/io/mdsl/ui/quickfix/AddOperationForScenarioStory.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.ui.quickfix;
2 |
3 | import org.eclipse.emf.ecore.EObject;
4 | import org.eclipse.xtext.ui.editor.model.edit.IModificationContext;
5 |
6 | import io.mdsl.apiDescription.IntegrationStory;
7 | import io.mdsl.transformations.ScenarioTransformations;
8 |
9 | public class AddOperationForScenarioStory extends QuickfixSemanticModification {
10 |
11 | AddOperationForScenarioStory() {
12 | }
13 |
14 | @Override
15 | public void performQuickfix(EObject element, IModificationContext context) {
16 |
17 | IntegrationStory story = (IntegrationStory) element;
18 | ScenarioTransformations et = new ScenarioTransformations();
19 | et.addOperationForScenarioStory(story);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.ui/src/io/mdsl/ui/quickfix/AddOperationsAccordingToMAPDecoration.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.ui.quickfix;
2 |
3 | import org.eclipse.emf.ecore.EObject;
4 | import org.eclipse.xtext.ui.editor.model.edit.IModificationContext;
5 |
6 | import io.mdsl.apiDescription.EndpointContract;
7 | import io.mdsl.transformations.OperationTransformations;
8 |
9 | public class AddOperationsAccordingToMAPDecoration extends QuickfixSemanticModification {
10 |
11 | @Override
12 | public void performQuickfix(EObject element, IModificationContext context) {
13 | EndpointContract ec = (EndpointContract) element;
14 | OperationTransformations ot = new OperationTransformations();
15 | ot.addOperationsForRole(ec);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.ui/src/io/mdsl/ui/quickfix/AddWishList.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.ui.quickfix;
2 |
3 | import org.eclipse.emf.ecore.EObject;
4 | import org.eclipse.xtext.ui.editor.model.edit.IModificationContext;
5 |
6 | import io.mdsl.apiDescription.Operation;
7 | import io.mdsl.transformations.MessageTransformations;
8 | import io.mdsl.transformations.TransformationHelpers;
9 |
10 | class AddWishList extends QuickfixSemanticModification {
11 | private String type;
12 |
13 | public AddWishList(String string) {
14 | type = string;
15 | }
16 |
17 | @Override
18 | public void performQuickfix(EObject element, IModificationContext context) {
19 | if(type.equals("fromOperation")) {
20 | if(!(element instanceof Operation)) {
21 | TransformationHelpers.reportError("This type of Add Wish List Quick Fix can only be applied if an operation is selected.");
22 | }
23 | Operation operation = (Operation) element;
24 | MessageTransformations.addWishList(operation);
25 | }
26 | else {
27 | TransformationHelpers.reportError("Add Wish List Quick Fix of unknown type: " + type);
28 | }
29 | }
30 | }
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.ui/src/io/mdsl/ui/quickfix/AddWishTemplate.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.ui.quickfix;
2 |
3 | import org.eclipse.emf.ecore.EObject;
4 | import org.eclipse.xtext.ui.editor.model.edit.IModificationContext;
5 |
6 | import io.mdsl.apiDescription.Operation;
7 | import io.mdsl.transformations.MessageTransformations;
8 | import io.mdsl.transformations.TransformationHelpers;
9 |
10 | class AddWishTemplate extends QuickfixSemanticModification {
11 | public AddWishTemplate() {
12 | }
13 |
14 | @Override
15 | public void performQuickfix(EObject element, IModificationContext context) {
16 | if (!(element instanceof Operation)) {
17 | TransformationHelpers.reportError("This type of Add Wish Template Quick Fix can only be applied if an operation is selected.");
18 | }
19 | Operation operation = (Operation) element;
20 | MessageTransformations.addWishTemplate(operation.getRequestMessage().getPayload(), operation.getResponseMessage().getPayload());
21 | }
22 | }
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.ui/src/io/mdsl/ui/quickfix/CombinedFlowStepSplit.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.ui.quickfix;
2 |
3 | import org.eclipse.emf.ecore.EObject;
4 | import org.eclipse.xtext.ui.editor.model.edit.IModificationContext;
5 | import org.eclipse.xtext.ui.editor.model.edit.ISemanticModification;
6 |
7 | import io.mdsl.apiDescription.CombinedInvocationStep;
8 | import io.mdsl.exception.MDSLException;
9 | import io.mdsl.transformations.FlowTransformations;
10 |
11 | class CombinedFlowStepSplit implements ISemanticModification {
12 | public CombinedFlowStepSplit() {
13 | }
14 |
15 | @Override
16 | public void apply(EObject element, IModificationContext context) throws Exception {
17 | FlowTransformations ft = new FlowTransformations();
18 | if(element instanceof CombinedInvocationStep) {
19 | ft.splitCombinedFlowStep((CombinedInvocationStep) element);
20 | }
21 | else {
22 | throw new MDSLException("This transformation operates on Combined Cis/Dep steps only.");
23 | }
24 | }
25 | }
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.ui/src/io/mdsl/ui/quickfix/CompleteDataType.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.ui.quickfix;
2 |
3 | import org.eclipse.emf.ecore.EObject;
4 | import org.eclipse.xtext.ui.editor.model.edit.IModificationContext;
5 |
6 | import io.mdsl.apiDescription.RoleAndType;
7 | import io.mdsl.transformations.DataTypeTransformations;
8 |
9 | class CompleteDataType extends QuickfixSemanticModification {
10 | private String type;
11 |
12 | public CompleteDataType(String type) {
13 | this.type = type;
14 | }
15 |
16 | @Override
17 | public void performQuickfix(EObject element, IModificationContext context) {
18 | RoleAndType rat = (RoleAndType) element;
19 | DataTypeTransformations.completeDataType(rat, type);
20 | }
21 | }
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.ui/src/io/mdsl/ui/quickfix/CompleteOperationWithErrorReport.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.ui.quickfix;
2 |
3 | import org.eclipse.emf.ecore.EObject;
4 | import org.eclipse.xtext.ui.editor.model.edit.IModificationContext;
5 |
6 | import io.mdsl.apiDescription.Operation;
7 | import io.mdsl.transformations.OperationTransformations;
8 |
9 | public class CompleteOperationWithErrorReport extends QuickfixSemanticModification {
10 |
11 | public void performQuickfix(EObject element, IModificationContext context) {
12 | // this is a very basic transformation, merely demonstrating the report syntax
13 | Operation operation = (Operation) element;
14 | OperationTransformations ot = new OperationTransformations();
15 | ot.completeOperationWithErrorReport(operation);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.ui/src/io/mdsl/ui/quickfix/CompleteOperationWithSecurityPolicy.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.ui.quickfix;
2 |
3 | import org.eclipse.emf.ecore.EObject;
4 | import org.eclipse.xtext.ui.editor.model.edit.IModificationContext;
5 |
6 | import io.mdsl.apiDescription.Operation;
7 | import io.mdsl.transformations.OperationTransformations;
8 |
9 | public class CompleteOperationWithSecurityPolicy extends QuickfixSemanticModification {
10 |
11 | public void performQuickfix(EObject element, IModificationContext context) {
12 | // this is a very basic transformation, merely demonstrating the policy syntax
13 | Operation operation = (Operation) element;
14 | OperationTransformations ot = new OperationTransformations();
15 | ot.completeOperationWithSecurityPolicy(operation);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.ui/src/io/mdsl/ui/quickfix/ConsolidateFlowSteps.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.ui.quickfix;
2 |
3 | import org.eclipse.emf.ecore.EObject;
4 | import org.eclipse.xtext.ui.editor.model.edit.IModificationContext;
5 |
6 | import io.mdsl.apiDescription.DomainEventProductionStep;
7 | import io.mdsl.transformations.FlowTransformations;
8 | import io.mdsl.transformations.TransformationHelpers;
9 |
10 | class ConsolidateFlowSteps extends QuickfixSemanticModification {
11 | private String branchingType;
12 |
13 | public ConsolidateFlowSteps(String branchingType) {
14 | this.branchingType = branchingType;
15 | }
16 |
17 | @Override
18 | public void performQuickfix(EObject element, IModificationContext context) {
19 | FlowTransformations ft = new FlowTransformations();
20 | if (element instanceof DomainEventProductionStep) {
21 | ft.consolidateFlowSteps((DomainEventProductionStep) element, branchingType);
22 | } else {
23 | TransformationHelpers.reportError("This transformation operates on Single Event Productions only.");
24 | }
25 | }
26 | }
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.ui/src/io/mdsl/ui/quickfix/ConvertFlowToBPMN.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.ui.quickfix;
2 |
3 | import org.eclipse.emf.ecore.EObject;
4 | import org.eclipse.swt.program.Program;
5 | import org.eclipse.xtext.ui.editor.model.edit.IModificationContext;
6 |
7 | import io.mdsl.apiDescription.Orchestration;
8 | import io.mdsl.generator.bpmn.SketchMinerLinkCreator;
9 | import io.mdsl.utils.MDSLLogger;;
10 |
11 | class ConvertFlowToBPMN extends QuickfixSemanticModification {
12 | @Override
13 | public void performQuickfix(EObject element, IModificationContext context) {
14 | Orchestration flow = (Orchestration) element;
15 | SketchMinerLinkCreator smlc = new SketchMinerLinkCreator();
16 | String smStoryAsLink = smlc.createSketchMinerLink(flow);
17 | MDSLLogger.reportDetailedInformation(smStoryAsLink);
18 | // open browser with BPMN story link
19 | Program.launch(smStoryAsLink);
20 | }
21 | }
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.ui/src/io/mdsl/ui/quickfix/ConvertToStringDataType.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.ui.quickfix;
2 |
3 | import org.eclipse.emf.ecore.EObject;
4 | import org.eclipse.xtext.ui.editor.model.edit.IModificationContext;
5 |
6 | import io.mdsl.apiDescription.GenericParameter;
7 | import io.mdsl.transformations.DataTypeTransformations;
8 |
9 | class ConvertToStringDataType extends QuickfixSemanticModification {
10 | @Override
11 | public void performQuickfix(EObject element, IModificationContext context) {
12 | GenericParameter gp = (GenericParameter) element;
13 | DataTypeTransformations.convertToStringType(gp);
14 | }
15 | }
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.ui/src/io/mdsl/ui/quickfix/DecorateAsMAPInformationHolderResource.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.ui.quickfix;
2 |
3 | import org.eclipse.emf.ecore.EObject;
4 | import org.eclipse.xtext.ui.editor.model.edit.IModificationContext;
5 |
6 | import io.mdsl.apiDescription.EndpointContract;
7 | import io.mdsl.transformations.MAPDecoratorHelpers;
8 |
9 | public class DecorateAsMAPInformationHolderResource extends QuickfixSemanticModification {
10 |
11 | @Override
12 | public void performQuickfix(EObject element, IModificationContext context) {
13 | EndpointContract etype = (EndpointContract) element;
14 | MAPDecoratorHelpers.setRoleToInformationHolderResource(etype);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.ui/src/io/mdsl/ui/quickfix/DecorateAsMAPProcessingResource.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.ui.quickfix;
2 |
3 | import org.eclipse.emf.ecore.EObject;
4 | import org.eclipse.xtext.ui.editor.model.edit.IModificationContext;
5 |
6 | // import io.mdsl.transformations.TransformationHelper;
7 |
8 | import io.mdsl.apiDescription.EndpointContract;
9 | import io.mdsl.transformations.MAPDecoratorHelpers;
10 |
11 | public class DecorateAsMAPProcessingResource extends QuickfixSemanticModification {
12 |
13 | @Override
14 | public void performQuickfix(EObject element, IModificationContext context) {
15 | EndpointContract etype = (EndpointContract) element;
16 | MAPDecoratorHelpers.setRoleToProcessingResource(etype);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.ui/src/io/mdsl/ui/quickfix/IntroduceParameterTreeDTO.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.ui.quickfix;
2 |
3 | import org.eclipse.emf.ecore.EObject;
4 | import org.eclipse.xtext.ui.editor.model.edit.IModificationContext;
5 | import org.eclipse.xtext.ui.editor.model.edit.ISemanticModification;
6 |
7 | import io.mdsl.transformations.MessageTransformations;
8 |
9 | class IntroduceParameterTreeDTO extends QuickfixSemanticModification {
10 |
11 | @Override
12 | public void performQuickfix(EObject element, IModificationContext context) {
13 | MessageTransformations.addParameterTreeWrapper(element);
14 | }
15 | }
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.ui/src/io/mdsl/ui/quickfix/MakeRequestConditional.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.ui.quickfix;
2 |
3 | import org.eclipse.emf.ecore.EObject;
4 | import org.eclipse.xtext.ui.editor.model.edit.IModificationContext;
5 |
6 | import io.mdsl.apiDescription.Operation;
7 | import io.mdsl.transformations.MessageTransformations;
8 | import io.mdsl.transformations.TransformationHelpers;
9 |
10 | class MakeRequestConditional extends QuickfixSemanticModification {
11 | private String variant = "lastModifiedAt";
12 |
13 | public MakeRequestConditional(String variant) {
14 | this.variant = variant;
15 | }
16 |
17 | @Override
18 | public void performQuickfix(EObject element, IModificationContext context) {
19 | if (!(element instanceof Operation)) {
20 | TransformationHelpers.reportError("This type of Add Wish Template Quick Fix can only be applied if an operation is selected.");
21 | }
22 | Operation operation = (Operation) element;
23 | MessageTransformations.makeRequestConditional(operation, variant);
24 | }
25 | }
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.ui/src/io/mdsl/ui/quickfix/SegregateCommandsFromQueries.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.ui.quickfix;
2 |
3 | import org.eclipse.emf.ecore.EObject;
4 | import org.eclipse.xtext.ui.editor.model.edit.IModificationContext;
5 |
6 | import io.mdsl.apiDescription.EndpointContract;
7 | import io.mdsl.transformations.EndpointTransformations;
8 | import io.mdsl.transformations.TransformationHelpers;
9 |
10 | public class SegregateCommandsFromQueries extends QuickfixSemanticModification {
11 |
12 | private boolean generateOperations;
13 |
14 | SegregateCommandsFromQueries() {
15 | }
16 |
17 | @Override
18 | public void performQuickfix(EObject element, IModificationContext context) {
19 | if (!(element instanceof EndpointContract)) {
20 | TransformationHelpers.reportError("SegregateCommandsFromQueries expects an EndpointContract as input");
21 | }
22 |
23 | EndpointTransformations ets = new EndpointTransformations();
24 | ets.separateCommandsFromQueries((EndpointContract)element);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl.ui/src/io/mdsl/ui/quickfix/SplitOperation.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.ui.quickfix;
2 |
3 | import org.eclipse.emf.ecore.EObject;
4 | import org.eclipse.xtext.ui.editor.model.edit.IModificationContext;
5 |
6 | import io.mdsl.apiDescription.Operation;
7 | import io.mdsl.transformations.OperationTransformations;
8 | import io.mdsl.transformations.TransformationHelpers;
9 |
10 | class SplitOperation extends QuickfixSemanticModification {
11 | private boolean touchResponse=false;
12 |
13 | public SplitOperation(boolean touchResponse) {
14 | this.touchResponse = touchResponse;
15 | }
16 |
17 | @Override
18 | public void performQuickfix(EObject element, IModificationContext context) {
19 |
20 | if (!(element instanceof Operation)) {
21 | TransformationHelpers.reportError("This Quick Fix can only be applied if an operation is selected.");
22 | }
23 |
24 | Operation operation = (Operation) element;
25 | OperationTransformations opt = new OperationTransformations();
26 | opt.splitOperation(operation, touchResponse);
27 | }
28 | }
--------------------------------------------------------------------------------
/dsl-core/io.mdsl/FreemarkerStandaloneDemo.ftl:
--------------------------------------------------------------------------------
1 |
2 |
3 | Welcome!
4 |
5 |
6 | Welcome in ${apiname}!
7 | Endpoints:
8 | tbc, stay tuned!
9 |
10 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl/MDSLOverviewReport.md.ftl:
--------------------------------------------------------------------------------
1 | # Report for MDSL specification ${filename}
2 |
3 | ## Endpoints
4 |
5 | The API description ${apiname} features the following endpoints:
6 |
7 | <#list serviceSpecification.contracts as endpoint>
8 | * ${endpoint.name}
9 | #list>
10 | * No more endpoints found.
11 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl/build.properties:
--------------------------------------------------------------------------------
1 | source.. = src/,\
2 | src-gen/,\
3 | xtend-gen/
4 | bin.includes = model/generated/,\
5 | .,\
6 | META-INF/,\
7 | plugin.xml
8 | bin.excludes = **/*.mwe2,\
9 | **/*.xtend
10 | additional.bundles = org.eclipse.xtext.xbase,\
11 | org.eclipse.xtext.common.types,\
12 | org.eclipse.xtext.xtext.generator,\
13 | org.eclipse.emf.codegen.ecore,\
14 | org.eclipse.emf.mwe.utils,\
15 | org.eclipse.emf.mwe2.launch,\
16 | org.eclipse.emf.mwe2.lib,\
17 | org.objectweb.asm,\
18 | org.apache.commons.logging,\
19 | org.apache.log4j
20 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl/gradle.properties:
--------------------------------------------------------------------------------
1 | swaggerCoreVersion=2.1.2
2 | swaggerParserVersion=2.0.20
3 | freemarkerVersion=2.3.30
4 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl/plugin.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl/src/io/mdsl/APIDescriptionRuntimeModule.java:
--------------------------------------------------------------------------------
1 | /*
2 | * generated by Xtext 2.35.0
3 | */
4 | package io.mdsl;
5 |
6 |
7 | /**
8 | * Use this class to register components to be used at runtime / without the Equinox extension registry.
9 | */
10 | public class APIDescriptionRuntimeModule extends AbstractAPIDescriptionRuntimeModule {
11 | }
12 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl/src/io/mdsl/APIDescriptionStandaloneSetup.java:
--------------------------------------------------------------------------------
1 | /*
2 | * generated by Xtext 2.35.0
3 | */
4 | package io.mdsl;
5 |
6 |
7 | /**
8 | * Initialization support for running Xtext languages without Equinox extension registry.
9 | */
10 | public class APIDescriptionStandaloneSetup extends APIDescriptionStandaloneSetupGenerated {
11 |
12 | public static void doSetup() {
13 | new APIDescriptionStandaloneSetup().createInjectorAndDoEMFRegistration();
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl/src/io/mdsl/exception/MDSLException.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.exception;
2 |
3 | public class MDSLException extends RuntimeException {
4 |
5 | /**
6 | * default id, generated by quick fix
7 | */
8 | private static final long serialVersionUID = 1L;
9 | private String reason;
10 |
11 | public MDSLException(String reason) {
12 | super(reason);
13 | this.reason = reason;
14 | }
15 |
16 | public MDSLException(String reason, Exception e) {
17 | super(reason, e);
18 | this.reason = reason;
19 | }
20 |
21 | public String getReason() {
22 | return reason;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl/src/io/mdsl/exception/ResourceIsNoMDSLModelException.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.exception;
2 |
3 | import org.eclipse.emf.common.util.URI;
4 |
5 | public class ResourceIsNoMDSLModelException extends MDSLException {
6 |
7 | public ResourceIsNoMDSLModelException(URI uri) {
8 | super("The resource '" + uri.toString() + "' does not contain a MDSL model.");
9 | }
10 |
11 | public ResourceIsNoMDSLModelException() {
12 | super("The given resource does not contain a MDSL model.");
13 | }
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl/src/io/mdsl/generator/APIDescriptionGenerator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * generated by Xtext 2.21.0
3 | */
4 | package io.mdsl.generator;
5 |
6 | import org.eclipse.emf.ecore.resource.Resource;
7 | import org.eclipse.xtext.generator.AbstractGenerator;
8 | import org.eclipse.xtext.generator.IFileSystemAccess2;
9 | import org.eclipse.xtext.generator.IGeneratorContext;
10 |
11 | /**
12 | * Generates code from your model files on save.
13 | *
14 | * See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#code-generation
15 | */
16 | public class APIDescriptionGenerator extends AbstractGenerator {
17 |
18 | @Override
19 | public void doGenerate(Resource resource, IFileSystemAccess2 fsa, IGeneratorContext context) {
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl/src/io/mdsl/generator/AnonymousFieldNameGenerator.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.generator;
2 |
3 | /**
4 | * Generates field names by using a counter.
5 | */
6 | public class AnonymousFieldNameGenerator {
7 |
8 | private int counter = 1;
9 |
10 | private boolean isStringDefined(String name) {
11 | return name != null && !"".equals(name);
12 | }
13 |
14 | public String getUniqueName(String baseName) {
15 | String name = baseName != null ? baseName.trim() : baseName;
16 |
17 | // in case there is a name, just take it (formatted and without special characters)
18 | if (isStringDefined(name))
19 | return format(baseName);
20 |
21 | // in case there is no name, generate a unique "anonymous" name
22 | String genName = "anonymous" + counter;
23 | counter++;
24 | return genName;
25 | }
26 |
27 | private String format(String baseName) {
28 | String name = baseName;
29 | if (name.substring(0, 1).matches("^[0-9]"))
30 | name = "_" + name;
31 | return name.replaceAll("[^A-Za-z0-9_]", "");
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl/src/io/mdsl/generator/MDSL2JavaTemplateEmpty.java.ftl:
--------------------------------------------------------------------------------
1 | package io.mdsl.generated.java;
2 |
3 | public class ${genModel.apiName} {
4 | // TODO: generate more Java code ...
5 | }
6 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl/src/io/mdsl/generator/ProtocolBuffersGenerator.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.generator;
2 |
3 | import org.eclipse.emf.common.util.URI;
4 | import org.eclipse.xtext.generator.IFileSystemAccess2;
5 |
6 | import io.mdsl.apiDescription.ServiceSpecification;
7 | import io.mdsl.generator.protobuf.converter.MDSL2ProtobufConverter;
8 |
9 | /**
10 | * Generates a Protocol Buffers (*.proto) file with an MDSL model as input.
11 | *
12 | */
13 | public class ProtocolBuffersGenerator extends AbstractMDSLGenerator {
14 |
15 | @Override
16 | protected void generateFromServiceSpecification(ServiceSpecification mdslSpecification, IFileSystemAccess2 fsa,
17 | URI inputFileURI) {
18 | fsa.generateFile(inputFileURI.trimFileExtension().lastSegment() + ".proto",
19 | new MDSL2ProtobufConverter(mdslSpecification).convert().toString());
20 | }
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl/src/io/mdsl/generator/asyncapi/models/CardinalityDescription.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.generator.asyncapi.models;
2 |
3 | public class CardinalityDescription {
4 |
5 | private boolean isArray;
6 | private boolean isAtLeastOne;
7 | public boolean isArray() {
8 | return isArray;
9 | }
10 | public void setArray(boolean isArray) {
11 | this.isArray = isArray;
12 | }
13 | public boolean isAtLeastOne() {
14 | return isAtLeastOne;
15 | }
16 | public void setAtLeastOne(boolean isAtLeastOne) {
17 | this.isAtLeastOne = isAtLeastOne;
18 | }
19 |
20 | public CardinalityDescription(boolean isArray, boolean isAtLeastOne) {
21 | super();
22 | this.isArray = isArray;
23 | this.isAtLeastOne = isAtLeastOne;
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl/src/io/mdsl/generator/asyncapi/models/ParameterDescriptor.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.generator.asyncapi.models;
2 |
3 | import io.mdsl.apiDescription.Cardinality;
4 |
5 | public class ParameterDescriptor {
6 |
7 | private String name;
8 | private Cardinality card;
9 | public String getName() {
10 | return name;
11 | }
12 | public void setName(String name) {
13 | this.name = name;
14 | }
15 | public Cardinality getCard() {
16 | return card;
17 | }
18 | public void setCard(Cardinality card) {
19 | this.card = card;
20 | }
21 | public ParameterDescriptor(String name, Cardinality card) {
22 | super();
23 | this.name = name;
24 | this.card = card;
25 | }
26 |
27 |
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl/src/io/mdsl/generator/bpmn/sketchminer.ftl:
--------------------------------------------------------------------------------
1 | /// TODO provide generation statistics (source file name, time)
2 | <#-- language reference: https://www.bpmn-sketch-miner.ai/doc/10-ref.html#bpmn-sketch-miner-syntax-rules -->
3 | ${flowName}:
4 |
5 | <#list model.sequences as sequence>
6 | <#if sequence.isMergingFragment()>
7 | ...
8 | #if>
9 | <#list sequence.tasks as task>
10 | <#if task.comment?has_content>
11 | <#if task.type.name() == "COMMAND"><#if task.actor?has_content>${task.actor}<#else>${model.defaultActorName}#if>: #if>// ${task.comment}
12 | #if>
13 | <#if task.type.name() == "COMMAND"><#if task.actor?has_content>${task.actor}<#else>${model.defaultActorName}#if>: #if><#if task.type.name() == "COMMAND">user ${task.name?replace("_", "")}<#else>(${task.name?replace("_", "")})#if><#if task.parallelTasks?has_content><#list task.parallelTasks as parTask>|<#if parTask.type.name() == "COMMAND">user ${parTask.name?replace("_", "")}<#else>(${parTask.name?replace("_", "")})#if>#list>#if>
14 | #list>
15 | <#if sequence.isSplittingFragment()>
16 | ...
17 | #if>
18 |
19 | #list>
--------------------------------------------------------------------------------
/dsl-core/io.mdsl/src/io/mdsl/generator/java/DataType.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2020 The MDSL Project Team
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.mdsl.generator.java;
17 |
18 | /**
19 | * This type has been generated out of an MDSL contract.
20 | *
21 | */
22 | public class DataType {
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl/src/io/mdsl/generator/java/EndpointInterface.java.ftl:
--------------------------------------------------------------------------------
1 | <#assign endpoint = genModel.endpoints?filter(e -> e.name == endpointName)?first>
2 | package ${resolveJavaPackage(genModel, endpoint)}.services;
3 |
4 | import ${resolveJavaPackage(genModel, endpoint)}.types.*;
5 |
6 | /**
7 | * This interface has been generated from the MDSL endpoint called '${endpoint.name}'.
8 | *
9 | */
10 | public interface ${endpoint.name} {
11 |
12 | <#list endpoint.operations as operation>
13 | <#if operation.responsibility?has_content>
14 | /**
15 | * MAP decorator: ${operation.responsibility}
16 | *
17 | * Find all MAP responsibility patterns here: https://microservice-api-patterns.org/patterns/responsibility/
18 | */
19 | #if>
20 | ${mapType(operation.response.name, true)} ${resolveOperationName(endpoint, operation)}(${operation.parameters?map(p -> mapType(p.type.name) + " " + p.name)?join(", ")});
21 |
22 | #list>
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl/src/io/mdsl/generator/jolie/converter/EndpointModel.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.generator.jolie.converter;
2 |
3 | public class EndpointModel {
4 |
5 | }
6 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl/src/io/mdsl/generator/jolie/converter/TypeModel.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.generator.jolie.converter;
2 |
3 | public class TypeModel {
4 | private String name;
5 | private String definition;
6 |
7 | public TypeModel(String name, String definition) {
8 | super();
9 | this.name = name;
10 | this.definition = definition;
11 | }
12 |
13 | public String getName() {
14 | return name;
15 | }
16 | public void setName(String name) {
17 | this.name = name;
18 | }
19 | public String getDefinition() {
20 | return definition;
21 | }
22 | public void setDefinition(String definition) {
23 | this.definition = definition;
24 | }
25 |
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl/src/io/mdsl/generator/model/StateTransition.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.generator.model;
2 |
3 | public class StateTransition {
4 | private String name;
5 | private String from;
6 | private String to;
7 |
8 | public String getName() {
9 | return name;
10 | }
11 | public void setName(String name) {
12 | this.name = name;
13 | }
14 | public String getFrom() {
15 | return from;
16 | }
17 | public void setFrom(String from) {
18 | this.from = from;
19 | }
20 | public String getTo() {
21 | return to;
22 | }
23 | public void setTo(String to) {
24 | this.to = to;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl/src/io/mdsl/generator/model/UndefinedProtocol.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2020 The MDSL Project Team
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.mdsl.generator.model;
17 |
18 | /**
19 | * The protocol binding that is returned on an endpoint if there was no protocol
20 | * binding in MDSL.
21 | *
22 | */
23 | public class UndefinedProtocol implements ProtocolBinding {
24 |
25 | @Override
26 | public String getProtocolName() {
27 | return "Undefined";
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl/src/io/mdsl/generator/model/carving/ClusterCollection.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.generator.model.carving;
2 |
3 | import java.util.HashMap;
4 |
5 | public class ClusterCollection {
6 | private HashMap clusters;
7 |
8 | public ClusterCollection() {
9 | this.clusters = new HashMap();
10 | }
11 |
12 | public HashMap getClusters() {
13 | return clusters;
14 | }
15 |
16 | public void addCluster(CommandCluster cluster) {
17 | this.clusters.put(cluster.getCommandClusterName(), cluster);
18 | }
19 |
20 | // TODO implement design heuristics (might require additional input in MDSL):
21 | // JH, VV, SC, tbc
22 | }
23 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl/src/io/mdsl/generator/model/carving/CohesionCriterion.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.generator.model.carving;
2 |
3 | public class CohesionCriterion extends CarvingCriterion {
4 |
5 | public CohesionCriterion(float score) {
6 | super(1, score);
7 | }
8 |
9 | public CohesionCriterion(int weight, float score) {
10 | super(weight, score);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl/src/io/mdsl/generator/model/carving/CommandCluster.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.generator.model.carving;
2 |
3 | import java.util.HashMap;
4 | import io.mdsl.generator.model.composition.Command;
5 |
6 | public class CommandCluster {
7 | private HashMap connectedCommands;
8 | private String clusterName = "tbd";
9 |
10 | public CommandCluster(String name) {
11 | this.clusterName = name;
12 | this.connectedCommands = new HashMap();
13 | }
14 |
15 | public HashMap getConnectedCommands() {
16 | return connectedCommands;
17 | }
18 |
19 | public void addConnectedCommand(String name, Command connectedCommand) {
20 | // System.out.println("Adding " + name + " to " + clusterName);
21 | this.connectedCommands.put(name, connectedCommand);
22 | }
23 |
24 | public String getCommandClusterName() {
25 | return clusterName;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl/src/io/mdsl/generator/model/carving/CouplingCriterion.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.generator.model.carving;
2 |
3 | public class CouplingCriterion extends CarvingCriterion {
4 |
5 | public CouplingCriterion(float score) {
6 | super(1, score);
7 | }
8 |
9 | public CouplingCriterion(int weight, float score) {
10 | super(weight, score);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl/src/io/mdsl/generator/model/composition/views/CompositeInvocation.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.generator.model.composition.views;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 |
6 | import io.mdsl.generator.model.composition.Flow;
7 |
8 | public class CompositeInvocation extends Invocation {
9 | List actionList = new ArrayList();
10 |
11 | public CompositeInvocation(String commandName, String eventName, List composedEvents) {
12 | super(commandName, eventName);
13 | actionList = composedEvents;
14 | }
15 |
16 | public List getParallelActions() {
17 | return actionList;
18 | }
19 |
20 | public boolean isAnd() {
21 | return this.event.startsWith(Flow.AND_OPERATOR);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl/src/io/mdsl/generator/model/composition/views/Invocation.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.generator.model.composition.views;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 |
6 | public class Invocation {
7 | protected String event;
8 | protected String command;
9 |
10 | public Invocation(String command, String event) {
11 | this.event = event;
12 | this.command = command;
13 | }
14 |
15 | public String getCommand() {
16 | return command;
17 | }
18 |
19 | public void setCommand(String command) {
20 | this.command = command;
21 | }
22 |
23 | public String getEvent() {
24 | return event;
25 | }
26 |
27 | public void setEvent(String event) {
28 | this.event = event;
29 | }
30 |
31 | /*
32 | public boolean getAnd() {
33 | return false;
34 | }
35 | */
36 | }
--------------------------------------------------------------------------------
/dsl-core/io.mdsl/src/io/mdsl/generator/model/composition/views/PathElement.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.generator.model.composition.views;
2 |
3 | public class PathElement {
4 | private static final String INVOCATION_ARROW = "->";
5 | private String from;
6 | private String to;
7 |
8 | public PathElement(String from, String to) {
9 | this.from = from;
10 | this.to = to;
11 | }
12 |
13 | public String getName() {
14 | return from + INVOCATION_ARROW + to;
15 | }
16 |
17 | public String getSource() {
18 | return from;
19 | }
20 |
21 | public String getSink() {
22 | return to;
23 | }
24 |
25 | public String toString() {
26 | return "(" + from + ")\n" + to + "\n";
27 | }
28 |
29 | public String dump() {
30 | return from + "->" + to + ";";
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl/src/io/mdsl/generator/model/composition/views/camel/CamelUtils.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.generator.model.composition.views.camel;
2 |
3 | public class CamelUtils {
4 | public String headerPrefix() {
5 | // done here because $ and { are used both by Camel and by Freemarker:
6 | return "${header.";
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl/src/io/mdsl/generator/model/composition/views/jaamsim/Branch.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.generator.model.composition.views.jaamsim;
2 |
3 | import java.util.List;
4 |
5 | public abstract class Branch extends Component {
6 |
7 | public static final String CHOICE_QUEUE_SUFFIX = "ChoiceQueue";
8 |
9 | public Branch(String name) {
10 | super(name);
11 | }
12 |
13 | public String getName() {
14 | return name;
15 | }
16 |
17 | public abstract List getNextComponentList();
18 |
19 | protected String nextComponentNames(List components) {
20 | String result = "";
21 | for(String component : components) {
22 | if(component!=null) {
23 | result += " " + component;
24 | }
25 | else {
26 | result += " n/a";
27 | }
28 | }
29 | return result;
30 | }
31 |
32 | public String dump() {
33 | String nameAndType = this.name + " (" + this.getClass().getSimpleName() + ")";
34 | String nextComponentNames = nextComponentNames(getNextComponentList());
35 |
36 | return nameAndType + ", nextComponents:" + nextComponentNames;
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl/src/io/mdsl/generator/model/composition/views/jaamsim/CommandInvocationBranch.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.generator.model.composition.views.jaamsim;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 |
6 | import io.mdsl.generator.model.composition.Command;
7 | import io.mdsl.generator.model.composition.Event;
8 | import io.mdsl.generator.model.composition.Flow;
9 |
10 | public class CommandInvocationBranch extends Branch {
11 |
12 | public static final String CHOICE_QUEUE_SUFFIX = "ChoiceQueue";
13 |
14 | private Event event;
15 |
16 | public CommandInvocationBranch(String name, Event event) {
17 | super(name);
18 | this.event = event;
19 | }
20 |
21 | public String getName() {
22 | return name;
23 | }
24 |
25 | public List getNextComponentList() {
26 | List orCommands = event.triggeredCommands();
27 | ArrayList result = new ArrayList();
28 | orCommands.forEach(command->result.add(command.getName() + CHOICE_QUEUE_SUFFIX));
29 | return result;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl/src/io/mdsl/generator/model/composition/views/jaamsim/Component.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.generator.model.composition.views.jaamsim;
2 |
3 | public class Component {
4 | protected String name;
5 |
6 | public Component(String name) {
7 | this.name = name;
8 | }
9 |
10 | public String getName() {
11 | return name;
12 | }
13 |
14 | public void setName(String name) {
15 | this.name = name;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl/src/io/mdsl/generator/model/composition/views/jaamsim/EntityGenerator.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.generator.model.composition.views.jaamsim;
2 |
3 | public class EntityGenerator extends Component {
4 |
5 | public EntityGenerator(String name) {
6 | super(name);
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl/src/io/mdsl/generator/model/composition/views/jaamsim/EntitySink.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.generator.model.composition.views.jaamsim;
2 |
3 | public class EntitySink extends Component {
4 |
5 | public EntitySink(String name) {
6 | super(name);
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl/src/io/mdsl/generator/model/composition/views/jaamsim/EventProductionBranch.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.generator.model.composition.views.jaamsim;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 |
6 | import io.mdsl.generator.model.composition.Command;
7 | import io.mdsl.generator.model.composition.Event;
8 |
9 | public class EventProductionBranch extends Branch {
10 |
11 | private Command command;
12 |
13 | public EventProductionBranch(String name, Command command) {
14 | super(name);
15 | this.command = command;
16 | }
17 |
18 | public String getName() {
19 | return name;
20 | }
21 |
22 | public List getNextComponentList() {
23 | List orEvents = command.emits();
24 | ArrayList result = new ArrayList();
25 | orEvents.forEach(command->result.add(command.getName()));
26 | return result;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl/src/io/mdsl/generator/model/composition/views/jaamsim/GateQueue.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.generator.model.composition.views.jaamsim;
2 |
3 | public class GateQueue extends Queue {
4 |
5 | public GateQueue(String name) {
6 | super(name);
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl/src/io/mdsl/generator/model/composition/views/jaamsim/GatewayGuardServer.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.generator.model.composition.views.jaamsim;
2 |
3 | import io.mdsl.generator.model.composition.Command;
4 | import io.mdsl.generator.model.composition.Event;
5 | import io.mdsl.generator.model.composition.Flow;
6 |
7 | // note: not to be confused with GuardInput server, two different cases/scenarios
8 | public class GatewayGuardServer extends Server {
9 |
10 | private Event event;
11 |
12 | public GatewayGuardServer(String name, Event event, Command command, Flow flow) {
13 | super(name, command, flow);
14 | this.event = event;
15 | }
16 |
17 | public String getNextComponent() {
18 | return command.getName();
19 | }
20 |
21 | public Event getEvent() {
22 | return event;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl/src/io/mdsl/generator/model/composition/views/jaamsim/Queue.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.generator.model.composition.views.jaamsim;
2 |
3 | public class Queue extends Component {
4 |
5 | private static final String DEFAULT_MAX_VALID_LENGTH = "100000000";
6 | private String maxValidLength = DEFAULT_MAX_VALID_LENGTH;
7 |
8 | public Queue(String name) {
9 | super(name);
10 | }
11 |
12 | public void setMaxValidLength(String maxValidLength) {
13 | this.maxValidLength = maxValidLength;
14 | }
15 |
16 | public String getMaxValidLength() {
17 | return maxValidLength;
18 | }
19 |
20 | public String dump() {
21 | return name;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl/src/io/mdsl/generator/model/composition/views/jaamsim/SimulationEntity.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.generator.model.composition.views.jaamsim;
2 |
3 | public class SimulationEntity extends Component {
4 |
5 | public SimulationEntity(String name) {
6 | super(name);
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl/src/io/mdsl/generator/model/composition/views/jaamsim/Statistics.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.generator.model.composition.views.jaamsim;
2 |
3 | import io.mdsl.generator.model.composition.Flow;
4 |
5 | public class Statistics extends Component {
6 |
7 | private Flow flow;
8 |
9 | public Statistics(String name, Flow flow) {
10 | super(name);
11 | this.flow = flow;
12 | }
13 |
14 | public String getNextComponent() {
15 | return this.flow.getName() + "EntitySink";
16 | }
17 |
18 | public String dump() {
19 | return name;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl/src/io/mdsl/generator/model/composition/views/sketchminer/TaskType.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2020 The Context Mapper Project Team
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.mdsl.generator.model.composition.views.sketchminer;
17 |
18 | public enum TaskType {
19 |
20 | COMMAND, EVENT
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl/src/io/mdsl/scoping/APIDescriptionScopeProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * generated by Xtext 2.35.0
3 | */
4 | package io.mdsl.scoping;
5 |
6 |
7 | /**
8 | * This class contains custom scoping description.
9 | *
10 | * See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#scoping
11 | * on how and when to use it.
12 | */
13 | public class APIDescriptionScopeProvider extends AbstractAPIDescriptionScopeProvider {
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl/src/io/mdsl/standalone/MDSLStandaloneSetup.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2020 The MDSL Project Team
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.mdsl.standalone;
17 |
18 | /**
19 | * Factory method to get an MDSLStandaloneAPI instance.
20 | *
21 | * @author Stefan Kapferer
22 | */
23 | public class MDSLStandaloneSetup {
24 |
25 | public static MDSLStandaloneAPI getStandaloneAPI() {
26 | return new MDSLStandaloneUsageHelper();
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl/src/io/mdsl/utils/CardinalityHelper.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.utils;
2 |
3 | import io.mdsl.apiDescription.Cardinality;
4 |
5 | public class CardinalityHelper {
6 |
7 | public static boolean isList(Cardinality card) {
8 | if (card == null)
9 | return false;
10 | return (card.getZeroOrMore() != null && "*".equals(card.getZeroOrMore())) || (card.getAtLeastOne() != null && "+".equals(card.getAtLeastOne()));
11 | }
12 |
13 | public static boolean isOptional(Cardinality card) {
14 | if (card == null)
15 | return false;
16 | return (card.getZeroOrOne() != null && "?".equals(card.getZeroOrOne())) || (card.getZeroOrMore() != null && "*".equals(card.getZeroOrMore()));
17 | }
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl/src/io/mdsl/utils/MDSLLogger.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.utils;
2 |
3 | import io.mdsl.exception.MDSLException;
4 |
5 | public class MDSLLogger {
6 |
7 | // TODO (future work) set from outside (Eclipse preference, CLI parameter, tbd for MDSL Web)
8 | public static int logLevel = 1; // -1=off, 0=errors, 1=warn, 2=inform, 3=all (could use enum)
9 | public static boolean reportPatternUsage = true;
10 |
11 | public static void reportError(String message) {
12 | if(MDSLLogger.logLevel>=0) {
13 | System.err.println("[E] " + message);
14 | }
15 | throw new MDSLException(message);
16 | }
17 |
18 | public static void reportWarning(String message) {
19 | if(MDSLLogger.logLevel>=1) {
20 | System.err.println("[W] " + message);
21 | }
22 | }
23 |
24 | public static void reportInformation(String message) {
25 | if(MDSLLogger.logLevel>=2) {
26 | System.err.println("[I] " + message);
27 | }
28 | }
29 |
30 | public static void reportDetailedInformation(String message) {
31 | if(MDSLLogger.logLevel>=3) {
32 | System.err.println("[D] " + message);
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl/src/io/mdsl/utils/MDSLParser.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.utils;
2 |
3 | import java.io.FileNotFoundException;
4 | import java.io.FileReader;
5 | import java.io.IOException;
6 | import java.io.Reader;
7 |
8 | import io.mdsl.apiDescription.ServiceSpecification;
9 | import io.mdsl.exception.MDSLException;
10 |
11 | public class MDSLParser {
12 |
13 | public static ServiceSpecification parse(String mdslFile) throws MDSLException {
14 | Reader r;
15 | try {
16 | r = new FileReader(mdslFile);
17 | MDSLXtextParserWrapper parser = new MDSLXtextParserWrapper();
18 | return (ServiceSpecification) parser.parse(r);
19 | } catch (FileNotFoundException e) {
20 | throw new MDSLException("Spec" + mdslFile + " not found.", e);
21 | } catch (IOException e) {
22 | throw new MDSLException("Spec" + mdslFile + " caused IOException.", e);
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl/src/io/mdsl/utils/MDSLStandaloneParserApplication.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.utils;
2 |
3 | //import java.io.FileNotFoundException;
4 | //import java.io.FileReader;
5 | //import java.io.IOException;
6 | //import java.io.Reader;
7 | //
8 | import io.mdsl.apiDescription.ServiceSpecification;
9 |
10 | public class MDSLStandaloneParserApplication {
11 |
12 | public static void main(String[] args) {
13 |
14 | // Reader r;
15 | // try {
16 | // r = new FileReader(args[0]);
17 | // MDSLXtextParserWrapper parser = new MDSLXtextParserWrapper();
18 | // ServiceSpecification mdslTree = (ServiceSpecification) parser.parse(r);
19 | ServiceSpecification mdslTree = MDSLParser.parse(args[0]);
20 | System.out.println ("MDSL specification parsed, API name is: " + mdslTree.getName());
21 | // } catch (FileNotFoundException e) {
22 | // e.printStackTrace();
23 | // } catch (IOException e) {
24 | // e.printStackTrace();
25 | // }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl/src/io/mdsl/utils/URITemplateHelper.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.utils;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 | import java.util.regex.Matcher;
6 | import java.util.regex.Pattern;
7 |
8 | public class URITemplateHelper {
9 |
10 | public static List findTemplateParameters(String uriSnippet) {
11 | List result = new ArrayList();
12 | String regex = "\\{\\w*\\}";
13 |
14 | Pattern pattern = Pattern.compile(regex);
15 | Matcher matcher = pattern.matcher(uriSnippet);
16 |
17 | while(matcher.find()) {
18 | String nextTemplate = uriSnippet.substring(matcher.start(), matcher.end());
19 | result.add(nextTemplate);
20 | }
21 | return result;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/dsl-core/io.mdsl/src/io/mdsl/validation/APIDescriptionValidator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * generated by Xtext 2.21.0
3 | */
4 | package io.mdsl.validation;
5 |
6 |
7 | /**
8 | * This class contains custom validation rules.
9 | *
10 | * See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#validation
11 | */
12 | public class APIDescriptionValidator extends AbstractAPIDescriptionValidator {
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/dsl-core/settings.gradle:
--------------------------------------------------------------------------------
1 | include 'mdsl-core'
2 | include 'mdsl-core-tests'
3 | include 'mdsl-lsp'
4 | include 'mdsl-cli'
5 |
6 | project(":mdsl-core").projectDir = file("io.mdsl")
7 | project(":mdsl-core-tests").projectDir = file("io.mdsl.tests")
8 | project(":mdsl-lsp").projectDir = file("io.mdsl.ide")
9 | project(":mdsl-cli").projectDir = file("io.mdsl.cli")
10 |
11 |
--------------------------------------------------------------------------------
/dsl-core/sketchminer.ftl:
--------------------------------------------------------------------------------
1 | flowname-todo:
2 |
3 | #if>
4 | <#list model.sequences as sequence>
5 | <#if sequence.isMergingFragment()>
6 | ...
7 | #if>
8 | <#list sequence.tasks as task>
9 | <#if task.comment?has_content>
10 | <#if task.type.name() == "COMMAND"><#if model.hasMultipleActors()><#if task.actor?has_content>${task.actor}<#else>${model.defaultActorName}#if>: #if>#if>// ${task.comment}
11 | #if>
12 | <#if task.type.name() == "COMMAND"><#if model.hasMultipleActors()><#if task.actor?has_content>${task.actor}<#else>${model.defaultActorName}#if>: #if>#if><#if task.type.name() == "COMMAND">service ${task.name?replace("_", "")}<#else>(${task.name?replace("_", "")})#if><#if task.parallelTasks?has_content><#list task.parallelTasks as parTask>|<#if parTask.type.name() == "COMMAND">service ${parTask.name?replace("_", "")}<#else>(${parTask.name?replace("_", "")})#if>#list>#if>
13 | #list>
14 | <#if sequence.isSplittingFragment()>
15 | ...
16 | #if>
17 |
18 | #list>
--------------------------------------------------------------------------------
/examples/AsyncAPIHelloWorldSample.mdsl:
--------------------------------------------------------------------------------
1 | API description HelloWorldAsyncAPI
2 |
3 | data type SampleDTO { "id": ID, "message": D }
4 |
5 | channel SayHello
6 | of type PUBLISH_SUBSCRIBE
7 | on path "/public/sayHelloZIO"
8 | produces message HelloMessage
9 | delivering payload SampleDTO
10 |
11 | message broker HelloWorldAmqpProvider
12 | exposes SayHello
13 | at location "amqp.example.com"
14 | via protocol AMQP
15 |
16 | message endpoint HelloWorldAmqpClient
17 | uses from HelloWorldAmqpProvider:
18 | SayHello
--------------------------------------------------------------------------------
/examples/HelloWorld.mdsl:
--------------------------------------------------------------------------------
1 | API description HelloWorldAPI
2 |
3 | data type SampleDTO {ID, D}
4 |
5 | endpoint type HelloWorldEndpoint
6 | exposes
7 | operation sayHello
8 | expecting payload D
9 | delivering payload SampleDTO
10 | operation getTest with responsibility RETRIEVAL_OPERATION
11 | expecting payload SampleDTO
12 | delivering payload {"a": SampleDTO, "b": SampleDTO}
13 |
14 | API provider HelloWorldAPIProvider
15 | offers HelloWorldEndpoint at endpoint location "http://localhost:8080"
16 | via protocol HTTP binding resource Home at "/hello"
17 |
18 | API client HelloWorldAPIClient
19 | consumes HelloWorldEndpoint
--------------------------------------------------------------------------------
/examples/HelloWorldMDSL.mdsl:
--------------------------------------------------------------------------------
1 | API description HelloWorldAPI
2 |
3 | data type SampleDTO {ID, D}
4 |
5 | endpoint type HelloWorldEndpoint
6 | exposes
7 | operation sayHello
8 | expecting payload D
9 | delivering payload SampleDTO
10 |
11 | API provider HelloWorldAPIProvider
12 | offers HelloWorldEndpoint at endpoint location "http://localhost:8080"
13 | via protocol HTTP
14 | binding resource Home at "/hello"
15 | operation sayHello to POST
16 |
17 | API client HelloWorldAPIClient1
18 | consumes HelloWorldEndpoint
19 |
20 | IPA
--------------------------------------------------------------------------------
/examples/HelloWorldMEPDemo.mdsl:
--------------------------------------------------------------------------------
1 | API description HelloWorldAndMEPDemoAPI version "v1.0.0"
2 |
3 | data type SampleDTO {ID, D}
4 | data type InvalidIdentifier ID
5 |
6 | endpoint type HelloWorldEndpoint
7 | exposes
8 | operation sayHello in REQUEST_REPLY conversation
9 | expecting payload D
10 | delivering payload SampleDTO
11 |
12 | endpoint type MEPDemoAndTestEndpoint
13 | exposes
14 | operation testRequestReply in REQUEST_REPLY conversation
15 | expecting payload D
16 | delivering payload SampleDTO
17 | operation testOneWay in ONE_WAY conversation
18 | expecting payload D
19 | operation testNotification in NOTIFICATION conversation
20 | delivering payload SampleDTO
21 | operation testNoOp in "ToBeContinued" conversation
22 | // incomplete specification, does not make much sense at runtime
23 |
24 | API provider HelloWorldAPIProvider
25 | offers HelloWorldEndpoint
26 |
27 | API client HelloWorldAPIClient
28 | consumes HelloWorldEndpoint
29 |
30 | // MEPDemoAndTestEndpoint not offered, not consumed (linter could report that)
--------------------------------------------------------------------------------
/examples/HelloWorldWebsitePrimer.mdsl:
--------------------------------------------------------------------------------
1 | API description HelloWorldAPI
2 |
3 | data type SampleDTO {ID, D}
4 |
5 | endpoint type HelloWorldEndpoint
6 | exposes
7 | operation sayHello
8 | expecting payload "in": D
9 | delivering payload SampleDTO
10 |
11 | API provider HelloWorldAPIProvider
12 | offers HelloWorldEndpoint
13 | at endpoint location "http://localhost:8000"
14 | via protocol HTTP
15 | binding resource HomeResource at "/"
16 | operation sayHello to POST
17 |
18 | API client HelloWorldAPIClient
19 | consumes HelloWorldEndpoint
20 | from HelloWorldAPIProvider
21 | via protocol HTTP
--------------------------------------------------------------------------------
/examples/MDSLGitPages/CRMServiceContract.mdsl:
--------------------------------------------------------------------------------
1 | API description SampleCustomerManagementAPI version "1.0.0"
2 | usage context PUBLIC_API for FRONTEND_INTEGRATION
3 |
4 | endpoint type CustomerManagementContract
5 | version "1.0.0"
6 | serves as INFORMATION_HOLDER_RESOURCE
7 | exposes
8 | operation lookupSingleCustomer version "1.0.1"
9 | with responsibility RETRIEVAL_OPERATION
10 | expecting
11 | payload ID
12 | delivering
13 | payload {"customerId":ID,
14 | "name":D,
15 | "address"}
16 |
17 | operation lookupCustomerDirectory // no version information
18 | with responsibility RETRIEVAL_OPERATION
19 | expecting
20 | payload <> "customerId":ID+ // at least one
21 | delivering
22 | payload
23 | "customerRecord": {
24 | "cid":ID!, // ! mandatory, exactly one
25 | "nameTuple":("firstname":D, "lastname":D),
26 | "addressTuple":(
27 | "street":D,
28 | "poBox":D?, // optional
29 | "zipCode":D,
30 | "city":D)+,
31 | "segment":("REGULAR":D|"VIP":D) // choice
32 | }* // zero or more
--------------------------------------------------------------------------------
/examples/MDSLGitPages/HelloWorld.mdsl:
--------------------------------------------------------------------------------
1 | API description HelloWorldAPI
2 |
3 | data type SampleDTO {ID, D}
4 |
5 | endpoint type HelloWorldEndpoint
6 | exposes
7 | operation sayHello
8 | expecting payload D
9 | delivering payload SampleDTO
10 |
11 | API provider HelloWorldAPIProvider
12 | offers HelloWorldEndpoint
13 |
14 | API client HelloWorldAPIClient
15 | consumes HelloWorldEndpoint
--------------------------------------------------------------------------------
/examples/MDSLGitPages/Skeleton.mdsl:
--------------------------------------------------------------------------------
1 | API description NN
2 | usage context COMMUNITY_API for BACKEND_INTEGRATION // MAP pattern tags (optional)
3 | // see https://microservice-api-patterns.org/patterns/index
4 |
5 | data type nn {D} // reusable data contract elements (optional)
6 |
7 | endpoint type NN
8 | version "1.0.0" // semantic versioning information (optional)
9 | serves as PROCESSING_RESOURCE // can also be a MAP pattern tag (optional))
10 | exposes
11 | operation myOp
12 | with responsibility "myOpSemanticsDecorator" // can also be a MAP pattern tag (optional)
13 | expecting
14 | headers ("myHeader1": D, "myHeader2":D) // optional "header1" not possible
15 | payload "myRequest": {D}
16 | structured as MAP_TYPE
17 | delivering
18 | headers {D} // optional
19 | payload {D}
20 | structured as MAP_TYPE
21 | reporting
22 | error SomeReport "myReport": {D} // see bottom of page for explanation (optional)
--------------------------------------------------------------------------------
/examples/MinimalStory.mdsl:
--------------------------------------------------------------------------------
1 | API description MinimalSpecification
2 |
3 | scenario S1
4 | a "user" wants to "work"
--------------------------------------------------------------------------------
/examples/asyncMDSL/bindings.mdsl:
--------------------------------------------------------------------------------
1 | API description ProtocolBindingExample
2 |
3 | overview "
4 | An example on how to use Message Channel and Message Broker
5 | protocol bindings.
6 | "
7 |
8 | channel MyAwsomeChannel
9 | of type POINT_TO_POINT, DATA_TYPE, GUARANTEED_DELIVERY
10 | on path "channel-logical-path"
11 | produces message MyAwsomeMessage
12 | delivering payload {
13 | "myAwsomeProperty": D
14 | }
15 | where
16 | MESSAGE_EXPIRES in 60s
17 | bindings for AMQP {
18 | "queue": {
19 | "name": "my-queue-name"
20 | }
21 | }
22 |
23 |
24 | message broker MyMessageBroker
25 | exposes
26 | MyAwsomeChannel
27 | at location "tcp://mqtt.myapp.com:1883"
28 | via protocol MQTT
29 | bindings {
30 | "lastWill": {
31 | "qos": 2,
32 | "retain": false
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/examples/asyncMDSL/hello-world.mdsl:
--------------------------------------------------------------------------------
1 | API description HelloWorldAsyncAPI
2 |
3 | data type SampleDTO { "id": ID, "message": D }
4 |
5 | channel SayHello
6 | of type PUBLISH_SUBSCRIBE
7 | on path "/public/sayHello"
8 | produces message HelloMessage
9 | delivering payload SampleDTO
10 |
11 | message broker HelloWorldAmqpProvider
12 | exposes SayHello
13 | at location "amqp.example.com"
14 | via protocol AMQP
15 |
16 | message endpoint HelloWorldAmqpClient
17 | uses from HelloWorldAmqpProvider:
18 | SayHello
--------------------------------------------------------------------------------
/examples/asyncMDSL/loan-broker-example-java-spring.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Microservice-API-Patterns/MDSL-Specification/9da0bac0e6133b8a69131925e38bc98e63e20af2/examples/asyncMDSL/loan-broker-example-java-spring.png
--------------------------------------------------------------------------------
/examples/asyncMDSL/message-endpoint.mdsl:
--------------------------------------------------------------------------------
1 | API description MessageEndpointExample
2 |
3 | data type SampleDTO { "id": ID, "message": D }
4 |
5 | channel Channel1
6 | on path "/channels/one"
7 | produces message MessageOne
8 | delivering payload SampleDTO
9 |
10 | channel Channel2
11 | on path "/channels/Channel2"
12 | produces message Message2
13 | delivering payload SampleDTO
14 |
15 | channel Channel3
16 | on path "/channels/Channel3"
17 | produces message Message3
18 | delivering payload SampleDTO
19 |
20 | message broker HelloWorldAmqpProvider
21 | exposes Channel1, Channel2, Channel3
22 | at location "amqp.example.com"
23 | via protocol AMQP
24 |
25 | message endpoint DemoMessageEndpoint
26 | uses
27 | channels: // channels without a Message Broker
28 | Channel1
29 | where consumed if "$message.payload#/id" == 42,
30 | Channel2
31 |
32 | from HelloWorldAmqpProvider:
33 | Channel3
--------------------------------------------------------------------------------
/examples/asyncMDSL/sensor-example.mdsl:
--------------------------------------------------------------------------------
1 | API description SensorExample
2 | version "1.0.0"
3 | overview "IoT sensor example"
4 |
5 | data type SensorDataDTO {
6 | "sensorId": ID
7 | }
8 |
9 | channel SensorChannel
10 | of type PUBLISH_SUBSCRIBE
11 | delivery guarantee AT_MOST_ONCE
12 | on path "sensordata"
13 | accepts and produces message SensorDataMessage
14 | description "Sensor data"
15 | delivering
16 | payload SensorDataDTO
17 |
18 | message broker SensorsBrokerMQTTProvider
19 | exposes SensorChannel
20 | at location "mqtt.loanbroker.com"
21 | via protocol MQTT
--------------------------------------------------------------------------------
/examples/examples-advanced/AdvancedServiceContractConcepts1.mdsl:
--------------------------------------------------------------------------------
1 | API description AdvancedServiceConceptsPreview
2 |
3 | data type SampleDTO {ID, D}
4 |
5 | event type SomethingHasHappened {"when":D, "what":D}
6 | event type ServerSideProcessingComplete
7 | event type FailureMessage
8 |
9 | endpoint type HelloWorldEndpoint
10 | exposes
11 | operation doSomethingOnServerSide with responsibility STATE_TRANSITION_OPERATION
12 | expecting payload D
13 | delivering payload SampleDTO
14 | reporting error FailureMessage
15 | transitions from "ReadyToWork" to "Done"
16 | emitting event ServerSideProcessingComplete
17 | compensated by undoSomethingOnServerSide
18 | operation undoSomethingOnServerSide with responsibility STATE_TRANSITION_OPERATION
19 | expecting payload D
20 | delivering payload SampleDTO
21 | transitions from "Done" to "ReadyToWork"
22 | receives
23 | event SomethingHasHappened
24 |
25 | API provider HelloWorldAPIProvider
26 | offers HelloWorldEndpoint
27 |
28 | API client HelloWorldAPIClient
29 | consumes HelloWorldEndpoint
30 |
--------------------------------------------------------------------------------
/examples/examples-advanced/CSVTutorial.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package SpreadSheetExchangeAPI;
4 |
5 | message CSVSpreadsheet {
6 | CSVSheetTab anonymous1 = 1;
7 | }
8 |
9 | message CSVSheetTab {
10 | }
11 |
12 | message Rows {
13 | }
14 |
15 | message Column {
16 | }
17 |
18 | message Cell {
19 | }
20 |
21 | message uploadSpreadsheetResponseMessage {
22 | }
23 |
24 | message downloadSpreadsheetRequestMessage {
25 | string anonymous1 = 1;
26 | }
27 |
28 | service SpreadSheetExchangeEndpoint {
29 | rpc downloadSpreadsheet(downloadSpreadsheetRequestMessage) returns (CSVSpreadsheet);
30 | rpc uploadSpreadsheet(CSVSpreadsheet) returns (uploadSpreadsheetResponseMessage);
31 | }
32 |
33 |
--------------------------------------------------------------------------------
/examples/examples-advanced/HelloMIMEWorld.mdsl:
--------------------------------------------------------------------------------
1 | API description HelloMIMEWorld2
2 |
3 | data type TestDTO1 "dto1": {"data":ID, <> "formats":D+}
4 |
5 | endpoint type MultiRepresentationResource
6 | exposes
7 | operation testOperation with responsibility STATE_CREATION_OPERATION
8 | expecting
9 | payload "expecting": TestDTO1
10 | delivering
11 | payload "delivering": TestDTO1*
12 |
13 | API provider FlexibleAndAdaptiveAPIProvider
14 | offers MultiRepresentationResource
15 | at endpoint location "https://some.sample.domain/apiEndpoint"
16 | via protocol HTTP
17 | binding
18 | resource single // at "/{primaryIntegerKey}/{atLeastOneString}"
19 | media type CMT1 as "application/json"
20 | media type CMT2 as "application/xml"
21 | operation testOperation to PUT
22 | // all elements realized as BODY parameters
23 | accepts "application/xml" "application/json"
24 | replies CMT1 CMT2 "plain/text"
--------------------------------------------------------------------------------
/examples/examples-advanced/HelloWorldMDSL2AsyncMDSL.mdsl:
--------------------------------------------------------------------------------
1 | API description HelloWorldAPI
2 |
3 | data type SampleDTO {ID, D}
4 |
5 | endpoint type HelloWorldEndpoint
6 | exposes
7 | operation sayHello1
8 | expecting payload D
9 | delivering payload SampleDTO
10 | operation sayHello2
11 | expecting payload D?
12 | delivering payload SampleDTO*
13 |
14 | endpoint type HelloWorldEndpoint2
15 | exposes
16 | operation sayHello1
17 | expecting payload "id":D
18 | delivering payload "tbc":SampleDTO
19 | operation sayHello3
20 | expecting payload D
21 | delivering payload SampleDTO
22 |
23 | API provider HelloWorldAPIProvider
24 | offers HelloWorldEndpoint
25 |
26 | API client HelloWorldAPIClient
27 | consumes HelloWorldEndpoint
--------------------------------------------------------------------------------
/examples/examples-advanced/SampleDataAndServiceActivatorTest.mdsl:
--------------------------------------------------------------------------------
1 | API description SampleDataAndServiceActivatorTest
2 |
3 | data type SampleBaseType "myId": D
4 |
5 | data type FlatTree {"anOffer":D, "value2":D}
6 | data type FlatTreeWithOptions {"HELLO":D*, "p2":D?}
7 |
8 | data type NestedTree {"HELLO":D*, "p2":D?, "subtree": {"p31":ID, "p32":MD}}
9 | data type NestedTreeWithIncompleteTypes {"v1":D, "v2":D, {ID, MD, P, "idOnly"}}
10 |
11 | // TODO test type references, top level and in nested tree
12 |
13 | endpoint type ServiceActivatorDemo
14 | exposes
15 | operation testAPI
16 | expecting payload "inData": FlatTreeWithOptions
17 | delivering payload "outData": NestedTree
18 |
19 | API provider ServiceActivatorDemoProvider offers ServiceActivatorDemo at endpoint location "http://localhost:8080"
20 | via protocol HTTP binding
21 | resource ServiceActivatorDemoHome at "/serviceActivatorDemoHome"
22 | operation testAPI to PUT element "inData" realized as BODY parameter
--------------------------------------------------------------------------------
/examples/examples-advanced/jaamsim-to-mdsl/src/main/resources/MDSLTools-SkeletonOfAPIWithFlow.mdsl:
--------------------------------------------------------------------------------
1 | API description SampleAPI
2 |
3 | // TODO let these standard types match those found in default JaamSim setup (distributions?)
4 |
5 | data type SimPartAttributesDTO {
6 | "description": D,
7 | "defaultStateList": D*,
8 | "initialState": D}
9 | data type SampleEntityDataDTO {"value1": D, "value2": D}
10 |
11 | event type SampleEvent {"when":D, "where":D, "what":D}
12 |
13 | command type SampleCommand
14 |
15 | flow FlowPlaceholder
16 |
--------------------------------------------------------------------------------
/examples/examples-advanced/readme.md:
--------------------------------------------------------------------------------
1 | *Note:* These examples are provides as-is, without further explanations. More such examples are available upon request.
--------------------------------------------------------------------------------
/examples/freemarker-example/FreemarkerReportStub-Genmodel.md.ftl:
--------------------------------------------------------------------------------
1 | # Report for MDSL specification ${fileName}
2 |
3 | ## Endpoint Types
4 |
5 | The API description ${genModel.apiName} features the following endpoint types (a.k.a. service contracts):
6 |
7 | <#list genModel.endpoints as endpoint>
8 | * ${endpoint.name}
9 | #list>
10 |
11 |
--------------------------------------------------------------------------------
/examples/freemarker-example/FreemarkerReportStub-Grammar.md.ftl:
--------------------------------------------------------------------------------
1 | # Report for MDSL specification ${fileName}
2 |
3 | ## Endpoint Types
4 |
5 | The API description ${apiName} features the following endpoint types (a.k.a. service contracts):
6 |
7 | <#list serviceSpecification.contracts as endpoint_type>
8 | * ${endpoint_type.name}
9 | #list>
10 |
--------------------------------------------------------------------------------
/examples/freemarker-example/FreemarkerWebDemo.html.ftl:
--------------------------------------------------------------------------------
1 |
2 |
3 | Welcome!
4 |
5 |
6 | Welcome in ${apiName}!
7 | Endpoints:
8 | tbc, stay tuned!
9 |
10 |
--------------------------------------------------------------------------------
/examples/freemarker-example/ReferenceManagementAPI.mdsl:
--------------------------------------------------------------------------------
1 | API description ReferenceManagementServiceAPI
2 |
3 | data type PaperItemDTO { "title":D, "authors":D, "venue":D, "paperItemId":PaperItemKey }
4 | data type PaperItemKey { "doi":D }
5 | data type createPaperItemParameter { "who":D, "what":D, "where":D }
6 |
7 | endpoint type PaperArchiveFacade
8 | serves as INFORMATION_HOLDER_RESOURCE
9 | exposes
10 | operation createPaperItem
11 | with responsibility STATE_CREATION_OPERATION
12 | expecting
13 | payload createPaperItemParameter
14 | delivering
15 | payload PaperItemDTO
16 | operation lookupPapersFromAuthor
17 | with responsibility RETRIEVAL_OPERATION
18 | expecting
19 | payload D
20 | delivering
21 | payload PaperItemDTO*
22 | operation convertToMarkdownForWebsite
23 | expecting
24 | payload PaperItemKey
25 | delivering
26 | payload D
27 |
28 |
--------------------------------------------------------------------------------
/examples/freemarker-example/src-gen/my-output.md:
--------------------------------------------------------------------------------
1 | # Report for MDSL specification ReferenceManagementAPI.mdsl
2 |
3 | ## Endpoint Types
4 |
5 | The API description ReferenceManagementServiceAPI features the following endpoint types (a.k.a. service contracts):
6 |
7 | * PaperArchiveFacade
8 |
--------------------------------------------------------------------------------
/examples/graphql-example/apollo-client-example/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore node modules:
2 | /node_modules
3 |
4 |
--------------------------------------------------------------------------------
/examples/graphql-example/apollo-client-example/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "apollo-client-example-2022",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "start": "react-scripts start",
8 | "build": "react-scripts build",
9 | "test": "react-scripts test --env=jsdom",
10 | "eject": "react-scripts eject"
11 | },
12 | "keywords": [],
13 | "author": "",
14 | "license": "ISC",
15 | "dependencies": {
16 | "@apollo/client": "^3.6.9",
17 | "apollo-client": "^2.6.10",
18 | "graphql": "^15.8.0",
19 | "react": "^18.2.0",
20 | "react-dom": "^18.2.0",
21 | "react-scripts": "^5.0.1"
22 | },
23 | "browserslist": {
24 | "production": [
25 | ">0.2%",
26 | "not dead",
27 | "not op_mini all"
28 | ],
29 | "development": [
30 | "last 1 chrome version",
31 | "last 1 firefox version",
32 | "last 1 safari version"
33 | ]
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/examples/graphql-example/apollo-client-example/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
10 | Apollo client example
11 |
12 |
13 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/examples/graphql-example/apollo-client-example/readme.md:
--------------------------------------------------------------------------------
1 | # apollo-client-example
2 |
3 | This folder contains the sources to the GraphQL generation example mentioned in the MDSL Tools documentation.
4 |
5 | *Important note 1:* The following examples have quite a few dependencies, for instance on Node.js and npm. They assume you have an up-to-date installation of these JavaScript technologies that meets your current security and other operational requirements (e.g., development-level proof-of-concept or learning environment?).
6 |
7 | *Important note 2:* The instructions in this page were created in the fall of 2020, so some of the screen captions, code snippets, and instructions might contain information that was current at that time. The same holds for the examples in the repository. We recommend to always start from a stable and supported version of Node.js and the other dependencies, and bring in the code snippets and examples from this page step by step. We cannot guarantee that they will always work unmodified in future versions of MDSL and the dependencies in the examples.
8 |
--------------------------------------------------------------------------------
/examples/graphql-example/apollo-server-example/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore node modules:
2 | /node_modules
3 |
4 |
--------------------------------------------------------------------------------
/examples/graphql-example/apollo-server-example/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "apollp-server-example",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "keywords": [],
10 | "author": "",
11 | "license": "ISC",
12 | "dependencies": {
13 | "apollo-server": "^2.25.4",
14 | "graphql": "^15.3.0"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/examples/graphql-example/document-management-input.mdsl:
--------------------------------------------------------------------------------
1 | API description ReferenceManagementServiceAPI
2 |
3 | data type PaperItemDTO { "title":D, "authors":D, "venue":D, "paperItemId":PaperItemKey }
4 | data type PaperItemKey { "doi":D }
5 | data type CreatePaper { "who":D, "what":D, "where":D }
6 |
7 | endpoint type PaperArchiveFacade
8 | serves as INFORMATION_HOLDER_RESOURCE
9 | exposes
10 | operation createPaperItem
11 | with responsibility STATE_CREATION_OPERATION
12 | expecting
13 | payload CreatePaper
14 | delivering
15 | payload PaperItemDTO
16 | operation lookupPapersFromAuthor
17 | with responsibility RETRIEVAL_OPERATION
18 | expecting
19 | payload D
20 | delivering
21 | payload PaperItemDTO*
22 | operation convertToMarkdownForWebsite
23 | expecting
24 | payload PaperItemKey
25 | delivering
26 | payload D
--------------------------------------------------------------------------------
/examples/graphql-example/readme.md:
--------------------------------------------------------------------------------
1 | # GraphQL Generation Example
2 |
3 | This folder contains the sources to the GraphQL generation example mentioned in the MDSL Tools documentation.
4 |
--------------------------------------------------------------------------------
/examples/graphql-example/spring-boot-example/.gitignore:
--------------------------------------------------------------------------------
1 | # Yarn / Node
2 | # yarn.lock # taken out Sept 8, 2022
3 | node_modules
4 |
5 | HELP.md
6 | .gradle
7 | build/
8 | !gradle/wrapper/gradle-wrapper.jar
9 | !**/src/main/**/build/
10 | !**/src/test/**/build/
11 |
12 | ### STS ###
13 | .apt_generated
14 | .classpath
15 | .factorypath
16 | .project
17 | .settings
18 | .springBeans
19 | .sts4-cache
20 |
21 | ### IntelliJ IDEA ###
22 | .idea
23 | *.iws
24 | *.iml
25 | *.ipr
26 | out/
27 | !**/src/main/**/out/
28 | !**/src/test/**/out/
29 |
30 | ### NetBeans ###
31 | /nbproject/private/
32 | /nbbuild/
33 | /dist/
34 | /nbdist/
35 | /.nb-gradle/
36 |
37 | ### VS Code ###
38 | .vscode/
39 |
--------------------------------------------------------------------------------
/examples/graphql-example/spring-boot-example/README.md:
--------------------------------------------------------------------------------
1 | # spring-boot-example
2 |
3 | *Important note 1:* The example has quite a few dependencies, for instance on yarn. It assumes you have an up-to-date installation of these technologies that meets your current security and other operational requirements (e.g., development-level proof-of-concept or learning environment?).
4 |
5 | *Important note 2:* The instructions in this page were created in the fall of 2020, so some of the screen captions, code snippets, and instructions might contain information that was current at that time. The same holds for the examples in the repository. We recommend to always start from a stable and supported version of the other dependencies, and bring in the code snippets and examples from this page step by step. We cannot guarantee that they will always work unmodified in future versions of MDSL and the dependencies in this example.
--------------------------------------------------------------------------------
/examples/graphql-example/spring-boot-example/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'org.springframework.boot' version '2.3.4.RELEASE'
3 | id 'io.spring.dependency-management' version '1.0.10.RELEASE'
4 | id 'java'
5 | id "com.moowork.node" version "1.3.1"
6 | }
7 |
8 | group = 'io.mdsl.graphql'
9 | version = '0.0.1-SNAPSHOT'
10 | sourceCompatibility = '11'
11 |
12 | repositories {
13 | mavenCentral()
14 | }
15 |
16 | dependencies {
17 | implementation 'com.graphql-java:graphql-java:15.0'
18 | implementation 'com.graphql-java:graphql-java-spring-boot-starter-webmvc:2.0'
19 | implementation 'com.google.guava:guava:26.0-jre'
20 |
21 | implementation 'org.springframework.boot:spring-boot-starter-web'
22 | testImplementation('org.springframework.boot:spring-boot-starter-test') {
23 | exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
24 | }
25 | }
26 |
27 | test {
28 | useJUnitPlatform()
29 | }
30 |
31 | build.dependsOn yarn
32 |
--------------------------------------------------------------------------------
/examples/graphql-example/spring-boot-example/codegen.yml:
--------------------------------------------------------------------------------
1 | schema: src/main/resources/schema.graphql
2 | generates:
3 | src/main/java/io/mdsl/graphql/javaexampleapp/generated/Types.java:
4 | plugins:
5 | - java
6 | src/main/java/io/mdsl/graphql/javaexampleapp/generated/Resolvers.java:
7 | plugins:
8 | - java-resolvers
--------------------------------------------------------------------------------
/examples/graphql-example/spring-boot-example/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Microservice-API-Patterns/MDSL-Specification/9da0bac0e6133b8a69131925e38bc98e63e20af2/examples/graphql-example/spring-boot-example/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/examples/graphql-example/spring-boot-example/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 |
--------------------------------------------------------------------------------
/examples/graphql-example/spring-boot-example/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "java-app",
3 | "scripts": {
4 | "postinstall": "graphql-codegen"
5 | },
6 | "dependencies": {
7 | "graphql": "^15.3.0",
8 | "@graphql-codegen/cli": "1.17.10",
9 | "@graphql-codegen/java": "1.17.8",
10 | "@graphql-codegen/java-resolvers": "1.17.8"
11 | }
12 | }
--------------------------------------------------------------------------------
/examples/graphql-example/spring-boot-example/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'java-example-app'
2 |
--------------------------------------------------------------------------------
/examples/graphql-example/spring-boot-example/src/main/java/io/mdsl/graphql/javaexampleapp/JavaExampleAppApplication.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.graphql.javaexampleapp;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 |
6 | @SpringBootApplication
7 | public class JavaExampleAppApplication {
8 |
9 | public static void main(String[] args) {
10 | SpringApplication.run(JavaExampleAppApplication.class, args);
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/examples/graphql-example/spring-boot-example/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/examples/graphql-example/spring-boot-example/src/test/java/io/mdsl/graphql/javaexampleapp/JavaExampleAppApplicationTests.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.graphql.javaexampleapp;
2 |
3 | import org.junit.jupiter.api.Test;
4 | import org.springframework.boot.test.context.SpringBootTest;
5 |
6 | @SpringBootTest
7 | class JavaExampleAppApplicationTests {
8 |
9 | @Test
10 | void contextLoads() {
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/examples/graphql-example/spring-boot-example/yarn.lock:
--------------------------------------------------------------------------------
1 | # This file is generated by running "yarn install" inside your project.
2 | # Manual changes might be lost - proceed with caution!
3 |
4 | __metadata:
5 | version: 6
6 |
7 | "spring-boot-example@workspace:.":
8 | version: 0.0.0-use.local
9 | resolution: "spring-boot-example@workspace:."
10 | languageName: unknown
11 | linkType: soft
12 |
--------------------------------------------------------------------------------
/examples/java-example/README.md:
--------------------------------------------------------------------------------
1 | # Java Generation Example
2 |
3 | This folder contains the sources to the Java generation example mentioned [here](https://microservice-api-patterns.github.io/MDSL-Specification/java).
4 |
--------------------------------------------------------------------------------
/examples/java-example/src-gen/io/mdsl/generator/example/services/PaperArchiveFacade.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.generator.example.services;
2 |
3 | import io.mdsl.generator.example.types.*;
4 |
5 | /**
6 | * This interface has been generated from the MDSL endpoint called 'PaperArchiveFacade'.
7 | *
8 | */
9 | public interface PaperArchiveFacade {
10 |
11 | /**
12 | * MAP decorator: STATE_CREATION_OPERATION
13 | *
14 | * Find all MAP responsibility patterns here: https://microservice-api-patterns.org/patterns/responsibility/
15 | */
16 | PaperItemDTO createPaperItem(CreatePaperItemParameter anonymousInput);
17 |
18 | /**
19 | * MAP decorator: RETRIEVAL_OPERATION
20 | *
21 | * Find all MAP responsibility patterns here: https://microservice-api-patterns.org/patterns/responsibility/
22 | */
23 | PaperItemDTOList lookupPapersFromAuthor(LookupPapersFromAuthorRequestDataType anonymousInput);
24 |
25 | ConvertToMarkdownForWebsiteResponseDataType convertToMarkdownForWebsite(PaperItemKey anonymousInput);
26 |
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/examples/java-example/src-gen/io/mdsl/generator/example/types/ConvertToMarkdownForWebsiteResponseDataType.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.generator.example.types;
2 |
3 |
4 | /**
5 | * This class has been generated from the MDSL data type 'ConvertToMarkdownForWebsiteResponseDataType'.
6 | *
7 | */
8 | public class ConvertToMarkdownForWebsiteResponseDataType {
9 |
10 | /**
11 | * The name of this field (anonymous2) has been generated because it is not defined in your MDSL contract.
12 | * TODO: You can fix this by providing an attribute name in MDSL (regenerate) or rename the field right here (use rename refactoring).
13 | */
14 | private String anonymous2;
15 |
16 | public String getAnonymous2() {
17 | return anonymous2;
18 | }
19 |
20 | public void setAnonymous2(String anonymous2) {
21 | this.anonymous2 = anonymous2;
22 | }
23 |
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/examples/java-example/src-gen/io/mdsl/generator/example/types/CreatePaperItemParameter.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.generator.example.types;
2 |
3 |
4 | /**
5 | * This class has been generated from the MDSL data type 'createPaperItemParameter'.
6 | *
7 | */
8 | public class CreatePaperItemParameter {
9 |
10 | private String who;
11 | private String what;
12 | private String where;
13 |
14 | public String getWho() {
15 | return who;
16 | }
17 |
18 | public void setWho(String who) {
19 | this.who = who;
20 | }
21 |
22 | public String getWhat() {
23 | return what;
24 | }
25 |
26 | public void setWhat(String what) {
27 | this.what = what;
28 | }
29 |
30 | public String getWhere() {
31 | return where;
32 | }
33 |
34 | public void setWhere(String where) {
35 | this.where = where;
36 | }
37 |
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/examples/java-example/src-gen/io/mdsl/generator/example/types/LookupPapersFromAuthorRequestDataType.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.generator.example.types;
2 |
3 |
4 | /**
5 | * This class has been generated from the MDSL data type 'lookupPapersFromAuthorRequestDataType'.
6 | *
7 | */
8 | public class LookupPapersFromAuthorRequestDataType {
9 |
10 | /**
11 | * The name of this field (anonymous1) has been generated because it is not defined in your MDSL contract.
12 | * TODO: You can fix this by providing an attribute name in MDSL (regenerate) or rename the field right here (use rename refactoring).
13 | */
14 | private String anonymous1;
15 |
16 | public String getAnonymous1() {
17 | return anonymous1;
18 | }
19 |
20 | public void setAnonymous1(String anonymous1) {
21 | this.anonymous1 = anonymous1;
22 | }
23 |
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/examples/java-example/src-gen/io/mdsl/generator/example/types/PaperItemDTO.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.generator.example.types;
2 |
3 |
4 | /**
5 | * This class has been generated from the MDSL data type 'PaperItemDTO'.
6 | *
7 | */
8 | public class PaperItemDTO {
9 |
10 | private String title;
11 | private String authors;
12 | private String venue;
13 | private PaperItemKey paperItemId;
14 |
15 | public String getTitle() {
16 | return title;
17 | }
18 |
19 | public void setTitle(String title) {
20 | this.title = title;
21 | }
22 |
23 | public String getAuthors() {
24 | return authors;
25 | }
26 |
27 | public void setAuthors(String authors) {
28 | this.authors = authors;
29 | }
30 |
31 | public String getVenue() {
32 | return venue;
33 | }
34 |
35 | public void setVenue(String venue) {
36 | this.venue = venue;
37 | }
38 |
39 | public PaperItemKey getPaperItemId() {
40 | return paperItemId;
41 | }
42 |
43 | public void setPaperItemId(PaperItemKey paperItemId) {
44 | this.paperItemId = paperItemId;
45 | }
46 |
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/examples/java-example/src-gen/io/mdsl/generator/example/types/PaperItemDTOList.java:
--------------------------------------------------------------------------------
1 | package io.mdsl.generator.example.types;
2 |
3 | import java.util.List;
4 |
5 | /**
6 | * This class has been generated from the MDSL data type 'PaperItemDTOList'.
7 | *
8 | */
9 | public class PaperItemDTOList {
10 |
11 | private List