Skip to content

Commit d62e740

Browse files
authored
Merge pull request #60 from ModelDriven/ST6RI-115
ST6Ri-115 Update the repository save utility to use type-validating API
2 parents 5c9aa06 + 2a9be3e commit d62e740

15 files changed

Lines changed: 345 additions & 153 deletions

File tree

org.omg.sysml.interactive/src/org/omg/sysml/interactive/SysMLInteractive.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ public String show(String name) {
224224
}
225225

226226
protected ApiElementProcessingFacade getProcessingFacade(String modelName) throws ApiException {
227+
System.out.println("API base path: " + this.apiBasePath);
227228
ApiElementProcessingFacade processingFacade = new ApiElementProcessingFacade(modelName, this.apiBasePath);
228229
final ElementVisitorFactoryImpl visitorFactory = new ElementVisitorFactoryImpl(processingFacade);
229230
Traversal traversal = new TraversalImpl(visitorFactory);
@@ -242,7 +243,7 @@ public String publish(String name) {
242243
String modelName = element.getName() + " " + new Date();
243244
ApiElementProcessingFacade processingFacade = this.getProcessingFacade(modelName);
244245
processingFacade.getTraversal().visit(element);
245-
return modelName + " (" + processingFacade.getModelId() + ")\n";
246+
return modelName + " (" + processingFacade.getProjectId() + ")\n";
246247
}
247248
} catch (Exception e) {
248249
return SysMLInteractiveUtil.formatException(e);

org.omg.sysml.xtext/META-INF/MANIFEST.MF

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ Require-Bundle: org.eclipse.xtext,
1313
org.eclipse.xtext.util,
1414
org.eclipse.xtend.lib;bundle-version="2.14.0",
1515
org.antlr.runtime;bundle-version="[3.2.0,3.2.1)",
16-
org.omg.sysml;bundle-version="1.0.0"
16+
org.omg.sysml;bundle-version="1.0.0",
17+
org.omg.kerml.xtext
1718
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
1819
Export-Package: org.omg.sysml.xtext.serializer,
1920
org.omg.sysml.xtext.parser.antlr.internal,
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*****************************************************************************
2+
* SysML 2 Pilot Implementation
3+
* Copyright (c) 2019 Model Driven Solutions, Inc.
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU Lesser General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU Lesser General Public License for more details.
14+
*
15+
* You should have received a copy of theGNU Lesser General Public License
16+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
*
18+
* @license LGPL-3.0-or-later <http://spdx.org/licenses/LGPL-3.0-or-later>
19+
*
20+
* Contributors:
21+
* Ed Seidewitz
22+
*
23+
*****************************************************************************/
24+
package org.omg.sysml.util;
25+
26+
import org.omg.kerml.xtext.KerMLStandaloneSetup;
27+
import org.omg.sysml.xtext.SysMLStandaloneSetup;
28+
29+
public class SysMLRepositorySaveUtil extends AlfRepositorySaveUtil {
30+
31+
public SysMLRepositorySaveUtil() {
32+
super();
33+
KerMLStandaloneSetup.doSetup();
34+
SysMLStandaloneSetup.doSetup();
35+
this.addExtension(".kerml");
36+
this.addExtension(".sysml");
37+
}
38+
39+
public static void main(String[] args) {
40+
new SysMLRepositorySaveUtil().run(args);
41+
}
42+
43+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*****************************************************************************
2+
* SysML 2 Pilot Implementation
3+
* Copyright (c) 2019 Model Driven Solutions, Inc.
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU Lesser General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU Lesser General Public License for more details.
14+
*
15+
* You should have received a copy of theGNU Lesser General Public License
16+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
*
18+
* @license LGPL-3.0-or-later <http://spdx.org/licenses/LGPL-3.0-or-later>
19+
*
20+
* Contributors:
21+
* Ed Seidewitz
22+
*
23+
*****************************************************************************/
24+
package org.omg.sysml.util;
25+
26+
import org.omg.kerml.xtext.KerMLStandaloneSetup;
27+
import org.omg.sysml.xtext.SysMLStandaloneSetup;
28+
29+
public class SysMLTraversalUtil extends AlfTraversalUtil {
30+
31+
public SysMLTraversalUtil() {
32+
super();
33+
KerMLStandaloneSetup.doSetup();
34+
SysMLStandaloneSetup.doSetup();
35+
this.addExtension(".kerml");
36+
this.addExtension(".sysml");
37+
}
38+
39+
public static void main(String[] args) {
40+
new SysMLTraversalUtil().run(args);
41+
}
42+
43+
}

org.omg.sysml/.classpath

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
<classpathentry kind="src" path="syntax-gen"/>
77
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
88
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
9-
<classpathentry exported="true" kind="lib" path="lib/sysml-api-client-0.1.0-all.jar"/>
9+
<classpathentry exported="true" kind="lib" path="lib/sysml-v2-api-client-2019-09-all.jar" sourcepath="/SysML-v2-API-Client/src/main/java"/>
1010
<classpathentry kind="output" path="bin"/>
1111
</classpath>

org.omg.sysml/.launch/Save Alf with Library.launch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
33
<stringAttribute key="bad_container_name" value="/org.omg.sysml/.l"/>
44
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
5-
<listEntry value="/org.omg.sysml/src/org/omg/sysml/util/traversal/impl/AlfRepositorySaveImpl.java"/>
5+
<listEntry value="/org.omg.sysml/src/org/omg/sysml/util/AlfRepositorySaveUtil.java"/>
66
</listAttribute>
77
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
88
<listEntry value="1"/>
99
</listAttribute>
1010
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_EXCLUDE_TEST_CODE" value="true"/>
1111
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
12-
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.omg.sysml.util.traversal.impl.AlfRepositorySaveImpl"/>
13-
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="&quot;${selected_resource_loc}&quot; &quot;${project_loc}&quot;/src/library"/>
12+
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.omg.sysml.util.AlfRepositorySaveUtil"/>
13+
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-s http://sysml2-dev.intercax.com:9000 &quot;${selected_resource_loc}&quot; &quot;${workspace_loc}&quot;/sysml.library"/>
1414
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.omg.sysml"/>
1515
</launchConfiguration>

org.omg.sysml/.launch/Save Alf.launch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
33
<stringAttribute key="bad_container_name" value="/SySML-v2-Pilot-Implementation/org.omg.sysml/.l"/>
44
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
5-
<listEntry value="/org.omg.sysml/src/org/omg/sysml/util/traversal/impl/AlfRepositorySaveImpl.java"/>
5+
<listEntry value="/org.omg.sysml/src/org/omg/sysml/util/AlfRepositorySaveUtil.java"/>
66
</listAttribute>
77
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
88
<listEntry value="1"/>
99
</listAttribute>
1010
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_EXCLUDE_TEST_CODE" value="true"/>
1111
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
12-
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.omg.sysml.util.traversal.impl.AlfRepositorySaveImpl"/>
13-
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="&quot;${selected_resource_loc}&quot;"/>
12+
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.omg.sysml.util.AlfRepositorySaveUtil"/>
13+
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-b http://sysml2-dev.intercax.com:9000 &quot;${selected_resource_loc}&quot;"/>
1414
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.omg.sysml"/>
1515
</launchConfiguration>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
3+
<stringAttribute key="bad_container_name" value="/SySML-v2-Pilot-Implementation/org.omg.sysml/.l"/>
4+
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
5+
<listEntry value="/org.omg.sysml.xtext/src/org/omg/sysml/util/SysMLRepositorySaveUtil.java"/>
6+
</listAttribute>
7+
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
8+
<listEntry value="1"/>
9+
</listAttribute>
10+
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_EXCLUDE_TEST_CODE" value="true"/>
11+
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
12+
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.omg.sysml.util.SysMLRepositorySaveUtil"/>
13+
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-b http://sysml2-dev.intercax.com:9000 &quot;${selected_resource_loc}&quot;&#10;&quot;${project_loc}/../sysml.library/Kernel Library&quot; &#10;&quot;${project_loc}/../sysml.library/System Library&quot; &#10;&quot;${project_loc}/../sysml.library/Domain LIbraries&quot;"/>
14+
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.omg.sysml.xtext"/>
15+
</launchConfiguration>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
3+
<stringAttribute key="bad_container_name" value="/SySML-v2-Pilot-Implementation/org.omg.sysml/.l"/>
4+
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
5+
<listEntry value="/org.omg.sysml.xtext/src/org/omg/sysml/util/SysMLRepositorySaveUtil.java"/>
6+
</listAttribute>
7+
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
8+
<listEntry value="1"/>
9+
</listAttribute>
10+
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_EXCLUDE_TEST_CODE" value="true"/>
11+
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
12+
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.omg.sysml.util.SysMLRepositorySaveUtil"/>
13+
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-b http://sysml2-dev.intercax.com:9000 &quot;${selected_resource_loc}&quot;"/>
14+
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.omg.sysml.xtext"/>
15+
</launchConfiguration>
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
22
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
33
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
4-
<listEntry value="/org.omg.sysml/src/org/omg/sysml/util/traversal/impl/AlfTraversalImpl.java"/>
4+
<listEntry value="/org.omg.sysml/src/org/omg/sysml/util/AlfTraversalUtil.java"/>
55
</listAttribute>
66
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
77
<listEntry value="1"/>
88
</listAttribute>
99
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
10-
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.omg.sysml.util.traversal.impl.AlfTraversalImpl"/>
11-
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="&quot;${selected_resource_loc}&quot; &quot;${project_loc}&quot;/src/library"/>
10+
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.omg.sysml.util.AlfTraversalUtil"/>
11+
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="&quot;${selected_resource_loc}&quot;"/>
1212
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.omg.sysml"/>
1313
</launchConfiguration>

0 commit comments

Comments
 (0)