From 68c297ef592daab1eb47fb1a5eb4e5c0dffb7aba Mon Sep 17 00:00:00 2001 From: John Verhaeg Date: Wed, 17 Sep 2014 11:11:22 -0500 Subject: [PATCH] Fixes #224 --- {modeshape-modeler => modelspace}/README.md | 0 .../modelspace-ddl}/pom.xml | 16 +- .../src/assembly/module-with-dependencies.xml | 0 .../ddl/TeiidDdlDependencyProcessor.java | 20 +- .../org/modelspace}/ddl/TeiidDdlExporter.java | 12 +- .../java/org/modelspace/ddl/TeiidDdlI18n.java | 8 +- .../org/modelspace}/ddl/TeiidDdlLexicon.java | 8 +- .../java/org/modelspace}/ddl/ITTeiidDdl.java | 13 +- .../ddl/ITTeiidDdlDependencyProcessor.java | 5 +- .../modelspace}/ddl/ITTeiidDdlExporter.java | 9 +- .../ddl/TeiidDdlIntegrationTest.java | 4 +- .../test/resources/Teiid-MySQLAccounts.ddl | 0 .../src/test/resources/log4j.properties | 4 +- .../modelspace-eclipse}/META-INF/MANIFEST.MF | 4 +- .../OSGI-INF/l10n/bundle.properties | 4 +- .../modelspace-eclipse}/build.properties | 0 .../modelspace-eclipse}/pom.xml | 6 +- .../modeler/eclipse/EclipseI18n.java | 2 +- .../modeler/eclipse/EclipseUtil.java | 0 .../modeshape/modeler/eclipse/FocusTree.java | 0 .../modeler/eclipse/FocusTreeLightweight.java | 0 .../modeshape/modeler/eclipse/DemoUtil.java | 0 .../modeler/eclipse/FocusTreeDemo.java | 0 .../eclipse/FocusTreeFileSystemModel.java | 0 .../FocusTreeModeShapeModelerXsdModel.java | 0 .../modeler/eclipse/TestEclipseI18n.java | 0 .../src/test/resources/Books.xsd | 0 .../resources/data/types/BookDatatypes.xsd | 0 .../test/resources/images/transformation.png | Bin ...-4.0.0.Alpha4-module-with-dependencies.zip | Bin ...-4.0.0.Alpha4-module-with-dependencies.zip | Bin ...-4.0.0.Alpha4-module-with-dependencies.zip | Bin ...-4.0.0.Alpha4-module-with-dependencies.zip | Bin .../modelspace-engine}/pom.xml | 8 +- .../src/main/java/org/modelspace}/Data.java | 2 +- .../main/java/org/modelspace}/Descriptor.java | 14 +- .../main/java/org/modelspace}/Metamodel.java | 12 +- .../org/modelspace}/MetamodelManager.java | 38 +-- .../src/main/java/org/modelspace}/Model.java | 28 +- .../java/org/modelspace}/ModelObject.java | 118 +++---- .../java/org/modelspace}/ModelProperty.java | 66 ++-- .../main/java/org/modelspace/Modelspace.java | 104 +++---- .../org/modelspace/ModelspaceException.java | 22 +- .../java/org/modelspace/ModelspaceI18n.java | 9 +- .../org/modelspace/ModelspaceLexicon.java | 8 +- .../org/modelspace}/PropertyDescriptor.java | 26 +- .../modelspace}/internal/DescriptorImpl.java | 42 +-- .../org/modelspace}/internal/JcrUtil.java | 16 +- .../modelspace}/internal/MetamodelImpl.java | 40 +-- .../internal/MetamodelInstaller.java | 66 ++-- .../internal/MetamodelManagerImpl.java | 190 ++++++------ .../org/modelspace}/internal/ModelImpl.java | 88 +++--- .../modelspace}/internal/ModelObjectImpl.java | 252 +++++++-------- .../internal/ModelPropertyImpl.java | 162 +++++----- .../modelspace/internal/ModelspaceImpl.java | 292 +++++++++--------- .../internal/PropertyDescriptorImpl.java | 26 +- .../internal/SequencerImporter.java | 10 +- .../modelspace}/internal/task/SystemTask.java | 6 +- .../internal/task/SystemTaskWithResult.java | 6 +- .../org/modelspace}/internal/task/Task.java | 2 +- .../internal/task/TaskWithResult.java | 2 +- .../internal/task/WriteSystemTask.java | 6 +- .../modelspace}/internal/task/WriteTask.java | 2 +- .../internal/task/WriteTaskWithResult.java | 2 +- .../java/org/modelspace/spi}/Dependency.java | 2 +- .../modelspace/spi}/DependencyProcessor.java | 16 +- .../java/org/modelspace/spi}/Exporter.java | 14 +- .../java/org/modelspace/spi}/Importer.java | 14 +- .../src/main/resources/config.json | 8 +- .../src/main/resources/infinispan.xml | 4 +- .../src/main/resources/metamodel.cnd | 2 +- .../org/modelspace}/MockObjectFactory.java | 2 +- .../org/modelspace/ModelspaceI18nTest.java | 4 +- .../internal/MetamodelManagerImplTest.java | 10 +- .../internal/ModelObjectImplTest.java | 10 +- .../internal/ModelspaceImplTest.java | 93 +++--- .../spi/metamodel/DependencyTest.java | 4 +- .../modelspace}/test/BaseIntegrationTest.java | 4 +- .../modelspace/test/BaseModelspaceTest.java | 32 +- .../java/org/modelspace}/test/BaseTest.java | 2 +- .../java/org/modelspace}/test/TestRunner.java | 2 +- .../src/test/resources/log4j.properties | 6 +- .../src/test/resources/testConfig.json | 4 +- .../modelspace-java}/pom.xml | 16 +- .../src/assembly/module-with-dependencies.xml | 0 .../java/JavaDependencyProcessor.java | 22 +- .../java/org/modelspace}/ITMetamodel.java | 8 +- .../org/modelspace}/ITMetamodelManager.java | 67 ++-- .../test/java/org/modelspace}/ITModel.java | 9 +- .../java/org/modelspace}/ITModelObject.java | 44 +-- .../java/org/modelspace/ITModelspace.java | 32 +- .../java/org/modelspace}/java/ITJava.java | 36 +-- .../java/ITJavaDependencyProcessor.java | 20 +- .../modelspace}/test/JavaIntegrationTest.java | 13 +- .../src/test/resources/Mock.java | 2 +- .../src/test/resources/log4j.properties | 4 +- .../modelspace-ui}/pom.xml | 6 +- .../modeler/ui/FocusTreeController.java | 0 .../modeshape/modeler/ui/FocusTreeModel.java | 0 .../modeshape/modeler/ui/FocusTreeView.java | 0 .../java/org/modeshape/modeler/ui/UiI18n.java | 0 .../java/org/modeshape/modeler/ui/UiUtil.java | 0 .../src/main/resources/images/close.gif | Bin .../src/main/resources/images/copy.gif | Bin .../src/main/resources/images/minimize.gif | Bin .../src/main/resources/images/scrollLeft.png | Bin .../src/main/resources/images/scrollRight.png | Bin .../modelspace-xsd}/pom.xml | 16 +- .../src/assembly/module-with-dependencies.xml | 0 .../xsd/XsdDependencyProcessor.java | 74 ++--- .../java/org/modelspace}/xsd/XsdExporter.java | 16 +- .../main/java/org/modelspace/xsd/XsdI18n.java | 9 +- .../java/org/modelspace}/xsd/XsdLexicon.java | 6 +- .../xsd/ITXsdDependencyProcessor.java | 99 +++--- .../modelspace}/xsd/ITXsdDesquencerTest.java | 6 +- .../xsd/test/XsdIntegrationTest.java | 8 +- .../src/test/resources/Books/Books.xsd | 0 .../Books/SOAP/BooksWithSOAPEncoding.xsd | 0 .../Books/SOAP/encoding/soap_encoding.xsd | 0 .../Books/data/types/BookDatatypes.xsd | 0 .../test/resources/Movies/MovieDatatypes.xsd | 0 .../src/test/resources/Movies/Movies.xsd | 0 .../src/test/resources/log4j.properties | 4 +- .../src/test/resources/music.xsd | 0 {modeshape-modeler => modelspace}/pom.xml | 14 +- .../test/resources/Teiid-MySQLAccounts.ddl | 40 --- polyglotter-engine/pom.xml | 2 +- .../ITJava2JavaTransformation.java | 8 +- .../java/org/polyglotter/Polyglotter.java | 148 ++++----- .../java/org/polyglotter/operation/Map.java | 6 +- .../transformation/Transformation.java | 2 +- .../transformation/TransformationFactory.java | 18 +- .../org/polyglotter/operation/MapTest.java | 2 +- .../java/org/polyglotter/test/BaseTest.java | 2 +- .../TransformationImplTest.java | 2 +- pom.xml | 24 +- 136 files changed, 1389 insertions(+), 1409 deletions(-) rename {modeshape-modeler => modelspace}/README.md (100%) rename {modeshape-modeler/modeshape-modeler-ddl => modelspace/modelspace-ddl}/pom.xml (87%) rename {modeshape-modeler/modeshape-modeler-ddl => modelspace/modelspace-ddl}/src/assembly/module-with-dependencies.xml (100%) rename {modeshape-modeler/modeshape-modeler-ddl/src/main/java/org/modeshape/modeler => modelspace/modelspace-ddl/src/main/java/org/modelspace}/ddl/TeiidDdlDependencyProcessor.java (75%) rename {modeshape-modeler/modeshape-modeler-ddl/src/main/java/org/modeshape/modeler => modelspace/modelspace-ddl/src/main/java/org/modelspace}/ddl/TeiidDdlExporter.java (83%) rename modeshape-modeler/modeshape-modeler-ddl/src/main/java/org/modeshape/modeler/ddl/TeiidDdlModelerI18n.java => modelspace/modelspace-ddl/src/main/java/org/modelspace/ddl/TeiidDdlI18n.java (87%) rename {modeshape-modeler/modeshape-modeler-ddl/src/main/java/org/modeshape/modeler => modelspace/modelspace-ddl/src/main/java/org/modelspace}/ddl/TeiidDdlLexicon.java (88%) rename {modeshape-modeler/modeshape-modeler-ddl/src/test/java/org/modeshape/modeler => modelspace/modelspace-ddl/src/test/java/org/modelspace}/ddl/ITTeiidDdl.java (90%) rename {modeshape-modeler/modeshape-modeler-ddl/src/test/java/org/modeshape/modeler => modelspace/modelspace-ddl/src/test/java/org/modelspace}/ddl/ITTeiidDdlDependencyProcessor.java (94%) rename {modeshape-modeler/modeshape-modeler-ddl/src/test/java/org/modeshape/modeler => modelspace/modelspace-ddl/src/test/java/org/modelspace}/ddl/ITTeiidDdlExporter.java (89%) rename {modeshape-modeler/modeshape-modeler-ddl/src/test/java/org/modeshape/modeler => modelspace/modelspace-ddl/src/test/java/org/modelspace}/ddl/TeiidDdlIntegrationTest.java (93%) rename {modeshape-modeler/modeshape-modeler-ddl => modelspace/modelspace-ddl}/src/test/resources/Teiid-MySQLAccounts.ddl (100%) rename {modeshape-modeler/modeshape-modeler-xsd => modelspace/modelspace-ddl}/src/test/resources/log4j.properties (84%) rename {modeshape-modeler/modeshape-modeler-eclipse => modelspace/modelspace-eclipse}/META-INF/MANIFEST.MF (76%) rename {modeshape-modeler/modeshape-modeler-eclipse => modelspace/modelspace-eclipse}/OSGI-INF/l10n/bundle.properties (92%) rename {modeshape-modeler/modeshape-modeler-eclipse => modelspace/modelspace-eclipse}/build.properties (100%) rename {modeshape-modeler/modeshape-modeler-ui => modelspace/modelspace-eclipse}/pom.xml (72%) rename {modeshape-modeler/modeshape-modeler-eclipse => modelspace/modelspace-eclipse}/src/main/java/org/modeshape/modeler/eclipse/EclipseI18n.java (92%) rename {modeshape-modeler/modeshape-modeler-eclipse => modelspace/modelspace-eclipse}/src/main/java/org/modeshape/modeler/eclipse/EclipseUtil.java (100%) rename {modeshape-modeler/modeshape-modeler-eclipse => modelspace/modelspace-eclipse}/src/main/java/org/modeshape/modeler/eclipse/FocusTree.java (100%) rename {modeshape-modeler/modeshape-modeler-eclipse => modelspace/modelspace-eclipse}/src/main/java/org/modeshape/modeler/eclipse/FocusTreeLightweight.java (100%) rename {modeshape-modeler/modeshape-modeler-eclipse => modelspace/modelspace-eclipse}/src/test/java/org/modeshape/modeler/eclipse/DemoUtil.java (100%) rename {modeshape-modeler/modeshape-modeler-eclipse => modelspace/modelspace-eclipse}/src/test/java/org/modeshape/modeler/eclipse/FocusTreeDemo.java (100%) rename {modeshape-modeler/modeshape-modeler-eclipse => modelspace/modelspace-eclipse}/src/test/java/org/modeshape/modeler/eclipse/FocusTreeFileSystemModel.java (100%) rename {modeshape-modeler/modeshape-modeler-eclipse => modelspace/modelspace-eclipse}/src/test/java/org/modeshape/modeler/eclipse/FocusTreeModeShapeModelerXsdModel.java (100%) rename {modeshape-modeler/modeshape-modeler-eclipse => modelspace/modelspace-eclipse}/src/test/java/org/modeshape/modeler/eclipse/TestEclipseI18n.java (100%) rename {modeshape-modeler/modeshape-modeler-eclipse => modelspace/modelspace-eclipse}/src/test/resources/Books.xsd (100%) rename {modeshape-modeler/modeshape-modeler-eclipse => modelspace/modelspace-eclipse}/src/test/resources/data/types/BookDatatypes.xsd (100%) rename {modeshape-modeler/modeshape-modeler-eclipse => modelspace/modelspace-eclipse}/src/test/resources/images/transformation.png (100%) rename {modeshape-modeler/modeshape-modeler-eclipse => modelspace/modelspace-eclipse}/src/test/resources/org/modeshape/modeshape-sequencer-java/4.0.0.Alpha4/modeshape-sequencer-java-4.0.0.Alpha4-module-with-dependencies.zip (100%) rename {modeshape-modeler/modeshape-modeler-eclipse => modelspace/modelspace-eclipse}/src/test/resources/org/modeshape/modeshape-sequencer-sramp/4.0.0.Alpha4/modeshape-sequencer-sramp-4.0.0.Alpha4-module-with-dependencies.zip (100%) rename {modeshape-modeler/modeshape-modeler-eclipse => modelspace/modelspace-eclipse}/src/test/resources/org/modeshape/modeshape-sequencer-xml/4.0.0.Alpha4/modeshape-sequencer-xml-4.0.0.Alpha4-module-with-dependencies.zip (100%) rename {modeshape-modeler/modeshape-modeler-eclipse => modelspace/modelspace-eclipse}/src/test/resources/org/modeshape/modeshape-sequencer-xsd/4.0.0.Alpha4/modeshape-sequencer-xsd-4.0.0.Alpha4-module-with-dependencies.zip (100%) rename {modeshape-modeler/modeshape-modeler-engine => modelspace/modelspace-engine}/pom.xml (92%) rename {modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler => modelspace/modelspace-engine/src/main/java/org/modelspace}/Data.java (97%) rename {modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler => modelspace/modelspace-engine/src/main/java/org/modelspace}/Descriptor.java (85%) rename {modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler => modelspace/modelspace-engine/src/main/java/org/modelspace}/Metamodel.java (87%) rename {modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler => modelspace/modelspace-engine/src/main/java/org/modelspace}/MetamodelManager.java (89%) rename {modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler => modelspace/modelspace-engine/src/main/java/org/modelspace}/Model.java (75%) rename {modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler => modelspace/modelspace-engine/src/main/java/org/modelspace}/ModelObject.java (81%) rename {modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler => modelspace/modelspace-engine/src/main/java/org/modelspace}/ModelProperty.java (74%) rename modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/Modeler.java => modelspace/modelspace-engine/src/main/java/org/modelspace/Modelspace.java (81%) rename modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/ModelerException.java => modelspace/modelspace-engine/src/main/java/org/modelspace/ModelspaceException.java (79%) rename modeshape-modeler/modeshape-modeler-xsd/src/main/java/org/modeshape/modeler/xsd/XsdModelerI18n.java => modelspace/modelspace-engine/src/main/java/org/modelspace/ModelspaceI18n.java (89%) rename modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/ModelerLexicon.java => modelspace/modelspace-engine/src/main/java/org/modelspace/ModelspaceLexicon.java (97%) rename {modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler => modelspace/modelspace-engine/src/main/java/org/modelspace}/PropertyDescriptor.java (86%) rename {modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler => modelspace/modelspace-engine/src/main/java/org/modelspace}/internal/DescriptorImpl.java (76%) rename {modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler => modelspace/modelspace-engine/src/main/java/org/modelspace}/internal/JcrUtil.java (89%) rename {modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler => modelspace/modelspace-engine/src/main/java/org/modelspace}/internal/MetamodelImpl.java (80%) rename {modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler => modelspace/modelspace-engine/src/main/java/org/modelspace}/internal/MetamodelInstaller.java (81%) rename {modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler => modelspace/modelspace-engine/src/main/java/org/modelspace}/internal/MetamodelManagerImpl.java (79%) rename {modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler => modelspace/modelspace-engine/src/main/java/org/modelspace}/internal/ModelImpl.java (72%) rename {modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler => modelspace/modelspace-engine/src/main/java/org/modelspace}/internal/ModelObjectImpl.java (77%) rename {modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler => modelspace/modelspace-engine/src/main/java/org/modelspace}/internal/ModelPropertyImpl.java (77%) rename modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/ModelerImpl.java => modelspace/modelspace-engine/src/main/java/org/modelspace/internal/ModelspaceImpl.java (75%) rename {modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler => modelspace/modelspace-engine/src/main/java/org/modelspace}/internal/PropertyDescriptorImpl.java (87%) rename {modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler => modelspace/modelspace-engine/src/main/java/org/modelspace}/internal/SequencerImporter.java (86%) rename {modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler => modelspace/modelspace-engine/src/main/java/org/modelspace}/internal/task/SystemTask.java (90%) rename {modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler => modelspace/modelspace-engine/src/main/java/org/modelspace}/internal/task/SystemTaskWithResult.java (90%) rename {modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler => modelspace/modelspace-engine/src/main/java/org/modelspace}/internal/task/Task.java (96%) rename {modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler => modelspace/modelspace-engine/src/main/java/org/modelspace}/internal/task/TaskWithResult.java (97%) rename {modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler => modelspace/modelspace-engine/src/main/java/org/modelspace}/internal/task/WriteSystemTask.java (90%) rename {modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler => modelspace/modelspace-engine/src/main/java/org/modelspace}/internal/task/WriteTask.java (96%) rename {modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler => modelspace/modelspace-engine/src/main/java/org/modelspace}/internal/task/WriteTaskWithResult.java (97%) rename {modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/spi/metamodel => modelspace/modelspace-engine/src/main/java/org/modelspace/spi}/Dependency.java (99%) rename {modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/spi/metamodel => modelspace/modelspace-engine/src/main/java/org/modelspace/spi}/DependencyProcessor.java (85%) rename {modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/spi/metamodel => modelspace/modelspace-engine/src/main/java/org/modelspace/spi}/Exporter.java (84%) rename {modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/spi/metamodel => modelspace/modelspace-engine/src/main/java/org/modelspace/spi}/Importer.java (84%) rename {modeshape-modeler/modeshape-modeler-engine => modelspace/modelspace-engine}/src/main/resources/config.json (50%) rename {modeshape-modeler/modeshape-modeler-engine => modelspace/modelspace-engine}/src/main/resources/infinispan.xml (82%) rename {modeshape-modeler/modeshape-modeler-engine => modelspace/modelspace-engine}/src/main/resources/metamodel.cnd (97%) rename {modeshape-modeler/modeshape-modeler-engine/src/test/java/org/modeshape/modeler => modelspace/modelspace-engine/src/test/java/org/modelspace}/MockObjectFactory.java (99%) rename modeshape-modeler/modeshape-modeler-engine/src/test/java/org/modeshape/modeler/ModelerI18nTest.java => modelspace/modelspace-engine/src/test/java/org/modelspace/ModelspaceI18nTest.java (93%) rename {modeshape-modeler/modeshape-modeler-engine/src/test/java/org/modeshape/modeler => modelspace/modelspace-engine/src/test/java/org/modelspace}/internal/MetamodelManagerImplTest.java (96%) rename {modeshape-modeler/modeshape-modeler-engine/src/test/java/org/modeshape/modeler => modelspace/modelspace-engine/src/test/java/org/modelspace}/internal/ModelObjectImplTest.java (95%) rename modeshape-modeler/modeshape-modeler-engine/src/test/java/org/modeshape/modeler/internal/ModelerImplTest.java => modelspace/modelspace-engine/src/test/java/org/modelspace/internal/ModelspaceImplTest.java (68%) rename {modeshape-modeler/modeshape-modeler-engine/src/test/java/org/modeshape/modeler => modelspace/modelspace-engine/src/test/java/org/modelspace}/spi/metamodel/DependencyTest.java (98%) rename {modeshape-modeler/modeshape-modeler-engine/src/test/java/org/modeshape/modeler => modelspace/modelspace-engine/src/test/java/org/modelspace}/test/BaseIntegrationTest.java (91%) rename modeshape-modeler/modeshape-modeler-engine/src/test/java/org/modeshape/modeler/test/BaseModelerTest.java => modelspace/modelspace-engine/src/test/java/org/modelspace/test/BaseModelspaceTest.java (83%) rename {modeshape-modeler/modeshape-modeler-engine/src/test/java/org/modeshape/modeler => modelspace/modelspace-engine/src/test/java/org/modelspace}/test/BaseTest.java (97%) rename {modeshape-modeler/modeshape-modeler-engine/src/test/java/org/modeshape/modeler => modelspace/modelspace-engine/src/test/java/org/modelspace}/test/TestRunner.java (98%) rename {modeshape-modeler/modeshape-modeler-engine => modelspace/modelspace-engine}/src/test/resources/log4j.properties (71%) rename {modeshape-modeler/modeshape-modeler-engine => modelspace/modelspace-engine}/src/test/resources/testConfig.json (54%) rename {modeshape-modeler/modeshape-modeler-java => modelspace/modelspace-java}/pom.xml (86%) rename {modeshape-modeler/modeshape-modeler-java => modelspace/modelspace-java}/src/assembly/module-with-dependencies.xml (100%) rename {modeshape-modeler/modeshape-modeler-java/src/main/java/org/modeshape/modeler => modelspace/modelspace-java/src/main/java/org/modelspace}/java/JavaDependencyProcessor.java (73%) rename {modeshape-modeler/modeshape-modeler-java/src/test/java/org/modeshape/modeler => modelspace/modelspace-java/src/test/java/org/modelspace}/ITMetamodel.java (87%) rename {modeshape-modeler/modeshape-modeler-java/src/test/java/org/modeshape/modeler => modelspace/modelspace-java/src/test/java/org/modelspace}/ITMetamodelManager.java (69%) rename {modeshape-modeler/modeshape-modeler-java/src/test/java/org/modeshape/modeler => modelspace/modelspace-java/src/test/java/org/modelspace}/ITModel.java (89%) rename {modeshape-modeler/modeshape-modeler-java/src/test/java/org/modeshape/modeler => modelspace/modelspace-java/src/test/java/org/modelspace}/ITModelObject.java (95%) rename modeshape-modeler/modeshape-modeler-java/src/test/java/org/modeshape/modeler/ITModeler.java => modelspace/modelspace-java/src/test/java/org/modelspace/ITModelspace.java (70%) rename {modeshape-modeler/modeshape-modeler-java/src/test/java/org/modeshape/modeler => modelspace/modelspace-java/src/test/java/org/modelspace}/java/ITJava.java (86%) rename {modeshape-modeler/modeshape-modeler-java/src/test/java/org/modeshape/modeler => modelspace/modelspace-java/src/test/java/org/modelspace}/java/ITJavaDependencyProcessor.java (82%) rename {modeshape-modeler/modeshape-modeler-java/src/test/java/org/modeshape/modeler => modelspace/modelspace-java/src/test/java/org/modelspace}/test/JavaIntegrationTest.java (83%) rename {modeshape-modeler/modeshape-modeler-java => modelspace/modelspace-java}/src/test/resources/Mock.java (97%) rename {modeshape-modeler/modeshape-modeler-java => modelspace/modelspace-java}/src/test/resources/log4j.properties (84%) rename {modeshape-modeler/modeshape-modeler-eclipse => modelspace/modelspace-ui}/pom.xml (70%) rename {modeshape-modeler/modeshape-modeler-ui => modelspace/modelspace-ui}/src/main/java/org/modeshape/modeler/ui/FocusTreeController.java (100%) rename {modeshape-modeler/modeshape-modeler-ui => modelspace/modelspace-ui}/src/main/java/org/modeshape/modeler/ui/FocusTreeModel.java (100%) rename {modeshape-modeler/modeshape-modeler-ui => modelspace/modelspace-ui}/src/main/java/org/modeshape/modeler/ui/FocusTreeView.java (100%) rename {modeshape-modeler/modeshape-modeler-ui => modelspace/modelspace-ui}/src/main/java/org/modeshape/modeler/ui/UiI18n.java (100%) rename {modeshape-modeler/modeshape-modeler-ui => modelspace/modelspace-ui}/src/main/java/org/modeshape/modeler/ui/UiUtil.java (100%) rename {modeshape-modeler/modeshape-modeler-ui => modelspace/modelspace-ui}/src/main/resources/images/close.gif (100%) rename {modeshape-modeler/modeshape-modeler-ui => modelspace/modelspace-ui}/src/main/resources/images/copy.gif (100%) rename {modeshape-modeler/modeshape-modeler-ui => modelspace/modelspace-ui}/src/main/resources/images/minimize.gif (100%) rename {modeshape-modeler/modeshape-modeler-ui => modelspace/modelspace-ui}/src/main/resources/images/scrollLeft.png (100%) rename {modeshape-modeler/modeshape-modeler-ui => modelspace/modelspace-ui}/src/main/resources/images/scrollRight.png (100%) rename {modeshape-modeler/modeshape-modeler-xsd => modelspace/modelspace-xsd}/pom.xml (86%) rename {modeshape-modeler/modeshape-modeler-xsd => modelspace/modelspace-xsd}/src/assembly/module-with-dependencies.xml (100%) rename {modeshape-modeler/modeshape-modeler-xsd/src/main/java/org/modeshape/modeler => modelspace/modelspace-xsd/src/main/java/org/modelspace}/xsd/XsdDependencyProcessor.java (85%) rename {modeshape-modeler/modeshape-modeler-xsd/src/main/java/org/modeshape/modeler => modelspace/modelspace-xsd/src/main/java/org/modelspace}/xsd/XsdExporter.java (94%) rename modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/ModelerI18n.java => modelspace/modelspace-xsd/src/main/java/org/modelspace/xsd/XsdI18n.java (89%) rename {modeshape-modeler/modeshape-modeler-xsd/src/main/java/org/modeshape/modeler => modelspace/modelspace-xsd/src/main/java/org/modelspace}/xsd/XsdLexicon.java (90%) rename {modeshape-modeler/modeshape-modeler-xsd/src/test/java/org/modeshape/modeler => modelspace/modelspace-xsd/src/test/java/org/modelspace}/xsd/ITXsdDependencyProcessor.java (76%) rename {modeshape-modeler/modeshape-modeler-xsd/src/test/java/org/modeshape/modeler => modelspace/modelspace-xsd/src/test/java/org/modelspace}/xsd/ITXsdDesquencerTest.java (90%) rename {modeshape-modeler/modeshape-modeler-xsd/src/test/java/org/modeshape/modeler => modelspace/modelspace-xsd/src/test/java/org/modelspace}/xsd/test/XsdIntegrationTest.java (92%) rename {modeshape-modeler/modeshape-modeler-xsd => modelspace/modelspace-xsd}/src/test/resources/Books/Books.xsd (100%) rename {modeshape-modeler/modeshape-modeler-xsd => modelspace/modelspace-xsd}/src/test/resources/Books/SOAP/BooksWithSOAPEncoding.xsd (100%) rename {modeshape-modeler/modeshape-modeler-xsd => modelspace/modelspace-xsd}/src/test/resources/Books/SOAP/encoding/soap_encoding.xsd (100%) rename {modeshape-modeler/modeshape-modeler-xsd => modelspace/modelspace-xsd}/src/test/resources/Books/data/types/BookDatatypes.xsd (100%) rename {modeshape-modeler/modeshape-modeler-xsd => modelspace/modelspace-xsd}/src/test/resources/Movies/MovieDatatypes.xsd (100%) rename {modeshape-modeler/modeshape-modeler-xsd => modelspace/modelspace-xsd}/src/test/resources/Movies/Movies.xsd (100%) rename {modeshape-modeler/modeshape-modeler-ddl => modelspace/modelspace-xsd}/src/test/resources/log4j.properties (83%) rename {modeshape-modeler/modeshape-modeler-xsd => modelspace/modelspace-xsd}/src/test/resources/music.xsd (100%) rename {modeshape-modeler => modelspace}/pom.xml (73%) delete mode 100644 modeshape-modeler/modeshape-modeler-engine/src/test/resources/Teiid-MySQLAccounts.ddl diff --git a/modeshape-modeler/README.md b/modelspace/README.md similarity index 100% rename from modeshape-modeler/README.md rename to modelspace/README.md diff --git a/modeshape-modeler/modeshape-modeler-ddl/pom.xml b/modelspace/modelspace-ddl/pom.xml similarity index 87% rename from modeshape-modeler/modeshape-modeler-ddl/pom.xml rename to modelspace/modelspace-ddl/pom.xml index b813e12..7da8ef2 100644 --- a/modeshape-modeler/modeshape-modeler-ddl/pom.xml +++ b/modelspace/modelspace-ddl/pom.xml @@ -7,16 +7,16 @@ org.polyglotter - modeshape-modeler + modelspace 0.0.1-SNAPSHOT - modeshape-modeler-ddl - ModeShape Modeler for DDL - An implementation of a DDL dependency processor. + modelspace-ddl + Modelspace for DDL + DDL SPI implementation for Modelspace. @@ -33,12 +33,12 @@ org.polyglotter - modeshape-modeler-engine + modelspace-engine org.polyglotter - modeshape-modeler-engine + modelspace-engine test-jar @@ -90,8 +90,8 @@ src/assembly/module-with-dependencies.xml - ${project.build.directory}/org/modeshape/modeshape-modeler-ddl/${modeshape.version} - modeshape-modeler-ddl-${modeshape.version} + ${project.build.directory}/org/polyglotter/modelspace-ddl/${modeshape.version} + modelspace-ddl-${modeshape.version} diff --git a/modeshape-modeler/modeshape-modeler-ddl/src/assembly/module-with-dependencies.xml b/modelspace/modelspace-ddl/src/assembly/module-with-dependencies.xml similarity index 100% rename from modeshape-modeler/modeshape-modeler-ddl/src/assembly/module-with-dependencies.xml rename to modelspace/modelspace-ddl/src/assembly/module-with-dependencies.xml diff --git a/modeshape-modeler/modeshape-modeler-ddl/src/main/java/org/modeshape/modeler/ddl/TeiidDdlDependencyProcessor.java b/modelspace/modelspace-ddl/src/main/java/org/modelspace/ddl/TeiidDdlDependencyProcessor.java similarity index 75% rename from modeshape-modeler/modeshape-modeler-ddl/src/main/java/org/modeshape/modeler/ddl/TeiidDdlDependencyProcessor.java rename to modelspace/modelspace-ddl/src/main/java/org/modelspace/ddl/TeiidDdlDependencyProcessor.java index 2b9dbbf..a03553b 100644 --- a/modeshape-modeler/modeshape-modeler-ddl/src/main/java/org/modeshape/modeler/ddl/TeiidDdlDependencyProcessor.java +++ b/modelspace/modelspace-ddl/src/main/java/org/modelspace/ddl/TeiidDdlDependencyProcessor.java @@ -21,15 +21,15 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler.ddl; +package org.modelspace.ddl; import javax.jcr.Node; import javax.jcr.RepositoryException; +import org.modelspace.Modelspace; +import org.modelspace.ModelspaceException; +import org.modelspace.spi.DependencyProcessor; import org.modeshape.jcr.api.JcrTools; -import org.modeshape.modeler.Modeler; -import org.modeshape.modeler.ModelerException; -import org.modeshape.modeler.spi.metamodel.DependencyProcessor; /** * @@ -39,7 +39,7 @@ public class TeiidDdlDependencyProcessor implements DependencyProcessor { /** * {@inheritDoc} * - * @see org.modeshape.modeler.spi.metamodel.DependencyProcessor#metamodelId() + * @see org.modelspace.spi.DependencyProcessor#metamodelId() */ @Override public String metamodelId() { @@ -49,19 +49,19 @@ public String metamodelId() { /** * {@inheritDoc} * - * @see org.modeshape.modeler.spi.metamodel.DependencyProcessor#process(java.lang.String, javax.jcr.Node, - * org.modeshape.modeler.Modeler, boolean) + * @see org.modelspace.spi.DependencyProcessor#process(java.lang.String, javax.jcr.Node, + * org.modelspace.Modelspace, boolean) */ @Override public String process( final String dataPath, final Node modelNode, - final Modeler modeler, - final boolean persistArtifacts ) throws ModelerException { + final Modelspace modelspace, + final boolean persistArtifacts ) throws ModelspaceException { try { new JcrTools().printSubgraph( modelNode ); return null; } catch ( final RepositoryException e ) { - throw new ModelerException( e, "Unable to resolve dependencies for \"%s\"", modelNode ); + throw new ModelspaceException( e, "Unable to resolve dependencies for \"%s\"", modelNode ); } } diff --git a/modeshape-modeler/modeshape-modeler-ddl/src/main/java/org/modeshape/modeler/ddl/TeiidDdlExporter.java b/modelspace/modelspace-ddl/src/main/java/org/modelspace/ddl/TeiidDdlExporter.java similarity index 83% rename from modeshape-modeler/modeshape-modeler-ddl/src/main/java/org/modeshape/modeler/ddl/TeiidDdlExporter.java rename to modelspace/modelspace-ddl/src/main/java/org/modelspace/ddl/TeiidDdlExporter.java index 2f1fb0d..860e4eb 100644 --- a/modeshape-modeler/modeshape-modeler-ddl/src/main/java/org/modeshape/modeler/ddl/TeiidDdlExporter.java +++ b/modelspace/modelspace-ddl/src/main/java/org/modelspace/ddl/TeiidDdlExporter.java @@ -21,7 +21,7 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler.ddl; +package org.modelspace.ddl; import java.io.OutputStream; import java.io.PrintWriter; @@ -30,8 +30,8 @@ import javax.jcr.Node; -import org.modeshape.modeler.Model; -import org.modeshape.modeler.spi.metamodel.Exporter; +import org.modelspace.Model; +import org.modelspace.spi.Exporter; /** * @@ -47,7 +47,7 @@ public class TeiidDdlExporter implements Exporter { /** * {@inheritDoc} * - * @see org.modeshape.modeler.spi.metamodel.Exporter#execute(org.modeshape.modeler.Model, java.io.OutputStream) + * @see org.modelspace.spi.Exporter#execute(org.modelspace.Model, java.io.OutputStream) */ @Override public void execute( final Model model, @@ -58,7 +58,7 @@ public void execute( final Model model, /** * {@inheritDoc} * - * @see org.modeshape.modeler.spi.metamodel.Exporter#metamodelId() + * @see org.modelspace.spi.Exporter#metamodelId() */ @Override public String metamodelId() { @@ -68,7 +68,7 @@ public String metamodelId() { /** * {@inheritDoc} * - * @see org.modeshape.modeler.spi.metamodel.Exporter#supports(java.lang.String) + * @see org.modelspace.spi.Exporter#supports(java.lang.String) */ @Override public boolean supports( final String mimeType ) { diff --git a/modeshape-modeler/modeshape-modeler-ddl/src/main/java/org/modeshape/modeler/ddl/TeiidDdlModelerI18n.java b/modelspace/modelspace-ddl/src/main/java/org/modelspace/ddl/TeiidDdlI18n.java similarity index 87% rename from modeshape-modeler/modeshape-modeler-ddl/src/main/java/org/modeshape/modeler/ddl/TeiidDdlModelerI18n.java rename to modelspace/modelspace-ddl/src/main/java/org/modelspace/ddl/TeiidDdlI18n.java index 54c422a..498d967 100644 --- a/modeshape-modeler/modeshape-modeler-ddl/src/main/java/org/modeshape/modeler/ddl/TeiidDdlModelerI18n.java +++ b/modelspace/modelspace-ddl/src/main/java/org/modelspace/ddl/TeiidDdlI18n.java @@ -21,18 +21,18 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler.ddl; +package org.modelspace.ddl; import org.polyglotter.common.I18n; /** - * Internationalized string constants, in alphabetical order, for the Teiid DDL Modeler project. + * Internationalized string constants, in alphabetical order, for the Teiid DDL Modelspace project. */ @SuppressWarnings( "javadoc" ) -public class TeiidDdlModelerI18n { +public class TeiidDdlI18n { public static String localize( final String text, final Object... arguments ) { - return I18n.localize( TeiidDdlModelerI18n.class, text, arguments ); + return I18n.localize( TeiidDdlI18n.class, text, arguments ); } } diff --git a/modeshape-modeler/modeshape-modeler-ddl/src/main/java/org/modeshape/modeler/ddl/TeiidDdlLexicon.java b/modelspace/modelspace-ddl/src/main/java/org/modelspace/ddl/TeiidDdlLexicon.java similarity index 88% rename from modeshape-modeler/modeshape-modeler-ddl/src/main/java/org/modeshape/modeler/ddl/TeiidDdlLexicon.java rename to modelspace/modelspace-ddl/src/main/java/org/modelspace/ddl/TeiidDdlLexicon.java index 12e63d1..cebce97 100644 --- a/modeshape-modeler/modeshape-modeler-ddl/src/main/java/org/modeshape/modeler/ddl/TeiidDdlLexicon.java +++ b/modelspace/modelspace-ddl/src/main/java/org/modelspace/ddl/TeiidDdlLexicon.java @@ -21,10 +21,10 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler.ddl; +package org.modelspace.ddl; /** - * The model lexicon for the Teiid DDL modeler. + * The lexicon for the Teiid DDL modelspace. */ public interface TeiidDdlLexicon { @@ -36,7 +36,7 @@ public interface TeiidDdlLexicon { /** * */ - String DDL_METAMODEL_ID = "org.modeshape.modeler.ddl.Ddl"; + String DDL_METAMODEL_ID = "org.modelspace.ddl.Ddl"; /** * The JCR Teiid namespace mapping. @@ -51,6 +51,6 @@ public interface Namespace { /** * */ - String URI = "http://www.modeshape.org/ddl/teiid/1.0"; + String URI = "http://www.polyglotter.org/ddl/teiid/1.0"; } } diff --git a/modeshape-modeler/modeshape-modeler-ddl/src/test/java/org/modeshape/modeler/ddl/ITTeiidDdl.java b/modelspace/modelspace-ddl/src/test/java/org/modelspace/ddl/ITTeiidDdl.java similarity index 90% rename from modeshape-modeler/modeshape-modeler-ddl/src/test/java/org/modeshape/modeler/ddl/ITTeiidDdl.java rename to modelspace/modelspace-ddl/src/test/java/org/modelspace/ddl/ITTeiidDdl.java index 6043b2a..c1a0c2b 100644 --- a/modeshape-modeler/modeshape-modeler-ddl/src/test/java/org/modeshape/modeler/ddl/ITTeiidDdl.java +++ b/modelspace/modelspace-ddl/src/test/java/org/modelspace/ddl/ITTeiidDdl.java @@ -21,7 +21,7 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler.ddl; +package org.modelspace.ddl; import static org.hamcrest.core.Is.is; import static org.junit.Assert.assertThat; @@ -29,9 +29,10 @@ import java.io.File; import org.junit.Test; -import org.modeshape.modeler.Descriptor; -import org.modeshape.modeler.Model; -import org.modeshape.modeler.ModelObject; +import org.modelspace.Descriptor; +import org.modelspace.Model; +import org.modelspace.ModelObject; +import org.modelspace.ddl.TeiidDdlLexicon; @SuppressWarnings( "javadoc" ) public class ITTeiidDdl extends TeiidDdlIntegrationTest { @@ -43,8 +44,8 @@ public void shouldGetDdlModel() throws Exception { final File dataFile = new File( "src/test/resources/Teiid-MySQLAccounts.ddl" ); final Model generatedModel = - modeler().importModel( dataFile, null, metamodelManager().metamodel( TeiidDdlLexicon.DDL_METAMODEL_ID ) ); - final Model model = modeler().model( dataFile.getName() ); + modelspace().importModel( dataFile, null, metamodelManager().metamodel( TeiidDdlLexicon.DDL_METAMODEL_ID ) ); + final Model model = modelspace().model( dataFile.getName() ); assertThat( model, is( generatedModel ) ); for ( final ModelObject mo : model.children() ) { diff --git a/modeshape-modeler/modeshape-modeler-ddl/src/test/java/org/modeshape/modeler/ddl/ITTeiidDdlDependencyProcessor.java b/modelspace/modelspace-ddl/src/test/java/org/modelspace/ddl/ITTeiidDdlDependencyProcessor.java similarity index 94% rename from modeshape-modeler/modeshape-modeler-ddl/src/test/java/org/modeshape/modeler/ddl/ITTeiidDdlDependencyProcessor.java rename to modelspace/modelspace-ddl/src/test/java/org/modelspace/ddl/ITTeiidDdlDependencyProcessor.java index 492bc61..244860e 100644 --- a/modeshape-modeler/modeshape-modeler-ddl/src/test/java/org/modeshape/modeler/ddl/ITTeiidDdlDependencyProcessor.java +++ b/modelspace/modelspace-ddl/src/test/java/org/modelspace/ddl/ITTeiidDdlDependencyProcessor.java @@ -21,14 +21,15 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler.ddl; +package org.modelspace.ddl; import static org.hamcrest.core.Is.is; import static org.hamcrest.core.IsNull.notNullValue; import static org.junit.Assert.assertThat; import org.junit.Test; -import org.modeshape.modeler.Metamodel; +import org.modelspace.Metamodel; +import org.modelspace.ddl.TeiidDdlLexicon; @SuppressWarnings( "javadoc" ) public class ITTeiidDdlDependencyProcessor extends TeiidDdlIntegrationTest { diff --git a/modeshape-modeler/modeshape-modeler-ddl/src/test/java/org/modeshape/modeler/ddl/ITTeiidDdlExporter.java b/modelspace/modelspace-ddl/src/test/java/org/modelspace/ddl/ITTeiidDdlExporter.java similarity index 89% rename from modeshape-modeler/modeshape-modeler-ddl/src/test/java/org/modeshape/modeler/ddl/ITTeiidDdlExporter.java rename to modelspace/modelspace-ddl/src/test/java/org/modelspace/ddl/ITTeiidDdlExporter.java index b67d479..930c439 100644 --- a/modeshape-modeler/modeshape-modeler-ddl/src/test/java/org/modeshape/modeler/ddl/ITTeiidDdlExporter.java +++ b/modelspace/modelspace-ddl/src/test/java/org/modelspace/ddl/ITTeiidDdlExporter.java @@ -21,7 +21,7 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler.ddl; +package org.modelspace.ddl; import static org.hamcrest.core.Is.is; import static org.hamcrest.core.IsNull.notNullValue; @@ -30,8 +30,9 @@ import java.io.File; import org.junit.Test; -import org.modeshape.modeler.Model; -import org.modeshape.modeler.spi.metamodel.Exporter; +import org.modelspace.Model; +import org.modelspace.ddl.TeiidDdlLexicon; +import org.modelspace.spi.Exporter; @SuppressWarnings( "javadoc" ) public class ITTeiidDdlExporter extends TeiidDdlIntegrationTest { @@ -39,7 +40,7 @@ public class ITTeiidDdlExporter extends TeiidDdlIntegrationTest { @Test public void shouldExport() throws Exception { metamodelManager().install( TeiidDdlLexicon.DDL_METAMODEL_CATEGORY ); - final Model model = modeler().importModel( new File( "src/test/resources/Teiid-MySQLAccounts.ddl" ), + final Model model = modelspace().importModel( new File( "src/test/resources/Teiid-MySQLAccounts.ddl" ), null, metamodelManager().metamodel( TeiidDdlLexicon.DDL_METAMODEL_ID ) ); final Exporter exporter = model.metamodel().exporter(); diff --git a/modeshape-modeler/modeshape-modeler-ddl/src/test/java/org/modeshape/modeler/ddl/TeiidDdlIntegrationTest.java b/modelspace/modelspace-ddl/src/test/java/org/modelspace/ddl/TeiidDdlIntegrationTest.java similarity index 93% rename from modeshape-modeler/modeshape-modeler-ddl/src/test/java/org/modeshape/modeler/ddl/TeiidDdlIntegrationTest.java rename to modelspace/modelspace-ddl/src/test/java/org/modelspace/ddl/TeiidDdlIntegrationTest.java index 1055911..7f01ee6 100644 --- a/modeshape-modeler/modeshape-modeler-ddl/src/test/java/org/modeshape/modeler/ddl/TeiidDdlIntegrationTest.java +++ b/modelspace/modelspace-ddl/src/test/java/org/modelspace/ddl/TeiidDdlIntegrationTest.java @@ -21,9 +21,9 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler.ddl; +package org.modelspace.ddl; -import org.modeshape.modeler.test.BaseIntegrationTest; +import org.modelspace.test.BaseIntegrationTest; /** * diff --git a/modeshape-modeler/modeshape-modeler-ddl/src/test/resources/Teiid-MySQLAccounts.ddl b/modelspace/modelspace-ddl/src/test/resources/Teiid-MySQLAccounts.ddl similarity index 100% rename from modeshape-modeler/modeshape-modeler-ddl/src/test/resources/Teiid-MySQLAccounts.ddl rename to modelspace/modelspace-ddl/src/test/resources/Teiid-MySQLAccounts.ddl diff --git a/modeshape-modeler/modeshape-modeler-xsd/src/test/resources/log4j.properties b/modelspace/modelspace-ddl/src/test/resources/log4j.properties similarity index 84% rename from modeshape-modeler/modeshape-modeler-xsd/src/test/resources/log4j.properties rename to modelspace/modelspace-ddl/src/test/resources/log4j.properties index 41cca89..3e665eb 100644 --- a/modeshape-modeler/modeshape-modeler-xsd/src/test/resources/log4j.properties +++ b/modelspace/modelspace-ddl/src/test/resources/log4j.properties @@ -10,5 +10,5 @@ log4j.rootLogger=ERROR, stdout # Set up the default logging to be ERROR level, then override specific units log4j.logger.org.modeshape=WARN log4j.logger.org.polyglotter=WARN -log4j.logger.org.modeshape.modeler=WARN -log4j.logger.org.modeshape.modeler.xsd=WARN +log4j.logger.org.modelspace=WARN +log4j.logger.org.modelspace.teiid.ddl=WARN diff --git a/modeshape-modeler/modeshape-modeler-eclipse/META-INF/MANIFEST.MF b/modelspace/modelspace-eclipse/META-INF/MANIFEST.MF similarity index 76% rename from modeshape-modeler/modeshape-modeler-eclipse/META-INF/MANIFEST.MF rename to modelspace/modelspace-eclipse/META-INF/MANIFEST.MF index 9bfdc26..77f7476 100644 --- a/modeshape-modeler/modeshape-modeler-eclipse/META-INF/MANIFEST.MF +++ b/modelspace/modelspace-eclipse/META-INF/MANIFEST.MF @@ -1,9 +1,9 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name -Bundle-SymbolicName: org.modeshape.modeler.eclipse;singleton:=true +Bundle-SymbolicName: org.modelspace.eclipse;singleton:=true Bundle-Version: 1.0.0.qualifier -Export-Package: org.modeshape.modeler.eclipse +Export-Package: org.modelspace.eclipse Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Bundle-Vendor: %Bundle-Vendor Bundle-ActivationPolicy: lazy diff --git a/modeshape-modeler/modeshape-modeler-eclipse/OSGI-INF/l10n/bundle.properties b/modelspace/modelspace-eclipse/OSGI-INF/l10n/bundle.properties similarity index 92% rename from modeshape-modeler/modeshape-modeler-eclipse/OSGI-INF/l10n/bundle.properties rename to modelspace/modelspace-eclipse/OSGI-INF/l10n/bundle.properties index bc88522..21d44a3 100644 --- a/modeshape-modeler/modeshape-modeler-eclipse/OSGI-INF/l10n/bundle.properties +++ b/modelspace/modelspace-eclipse/OSGI-INF/l10n/bundle.properties @@ -22,6 +22,6 @@ # 02110-1301 USA, or see the FSF site: http://www.fsf.org. # -#Properties file for org.modeshape.modeler.eclipse -Bundle-Name = ModeShape Modeler For Eclipse +#Properties file for org.modelspace.eclipse +Bundle-Name = Modelspace For Eclipse Bundle-Vendor = JBoss, a division of Red Hat, Inc. diff --git a/modeshape-modeler/modeshape-modeler-eclipse/build.properties b/modelspace/modelspace-eclipse/build.properties similarity index 100% rename from modeshape-modeler/modeshape-modeler-eclipse/build.properties rename to modelspace/modelspace-eclipse/build.properties diff --git a/modeshape-modeler/modeshape-modeler-ui/pom.xml b/modelspace/modelspace-eclipse/pom.xml similarity index 72% rename from modeshape-modeler/modeshape-modeler-ui/pom.xml rename to modelspace/modelspace-eclipse/pom.xml index fc6c8de..cfbfe8c 100644 --- a/modeshape-modeler/modeshape-modeler-ui/pom.xml +++ b/modelspace/modelspace-eclipse/pom.xml @@ -2,9 +2,9 @@ 4.0.0 org.polyglotter - modeshape-modeler + modelspace 0.0.1-SNAPSHOT - modeshape-modeler-ui - ModeShape Modeler UI + modelspace-eclipse + Modelspace for Eclipse \ No newline at end of file diff --git a/modeshape-modeler/modeshape-modeler-eclipse/src/main/java/org/modeshape/modeler/eclipse/EclipseI18n.java b/modelspace/modelspace-eclipse/src/main/java/org/modeshape/modeler/eclipse/EclipseI18n.java similarity index 92% rename from modeshape-modeler/modeshape-modeler-eclipse/src/main/java/org/modeshape/modeler/eclipse/EclipseI18n.java rename to modelspace/modelspace-eclipse/src/main/java/org/modeshape/modeler/eclipse/EclipseI18n.java index f542bc7..70329e7 100644 --- a/modeshape-modeler/modeshape-modeler-eclipse/src/main/java/org/modeshape/modeler/eclipse/EclipseI18n.java +++ b/modelspace/modelspace-eclipse/src/main/java/org/modeshape/modeler/eclipse/EclipseI18n.java @@ -24,6 +24,6 @@ package org.modeshape.modeler.eclipse; /** - * The internationalized string constants for the org.mdoeshape.modeler.eclipse packages. + * The internationalized string constants for the org.modelspace.eclipse packages. */ public final class EclipseI18n {} \ No newline at end of file diff --git a/modeshape-modeler/modeshape-modeler-eclipse/src/main/java/org/modeshape/modeler/eclipse/EclipseUtil.java b/modelspace/modelspace-eclipse/src/main/java/org/modeshape/modeler/eclipse/EclipseUtil.java similarity index 100% rename from modeshape-modeler/modeshape-modeler-eclipse/src/main/java/org/modeshape/modeler/eclipse/EclipseUtil.java rename to modelspace/modelspace-eclipse/src/main/java/org/modeshape/modeler/eclipse/EclipseUtil.java diff --git a/modeshape-modeler/modeshape-modeler-eclipse/src/main/java/org/modeshape/modeler/eclipse/FocusTree.java b/modelspace/modelspace-eclipse/src/main/java/org/modeshape/modeler/eclipse/FocusTree.java similarity index 100% rename from modeshape-modeler/modeshape-modeler-eclipse/src/main/java/org/modeshape/modeler/eclipse/FocusTree.java rename to modelspace/modelspace-eclipse/src/main/java/org/modeshape/modeler/eclipse/FocusTree.java diff --git a/modeshape-modeler/modeshape-modeler-eclipse/src/main/java/org/modeshape/modeler/eclipse/FocusTreeLightweight.java b/modelspace/modelspace-eclipse/src/main/java/org/modeshape/modeler/eclipse/FocusTreeLightweight.java similarity index 100% rename from modeshape-modeler/modeshape-modeler-eclipse/src/main/java/org/modeshape/modeler/eclipse/FocusTreeLightweight.java rename to modelspace/modelspace-eclipse/src/main/java/org/modeshape/modeler/eclipse/FocusTreeLightweight.java diff --git a/modeshape-modeler/modeshape-modeler-eclipse/src/test/java/org/modeshape/modeler/eclipse/DemoUtil.java b/modelspace/modelspace-eclipse/src/test/java/org/modeshape/modeler/eclipse/DemoUtil.java similarity index 100% rename from modeshape-modeler/modeshape-modeler-eclipse/src/test/java/org/modeshape/modeler/eclipse/DemoUtil.java rename to modelspace/modelspace-eclipse/src/test/java/org/modeshape/modeler/eclipse/DemoUtil.java diff --git a/modeshape-modeler/modeshape-modeler-eclipse/src/test/java/org/modeshape/modeler/eclipse/FocusTreeDemo.java b/modelspace/modelspace-eclipse/src/test/java/org/modeshape/modeler/eclipse/FocusTreeDemo.java similarity index 100% rename from modeshape-modeler/modeshape-modeler-eclipse/src/test/java/org/modeshape/modeler/eclipse/FocusTreeDemo.java rename to modelspace/modelspace-eclipse/src/test/java/org/modeshape/modeler/eclipse/FocusTreeDemo.java diff --git a/modeshape-modeler/modeshape-modeler-eclipse/src/test/java/org/modeshape/modeler/eclipse/FocusTreeFileSystemModel.java b/modelspace/modelspace-eclipse/src/test/java/org/modeshape/modeler/eclipse/FocusTreeFileSystemModel.java similarity index 100% rename from modeshape-modeler/modeshape-modeler-eclipse/src/test/java/org/modeshape/modeler/eclipse/FocusTreeFileSystemModel.java rename to modelspace/modelspace-eclipse/src/test/java/org/modeshape/modeler/eclipse/FocusTreeFileSystemModel.java diff --git a/modeshape-modeler/modeshape-modeler-eclipse/src/test/java/org/modeshape/modeler/eclipse/FocusTreeModeShapeModelerXsdModel.java b/modelspace/modelspace-eclipse/src/test/java/org/modeshape/modeler/eclipse/FocusTreeModeShapeModelerXsdModel.java similarity index 100% rename from modeshape-modeler/modeshape-modeler-eclipse/src/test/java/org/modeshape/modeler/eclipse/FocusTreeModeShapeModelerXsdModel.java rename to modelspace/modelspace-eclipse/src/test/java/org/modeshape/modeler/eclipse/FocusTreeModeShapeModelerXsdModel.java diff --git a/modeshape-modeler/modeshape-modeler-eclipse/src/test/java/org/modeshape/modeler/eclipse/TestEclipseI18n.java b/modelspace/modelspace-eclipse/src/test/java/org/modeshape/modeler/eclipse/TestEclipseI18n.java similarity index 100% rename from modeshape-modeler/modeshape-modeler-eclipse/src/test/java/org/modeshape/modeler/eclipse/TestEclipseI18n.java rename to modelspace/modelspace-eclipse/src/test/java/org/modeshape/modeler/eclipse/TestEclipseI18n.java diff --git a/modeshape-modeler/modeshape-modeler-eclipse/src/test/resources/Books.xsd b/modelspace/modelspace-eclipse/src/test/resources/Books.xsd similarity index 100% rename from modeshape-modeler/modeshape-modeler-eclipse/src/test/resources/Books.xsd rename to modelspace/modelspace-eclipse/src/test/resources/Books.xsd diff --git a/modeshape-modeler/modeshape-modeler-eclipse/src/test/resources/data/types/BookDatatypes.xsd b/modelspace/modelspace-eclipse/src/test/resources/data/types/BookDatatypes.xsd similarity index 100% rename from modeshape-modeler/modeshape-modeler-eclipse/src/test/resources/data/types/BookDatatypes.xsd rename to modelspace/modelspace-eclipse/src/test/resources/data/types/BookDatatypes.xsd diff --git a/modeshape-modeler/modeshape-modeler-eclipse/src/test/resources/images/transformation.png b/modelspace/modelspace-eclipse/src/test/resources/images/transformation.png similarity index 100% rename from modeshape-modeler/modeshape-modeler-eclipse/src/test/resources/images/transformation.png rename to modelspace/modelspace-eclipse/src/test/resources/images/transformation.png diff --git a/modeshape-modeler/modeshape-modeler-eclipse/src/test/resources/org/modeshape/modeshape-sequencer-java/4.0.0.Alpha4/modeshape-sequencer-java-4.0.0.Alpha4-module-with-dependencies.zip b/modelspace/modelspace-eclipse/src/test/resources/org/modeshape/modeshape-sequencer-java/4.0.0.Alpha4/modeshape-sequencer-java-4.0.0.Alpha4-module-with-dependencies.zip similarity index 100% rename from modeshape-modeler/modeshape-modeler-eclipse/src/test/resources/org/modeshape/modeshape-sequencer-java/4.0.0.Alpha4/modeshape-sequencer-java-4.0.0.Alpha4-module-with-dependencies.zip rename to modelspace/modelspace-eclipse/src/test/resources/org/modeshape/modeshape-sequencer-java/4.0.0.Alpha4/modeshape-sequencer-java-4.0.0.Alpha4-module-with-dependencies.zip diff --git a/modeshape-modeler/modeshape-modeler-eclipse/src/test/resources/org/modeshape/modeshape-sequencer-sramp/4.0.0.Alpha4/modeshape-sequencer-sramp-4.0.0.Alpha4-module-with-dependencies.zip b/modelspace/modelspace-eclipse/src/test/resources/org/modeshape/modeshape-sequencer-sramp/4.0.0.Alpha4/modeshape-sequencer-sramp-4.0.0.Alpha4-module-with-dependencies.zip similarity index 100% rename from modeshape-modeler/modeshape-modeler-eclipse/src/test/resources/org/modeshape/modeshape-sequencer-sramp/4.0.0.Alpha4/modeshape-sequencer-sramp-4.0.0.Alpha4-module-with-dependencies.zip rename to modelspace/modelspace-eclipse/src/test/resources/org/modeshape/modeshape-sequencer-sramp/4.0.0.Alpha4/modeshape-sequencer-sramp-4.0.0.Alpha4-module-with-dependencies.zip diff --git a/modeshape-modeler/modeshape-modeler-eclipse/src/test/resources/org/modeshape/modeshape-sequencer-xml/4.0.0.Alpha4/modeshape-sequencer-xml-4.0.0.Alpha4-module-with-dependencies.zip b/modelspace/modelspace-eclipse/src/test/resources/org/modeshape/modeshape-sequencer-xml/4.0.0.Alpha4/modeshape-sequencer-xml-4.0.0.Alpha4-module-with-dependencies.zip similarity index 100% rename from modeshape-modeler/modeshape-modeler-eclipse/src/test/resources/org/modeshape/modeshape-sequencer-xml/4.0.0.Alpha4/modeshape-sequencer-xml-4.0.0.Alpha4-module-with-dependencies.zip rename to modelspace/modelspace-eclipse/src/test/resources/org/modeshape/modeshape-sequencer-xml/4.0.0.Alpha4/modeshape-sequencer-xml-4.0.0.Alpha4-module-with-dependencies.zip diff --git a/modeshape-modeler/modeshape-modeler-eclipse/src/test/resources/org/modeshape/modeshape-sequencer-xsd/4.0.0.Alpha4/modeshape-sequencer-xsd-4.0.0.Alpha4-module-with-dependencies.zip b/modelspace/modelspace-eclipse/src/test/resources/org/modeshape/modeshape-sequencer-xsd/4.0.0.Alpha4/modeshape-sequencer-xsd-4.0.0.Alpha4-module-with-dependencies.zip similarity index 100% rename from modeshape-modeler/modeshape-modeler-eclipse/src/test/resources/org/modeshape/modeshape-sequencer-xsd/4.0.0.Alpha4/modeshape-sequencer-xsd-4.0.0.Alpha4-module-with-dependencies.zip rename to modelspace/modelspace-eclipse/src/test/resources/org/modeshape/modeshape-sequencer-xsd/4.0.0.Alpha4/modeshape-sequencer-xsd-4.0.0.Alpha4-module-with-dependencies.zip diff --git a/modeshape-modeler/modeshape-modeler-engine/pom.xml b/modelspace/modelspace-engine/pom.xml similarity index 92% rename from modeshape-modeler/modeshape-modeler-engine/pom.xml rename to modelspace/modelspace-engine/pom.xml index f917802..cdcc25e 100644 --- a/modeshape-modeler/modeshape-modeler-engine/pom.xml +++ b/modelspace/modelspace-engine/pom.xml @@ -7,16 +7,16 @@ org.polyglotter - modeshape-modeler + modelspace 0.0.1-SNAPSHOT - modeshape-modeler-engine - ModeShape Modeler Engine - The modeler engine implementing using ModeShape. + modelspace-engine + Modelspace Engine + The Modelspace engine implementing using ModeShape. diff --git a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/Data.java b/modelspace/modelspace-engine/src/main/java/org/modelspace/Data.java similarity index 97% rename from modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/Data.java rename to modelspace/modelspace-engine/src/main/java/org/modelspace/Data.java index 36a7541..7575b7a 100644 --- a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/Data.java +++ b/modelspace/modelspace-engine/src/main/java/org/modelspace/Data.java @@ -21,7 +21,7 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler; +package org.modelspace; /** * diff --git a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/Descriptor.java b/modelspace/modelspace-engine/src/main/java/org/modelspace/Descriptor.java similarity index 85% rename from modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/Descriptor.java rename to modelspace/modelspace-engine/src/main/java/org/modelspace/Descriptor.java index 3855ab4..ffe9e95 100644 --- a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/Descriptor.java +++ b/modelspace/modelspace-engine/src/main/java/org/modelspace/Descriptor.java @@ -21,7 +21,7 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler; +package org.modelspace; /** * Represents a {@link ModelObject model object} type definition. @@ -30,24 +30,24 @@ public interface Descriptor { /** * @return the child {@link ModelObject model object} {@link Descriptor descriptors} (never null but can be empty) - * @throws ModelerException + * @throws ModelspaceException * if an error occurs */ - Descriptor[] childDescriptors() throws ModelerException; + Descriptor[] childDescriptors() throws ModelspaceException; /** * @return the type name (never null or empty) - * @throws ModelerException + * @throws ModelspaceException * if an error occurs */ - String name() throws ModelerException; + String name() throws ModelspaceException; /** * @return the {@link ModelObject model object} {@link ModelProperty property} {@link PropertyDescriptor descriptors} (never * null but can be empty) - * @throws ModelerException + * @throws ModelspaceException * if an error occurs */ - PropertyDescriptor[] propertyDescriptors() throws ModelerException; + PropertyDescriptor[] propertyDescriptors() throws ModelspaceException; } diff --git a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/Metamodel.java b/modelspace/modelspace-engine/src/main/java/org/modelspace/Metamodel.java similarity index 87% rename from modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/Metamodel.java rename to modelspace/modelspace-engine/src/main/java/org/modelspace/Metamodel.java index 9eb2a85..82350bc 100644 --- a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/Metamodel.java +++ b/modelspace/modelspace-engine/src/main/java/org/modelspace/Metamodel.java @@ -21,11 +21,11 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler; +package org.modelspace; -import org.modeshape.modeler.spi.metamodel.DependencyProcessor; -import org.modeshape.modeler.spi.metamodel.Exporter; -import org.modeshape.modeler.spi.metamodel.Importer; +import org.modelspace.spi.DependencyProcessor; +import org.modelspace.spi.Exporter; +import org.modelspace.spi.Importer; /** * @@ -44,10 +44,10 @@ public interface Metamodel { /** * @return the descriptors defined by this metamodel - * @throws ModelerException + * @throws ModelspaceException * if any error occurs */ - Descriptor[] descriptors() throws ModelerException; + Descriptor[] descriptors() throws ModelspaceException; /** * @return this metamodel's exporter or null if one does not exist diff --git a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/MetamodelManager.java b/modelspace/modelspace-engine/src/main/java/org/modelspace/MetamodelManager.java similarity index 89% rename from modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/MetamodelManager.java rename to modelspace/modelspace-engine/src/main/java/org/modelspace/MetamodelManager.java index 55c201f..aab4d12 100644 --- a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/MetamodelManager.java +++ b/modelspace/modelspace-engine/src/main/java/org/modelspace/MetamodelManager.java @@ -21,7 +21,7 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler; +package org.modelspace; import java.net.URL; @@ -44,27 +44,27 @@ public interface MetamodelManager { * @param dataPath * the repository path to an data * @return the default metamodel for the data at the supplied path - * @throws ModelerException + * @throws ModelspaceException * if any problem occurs */ - Metamodel defaultMetamodel( final String dataPath ) throws ModelerException; + Metamodel defaultMetamodel( final String dataPath ) throws ModelspaceException; /** * @param category * the name of an {@link #installableMetamodelCategories() installable metamodel category} from an on-line Maven {@link #metamodelRepositories() metamodel repository} - * @throws ModelerException + * @throws ModelspaceException * if any problem occurs */ - void install( final String category ) throws ModelerException; + void install( final String category ) throws ModelspaceException; /** * @return the installable {@link Metamodel metamodel} categories from the {@link #metamodelRepositories() registered * repositories} - * @throws ModelerException + * @throws ModelspaceException * if any problem occurs */ - String[] installableMetamodelCategories() throws ModelerException; + String[] installableMetamodelCategories() throws ModelspaceException; /** * @param id @@ -94,10 +94,10 @@ public interface MetamodelManager { * @param dataPath * the workspace path to data * @return the metamodels applicable to the data at the supplied path - * @throws ModelerException + * @throws ModelspaceException * if any problem occurs */ - Metamodel[] metamodelsForArtifact( final String dataPath ) throws ModelerException; + Metamodel[] metamodelsForArtifact( final String dataPath ) throws ModelspaceException; /** * @param category @@ -112,10 +112,10 @@ public interface MetamodelManager { * @return the {@link #registerMetamodelRepository(URL) registered} Maven * {@link #metamodelRepositories() metamodel repository} URLs, ordered by how they will searched when * {@link #installableMetamodelCategories() retrieving} or {@link #install(String) installing} metamodel categories - * @throws ModelerException + * @throws ModelspaceException * if any error occurs */ - URL[] moveMetamodelRepositoryDown( final URL repositoryUrl ) throws ModelerException; + URL[] moveMetamodelRepositoryDown( final URL repositoryUrl ) throws ModelspaceException; /** * @param repositoryUrl @@ -123,10 +123,10 @@ public interface MetamodelManager { * @return the {@link #registerMetamodelRepository(URL) registered} Maven * {@link #metamodelRepositories() metamodel repository} URLs, ordered by how they will searched when * {@link #installableMetamodelCategories() retrieving} or {@link #install(String) installing} metamodel categories - * @throws ModelerException + * @throws ModelspaceException * if any error occurs */ - URL[] moveMetamodelRepositoryUp( final URL repositoryUrl ) throws ModelerException; + URL[] moveMetamodelRepositoryUp( final URL repositoryUrl ) throws ModelspaceException; /** * @param repositoryUrl @@ -134,18 +134,18 @@ public interface MetamodelManager { * @return the registered Maven {@link #metamodelRepositories() metamodel repository} * URLs, ordered by how they will searched when {@link #installableMetamodelCategories() retrieving} or * {@link #install(String) installing} metamodel categories - * @throws ModelerException + * @throws ModelspaceException * if any error occurs */ - URL[] registerMetamodelRepository( final URL repositoryUrl ) throws ModelerException; + URL[] registerMetamodelRepository( final URL repositoryUrl ) throws ModelspaceException; /** * @param category * the name of an {@link #installableMetamodelCategories() installed metamodel category} - * @throws ModelerException + * @throws ModelspaceException * if any problem occurs */ - void uninstall( final String category ) throws ModelerException; + void uninstall( final String category ) throws ModelspaceException; /** * @param repositoryUrl @@ -153,8 +153,8 @@ public interface MetamodelManager { * @return the {@link #registerMetamodelRepository(URL) registered} Maven * {@link #metamodelRepositories() metamodel repository} URLs, ordered by how they will searched when * {@link #installableMetamodelCategories() retrieving} or {@link #install(String) installing} metamodel categories - * @throws ModelerException + * @throws ModelspaceException * if any error occurs */ - URL[] unregisterMetamodelRepository( final URL repositoryUrl ) throws ModelerException; + URL[] unregisterMetamodelRepository( final URL repositoryUrl ) throws ModelspaceException; } diff --git a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/Model.java b/modelspace/modelspace-engine/src/main/java/org/modelspace/Model.java similarity index 75% rename from modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/Model.java rename to modelspace/modelspace-engine/src/main/java/org/modelspace/Model.java index ccb5696..8de8f6c 100644 --- a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/Model.java +++ b/modelspace/modelspace-engine/src/main/java/org/modelspace/Model.java @@ -21,12 +21,12 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler; +package org.modelspace; import java.net.URL; import java.util.Set; -import org.modeshape.modeler.spi.metamodel.Dependency; +import org.modelspace.spi.Dependency; /** * @@ -40,42 +40,42 @@ public interface Model extends ModelObject { /** * @return true if all dependencies, recursively, exist in the repository. - * @throws ModelerException + * @throws ModelspaceException * if any error occurs */ - boolean allDependenciesExist() throws ModelerException; + boolean allDependenciesExist() throws ModelspaceException; /** * @return the model's dependencies (never null but can be empty) - * @throws ModelerException + * @throws ModelspaceException * if any error occurs */ - Set< Dependency > dependencies() throws ModelerException; + Set< Dependency > dependencies() throws ModelspaceException; /** * @return the (last) external location, e.g., on the file system, known to contain a materialized representation of this model. - * @throws ModelerException + * @throws ModelspaceException * if any error occurs */ - URL externalLocation() throws ModelerException; + URL externalLocation() throws ModelspaceException; /** * @return this model's metamodel (can be null if a metamodel is not found) - * @throws ModelerException + * @throws ModelspaceException * if any error occurs */ - Metamodel metamodel() throws ModelerException; + Metamodel metamodel() throws ModelspaceException; /** * @return a collection of missing dependencies (never null but can be empty) - * @throws ModelerException + * @throws ModelspaceException * if any error occurs */ - Set< Dependency > missingDependencies() throws ModelerException; + Set< Dependency > missingDependencies() throws ModelspaceException; /** - * @return the {@link Modeler modeler} used to communicate with the persistent store (never null) + * @return the {@link Modelspace modelspace} used to communicate with the persistent store (never null) */ - Modeler modeler(); + Modelspace modelspace(); } diff --git a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/ModelObject.java b/modelspace/modelspace-engine/src/main/java/org/modelspace/ModelObject.java similarity index 81% rename from modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/ModelObject.java rename to modelspace/modelspace-engine/src/main/java/org/modelspace/ModelObject.java index 44ef786..1ca57ff 100644 --- a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/ModelObject.java +++ b/modelspace/modelspace-engine/src/main/java/org/modelspace/ModelObject.java @@ -21,7 +21,7 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler; +package org.modelspace; import java.util.Map; @@ -41,11 +41,11 @@ public interface ModelObject { * @param additionalNames * additional names of the new children to be added to this object * @return the child model object(s) created (never null or empty) - * @throws ModelerException + * @throws ModelspaceException * if any error occurs */ ModelObject[] addChild( final String name, - final String... additionalNames ) throws ModelerException; + final String... additionalNames ) throws ModelspaceException; /** * Adds a child with the supplied name and primary type. If the primary type has mandatory properties, use @@ -58,12 +58,12 @@ ModelObject[] addChild( final String name, * @param valuesByProperty * values identified by their (possibly mandatory) properties to be set on the new child * @return the model object created (never null) - * @throws ModelerException + * @throws ModelspaceException * if any error occurs */ ModelObject addChildOfType( final String primaryTypeId, final String name, - final Map< String, ? > valuesByProperty ) throws ModelerException; + final Map< String, ? > valuesByProperty ) throws ModelspaceException; /** * Adds a child with the supplied name and primary type. If the primary type has mandatory properties, use @@ -76,109 +76,109 @@ ModelObject addChildOfType( final String primaryTypeId, * @param additionalNames * additional names of the new children to be added to this object * @return the model object(s) created (never null or empty) - * @throws ModelerException + * @throws ModelspaceException * if any error occurs */ ModelObject[] addChildOfType( final String primaryTypeId, final String name, - final String... additionalNames ) throws ModelerException; + final String... additionalNames ) throws ModelspaceException; /** * @param typeId * the type ID of a mixin type to set on this model object * @param valuesByProperty * values identified by their (possibly mandatory) properties to be set on the new child - * @throws ModelerException + * @throws ModelspaceException * if any error occurs */ void addMixinType( final String typeId, - final Map< String, ? > valuesByProperty ) throws ModelerException; + final Map< String, ? > valuesByProperty ) throws ModelspaceException; /** * @param typeId * the ID of the first mixin type to be added to this object * @param additionalTypeIds * the IDs of additional mixin types to be added to this object - * @throws ModelerException + * @throws ModelspaceException * if any error occurs */ void addMixinType( final String typeId, - final String... additionalTypeIds ) throws ModelerException; + final String... additionalTypeIds ) throws ModelspaceException; /** * @param childName * the name of one of this model object's children * @return the child model object with the supplied name - * @throws ModelerException + * @throws ModelspaceException * if any error occurs */ - ModelObject child( final String childName ) throws ModelerException; + ModelObject child( final String childName ) throws ModelspaceException; /** * @param childName * the name of one of this model object's children * @return true if this model object has multiple children with the supplied name - * @throws ModelerException + * @throws ModelspaceException * if any error occurs */ - boolean childHasSameNameSiblings( final String childName ) throws ModelerException; + boolean childHasSameNameSiblings( final String childName ) throws ModelspaceException; /** * @return the child model objects of this model object - * @throws ModelerException + * @throws ModelspaceException * if any error occurs */ - ModelObject[] children() throws ModelerException; + ModelObject[] children() throws ModelspaceException; /** * @param childName * the name of one of this model object's children * @return the child model objects of this model object with the supplied name - * @throws ModelerException + * @throws ModelspaceException * if any error occurs */ - ModelObject[] children( final String childName ) throws ModelerException; + ModelObject[] children( final String childName ) throws ModelspaceException; /** * @param primaryTypeId * the primary type ID of the children being requested (cannot be null or empty) * @return the matching children (never null but can be empty) - * @throws ModelerException + * @throws ModelspaceException * if an error occurs */ - ModelObject[] childrenOfType( final String primaryTypeId ) throws ModelerException; + ModelObject[] childrenOfType( final String primaryTypeId ) throws ModelspaceException; /** * @param childName * the name of one of this model object's children * @return true if this model object has a child with the supplied name - * @throws ModelerException + * @throws ModelspaceException * if any error occurs */ - boolean hasChild( final String childName ) throws ModelerException; + boolean hasChild( final String childName ) throws ModelspaceException; /** * @return true if this model object has children - * @throws ModelerException + * @throws ModelspaceException * if any error occurs */ - boolean hasChildren() throws ModelerException; + boolean hasChildren() throws ModelspaceException; /** * @return true if this model object has properties - * @throws ModelerException + * @throws ModelspaceException * if any error occurs */ - boolean hasProperties() throws ModelerException; + boolean hasProperties() throws ModelspaceException; /** * @param propertyName * the name of one of this model object's properties * @return true if this model object has the a property with the supplied name - * @throws ModelerException + * @throws ModelspaceException * if any error occurs */ - boolean hasProperty( final String propertyName ) throws ModelerException; + boolean hasProperty( final String propertyName ) throws ModelspaceException; /** * @return this model object's 0-based index relative to any other same-name-siblings, or -1 if this is a model @@ -187,122 +187,122 @@ void addMixinType( final String typeId, /** * @return this model object's mixin type descriptors (never null but can be empty) - * @throws ModelerException + * @throws ModelspaceException * if any error occurs */ - Descriptor[] mixinTypes() throws ModelerException; + Descriptor[] mixinTypes() throws ModelspaceException; /** * @return this model object's enclosing model - * @throws ModelerException + * @throws ModelspaceException * if any error occurs */ - Model model() throws ModelerException; + Model model() throws ModelspaceException; /** * @return this model object's path relative to its {@link #model() model} - * @throws ModelerException + * @throws ModelspaceException * if any error occurs */ - String modelRelativePath() throws ModelerException; + String modelRelativePath() throws ModelspaceException; /** * @return this model object's name - * @throws ModelerException + * @throws ModelspaceException * if any error occurs */ - String name() throws ModelerException; + String name() throws ModelspaceException; /** * @return this model object's primary type descriptor (never null) - * @throws ModelerException + * @throws ModelspaceException * if any error occurs */ - Descriptor primaryType() throws ModelerException; + Descriptor primaryType() throws ModelspaceException; /** * Prints this object's subtree to standard out * - * @throws ModelerException + * @throws ModelspaceException * if any error occurs */ - void print() throws ModelerException; + void print() throws ModelspaceException; /** * @param propertyName * the name of model object property being selected (cannot be null or empty) * @return the property or null if the property doesn't exist - * @throws ModelerException + * @throws ModelspaceException * if any error occurs */ - ModelProperty property( final String propertyName ) throws ModelerException; + ModelProperty property( final String propertyName ) throws ModelspaceException; /** * @return the property names for this model object - * @throws ModelerException + * @throws ModelspaceException * if any error occurs */ - String[] propertyNames() throws ModelerException; + String[] propertyNames() throws ModelspaceException; /** * @param name * the name of the first child to be removed from this object * @param additionalNames * the names of additional children to be removed from this object - * @throws ModelerException + * @throws ModelspaceException * if any error occurs */ void removeChild( final String name, - final String... additionalNames ) throws ModelerException; + final String... additionalNames ) throws ModelspaceException; /** * @param typeId * the ID of the first mixin type to be removed from this object * @param additionalTypeIds * the IDs of additional mixin types to be removed from this object - * @throws ModelerException + * @throws ModelspaceException * if any error occurs */ void removeMixinType( final String typeId, - final String... additionalTypeIds ) throws ModelerException; + final String... additionalTypeIds ) throws ModelspaceException; /** * @param typeId * the type ID of a mixin type to set on this model object, or null * @param valuesByProperty * values identified by their (possibly mandatory) properties to be set on the new child - * @throws ModelerException + * @throws ModelspaceException * if any error occurs */ void setMixinType( final String typeId, - final Map< String, ? > valuesByProperty ) throws ModelerException; + final Map< String, ? > valuesByProperty ) throws ModelspaceException; /** * @param typeIds * one or more mixin type IDs for this model object, or null - * @throws ModelerException + * @throws ModelspaceException * if any error occurs */ - void setMixinTypes( final String... typeIds ) throws ModelerException; + void setMixinTypes( final String... typeIds ) throws ModelspaceException; /** * @param typeId * the primary type ID of this model object, or null - * @throws ModelerException + * @throws ModelspaceException * if any error occurs */ - void setPrimaryType( final String typeId ) throws ModelerException; + void setPrimaryType( final String typeId ) throws ModelspaceException; /** * @param typeId * the primary type ID of this model object, or null * @param valuesByProperty * values identified by their (possibly mandatory) properties to be set on the new child - * @throws ModelerException + * @throws ModelspaceException * if any error occurs */ void setPrimaryType( final String typeId, - final Map< String, ? > valuesByProperty ) throws ModelerException; + final Map< String, ? > valuesByProperty ) throws ModelspaceException; /** * Creates the property if it does not exist. Passing a null value will remove the property. Passing multiple @@ -312,12 +312,12 @@ void setPrimaryType( final String typeId, * the name of one of this model object's properties (cannot be null or empty) * @param values * one or more new values - * @throws ModelerException + * @throws ModelspaceException * if an error occurs * @throws IllegalArgumentException * if trying to set a single-valued property with multiple values or trying to set values that are not compatible with * the property definition */ void setProperty( final String propertyName, - final Object... values ) throws ModelerException; + final Object... values ) throws ModelspaceException; } \ No newline at end of file diff --git a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/ModelProperty.java b/modelspace/modelspace-engine/src/main/java/org/modelspace/ModelProperty.java similarity index 74% rename from modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/ModelProperty.java rename to modelspace/modelspace-engine/src/main/java/org/modelspace/ModelProperty.java index 9a96140..3364576 100644 --- a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/ModelProperty.java +++ b/modelspace/modelspace-engine/src/main/java/org/modelspace/ModelProperty.java @@ -21,7 +21,7 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler; +package org.modelspace; import java.math.BigDecimal; import java.util.Calendar; @@ -38,117 +38,117 @@ public interface ModelProperty { /** * @return the value represented as a boolean or null if the property doesn't exist - * @throws ModelerException + * @throws ModelspaceException * if an error occurs */ - boolean booleanValue() throws ModelerException; + boolean booleanValue() throws ModelspaceException; /** * @return the values represented as booleans or null if the property doesn't exist - * @throws ModelerException + * @throws ModelspaceException * if not a multi-value property or if an error occurs */ - boolean[] booleanValues() throws ModelerException; + boolean[] booleanValues() throws ModelspaceException; /** * @return the value represented as a date or null if the property doesn't exist - * @throws ModelerException + * @throws ModelspaceException * if an error occurs */ - Calendar dateValue() throws ModelerException; + Calendar dateValue() throws ModelspaceException; /** * @return the values represented as dates or null if the property doesn't exist - * @throws ModelerException + * @throws ModelspaceException * if not a multi-value property or if an error occurs */ - Calendar[] dateValues() throws ModelerException; + Calendar[] dateValues() throws ModelspaceException; /** * @return the value represented as a decimal or null if the property doesn't exist - * @throws ModelerException + * @throws ModelspaceException * if an error occurs */ - BigDecimal decimalValue() throws ModelerException; + BigDecimal decimalValue() throws ModelspaceException; /** * @return the values represented as decimals or null if the property doesn't exist - * @throws ModelerException + * @throws ModelspaceException * if not a multi-value property or if an error occurs */ - BigDecimal[] decimalValues() throws ModelerException; + BigDecimal[] decimalValues() throws ModelspaceException; /** * @return the property descriptor (never null) - * @throws ModelerException + * @throws ModelspaceException * if an error occurs */ - PropertyDescriptor descriptor() throws ModelerException; + PropertyDescriptor descriptor() throws ModelspaceException; /** * @return the value represented as a double or null if the property doesn't exist - * @throws ModelerException + * @throws ModelspaceException * if an error occurs */ - double doubleValue() throws ModelerException; + double doubleValue() throws ModelspaceException; /** * @return the values represented as doubles or null if the property doesn't exist - * @throws ModelerException + * @throws ModelspaceException * if not a multi-value property or if an error occurs */ - double[] doubleValues() throws ModelerException; + double[] doubleValues() throws ModelspaceException; /** * @return the Long value of the supplied property, or null if the property doesn't exist - * @throws ModelerException + * @throws ModelspaceException * if an error occurs */ - long longValue() throws ModelerException; + long longValue() throws ModelspaceException; /** * @return the Long values of the supplied property, or null if the property doesn't exist - * @throws ModelerException + * @throws ModelspaceException * if not a multi-value property or if an error occurs */ - long[] longValues() throws ModelerException; + long[] longValues() throws ModelspaceException; /** * Passing in null will remove the existing property from its node. * * @param values * the new value for single-valued properties or the new values for multi-valued properties(can be null) - * @throws ModelerException + * @throws ModelspaceException * if an error occurs */ - void set( final Object... values ) throws ModelerException; + void set( final Object... values ) throws ModelspaceException; /** * @return the String value of the supplied property, or null if the property doesn't exist - * @throws ModelerException + * @throws ModelspaceException * if an error occurs */ - String stringValue() throws ModelerException; + String stringValue() throws ModelspaceException; /** * @return the String values of the supplied property, or null if the property doesn't exist - * @throws ModelerException + * @throws ModelspaceException * if not a multi-value property or if an error occurs */ - String[] stringValues() throws ModelerException; + String[] stringValues() throws ModelspaceException; /** * @return the value of the supplied property, or null if the property doesn't exist - * @throws ModelerException + * @throws ModelspaceException * if an error occurs */ - Object value() throws ModelerException; + Object value() throws ModelspaceException; /** * @return the values of the supplied property, or null if the property doesn't exist - * @throws ModelerException + * @throws ModelspaceException * if not a multi-value property or if an error occurs */ - Object[] values() throws ModelerException; + Object[] values() throws ModelspaceException; } diff --git a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/Modeler.java b/modelspace/modelspace-engine/src/main/java/org/modelspace/Modelspace.java similarity index 81% rename from modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/Modeler.java rename to modelspace/modelspace-engine/src/main/java/org/modelspace/Modelspace.java index 505fbe2..41790c1 100644 --- a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/Modeler.java +++ b/modelspace/modelspace-engine/src/main/java/org/modelspace/Modelspace.java @@ -21,28 +21,28 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler; +package org.modelspace; import java.io.File; import java.io.InputStream; import java.io.OutputStream; import java.net.URL; -import org.modeshape.modeler.internal.ModelerImpl; +import org.modelspace.internal.ModelspaceImpl; import org.polyglotter.common.Logger; /** * */ -public interface Modeler extends AutoCloseable { +public interface Modelspace extends AutoCloseable { /** * */ - Logger LOGGER = Logger.logger( ModelerI18n.class ); + Logger LOGGER = Logger.logger( ModelspaceI18n.class ); /** - * @return the path to the configuration for the embedded repository supplied when this Modeler was instantiated. + * @return the path to the configuration for the embedded repository supplied when this Modelspace was instantiated. */ String configurationPath(); @@ -51,43 +51,43 @@ public interface Modeler extends AutoCloseable { * @param path * the path of the model being deleted (cannot be null or empty) * @return true if deleted or false if node at that path does not exist - * @throws ModelerException + * @throws ModelspaceException * if node is not a model at that path */ - boolean deleteModel( String path ) throws ModelerException; + boolean deleteModel( String path ) throws ModelspaceException; /** * @param model * a workspace model * @param file * a file to which the supplied model should be exported - * @throws ModelerException + * @throws ModelspaceException * if any problem occurs */ void export( Model model, - File file ) throws ModelerException; + File file ) throws ModelspaceException; /** * @param model * a workspace model * @param stream * an output stream to which the supplied model should be exported - * @throws ModelerException + * @throws ModelspaceException * if any problem occurs */ void export( Model model, - OutputStream stream ) throws ModelerException; + OutputStream stream ) throws ModelspaceException; /** * @param model * a workspace model * @param url * a URL to which the supplied model should be exported - * @throws ModelerException + * @throws ModelspaceException * if any problem occurs */ void export( Model model, - URL url ) throws ModelerException; + URL url ) throws ModelspaceException; /** * @param dataPath @@ -96,11 +96,11 @@ void export( Model model, * the workspace path where the model should be created * @return a new model using a metamodel determined by the data's content, and if the data is a file, its file extension; never * null - * @throws ModelerException + * @throws ModelspaceException * if any problem occurs */ Model generateModel( final String dataPath, - final String modelPath ) throws ModelerException; + final String modelPath ) throws ModelspaceException; /** * @param dataPath @@ -110,12 +110,12 @@ Model generateModel( final String dataPath, * @param metamodel * the metamodel of model to be created for the supplied data; may be null. * @return a new model of the supplied metamodel; never null - * @throws ModelerException + * @throws ModelspaceException * if any problem occurs */ Model generateModel( final String dataPath, final String modelPath, - final Metamodel metamodel ) throws ModelerException; + final Metamodel metamodel ) throws ModelspaceException; /** * @param file @@ -123,11 +123,11 @@ Model generateModel( final String dataPath, * @param workspaceFolder * the parent path where the file should be imported * @return the workspace path the to imported data - * @throws ModelerException + * @throws ModelspaceException * if any problem occurs */ String importData( final File file, - final String workspaceFolder ) throws ModelerException; + final String workspaceFolder ) throws ModelspaceException; /** * @param file @@ -137,12 +137,12 @@ String importData( final File file, * @param workspaceName * the name of the file in the workspace. If null or empty, the name of the supplied file will be used. * @return the workspace path the to imported data - * @throws ModelerException + * @throws ModelspaceException * if any problem occurs */ String importData( final File file, final String workspaceFolder, - final String workspaceName ) throws ModelerException; + final String workspaceName ) throws ModelspaceException; /** * @param stream @@ -150,11 +150,11 @@ String importData( final File file, * @param workspacePath * the path where the data should be imported * @return the workspace path the to imported data - * @throws ModelerException + * @throws ModelspaceException * if any problem occurs */ String importData( final InputStream stream, - final String workspacePath ) throws ModelerException; + final String workspacePath ) throws ModelspaceException; /** * @param url @@ -162,11 +162,11 @@ String importData( final InputStream stream, * @param workspaceFolder * the parent path where the data should be imported * @return the workspace path the to imported data - * @throws ModelerException + * @throws ModelspaceException * if any problem occurs */ String importData( final URL url, - final String workspaceFolder ) throws ModelerException; + final String workspaceFolder ) throws ModelspaceException; /** * @param url @@ -177,12 +177,12 @@ String importData( final URL url, * the name of the data in the workspace. If null or empty, the last segment of the supplied URL will be * used. * @return the workspace path the to imported data - * @throws ModelerException + * @throws ModelspaceException * if any problem occurs */ String importData( final URL url, final String workspaceFolder, - final String workspaceName ) throws ModelerException; + final String workspaceName ) throws ModelspaceException; /** * Creates a model with the name of the supplied file. @@ -194,12 +194,12 @@ String importData( final URL url, * @param metamodel * the metamodel of model to be created for the supplied data; may be null. * @return a new model of the supplied metamodel; never null - * @throws ModelerException + * @throws ModelspaceException * if any problem occurs */ Model importModel( final File file, final String modelFolder, - final Metamodel metamodel ) throws ModelerException; + final Metamodel metamodel ) throws ModelspaceException; /** * Creates a model with the name of the supplied file. @@ -213,13 +213,13 @@ Model importModel( final File file, * @param metamodel * the metamodel of model to be created for the supplied data; may be null. * @return a new model of the supplied metamodel; never null - * @throws ModelerException + * @throws ModelspaceException * if any problem occurs */ Model importModel( final File file, final String modelFolder, final String modelName, - final Metamodel metamodel ) throws ModelerException; + final Metamodel metamodel ) throws ModelspaceException; /** * @param stream @@ -229,12 +229,12 @@ Model importModel( final File file, * @param metamodel * the metamodel of model to be created for the supplied data; may be null. * @return a new model of the supplied metamodel; never null - * @throws ModelerException + * @throws ModelspaceException * if any problem occurs */ Model importModel( final InputStream stream, final String modelPath, - final Metamodel metamodel ) throws ModelerException; + final Metamodel metamodel ) throws ModelspaceException; /** * @param dataUrl @@ -244,12 +244,12 @@ Model importModel( final InputStream stream, * @param metamodel * the metamodel of model to be created for the supplied data; may be null. * @return a new model of the supplied metamodel; never null - * @throws ModelerException + * @throws ModelspaceException * if any problem occurs */ Model importModel( final URL dataUrl, final String modelFolder, - final Metamodel metamodel ) throws ModelerException; + final Metamodel metamodel ) throws ModelspaceException; /** * @param dataUrl @@ -261,29 +261,29 @@ Model importModel( final URL dataUrl, * @param metamodel * the metamodel of model to be created for the supplied data; may be null. * @return a new model of the supplied metamodel; never null - * @throws ModelerException + * @throws ModelspaceException * if any problem occurs */ Model importModel( final URL dataUrl, final String modelFolder, final String modelName, - final Metamodel metamodel ) throws ModelerException; + final Metamodel metamodel ) throws ModelspaceException; /** - * @return the metamodel modeler - * @throws ModelerException + * @return the metamodel manager + * @throws ModelspaceException * if any error occurs */ - MetamodelManager metamodelManager() throws ModelerException; + MetamodelManager metamodelManager() throws ModelspaceException; /** * @param path * a workspace path for a model * @return the model at the supplied path, or null if not found - * @throws ModelerException + * @throws ModelspaceException * if any error occurs */ - Model model( final String path ) throws ModelerException; + Model model( final String path ) throws ModelspaceException; /** * Creates a new model or returns an existing one. @@ -293,11 +293,11 @@ Model importModel( final URL dataUrl, * @param metamodelId * the metamodel identifier (cannot be null or empty) * @return the new model or the existing one (never null) - * @throws ModelerException + * @throws ModelspaceException * if the path already exists and the node is not a model with the specified metamodel ID */ Model newModel( final String modelPath, - final String metamodelId ) throws ModelerException; + final String metamodelId ) throws ModelspaceException; /** * Creates a new model or returns an existing one. @@ -309,12 +309,12 @@ Model newModel( final String modelPath, * @param override * true if an existing model is found and should be replaced * @return the new model or the existing one (never null) - * @throws ModelerException + * @throws ModelspaceException * when not in override mode, if the path already exists and the node is not a model with the specified metamodel ID */ Model newModel( final String modelPath, final String metamodelId, - boolean override ) throws ModelerException; + boolean override ) throws ModelspaceException; /** * @return the path to the folder that should contain the repository store @@ -331,9 +331,9 @@ class Factory { * * @param repositoryStoreParentPath * the path to the folder that should contain the repository store - * @return a new Modeler with a default configuration + * @return a new Modelspace with a default configuration */ - public static Modeler instance( final String repositoryStoreParentPath ) { + public static Modelspace instance( final String repositoryStoreParentPath ) { return instance( repositoryStoreParentPath ); } @@ -342,11 +342,11 @@ public static Modeler instance( final String repositoryStoreParentPath ) { * the path to the folder that should contain the repository store * @param configurationPath * the path to a configuration file - * @return a new Modeler + * @return a new Modelspace */ - public static Modeler instance( final String repositoryStoreParentPath, - final String configurationPath ) { - return new ModelerImpl( repositoryStoreParentPath, configurationPath ); + public static Modelspace instance( final String repositoryStoreParentPath, + final String configurationPath ) { + return new ModelspaceImpl( repositoryStoreParentPath, configurationPath ); } } } diff --git a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/ModelerException.java b/modelspace/modelspace-engine/src/main/java/org/modelspace/ModelspaceException.java similarity index 79% rename from modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/ModelerException.java rename to modelspace/modelspace-engine/src/main/java/org/modelspace/ModelspaceException.java index 8e98088..54a44e6 100644 --- a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/ModelerException.java +++ b/modelspace/modelspace-engine/src/main/java/org/modelspace/ModelspaceException.java @@ -1,17 +1,17 @@ /* - * Modeler (http://Modeler.org) + * Modelspace (http://Modelspace.org) * See the COPYRIGHT.txt file distributed with this work for information * regarding copyright ownership. Some portions may be licensed * to Red Hat, Inc. under one or more contributor license agreements. * See the AUTHORS.txt file in the distribution for a full listing of * individual contributors. * - * Modeler is free software. Unless otherwise indicated, all code in Modeler + * Modelspace is free software. Unless otherwise indicated, all code in Modelspace * is licensed to you under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * - * Modeler is distributed in the hope that it will be useful, + * Modelspace is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. @@ -22,7 +22,7 @@ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler; +package org.modelspace; import org.polyglotter.common.BaseException; import org.polyglotter.common.I18n; @@ -30,7 +30,7 @@ /** * */ -public class ModelerException extends BaseException { +public class ModelspaceException extends BaseException { /** * @param message @@ -38,7 +38,7 @@ public class ModelerException extends BaseException { * @param arguments * optional arguments to the supplied message */ - public ModelerException( final I18n message, + public ModelspaceException( final I18n message, final Object... arguments ) { super( message, arguments ); } @@ -49,9 +49,9 @@ public ModelerException( final I18n message, * @param arguments * optional arguments to the supplied message */ - public ModelerException( final String message, + public ModelspaceException( final String message, final Object... arguments ) { - super( ModelerI18n.class, message, arguments ); + super( ModelspaceI18n.class, message, arguments ); } /** @@ -62,7 +62,7 @@ public ModelerException( final String message, * @param arguments * optional arguments to the supplied message */ - public ModelerException( final Throwable cause, + public ModelspaceException( final Throwable cause, final I18n message, final Object... arguments ) { super( cause, message, arguments ); @@ -76,9 +76,9 @@ public ModelerException( final Throwable cause, * @param arguments * optional arguments to the supplied message */ - public ModelerException( final Throwable cause, + public ModelspaceException( final Throwable cause, final String message, final Object... arguments ) { - super( ModelerI18n.class, cause, message, arguments ); + super( ModelspaceI18n.class, cause, message, arguments ); } } diff --git a/modeshape-modeler/modeshape-modeler-xsd/src/main/java/org/modeshape/modeler/xsd/XsdModelerI18n.java b/modelspace/modelspace-engine/src/main/java/org/modelspace/ModelspaceI18n.java similarity index 89% rename from modeshape-modeler/modeshape-modeler-xsd/src/main/java/org/modeshape/modeler/xsd/XsdModelerI18n.java rename to modelspace/modelspace-engine/src/main/java/org/modelspace/ModelspaceI18n.java index 0e1933f..fe9cae6 100644 --- a/modeshape-modeler/modeshape-modeler-xsd/src/main/java/org/modeshape/modeler/xsd/XsdModelerI18n.java +++ b/modelspace/modelspace-engine/src/main/java/org/modelspace/ModelspaceI18n.java @@ -21,18 +21,19 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler.xsd; +package org.modelspace; import org.polyglotter.common.I18n; /** - * Internationalized string constants, in alphabetical order, for the XSD Modeler project. + * Internationalized string constants, in alphabetical order, for the Modelspace project. */ @SuppressWarnings( "javadoc" ) -public class XsdModelerI18n { +public final class ModelspaceI18n { public static String localize( final String text, final Object... arguments ) { - return I18n.localize( XsdModelerI18n.class, text, arguments ); + return I18n.localize( ModelspaceI18n.class, text, arguments ); } + } diff --git a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/ModelerLexicon.java b/modelspace/modelspace-engine/src/main/java/org/modelspace/ModelspaceLexicon.java similarity index 97% rename from modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/ModelerLexicon.java rename to modelspace/modelspace-engine/src/main/java/org/modelspace/ModelspaceLexicon.java index ba445ed..5033258 100644 --- a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/ModelerLexicon.java +++ b/modelspace/modelspace-engine/src/main/java/org/modelspace/ModelspaceLexicon.java @@ -21,15 +21,15 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler; +package org.modelspace; /** - * The lexicon of the modeler. + * The lexicon of the modelspace. */ -public interface ModelerLexicon { +public interface ModelspaceLexicon { /** - * The Modeler namespace prefix. Value is {@value} . + * The Modelspace namespace prefix. Value is {@value} . */ String NAMESPACE_PREFIX = "mm"; diff --git a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/PropertyDescriptor.java b/modelspace/modelspace-engine/src/main/java/org/modelspace/PropertyDescriptor.java similarity index 86% rename from modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/PropertyDescriptor.java rename to modelspace/modelspace-engine/src/main/java/org/modelspace/PropertyDescriptor.java index 78b950d..617cd8c 100644 --- a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/PropertyDescriptor.java +++ b/modelspace/modelspace-engine/src/main/java/org/modelspace/PropertyDescriptor.java @@ -21,7 +21,7 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler; +package org.modelspace; /** * A {@link ModelObject model object} {@link ModelProperty property} descriptor. @@ -43,45 +43,45 @@ public interface PropertyDescriptor { * one default value. * * @return the default values or an empty array if no default values exist. - * @throws ModelerException + * @throws ModelspaceException * if an error occurs */ - Object[] defaultValues() throws ModelerException; + Object[] defaultValues() throws ModelspaceException; /** * @return true if property is required - * @throws ModelerException + * @throws ModelspaceException * if an error occurs */ - boolean mandatory() throws ModelerException; + boolean mandatory() throws ModelspaceException; /** * @return true if the property value is modifiable - * @throws ModelerException + * @throws ModelspaceException * if an error occurs */ - boolean modifiable() throws ModelerException; + boolean modifiable() throws ModelspaceException; /** * @return true if this property is multi-valued - * @throws ModelerException + * @throws ModelspaceException * if an error occurs */ - boolean multiple() throws ModelerException; + boolean multiple() throws ModelspaceException; /** * @return the property name (never null or empty) - * @throws ModelerException + * @throws ModelspaceException * if an error occurs */ - String name() throws ModelerException; + String name() throws ModelspaceException; /** * @return the type of the property (never null) - * @throws ModelerException + * @throws ModelspaceException * if an error occurs */ - Type type() throws ModelerException; + Type type() throws ModelspaceException; /** * The property type. diff --git a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/DescriptorImpl.java b/modelspace/modelspace-engine/src/main/java/org/modelspace/internal/DescriptorImpl.java similarity index 76% rename from modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/DescriptorImpl.java rename to modelspace/modelspace-engine/src/main/java/org/modelspace/internal/DescriptorImpl.java index e4e03a5..47b8082 100644 --- a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/DescriptorImpl.java +++ b/modelspace/modelspace-engine/src/main/java/org/modelspace/internal/DescriptorImpl.java @@ -21,51 +21,51 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler.internal; +package org.modelspace.internal; import javax.jcr.Session; import javax.jcr.nodetype.NodeDefinition; import javax.jcr.nodetype.NodeTypeManager; import javax.jcr.nodetype.PropertyDefinition; +import org.modelspace.Descriptor; +import org.modelspace.ModelObject; +import org.modelspace.Modelspace; +import org.modelspace.ModelspaceException; +import org.modelspace.PropertyDescriptor; +import org.modelspace.internal.task.TaskWithResult; import org.modeshape.common.util.CheckArg; -import org.modeshape.modeler.Descriptor; -import org.modeshape.modeler.ModelObject; -import org.modeshape.modeler.Modeler; -import org.modeshape.modeler.ModelerException; -import org.modeshape.modeler.PropertyDescriptor; -import org.modeshape.modeler.internal.task.TaskWithResult; /** * An implementation of a {@link ModelObject model object} {@link PropertyDescriptor property descriptor}. */ class DescriptorImpl implements Descriptor { - final ModelerImpl modeler; + final ModelspaceImpl modelspace; final String name; - DescriptorImpl( final Modeler modeler, + DescriptorImpl( final Modelspace modelspace, final String nodeTypeName ) { - CheckArg.isNotNull( modeler, "modeler" ); + CheckArg.isNotNull( modelspace, "modelspace" ); CheckArg.isNotEmpty( nodeTypeName, "nodeTypeName" ); - this.modeler = ( ModelerImpl ) modeler; + this.modelspace = ( ModelspaceImpl ) modelspace; this.name = nodeTypeName; } /** * {@inheritDoc} * - * @see org.modeshape.modeler.Descriptor#childDescriptors() + * @see org.modelspace.Descriptor#childDescriptors() */ @Override - public Descriptor[] childDescriptors() throws ModelerException { - return this.modeler.run( new TaskWithResult< Descriptor[] >() { + public Descriptor[] childDescriptors() throws ModelspaceException { + return this.modelspace.run( new TaskWithResult< Descriptor[] >() { /** * {@inheritDoc} * - * @see org.modeshape.modeler.internal.task.TaskWithResult#run(javax.jcr.Session) + * @see org.modelspace.internal.task.TaskWithResult#run(javax.jcr.Session) */ @Override public Descriptor[] run( final Session session ) throws Exception { @@ -75,7 +75,7 @@ public Descriptor[] run( final Session session ) throws Exception { int i = 0; for ( final NodeDefinition childDefn : childDefns ) { - childDescriptors[ i++ ] = new DescriptorImpl( modeler, childDefn.getName() ); + childDescriptors[ i++ ] = new DescriptorImpl( modelspace, childDefn.getName() ); } return childDescriptors; @@ -86,7 +86,7 @@ public Descriptor[] run( final Session session ) throws Exception { /** * {@inheritDoc} * - * @see org.modeshape.modeler.Descriptor#name() + * @see org.modelspace.Descriptor#name() */ @Override public String name() { @@ -96,16 +96,16 @@ public String name() { /** * {@inheritDoc} * - * @see org.modeshape.modeler.Descriptor#propertyDescriptors() + * @see org.modelspace.Descriptor#propertyDescriptors() */ @Override - public PropertyDescriptor[] propertyDescriptors() throws ModelerException { - return this.modeler.run( new TaskWithResult< PropertyDescriptor[] >() { + public PropertyDescriptor[] propertyDescriptors() throws ModelspaceException { + return this.modelspace.run( new TaskWithResult< PropertyDescriptor[] >() { /** * {@inheritDoc} * - * @see org.modeshape.modeler.internal.task.TaskWithResult#run(javax.jcr.Session) + * @see org.modelspace.internal.task.TaskWithResult#run(javax.jcr.Session) */ @Override public PropertyDescriptor[] run( final Session session ) throws Exception { diff --git a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/JcrUtil.java b/modelspace/modelspace-engine/src/main/java/org/modelspace/internal/JcrUtil.java similarity index 89% rename from modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/JcrUtil.java rename to modelspace/modelspace-engine/src/main/java/org/modelspace/internal/JcrUtil.java index 7db4ed1..5d1b786 100644 --- a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/JcrUtil.java +++ b/modelspace/modelspace-engine/src/main/java/org/modelspace/internal/JcrUtil.java @@ -21,15 +21,15 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler.internal; +package org.modelspace.internal; import javax.jcr.Node; import javax.jcr.RepositoryException; import javax.jcr.Value; +import org.modelspace.ModelspaceException; import org.modeshape.common.util.CheckArg; import org.modeshape.jcr.api.JcrTools; -import org.modeshape.modeler.ModelerException; /** * A collection of utilities related to JCR. @@ -54,18 +54,18 @@ public static void debug( final Node node ) throws RepositoryException { * @param propertyName * the name of the property whose value is being requested (cannot be null or empty) * @return the property value (never null or empty) - * @throws ModelerException + * @throws ModelspaceException * if property does not exist or if an error occurs */ public static String value( final Node node, - final String propertyName ) throws ModelerException { + final String propertyName ) throws ModelspaceException { CheckArg.isNotNull( node, "node" ); CheckArg.isNotEmpty( propertyName, "propertyName" ); try { return node.getProperty( propertyName ).getString(); } catch ( final Exception e ) { - throw new ModelerException( e, "Unable to get value of property \"%s\" from node \"%s\"", propertyName, node ); + throw new ModelspaceException( e, "Unable to get value of property \"%s\" from node \"%s\"", propertyName, node ); } } @@ -75,11 +75,11 @@ public static String value( final Node node, * @param propertyName * the name of the multi-valued property whose values are being requested (cannot be null or empty) * @return the property value (never null or empty) - * @throws ModelerException + * @throws ModelspaceException * if property does not exist, if property is not multi-valued, or if an error occurs */ public static String[] values( final Node node, - final String propertyName ) throws ModelerException { + final String propertyName ) throws ModelspaceException { CheckArg.isNotNull( node, "node" ); CheckArg.isNotEmpty( propertyName, "propertyName" ); @@ -94,7 +94,7 @@ public static String[] values( final Node node, return result; } catch ( final Exception e ) { - throw new ModelerException( e, "Unable to get values of property \"%s\" from node \"%s\"", propertyName, node ); + throw new ModelspaceException( e, "Unable to get values of property \"%s\" from node \"%s\"", propertyName, node ); } } diff --git a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/MetamodelImpl.java b/modelspace/modelspace-engine/src/main/java/org/modelspace/internal/MetamodelImpl.java similarity index 80% rename from modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/MetamodelImpl.java rename to modelspace/modelspace-engine/src/main/java/org/modelspace/internal/MetamodelImpl.java index e1c8201..c2f1186 100644 --- a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/MetamodelImpl.java +++ b/modelspace/modelspace-engine/src/main/java/org/modelspace/internal/MetamodelImpl.java @@ -21,7 +21,7 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler.internal; +package org.modelspace.internal; import java.util.ArrayList; import java.util.List; @@ -30,18 +30,18 @@ import javax.jcr.nodetype.NodeType; import javax.jcr.nodetype.NodeTypeIterator; +import org.modelspace.Descriptor; +import org.modelspace.Metamodel; +import org.modelspace.ModelspaceException; +import org.modelspace.internal.task.TaskWithResult; +import org.modelspace.spi.DependencyProcessor; +import org.modelspace.spi.Exporter; +import org.modelspace.spi.Importer; import org.modeshape.common.util.StringUtil; -import org.modeshape.modeler.Descriptor; -import org.modeshape.modeler.Metamodel; -import org.modeshape.modeler.ModelerException; -import org.modeshape.modeler.internal.task.TaskWithResult; -import org.modeshape.modeler.spi.metamodel.DependencyProcessor; -import org.modeshape.modeler.spi.metamodel.Exporter; -import org.modeshape.modeler.spi.metamodel.Importer; final class MetamodelImpl implements Metamodel { - final ModelerImpl modeler; + final ModelspaceImpl modelspace; private final String category; private final String id; @@ -51,10 +51,10 @@ final class MetamodelImpl implements Metamodel { private String name; - MetamodelImpl( final ModelerImpl modeler, + MetamodelImpl( final ModelspaceImpl modelspace, final String category, final String id ) { - this.modeler = modeler; + this.modelspace = modelspace; this.category = category; this.id = id; } @@ -72,7 +72,7 @@ public String category() { /** * {@inheritDoc} * - * @see org.modeshape.modeler.Metamodel#dependencyProcessor() + * @see org.modelspace.Metamodel#dependencyProcessor() */ @Override public DependencyProcessor dependencyProcessor() { @@ -84,25 +84,25 @@ public DependencyProcessor dependencyProcessor() { // dependencyProcessor = ( DependencyProcessor ) clazz.newInstance(); // return dependencyProcessor; // } catch ( final Exception e ) { - // throw new ModelerException( e ); + // throw new ModelspaceException( e ); // } } /** * {@inheritDoc} * - * @see org.modeshape.modeler.Metamodel#descriptors() + * @see org.modelspace.Metamodel#descriptors() */ @Override - public Descriptor[] descriptors() throws ModelerException { - return modeler.run( new TaskWithResult< Descriptor[] >() { + public Descriptor[] descriptors() throws ModelspaceException { + return modelspace.run( new TaskWithResult< Descriptor[] >() { @Override public Descriptor[] run( final Session session ) throws Exception { final List< Descriptor > descriptors = new ArrayList<>(); for ( final NodeTypeIterator iter = session.getWorkspace().getNodeTypeManager().getAllNodeTypes(); iter.hasNext(); ) { final NodeType nodeType = iter.nextNodeType(); - descriptors.add( new DescriptorImpl( modeler, nodeType.getName() ) ); + descriptors.add( new DescriptorImpl( modelspace, nodeType.getName() ) ); } return descriptors.toArray( new Descriptor[ descriptors.size() ] ); } @@ -112,7 +112,7 @@ public Descriptor[] run( final Session session ) throws Exception { /** * {@inheritDoc} * - * @see org.modeshape.modeler.Metamodel#exporter() + * @see org.modelspace.Metamodel#exporter() */ @Override public Exporter exporter() { @@ -124,7 +124,7 @@ public Exporter exporter() { // exporter = ( Exporter ) clazz.newInstance(); // return exporter; // } catch ( final Exception e ) { - // throw new ModelerException( e ); + // throw new ModelspaceException( e ); // } } @@ -141,7 +141,7 @@ public String id() { /** * {@inheritDoc} * - * @see org.modeshape.modeler.Metamodel#importer() + * @see org.modelspace.Metamodel#importer() */ @Override public Importer importer() { diff --git a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/MetamodelInstaller.java b/modelspace/modelspace-engine/src/main/java/org/modelspace/internal/MetamodelInstaller.java similarity index 81% rename from modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/MetamodelInstaller.java rename to modelspace/modelspace-engine/src/main/java/org/modelspace/internal/MetamodelInstaller.java index 74168f0..d0f8a52 100644 --- a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/MetamodelInstaller.java +++ b/modelspace/modelspace-engine/src/main/java/org/modelspace/internal/MetamodelInstaller.java @@ -1,17 +1,17 @@ /* - * Modeler (http://Modeler.org) + * Modelspace (http://Modelspace.org) * See the COPYRIGHT.txt file distributed with this work for information * regarding copyright ownership. Some portions may be licensed * to Red Hat, Inc. under one or more contributor license agreements. * See the AUTHORS.txt file in the distribution for a full listing of * individual contributors. * - * Modeler is free software. Unless otherwise indicated, all code in Modeler + * Modelspace is free software. Unless otherwise indicated, all code in Modelspace * is licensed to you under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * - * Modeler is distributed in the hope that it will be useful, + * Modelspace is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. @@ -21,7 +21,7 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler.internal; +package org.modelspace.internal; import java.io.IOException; import java.io.InputStream; @@ -39,26 +39,26 @@ import javax.jcr.Node; import javax.jcr.NodeIterator; +import org.modelspace.Metamodel; +import org.modelspace.Modelspace; +import org.modelspace.ModelspaceLexicon; +import org.modelspace.internal.MetamodelManagerImpl.LibraryClassLoader; +import org.modelspace.spi.DependencyProcessor; +import org.modelspace.spi.Exporter; import org.modeshape.jcr.api.JcrTools; -import org.modeshape.modeler.Metamodel; -import org.modeshape.modeler.Modeler; -import org.modeshape.modeler.ModelerLexicon; -import org.modeshape.modeler.internal.MetamodelManagerImpl.LibraryClassLoader; -import org.modeshape.modeler.spi.metamodel.DependencyProcessor; -import org.modeshape.modeler.spi.metamodel.Exporter; /** * A class that installs metamodel dependency processors and exporters. */ public class MetamodelInstaller { - private static final String MODELER_PREFIX = "modeshape-modeler-"; + private static final String MODELSPACE_PREFIX = "modelspace-"; // pass in category then version - private static final String ARCHIVE_NAME = MODELER_PREFIX + "%s-%s-module-with-dependencies.zip"; + private static final String ARCHIVE_NAME = MODELSPACE_PREFIX + "%s-%s-module-with-dependencies.zip"; // pass in category, version, name - private static final String EXTENSION_PATH_PATTERN = MetamodelManagerImpl.MODESHAPE_GROUP + "/" + MODELER_PREFIX + "%s/%s/%s"; + private static final String EXTENSION_PATH_PATTERN = "org/polyglotter/" + MODELSPACE_PREFIX + "%s/%s/%s"; private boolean archiveExists( final Node categoryNode, final String archiveName ) throws Exception { @@ -74,7 +74,7 @@ private boolean archiveExists( final Node categoryNode, } private Node archivesNode( final Node categoryNode ) throws Exception { - return categoryNode.getNode( ModelerLexicon.Metamodel.Category.ARCHIVES ); + return categoryNode.getNode( ModelspaceLexicon.Metamodel.Category.ARCHIVES ); } private Metamodel findMetamodel( final String metamodelId, @@ -122,7 +122,7 @@ boolean install( final Node categoryNode, // don't install if already installed if ( archiveExists( categoryNode, archiveName ) ) { - Modeler.LOGGER.debug( "Archive '%s' already exists", archiveName ); + Modelspace.LOGGER.debug( "Archive '%s' already exists", archiveName ); return false; } @@ -133,7 +133,7 @@ boolean install( final Node categoryNode, boolean archiveFound = false; try ( InputStream urlStream = url.openStream() ) { archiveFound = true; - Modeler.LOGGER.debug( "Archive found at URL '%s'", url ); + Modelspace.LOGGER.debug( "Archive found at URL '%s'", url ); // copy archive over to library if found at this repository Files.copy( urlStream, archivePath ); @@ -141,7 +141,7 @@ boolean install( final Node categoryNode, // add to classpath libraryClassLoader.addURL( url ); - // add to modeler workspace repository + // add to modelspace workspace repository new JcrTools().uploadFile( categoryNode.getSession(), archivesNode( categoryNode ).getPath() + '/' + archivePath.getFileName().toString(), urlStream ); @@ -149,7 +149,7 @@ boolean install( final Node categoryNode, archivePath.toFile().delete(); } catch ( final IOException e ) { if ( archiveFound ) throw e; - Modeler.LOGGER.debug( "Archive at URL '%s' was NOT found in repository", url ); + Modelspace.LOGGER.debug( "Archive at URL '%s' was NOT found in repository", url ); continue; } @@ -169,7 +169,7 @@ boolean install( final Node categoryNode, // see if this jar has already been installed if ( jarPath.toFile().exists() ) { - Modeler.LOGGER.debug( "Jar already installed: %s", jarPath ); + Modelspace.LOGGER.debug( "Jar already installed: %s", jarPath ); continue; } @@ -181,18 +181,18 @@ boolean install( final Node categoryNode, // add to classpath libraryClassLoader.addURL( jarPath.toUri().toURL() ); - Modeler.LOGGER.debug( "Added jar '%s' to classpath", jarPath.toUri().toURL() ); + Modelspace.LOGGER.debug( "Added jar '%s' to classpath", jarPath.toUri().toURL() ); // add jar to category node in repository try ( final InputStream stream = archive.getInputStream( jarEntry ) ) { final String nodePath = ( archivesNode( categoryNode ).getPath() + '/' + jarPath.getFileName().toString() ); new JcrTools().uploadFile( categoryNode.getSession(), nodePath, stream ); - Modeler.LOGGER.debug( "Uploaded jar '%s' to category node", nodePath ); + Modelspace.LOGGER.debug( "Uploaded jar '%s' to category node", nodePath ); } // Iterate through entries looking for appropriate extension classes - if ( jarPath.getFileName().toString().startsWith( MODELER_PREFIX ) ) + if ( jarPath.getFileName().toString().startsWith( MODELSPACE_PREFIX ) ) try ( final ZipFile jar = new ZipFile( jarPath.toFile() ) ) { for ( final Enumeration< ? extends ZipEntry > itr = jar.entries(); itr.hasMoreElements(); ) { final ZipEntry entry = itr.nextElement(); @@ -203,19 +203,19 @@ boolean install( final Node categoryNode, // see if class is a possible exporter or dependency processor if ( isExporterName( name ) ) { exporterNames.add( name.replace( '/', '.' ).substring( 0, name.length() - ".class".length() ) ); - Modeler.LOGGER.debug( "Found potential exporter '%s'", name ); + Modelspace.LOGGER.debug( "Found potential exporter '%s'", name ); } else if ( isDependencyProcessorName( name ) ) { dependencyProcessorNames.add( name.replace( '/', '.' ).substring( 0, name.length() - ".class".length() ) ); - Modeler.LOGGER.debug( "Found potential dependency processor '%s'", name ); + Modelspace.LOGGER.debug( "Found potential dependency processor '%s'", name ); } } } } else if ( isExporterName( name ) ) { exporterNames.add( name.replace( '/', '.' ).substring( 0, name.length() - ".class".length() ) ); - Modeler.LOGGER.debug( "Found potential exporter '%s'", name ); + Modelspace.LOGGER.debug( "Found potential exporter '%s'", name ); } else if ( isDependencyProcessorName( name ) ) { dependencyProcessorNames.add( name.replace( '/', '.' ).substring( 0, name.length() - ".class".length() ) ); - Modeler.LOGGER.debug( "Found potential dependency processor '%s'", name ); + Modelspace.LOGGER.debug( "Found potential dependency processor '%s'", name ); } } } @@ -232,16 +232,16 @@ boolean install( final Node categoryNode, final Exporter exporter = ( Exporter ) clazz.newInstance(); final String metamodelId = exporter.metamodelId(); final Node metamodelNode = metamodelNode( categoryNode, metamodelId ); - metamodelNode.setProperty( ModelerLexicon.Metamodel.EXPORTER_CLASS_NAME, className ); + metamodelNode.setProperty( ModelspaceLexicon.Metamodel.EXPORTER_CLASS_NAME, className ); final MetamodelImpl metamodel = ( MetamodelImpl ) findMetamodel( metamodelId, metamodels ); metamodel.setExporter( exporter ); extensionInstalled = true; - Modeler.LOGGER.debug( "Installed exporter '%s' for metamodel '%s'", className, metamodelId ); + Modelspace.LOGGER.debug( "Installed exporter '%s' for metamodel '%s'", className, metamodelId ); } } catch ( final NoClassDefFoundError | ClassNotFoundException ignored ) { - Modeler.LOGGER.debug( "Potential exporter class '%s' cannot be loaded", clazz ); + Modelspace.LOGGER.debug( "Potential exporter class '%s' cannot be loaded", clazz ); } } @@ -258,16 +258,16 @@ boolean install( final Node categoryNode, final String metamodelId = dependencyProcessor.metamodelId(); final Node metamodelNode = metamodelNode( categoryNode, metamodelId ); - metamodelNode.setProperty( ModelerLexicon.Metamodel.DEPENDENCY_PROCESSOR_CLASS_NAME, className ); + metamodelNode.setProperty( ModelspaceLexicon.Metamodel.DEPENDENCY_PROCESSOR_CLASS_NAME, className ); final MetamodelImpl metamodel = ( MetamodelImpl ) findMetamodel( metamodelId, metamodels ); metamodel.setDependencyProcessor( dependencyProcessor ); extensionInstalled = true; - Modeler.LOGGER.debug( "Installed dependency processor '%s' for metamodel '%s'", className, metamodelId ); + Modelspace.LOGGER.debug( "Installed dependency processor '%s' for metamodel '%s'", className, metamodelId ); } } catch ( final NoClassDefFoundError | ClassNotFoundException ignored ) { - Modeler.LOGGER.debug( "Potential dependency processor class '%s' cannot be loaded", className ); + Modelspace.LOGGER.debug( "Potential dependency processor class '%s' cannot be loaded", className ); } } } @@ -295,7 +295,7 @@ private boolean isJarFile( final String name ) { Node metamodelNode( final Node categoryNode, final String metamodelName ) throws Exception { - return categoryNode.getNode( ModelerLexicon.Metamodel.Category.METAMODELS ).getNode( metamodelName ); + return categoryNode.getNode( ModelspaceLexicon.Metamodel.Category.METAMODELS ).getNode( metamodelName ); } private String path( final String prefix, diff --git a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/MetamodelManagerImpl.java b/modelspace/modelspace-engine/src/main/java/org/modelspace/internal/MetamodelManagerImpl.java similarity index 79% rename from modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/MetamodelManagerImpl.java rename to modelspace/modelspace-engine/src/main/java/org/modelspace/internal/MetamodelManagerImpl.java index eafbbd5..a2d20a6 100644 --- a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/MetamodelManagerImpl.java +++ b/modelspace/modelspace-engine/src/main/java/org/modelspace/internal/MetamodelManagerImpl.java @@ -21,7 +21,7 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler.internal; +package org.modelspace.internal; import java.io.File; import java.io.IOException; @@ -52,26 +52,26 @@ import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; import org.jsoup.select.Elements; +import org.modelspace.Metamodel; +import org.modelspace.MetamodelManager; +import org.modelspace.Modelspace; +import org.modelspace.ModelspaceException; +import org.modelspace.ModelspaceI18n; +import org.modelspace.ModelspaceLexicon; +import org.modelspace.internal.task.TaskWithResult; +import org.modelspace.internal.task.WriteSystemTask; +import org.modelspace.spi.DependencyProcessor; +import org.modelspace.spi.Exporter; +import org.modelspace.spi.Importer; import org.modeshape.common.util.CheckArg; import org.modeshape.jcr.ExtensionLogger; import org.modeshape.jcr.JcrLexicon; import org.modeshape.jcr.api.JcrTools; import org.modeshape.jcr.api.nodetype.NodeTypeManager; import org.modeshape.jcr.api.sequencer.Sequencer; -import org.modeshape.modeler.Metamodel; -import org.modeshape.modeler.MetamodelManager; -import org.modeshape.modeler.Modeler; -import org.modeshape.modeler.ModelerException; -import org.modeshape.modeler.ModelerI18n; -import org.modeshape.modeler.ModelerLexicon; -import org.modeshape.modeler.internal.task.TaskWithResult; -import org.modeshape.modeler.internal.task.WriteSystemTask; -import org.modeshape.modeler.spi.metamodel.DependencyProcessor; -import org.modeshape.modeler.spi.metamodel.Exporter; -import org.modeshape.modeler.spi.metamodel.Importer; /** - * The default implementation of a metamodel modeler. + * The default implementation of a metamodel modelspace. */ final class MetamodelManagerImpl implements MetamodelManager { @@ -91,26 +91,26 @@ final class MetamodelManagerImpl implements MetamodelManager { private static final String urlNotFound = "URL not found: %s"; private final MetamodelInstaller metamodelInstaller; - final ModelerImpl modeler; + final ModelspaceImpl modelspace; final LinkedList< URL > metamodelRepositories = new LinkedList<>(); final Set< Metamodel > metamodels = new HashSet<>(); final LibraryClassLoader libraryClassLoader = new LibraryClassLoader(); final Path library; - MetamodelManagerImpl( final ModelerImpl modeler ) throws ModelerException { - this.modeler = modeler; + MetamodelManagerImpl( final ModelspaceImpl modelspace ) throws ModelspaceException { + this.modelspace = modelspace; this.metamodelInstaller = new MetamodelInstaller(); // setup classpath area for metamodel archives try { library = Files.createTempDirectory( null ); } catch ( final IOException e ) { - throw new ModelerException( e, "Unable to create temporary folder for library" ); + throw new ModelspaceException( e, "Unable to create temporary folder for library" ); } library.toFile().deleteOnExit(); // load caches from MS repository - modeler.run( this, new WriteSystemTask() { + modelspace.run( this, new WriteSystemTask() { @Override public void run( final Session session, @@ -144,22 +144,22 @@ public void run( final Session session, Node categoryNode( final String category, final Node systemNode, final boolean create ) throws Exception { - if ( !systemNode.hasNode( ModelerLexicon.METAMODEL_CATEGORIES ) ) - throw new ModelerException( "Expected categories child node of '%s' was not found", systemNode.getPath() ); + if ( !systemNode.hasNode( ModelspaceLexicon.METAMODEL_CATEGORIES ) ) + throw new ModelspaceException( "Expected categories child node of '%s' was not found", systemNode.getPath() ); - final Node categoriesNode = systemNode.getNode( ModelerLexicon.METAMODEL_CATEGORIES ); + final Node categoriesNode = systemNode.getNode( ModelspaceLexicon.METAMODEL_CATEGORIES ); Node categoryNode = null; if ( !categoriesNode.hasNode( category ) ) { if ( create ) { - categoryNode = categoriesNode.addNode( category, ModelerLexicon.Metamodel.Category.NODE_TYPE ); - categoryNode.addNode( ModelerLexicon.Metamodel.Category.ARCHIVES, ModelerLexicon.Metamodel.Category.ARCHIVES ); - categoryNode.addNode( ModelerLexicon.Metamodel.Category.METAMODELS, ModelerLexicon.Metamodel.Category.METAMODELS ); - Modeler.LOGGER.debug( "Created category node '%s'", category ); + categoryNode = categoriesNode.addNode( category, ModelspaceLexicon.Metamodel.Category.NODE_TYPE ); + categoryNode.addNode( ModelspaceLexicon.Metamodel.Category.ARCHIVES, ModelspaceLexicon.Metamodel.Category.ARCHIVES ); + categoryNode.addNode( ModelspaceLexicon.Metamodel.Category.METAMODELS, ModelspaceLexicon.Metamodel.Category.METAMODELS ); + Modelspace.LOGGER.debug( "Created category node '%s'", category ); } } else { categoryNode = categoriesNode.getNode( category ); - Modeler.LOGGER.debug( "Found category node '%s'", category ); + Modelspace.LOGGER.debug( "Found category node '%s'", category ); } return categoryNode; @@ -185,13 +185,13 @@ public Metamodel defaultMetamodel( final Node fileNode, * @see MetamodelManager#defaultMetamodel(String) */ @Override - public Metamodel defaultMetamodel( final String filePath ) throws ModelerException { + public Metamodel defaultMetamodel( final String filePath ) throws ModelspaceException { CheckArg.isNotEmpty( filePath, "filePath" ); - return modeler.run( new TaskWithResult< Metamodel >() { + return modelspace.run( new TaskWithResult< Metamodel >() { @Override public Metamodel run( final Session session ) throws Exception { - final Node node = modeler.dataNode( session, filePath ); + final Node node = modelspace.dataNode( session, filePath ); final Metamodel metamodel = defaultMetamodel( node, metamodels( node ) ); return metamodel == null ? null : metamodel; } @@ -204,18 +204,18 @@ public Metamodel run( final Session session ) throws Exception { * @see MetamodelManager#install(String) */ @Override - public void install( final String category ) throws ModelerException { + public void install( final String category ) throws ModelspaceException { CheckArg.isNotEmpty( category, "category" ); - Modeler.LOGGER.debug( "Installing category '%s'", category ); - modeler.run( this, new WriteSystemTask() { + Modelspace.LOGGER.debug( "Installing category '%s'", category ); + modelspace.run( this, new WriteSystemTask() { @Override public void run( final Session session, final Node systemNode ) throws Exception { - Modeler.LOGGER.debug( "Installing importer for category '%s'", category ); + Modelspace.LOGGER.debug( "Installing importer for category '%s'", category ); installImporter( category, session, systemNode ); - Modeler.LOGGER.debug( "Installing metamodel for category '%s'", category ); + Modelspace.LOGGER.debug( "Installing metamodel for category '%s'", category ); installMetamodel( category, session, systemNode ); } } ); @@ -227,7 +227,7 @@ public void run( final Session session, * @see MetamodelManager#installableMetamodelCategories() */ @Override - public String[] installableMetamodelCategories() throws ModelerException { + public String[] installableMetamodelCategories() throws ModelspaceException { final Set< String > categories = new HashSet<>(); for ( final URL repositoryUrl : metamodelRepositories ) { try { @@ -253,7 +253,7 @@ public String[] installableMetamodelCategories() throws ModelerException { } } } catch ( final IOException e ) { - throw new ModelerException( e, "Unable to install metamodel categories for %s", + throw new ModelspaceException( e, "Unable to install metamodel categories for %s", path( repositoryUrl.toString(), MODESHAPE_GROUP ) ); } } @@ -289,7 +289,7 @@ void installImporter( final String category, try ( final ZipFile archive = new ZipFile( archivePath.toFile() ) ) { final Collection< String > potentialSequencerClassNames = new ArrayList<>(); - final Node archivesNode = categoryNode.getNode( ModelerLexicon.Metamodel.Category.ARCHIVES ); + final Node archivesNode = categoryNode.getNode( ModelspaceLexicon.Metamodel.Category.ARCHIVES ); for ( final Enumeration< ? extends ZipEntry > archiveIter = archive.entries(); archiveIter.hasMoreElements(); ) { final ZipEntry archiveEntry = archiveIter.nextElement(); @@ -299,7 +299,7 @@ void installImporter( final String category, String name = archiveEntry.getName().toLowerCase(); if ( !name.endsWith( ".jar" ) || name.endsWith( "-tests.jar" ) || name.endsWith( "-sources.jar" ) ) { - Modeler.LOGGER.debug( "Ignoring Jar: %s", name ); + Modelspace.LOGGER.debug( "Ignoring Jar: %s", name ); continue; } @@ -308,7 +308,7 @@ void installImporter( final String category, library.resolve( archiveEntry.getName().substring( archiveEntry.getName().lastIndexOf( '/' ) + 1 ) ); if ( jarPath.toFile().exists() ) { - Modeler.LOGGER.debug( "Jar already installed: %s", jarPath ); + Modelspace.LOGGER.debug( "Jar already installed: %s", jarPath ); continue; } @@ -340,13 +340,13 @@ void installImporter( final String category, // see if class is a possible sequencer if ( name.endsWith( "Sequencer.class" ) ) { potentialSequencerClassNames.add( name.replace( '/', '.' ).substring( 0, name.length() - ".class".length() ) ); - Modeler.LOGGER.debug( "Potential sequencer: %s", name ); + Modelspace.LOGGER.debug( "Potential sequencer: %s", name ); } } } } - final Node metamodelsNode = categoryNode.getNode( ModelerLexicon.Metamodel.Category.METAMODELS ); + final Node metamodelsNode = categoryNode.getNode( ModelspaceLexicon.Metamodel.Category.METAMODELS ); // try and load each potential sequencer class that was found for ( final String sequencerClassName : potentialSequencerClassNames ) { @@ -357,21 +357,21 @@ void installImporter( final String category, if ( Sequencer.class.isAssignableFrom( sequencerClass ) && !Modifier.isAbstract( sequencerClass.getModifiers() ) ) { - String id = Modeler.class.getPackage().getName() + '.' + category + '.' + String id = Modelspace.class.getPackage().getName() + '.' + category + '.' + sequencerClass.getSimpleName(); id = id.endsWith( "Sequencer" ) ? id.substring( 0, id.length() - "Sequencer".length() ) : id; // add metamodel to MS repository - final Node metamodelNode = metamodelsNode.addNode( id, ModelerLexicon.Metamodel.NODE_TYPE ); - metamodelNode.setProperty( ModelerLexicon.Metamodel.IMPORTER_CLASS_NAME, sequencerClass.getName() ); + final Node metamodelNode = metamodelsNode.addNode( id, ModelspaceLexicon.Metamodel.NODE_TYPE ); + metamodelNode.setProperty( ModelspaceLexicon.Metamodel.IMPORTER_CLASS_NAME, sequencerClass.getName() ); // add to cache - final MetamodelImpl metamodel = new MetamodelImpl( modeler, category, id ); + final MetamodelImpl metamodel = new MetamodelImpl( modelspace, category, id ); metamodel.setImporter( sequencerImporter( session, sequencerClass ) ); metamodels.add( metamodel ); } } catch ( final NoClassDefFoundError | ClassNotFoundException ignored ) { - Modeler.LOGGER.debug( "Potential importer class '%s' cannot be loaded", sequencerClass ); + Modelspace.LOGGER.debug( "Potential importer class '%s' cannot be loaded", sequencerClass ); } } } @@ -379,7 +379,7 @@ void installImporter( final String category, archivePath.toFile().delete(); return; } - throw new IllegalArgumentException( ModelerI18n.localize( unableToFindMetamodelCategory, category ) ); + throw new IllegalArgumentException( ModelspaceI18n.localize( unableToFindMetamodelCategory, category ) ); } void installMetamodel( final String category, @@ -393,19 +393,19 @@ void installMetamodel( final String category, metamodelRepositories, version(), metamodels ) ) { - Modeler.LOGGER.debug( "Installed extensions for category '%s'", category ); + Modelspace.LOGGER.debug( "Installed extensions for category '%s'", category ); } else { - Modeler.LOGGER.debug( "No extensions installed for category '%s'", category ); + Modelspace.LOGGER.debug( "No extensions installed for category '%s'", category ); } } void loadCategories( final Session session, final Node systemNode ) throws Exception { - if ( !systemNode.hasNode( ModelerLexicon.METAMODEL_CATEGORIES ) ) { - systemNode.addNode( ModelerLexicon.METAMODEL_CATEGORIES ); - Modeler.LOGGER.debug( "'%s' node created", ModelerLexicon.METAMODEL_CATEGORIES ); + if ( !systemNode.hasNode( ModelspaceLexicon.METAMODEL_CATEGORIES ) ) { + systemNode.addNode( ModelspaceLexicon.METAMODEL_CATEGORIES ); + Modelspace.LOGGER.debug( "'%s' node created", ModelspaceLexicon.METAMODEL_CATEGORIES ); } else { - final Node categoriesNode = systemNode.getNode( ModelerLexicon.METAMODEL_CATEGORIES ); + final Node categoriesNode = systemNode.getNode( ModelspaceLexicon.METAMODEL_CATEGORIES ); for ( final NodeIterator iter = categoriesNode.getNodes(); iter.hasNext(); ) { final Node categoryNode = iter.nextNode(); @@ -417,11 +417,11 @@ void loadCategories( final Session session, void loadCategoryArchives( final Session session, final Node categoryNode ) throws Exception { - if ( !categoryNode.hasNode( ModelerLexicon.Metamodel.Category.ARCHIVES ) ) { - categoryNode.addNode( ModelerLexicon.Metamodel.Category.ARCHIVES ); - Modeler.LOGGER.debug( "'%s' node created", ModelerLexicon.Metamodel.Category.ARCHIVES ); + if ( !categoryNode.hasNode( ModelspaceLexicon.Metamodel.Category.ARCHIVES ) ) { + categoryNode.addNode( ModelspaceLexicon.Metamodel.Category.ARCHIVES ); + Modelspace.LOGGER.debug( "'%s' node created", ModelspaceLexicon.Metamodel.Category.ARCHIVES ); } else { - final Node archivesNode = categoryNode.getNode( ModelerLexicon.Metamodel.Category.ARCHIVES ); + final Node archivesNode = categoryNode.getNode( ModelspaceLexicon.Metamodel.Category.ARCHIVES ); for ( final NodeIterator iter = archivesNode.getNodes(); iter.hasNext(); ) { final Node archiveNode = iter.nextNode(); @@ -434,56 +434,56 @@ void loadCategoryArchives( final Session session, archivePath.toFile().deleteOnExit(); libraryClassLoader.addURL( archivePath.toUri().toURL() ); - Modeler.LOGGER.debug( "Loaded archive: %s", archivePath ); + Modelspace.LOGGER.debug( "Loaded archive: %s", archivePath ); } } } void loadMetamodelRepositories( final Session session, final Node systemNode ) throws Exception { - if ( !systemNode.hasProperty( ModelerLexicon.METAMODEL_REPOSITORIES ) ) { + if ( !systemNode.hasProperty( ModelspaceLexicon.METAMODEL_REPOSITORIES ) ) { final Value[] vals = new Value[ 2 ]; vals[ 0 ] = session.getValueFactory().createValue( JBOSS_METAMODEL_REPOSITORY ); vals[ 1 ] = session.getValueFactory().createValue( MAVEN_METAMODEL_REPOSITORY ); - systemNode.setProperty( ModelerLexicon.METAMODEL_REPOSITORIES, vals ); + systemNode.setProperty( ModelspaceLexicon.METAMODEL_REPOSITORIES, vals ); } - for ( final String url : JcrUtil.values( systemNode, ModelerLexicon.METAMODEL_REPOSITORIES ) ) { + for ( final String url : JcrUtil.values( systemNode, ModelspaceLexicon.METAMODEL_REPOSITORIES ) ) { metamodelRepositories.add( new URL( url ) ); } } void loadMetamodels( final Session session, final Node categoryNode ) throws Exception { - if ( !categoryNode.hasNode( ModelerLexicon.Metamodel.Category.METAMODELS ) ) { - categoryNode.addNode( ModelerLexicon.Metamodel.Category.METAMODELS ); - Modeler.LOGGER.debug( "'%s' node created", ModelerLexicon.Metamodel.Category.METAMODELS ); + if ( !categoryNode.hasNode( ModelspaceLexicon.Metamodel.Category.METAMODELS ) ) { + categoryNode.addNode( ModelspaceLexicon.Metamodel.Category.METAMODELS ); + Modelspace.LOGGER.debug( "'%s' node created", ModelspaceLexicon.Metamodel.Category.METAMODELS ); } else { - final Node metamodelsNode = categoryNode.getNode( ModelerLexicon.Metamodel.Category.METAMODELS ); + final Node metamodelsNode = categoryNode.getNode( ModelspaceLexicon.Metamodel.Category.METAMODELS ); final String category = categoryNode.getName(); for ( final NodeIterator iter = metamodelsNode.getNodes(); iter.hasNext(); ) { final Node metamodelNode = iter.nextNode(); - final MetamodelImpl metamodel = new MetamodelImpl( modeler, category, metamodelNode.getName() ); + final MetamodelImpl metamodel = new MetamodelImpl( modelspace, category, metamodelNode.getName() ); metamodels.add( metamodel ); - if ( metamodelNode.hasProperty( ModelerLexicon.Metamodel.IMPORTER_CLASS_NAME ) ) { + if ( metamodelNode.hasProperty( ModelspaceLexicon.Metamodel.IMPORTER_CLASS_NAME ) ) { final String className = JcrUtil.value( metamodelNode, - ModelerLexicon.Metamodel.IMPORTER_CLASS_NAME ); + ModelspaceLexicon.Metamodel.IMPORTER_CLASS_NAME ); metamodel.setImporter( sequencerImporter( session, libraryClassLoader.loadClass( className ) ) ); } - if ( metamodelNode.hasProperty( ModelerLexicon.Metamodel.EXPORTER_CLASS_NAME ) ) { + if ( metamodelNode.hasProperty( ModelspaceLexicon.Metamodel.EXPORTER_CLASS_NAME ) ) { final String className = JcrUtil.value( metamodelNode, - ModelerLexicon.Metamodel.EXPORTER_CLASS_NAME ); + ModelspaceLexicon.Metamodel.EXPORTER_CLASS_NAME ); metamodel.setExporter( ( Exporter ) libraryClassLoader.loadClass( className ).newInstance() ); } - if ( metamodelNode.hasProperty( ModelerLexicon.Metamodel.DEPENDENCY_PROCESSOR_CLASS_NAME ) ) { + if ( metamodelNode.hasProperty( ModelspaceLexicon.Metamodel.DEPENDENCY_PROCESSOR_CLASS_NAME ) ) { final String className = JcrUtil.value( metamodelNode, - ModelerLexicon.Metamodel.DEPENDENCY_PROCESSOR_CLASS_NAME ); + ModelspaceLexicon.Metamodel.DEPENDENCY_PROCESSOR_CLASS_NAME ); metamodel.setDependencyProcessor( ( DependencyProcessor ) libraryClassLoader.loadClass( className ).newInstance() ); } - Modeler.LOGGER.debug( "Loaded metamodel: %s", metamodel.id() ); + Modelspace.LOGGER.debug( "Loaded metamodel: %s", metamodel.id() ); } } } @@ -559,13 +559,13 @@ public Metamodel[] metamodels( final Node fileNode ) throws Exception { * @see MetamodelManager#metamodelsForArtifact(String) */ @Override - public Metamodel[] metamodelsForArtifact( final String filePath ) throws ModelerException { + public Metamodel[] metamodelsForArtifact( final String filePath ) throws ModelspaceException { CheckArg.isNotEmpty( filePath, "filePath" ); - return modeler.run( new TaskWithResult< Metamodel[] >() { + return modelspace.run( new TaskWithResult< Metamodel[] >() { @Override public final Metamodel[] run( final Session session ) throws Exception { - return metamodels( modeler.dataNode( session, filePath ) ); + return metamodels( modelspace.dataNode( session, filePath ) ); } } ); } @@ -590,10 +590,10 @@ public Metamodel[] metamodelsForCategory( final String category ) { * @see MetamodelManager#moveMetamodelRepositoryDown(URL) */ @Override - public URL[] moveMetamodelRepositoryDown( final URL repositoryUrl ) throws ModelerException { + public URL[] moveMetamodelRepositoryDown( final URL repositoryUrl ) throws ModelspaceException { CheckArg.isNotNull( repositoryUrl, "repositoryUrl" ); final int ndx = metamodelRepositories.indexOf( repositoryUrl ); - if ( ndx < 0 ) throw new IllegalArgumentException( ModelerI18n.localize( urlNotFound, repositoryUrl ) ); + if ( ndx < 0 ) throw new IllegalArgumentException( ModelspaceI18n.localize( urlNotFound, repositoryUrl ) ); metamodelRepositories.remove( ndx ); metamodelRepositories.add( Math.min( ndx + 1, metamodelRepositories.size() ), repositoryUrl ); saveMetamodelRepositories(); @@ -606,10 +606,10 @@ public URL[] moveMetamodelRepositoryDown( final URL repositoryUrl ) throws Model * @see MetamodelManager#moveMetamodelRepositoryUp(URL) */ @Override - public URL[] moveMetamodelRepositoryUp( final URL repositoryUrl ) throws ModelerException { + public URL[] moveMetamodelRepositoryUp( final URL repositoryUrl ) throws ModelspaceException { CheckArg.isNotNull( repositoryUrl, "repositoryUrl" ); final int ndx = metamodelRepositories.indexOf( repositoryUrl ); - if ( ndx < 0 ) throw new IllegalArgumentException( ModelerI18n.localize( urlNotFound, repositoryUrl ) ); + if ( ndx < 0 ) throw new IllegalArgumentException( ModelspaceI18n.localize( urlNotFound, repositoryUrl ) ); metamodelRepositories.remove( ndx ); metamodelRepositories.add( Math.max( ndx - 1, 0 ), repositoryUrl ); saveMetamodelRepositories(); @@ -629,7 +629,7 @@ private String path( final String prefix, * @see MetamodelManager#registerMetamodelRepository(URL) */ @Override - public URL[] registerMetamodelRepository( final URL repositoryUrl ) throws ModelerException { + public URL[] registerMetamodelRepository( final URL repositoryUrl ) throws ModelspaceException { CheckArg.isNotNull( repositoryUrl, "repositoryUrl" ); if ( !metamodelRepositories.contains( repositoryUrl ) ) { metamodelRepositories.addFirst( repositoryUrl ); @@ -638,8 +638,8 @@ public URL[] registerMetamodelRepository( final URL repositoryUrl ) throws Model return metamodelRepositories(); } - private void saveMetamodelRepositories() throws ModelerException { - modeler.run( this, new WriteSystemTask() { + private void saveMetamodelRepositories() throws ModelspaceException { + modelspace.run( this, new WriteSystemTask() { @Override public void run( final Session session, @@ -648,7 +648,7 @@ public void run( final Session session, int ndx = 0; for ( final URL url : metamodelRepositories ) vals[ ndx++ ] = session.getValueFactory().createValue( url.toString() ); - systemNode.setProperty( ModelerLexicon.METAMODEL_REPOSITORIES, vals ); + systemNode.setProperty( ModelspaceLexicon.METAMODEL_REPOSITORIES, vals ); } } ); } @@ -671,7 +671,7 @@ Importer sequencerImporter( final Session session, * @see MetamodelManager#uninstall(String) */ @Override - public void uninstall( final String category ) throws ModelerException { + public void uninstall( final String category ) throws ModelspaceException { CheckArg.isNotEmpty( category, "category" ); // delete from cache all metamodels of that category @@ -683,29 +683,29 @@ public void uninstall( final String category ) throws ModelerException { if ( category.equals( metamodel.category() ) ) { deleted = true; iter.remove(); - Modeler.LOGGER.debug( "Uninstalled metamodel '%s'", metamodel.id() ); + Modelspace.LOGGER.debug( "Uninstalled metamodel '%s'", metamodel.id() ); } } - if ( !deleted ) throw new ModelerException( unableToFindMetamodelCategory, category ); + if ( !deleted ) throw new ModelspaceException( unableToFindMetamodelCategory, category ); // delete from MS repository - modeler.run( this, new WriteSystemTask() { + modelspace.run( this, new WriteSystemTask() { @Override public void run( final Session session, final Node systemNode ) throws Exception { final Node categoryNode = categoryNode( category, systemNode, false ); - if ( categoryNode == null ) throw new ModelerException( unableToFindMetamodelCategory, category ); + if ( categoryNode == null ) throw new ModelspaceException( unableToFindMetamodelCategory, category ); // remove category archive paths from classpath - if ( categoryNode.hasNode( ModelerLexicon.Metamodel.Category.ARCHIVES ) ) { - final Node archivesNode = categoryNode.getNode( ModelerLexicon.Metamodel.Category.ARCHIVES ); + if ( categoryNode.hasNode( ModelspaceLexicon.Metamodel.Category.ARCHIVES ) ) { + final Node archivesNode = categoryNode.getNode( ModelspaceLexicon.Metamodel.Category.ARCHIVES ); for ( final NodeIterator iter = archivesNode.getNodes(); iter.hasNext(); ) { final Node archiveNode = iter.nextNode(); final Path archivePath = library.resolve( archiveNode.getName() ); - if ( !archivePath.toFile().delete() ) Modeler.LOGGER.debug( "Unable to delete jar: %s", archivePath ); + if ( !archivePath.toFile().delete() ) Modelspace.LOGGER.debug( "Unable to delete jar: %s", archivePath ); } } @@ -721,14 +721,14 @@ public void run( final Session session, * @see MetamodelManager#unregisterMetamodelRepository(URL) */ @Override - public URL[] unregisterMetamodelRepository( final URL repositoryUrl ) throws ModelerException { + public URL[] unregisterMetamodelRepository( final URL repositoryUrl ) throws ModelspaceException { CheckArg.isNotNull( repositoryUrl, "repositoryUrl" ); if ( metamodelRepositories.remove( repositoryUrl ) ) saveMetamodelRepositories(); return metamodelRepositories(); } - private String version() throws ModelerException { - return modeler.repository().getDescriptor( Repository.REP_VERSION_DESC ); + private String version() throws ModelspaceException { + return modelspace.repository().getDescriptor( Repository.REP_VERSION_DESC ); } class LibraryClassLoader extends URLClassLoader { diff --git a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/ModelImpl.java b/modelspace/modelspace-engine/src/main/java/org/modelspace/internal/ModelImpl.java similarity index 72% rename from modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/ModelImpl.java rename to modelspace/modelspace-engine/src/main/java/org/modelspace/internal/ModelImpl.java index a470899..f07c74a 100644 --- a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/ModelImpl.java +++ b/modelspace/modelspace-engine/src/main/java/org/modelspace/internal/ModelImpl.java @@ -21,7 +21,7 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler.internal; +package org.modelspace.internal; import java.net.URL; import java.util.ArrayList; @@ -37,65 +37,65 @@ import javax.jcr.Value; import javax.jcr.nodetype.NodeType; +import org.modelspace.Metamodel; +import org.modelspace.Model; +import org.modelspace.Modelspace; +import org.modelspace.ModelspaceException; +import org.modelspace.ModelspaceLexicon; +import org.modelspace.internal.task.TaskWithResult; +import org.modelspace.spi.Dependency; import org.modeshape.common.util.StringUtil; -import org.modeshape.modeler.Metamodel; -import org.modeshape.modeler.Model; -import org.modeshape.modeler.Modeler; -import org.modeshape.modeler.ModelerException; -import org.modeshape.modeler.ModelerLexicon; -import org.modeshape.modeler.internal.task.TaskWithResult; -import org.modeshape.modeler.spi.metamodel.Dependency; class ModelImpl extends ModelObjectImpl implements Model { private Set< Dependency > dependencies; /** - * @param modeler - * the modeler's modeler + * @param modelspace + * the modelspace's modelspace * @param modelPath * a path to a model */ - ModelImpl( final Modeler modeler, + ModelImpl( final Modelspace modelspace, final String modelPath ) { - super( modeler, modelPath, -1 ); + super( modelspace, modelPath, -1 ); } /** * {@inheritDoc} * - * @see org.modeshape.modeler.Model#allDependenciesExist() + * @see org.modelspace.Model#allDependenciesExist() */ @Override - public boolean allDependenciesExist() throws ModelerException { + public boolean allDependenciesExist() throws ModelspaceException { return missingDependencies().isEmpty(); } /** * {@inheritDoc} * - * @see org.modeshape.modeler.Model#dependencies() + * @see org.modelspace.Model#dependencies() */ @Override - public Set< Dependency > dependencies() throws ModelerException { + public Set< Dependency > dependencies() throws ModelspaceException { if ( this.dependencies == null ) { - this.dependencies = modeler.run( new TaskWithResult< Set< Dependency > >() { + this.dependencies = modelspace.run( new TaskWithResult< Set< Dependency > >() { @Override public Set< Dependency > run( final Session session ) throws Exception { final Node modelNode = session.getNode( absolutePath() ); - if ( modelNode.hasNode( ModelerLexicon.Model.DEPENDENCIES ) ) { - final NodeIterator itr = modelNode.getNode( ModelerLexicon.Model.DEPENDENCIES ).getNodes(); + if ( modelNode.hasNode( ModelspaceLexicon.Model.DEPENDENCIES ) ) { + final NodeIterator itr = modelNode.getNode( ModelspaceLexicon.Model.DEPENDENCIES ).getNodes(); final Set< Dependency > result = new HashSet<>( ( int ) itr.getSize() ); while ( itr.hasNext() ) { final Node dependencyNode = itr.nextNode(); // must have source references - if ( dependencyNode.hasProperty( ModelerLexicon.Dependency.SOURCE_REFERENCE_PROPERTY ) ) { + if ( dependencyNode.hasProperty( ModelspaceLexicon.Dependency.SOURCE_REFERENCE_PROPERTY ) ) { final Value[] values = - dependencyNode.getProperty( ModelerLexicon.Dependency.SOURCE_REFERENCE_PROPERTY ).getValues(); + dependencyNode.getProperty( ModelspaceLexicon.Dependency.SOURCE_REFERENCE_PROPERTY ).getValues(); final List< String > refs = new ArrayList<>( values.length ); for ( final Value value : values ) { @@ -105,8 +105,8 @@ public Set< Dependency > run( final Session session ) throws Exception { String dependencyPath = null; boolean exists = false; - if ( dependencyNode.hasProperty( ModelerLexicon.Dependency.PATH ) ) { - dependencyPath = dependencyNode.getProperty( ModelerLexicon.Dependency.PATH ).getString(); + if ( dependencyNode.hasProperty( ModelspaceLexicon.Dependency.PATH ) ) { + dependencyPath = dependencyNode.getProperty( ModelspaceLexicon.Dependency.PATH ).getString(); } if ( !StringUtil.isBlank( dependencyPath ) ) { @@ -115,7 +115,7 @@ public Set< Dependency > run( final Session session ) throws Exception { final Dependency dependency = new Dependency( dependencyPath, refs, exists ); result.add( dependency ); - } else throw new ModelerException( "A dependency node exists for '%s' but has no source references", + } else throw new ModelspaceException( "A dependency node exists for '%s' but has no source references", absolutePath() ); } @@ -133,17 +133,17 @@ public Set< Dependency > run( final Session session ) throws Exception { /** * {@inheritDoc} * - * @see org.modeshape.modeler.Model#externalLocation() + * @see org.modelspace.Model#externalLocation() */ @Override - public URL externalLocation() throws ModelerException { - return modeler.run( new TaskWithResult< URL >() { + public URL externalLocation() throws ModelspaceException { + return modelspace.run( new TaskWithResult< URL >() { @Override public URL run( final Session session ) throws Exception { final Node model = session.getNode( path ); - return model.hasProperty( ModelerLexicon.Model.EXTERNAL_LOCATION ) - ? new URL( model.getProperty( ModelerLexicon.Model.EXTERNAL_LOCATION ).getString() ) + return model.hasProperty( ModelspaceLexicon.Model.EXTERNAL_LOCATION ) + ? new URL( model.getProperty( ModelspaceLexicon.Model.EXTERNAL_LOCATION ).getString() ) : null; } } ); @@ -152,16 +152,16 @@ public URL run( final Session session ) throws Exception { /** * {@inheritDoc} * - * @see org.modeshape.modeler.Model#metamodel() + * @see org.modelspace.Model#metamodel() */ @Override - public Metamodel metamodel() throws ModelerException { - return modeler.run( new TaskWithResult< Metamodel >() { + public Metamodel metamodel() throws ModelspaceException { + return modelspace.run( new TaskWithResult< Metamodel >() { @Override public Metamodel run( final Session session ) throws Exception { - return modeler.metamodelManager().metamodel( session.getNode( path ) - .getProperty( ModelerLexicon.Model.METAMODEL ) + return modelspace.metamodelManager().metamodel( session.getNode( path ) + .getProperty( ModelspaceLexicon.Model.METAMODEL ) .getString() ); } } ); @@ -170,11 +170,11 @@ public Metamodel run( final Session session ) throws Exception { /** * {@inheritDoc} * - * @see org.modeshape.modeler.Model#missingDependencies() + * @see org.modelspace.Model#missingDependencies() */ @Override - public Set< Dependency > missingDependencies() throws ModelerException { - return modeler.run( new TaskWithResult< Set< Dependency > >() { + public Set< Dependency > missingDependencies() throws ModelspaceException { + return modelspace.run( new TaskWithResult< Set< Dependency > >() { @Override public Set< Dependency > run( final Session session ) throws Exception { @@ -213,7 +213,7 @@ void missingDependencies( final Dependency dependency, final Node kid = itr.nextNode(); if ( modelNode( kid ) ) { - final Model dependencyModel = new ModelImpl( this.modeler, dependency.path() ); + final Model dependencyModel = new ModelImpl( this.modelspace, dependency.path() ); missing.addAll( dependencyModel.missingDependencies() ); } } @@ -225,7 +225,7 @@ void missingDependencies( final Dependency dependency, /** * {@inheritDoc} * - * @see org.modeshape.modeler.internal.ModelObjectImpl#model() + * @see org.modelspace.internal.ModelObjectImpl#model() */ @Override public Model model() { @@ -235,18 +235,18 @@ public Model model() { /** * {@inheritDoc} * - * @see org.modeshape.modeler.internal.ModelObjectImpl#modeler() + * @see org.modelspace.internal.ModelObjectImpl#modelspace() */ @Override - public Modeler modeler() { - return super.modeler(); + public Modelspace modelspace() { + return super.modelspace(); } private boolean modelNode( final Node node ) throws Exception { assert ( node != null ); for ( final NodeType nodeType : node.getMixinNodeTypes() ) { - if ( ModelerLexicon.Model.MODEL_MIXIN.equals( nodeType.getName() ) ) { + if ( ModelspaceLexicon.Model.MODEL_MIXIN.equals( nodeType.getName() ) ) { return true; } } @@ -257,7 +257,7 @@ private boolean modelNode( final Node node ) throws Exception { /** * {@inheritDoc} * - * @see org.modeshape.modeler.internal.ModelObjectImpl#modelRelativePath() + * @see org.modelspace.internal.ModelObjectImpl#modelRelativePath() */ @Override public String modelRelativePath() { diff --git a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/ModelObjectImpl.java b/modelspace/modelspace-engine/src/main/java/org/modelspace/internal/ModelObjectImpl.java similarity index 77% rename from modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/ModelObjectImpl.java rename to modelspace/modelspace-engine/src/main/java/org/modelspace/internal/ModelObjectImpl.java index 5a87e3b..b8fff87 100644 --- a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/ModelObjectImpl.java +++ b/modelspace/modelspace-engine/src/main/java/org/modelspace/internal/ModelObjectImpl.java @@ -21,7 +21,7 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler.internal; +package org.modelspace.internal; import java.util.ArrayList; import java.util.List; @@ -44,23 +44,23 @@ import javax.jcr.nodetype.NoSuchNodeTypeException; import javax.jcr.nodetype.NodeType; +import org.modelspace.Descriptor; +import org.modelspace.Model; +import org.modelspace.ModelObject; +import org.modelspace.ModelProperty; +import org.modelspace.Modelspace; +import org.modelspace.ModelspaceException; +import org.modelspace.ModelspaceI18n; +import org.modelspace.ModelspaceLexicon; +import org.modelspace.internal.task.Task; +import org.modelspace.internal.task.TaskWithResult; +import org.modelspace.internal.task.WriteTask; +import org.modelspace.internal.task.WriteTaskWithResult; import org.modeshape.common.util.CheckArg; import org.modeshape.common.util.StringUtil; import org.modeshape.jcr.JcrLexicon; import org.modeshape.jcr.JcrNtLexicon; import org.modeshape.jcr.api.JcrTools; -import org.modeshape.modeler.Descriptor; -import org.modeshape.modeler.Model; -import org.modeshape.modeler.ModelObject; -import org.modeshape.modeler.ModelProperty; -import org.modeshape.modeler.Modeler; -import org.modeshape.modeler.ModelerException; -import org.modeshape.modeler.ModelerI18n; -import org.modeshape.modeler.ModelerLexicon; -import org.modeshape.modeler.internal.task.Task; -import org.modeshape.modeler.internal.task.TaskWithResult; -import org.modeshape.modeler.internal.task.WriteTask; -import org.modeshape.modeler.internal.task.WriteTaskWithResult; class ModelObjectImpl implements ModelObject { @@ -73,17 +73,17 @@ class ModelObjectImpl implements ModelObject { static final String UNABLE_TO_SET_SINGLE_VALUE_PROPERTY_WITH_MULTIPLE_VALUES = "Unable to set property '%s' of node '%s' because it is a single-valued property and an values were passed in."; - final ModelerImpl modeler; + final ModelspaceImpl modelspace; final String path; final int index; - ModelObjectImpl( final Modeler modeler, + ModelObjectImpl( final Modelspace modelspace, final String path, final int index ) { - CheckArg.isNotNull( modeler, "modeler" ); + CheckArg.isNotNull( modelspace, "modelspace" ); CheckArg.isNotEmpty( path, "path" ); - this.modeler = ( ModelerImpl ) modeler; + this.modelspace = ( ModelspaceImpl ) modelspace; this.path = path; this.index = index; } @@ -91,7 +91,7 @@ class ModelObjectImpl implements ModelObject { /** * {@inheritDoc} * - * @see org.modeshape.modeler.ModelObject#absolutePath() + * @see org.modelspace.ModelObject#absolutePath() */ @Override public String absolutePath() { @@ -101,25 +101,25 @@ public String absolutePath() { /** * {@inheritDoc} * - * @see org.modeshape.modeler.ModelObject#addChild(java.lang.String, java.lang.String[]) + * @see org.modelspace.ModelObject#addChild(java.lang.String, java.lang.String[]) */ @Override public ModelObject[] addChild( final String name, - final String... additionalNames ) throws ModelerException { + final String... additionalNames ) throws ModelspaceException { return addChildOfType( null, name, additionalNames ); } /** * {@inheritDoc} * - * @see org.modeshape.modeler.ModelObject#addChildOfType(java.lang.String, java.lang.String, java.util.Map) + * @see org.modelspace.ModelObject#addChildOfType(java.lang.String, java.lang.String, java.util.Map) */ @Override public ModelObject addChildOfType( final String primaryTypeId, final String name, - final Map< String, ? > valuesByProperty ) throws ModelerException { + final Map< String, ? > valuesByProperty ) throws ModelspaceException { CheckArg.isNotEmpty( name, "name" ); - return modeler.run( new WriteTaskWithResult< ModelObject >() { + return modelspace.run( new WriteTaskWithResult< ModelObject >() { @Override public ModelObject run( final Session session ) throws Exception { @@ -128,7 +128,7 @@ public ModelObject run( final Session session ) throws Exception { final Node node = session.getNode( path ).addNode( name, id ); setProperty( session, node, valuesByProperty ); session.save(); // To catch possible constraint violation due to invalid type - return new ModelObjectImpl( modeler, node.getPath(), node.getIndex() ); + return new ModelObjectImpl( modelspace, node.getPath(), node.getIndex() ); } catch ( final ConstraintViolationException | NoSuchNodeTypeException e ) { throw new IllegalArgumentException( e ); } @@ -139,14 +139,14 @@ public ModelObject run( final Session session ) throws Exception { /** * {@inheritDoc} * - * @see org.modeshape.modeler.ModelObject#addChildOfType(java.lang.String, java.lang.String, java.lang.String[]) + * @see org.modelspace.ModelObject#addChildOfType(java.lang.String, java.lang.String, java.lang.String[]) */ @Override public ModelObject[] addChildOfType( final String primaryTypeId, final String name, - final String... additionalNames ) throws ModelerException { + final String... additionalNames ) throws ModelspaceException { CheckArg.isNotEmpty( name, "name" ); - return modeler.run( new WriteTaskWithResult< ModelObject[] >() { + return modelspace.run( new WriteTaskWithResult< ModelObject[] >() { @Override public ModelObject[] run( final Session session ) throws Exception { @@ -157,7 +157,7 @@ public ModelObject[] run( final Session session ) throws Exception { try { { // create first new child final Node kidNode = node.addNode( name, id ); - final ModelObject newModelObject = new ModelObjectImpl( modeler, + final ModelObject newModelObject = new ModelObjectImpl( modelspace, kidNode.getPath(), kidNode.getIndex() ); newKids.add( newModelObject ); @@ -168,7 +168,7 @@ public ModelObject[] run( final Session session ) throws Exception { for ( final String additionalName : additionalNames ) { CheckArg.isNotEmpty( additionalName, "additionalName" ); final Node kidNode = node.addNode( additionalName, id ); - final ModelObject newModelObject = new ModelObjectImpl( modeler, + final ModelObject newModelObject = new ModelObjectImpl( modelspace, kidNode.getPath(), kidNode.getIndex() ); newKids.add( newModelObject ); @@ -188,13 +188,13 @@ public ModelObject[] run( final Session session ) throws Exception { /** * {@inheritDoc} * - * @see org.modeshape.modeler.ModelObject#addMixinType(java.lang.String, java.util.Map) + * @see org.modelspace.ModelObject#addMixinType(java.lang.String, java.util.Map) */ @Override public void addMixinType( final String typeId, - final Map< String, ? > valuesByProperty ) throws ModelerException { + final Map< String, ? > valuesByProperty ) throws ModelspaceException { CheckArg.isNotEmpty( typeId, "typeId" ); - modeler.run( new WriteTask() { + modelspace.run( new WriteTask() { @Override public void run( final Session session ) throws Exception { @@ -213,13 +213,13 @@ public void run( final Session session ) throws Exception { /** * {@inheritDoc} * - * @see org.modeshape.modeler.ModelObject#addMixinType(java.lang.String, java.lang.String[]) + * @see org.modelspace.ModelObject#addMixinType(java.lang.String, java.lang.String[]) */ @Override public void addMixinType( final String typeId, - final String... additionalTypeIds ) throws ModelerException { + final String... additionalTypeIds ) throws ModelspaceException { CheckArg.isNotEmpty( typeId, "typeId" ); - modeler.run( new WriteTask() { + modelspace.run( new WriteTask() { @Override public void run( final Session session ) throws Exception { @@ -242,17 +242,17 @@ public void run( final Session session ) throws Exception { /** * {@inheritDoc} * - * @see org.modeshape.modeler.ModelObject#child(java.lang.String) + * @see org.modelspace.ModelObject#child(java.lang.String) */ @Override - public ModelObject child( final String childName ) throws ModelerException { + public ModelObject child( final String childName ) throws ModelspaceException { CheckArg.isNotEmpty( childName, "childName" ); - return modeler.run( new TaskWithResult< ModelObject >() { + return modelspace.run( new TaskWithResult< ModelObject >() { @Override public ModelObject run( final Session session ) throws Exception { try { - return new ModelObjectImpl( modeler, session.getNode( path ).getNode( childName ).getPath(), 0 ); + return new ModelObjectImpl( modelspace, session.getNode( path ).getNode( childName ).getPath(), 0 ); } catch ( final PathNotFoundException e ) { return null; } @@ -263,21 +263,21 @@ public ModelObject run( final Session session ) throws Exception { /** * {@inheritDoc} * - * @see org.modeshape.modeler.ModelObject#childHasSameNameSiblings(java.lang.String) + * @see org.modelspace.ModelObject#childHasSameNameSiblings(java.lang.String) */ @Override - public boolean childHasSameNameSiblings( final String childName ) throws ModelerException { + public boolean childHasSameNameSiblings( final String childName ) throws ModelspaceException { return children( childName ).length > 1; } /** * {@inheritDoc} * - * @see org.modeshape.modeler.ModelObject#children() + * @see org.modelspace.ModelObject#children() */ @Override - public ModelObject[] children() throws ModelerException { - return modeler.run( new TaskWithResult< ModelObject[] >() { + public ModelObject[] children() throws ModelspaceException { + return modelspace.run( new TaskWithResult< ModelObject[] >() { @Override public ModelObject[] run( final Session session ) throws Exception { @@ -290,7 +290,7 @@ ModelObject[] children( final NodeIterator iterator ) throws Exception { final ModelObject[] children = new ModelObject[ ( int ) iterator.getSize() ]; for ( int ndx = 0; iterator.hasNext(); ndx++ ) { final Node child = iterator.nextNode(); - children[ ndx ] = new ModelObjectImpl( modeler, child.getPath(), child.getIndex() - 1 ); + children[ ndx ] = new ModelObjectImpl( modelspace, child.getPath(), child.getIndex() - 1 ); } return children; } @@ -298,12 +298,12 @@ ModelObject[] children( final NodeIterator iterator ) throws Exception { /** * {@inheritDoc} * - * @see org.modeshape.modeler.ModelObject#children(java.lang.String) + * @see org.modelspace.ModelObject#children(java.lang.String) */ @Override - public ModelObject[] children( final String childName ) throws ModelerException { + public ModelObject[] children( final String childName ) throws ModelspaceException { CheckArg.isNotEmpty( childName, "childName" ); - return modeler.run( new TaskWithResult< ModelObject[] >() { + return modelspace.run( new TaskWithResult< ModelObject[] >() { @Override public ModelObject[] run( final Session session ) throws Exception { @@ -315,18 +315,18 @@ public ModelObject[] run( final Session session ) throws Exception { /** * {@inheritDoc} * - * @see org.modeshape.modeler.ModelObject#childrenOfType(java.lang.String) + * @see org.modelspace.ModelObject#childrenOfType(java.lang.String) */ @Override - public ModelObject[] childrenOfType( final String primaryTypeId ) throws ModelerException { + public ModelObject[] childrenOfType( final String primaryTypeId ) throws ModelspaceException { CheckArg.isNotEmpty( primaryTypeId, "primaryTypeId" ); - return modeler.run( new TaskWithResult< ModelObject[] >() { + return modelspace.run( new TaskWithResult< ModelObject[] >() { /** * {@inheritDoc} * - * @see org.modeshape.modeler.internal.task.TaskWithResult#run(javax.jcr.Session) + * @see org.modelspace.internal.task.TaskWithResult#run(javax.jcr.Session) */ @Override public ModelObject[] run( final Session session ) throws Exception { @@ -368,12 +368,12 @@ public boolean equals( final Object object ) { /** * {@inheritDoc} * - * @see org.modeshape.modeler.ModelObject#hasChild(java.lang.String) + * @see org.modelspace.ModelObject#hasChild(java.lang.String) */ @Override - public boolean hasChild( final String childName ) throws ModelerException { + public boolean hasChild( final String childName ) throws ModelspaceException { CheckArg.isNotEmpty( childName, "childName" ); - return modeler.run( new TaskWithResult< Boolean >() { + return modelspace.run( new TaskWithResult< Boolean >() { @Override public Boolean run( final Session session ) throws Exception { @@ -385,11 +385,11 @@ public Boolean run( final Session session ) throws Exception { /** * {@inheritDoc} * - * @see org.modeshape.modeler.ModelObject#hasChildren() + * @see org.modelspace.ModelObject#hasChildren() */ @Override - public boolean hasChildren() throws ModelerException { - return modeler.run( new TaskWithResult< Boolean >() { + public boolean hasChildren() throws ModelspaceException { + return modelspace.run( new TaskWithResult< Boolean >() { @Override public Boolean run( final Session session ) throws Exception { @@ -411,22 +411,22 @@ public int hashCode() { /** * {@inheritDoc} * - * @see org.modeshape.modeler.ModelObject#hasProperties() + * @see org.modelspace.ModelObject#hasProperties() */ @Override - public boolean hasProperties() throws ModelerException { + public boolean hasProperties() throws ModelspaceException { return propertyNames().length > 0; } /** * {@inheritDoc} * - * @see org.modeshape.modeler.ModelObject#hasProperty(java.lang.String) + * @see org.modelspace.ModelObject#hasProperty(java.lang.String) */ @Override - public boolean hasProperty( final String propertyName ) throws ModelerException { + public boolean hasProperty( final String propertyName ) throws ModelspaceException { CheckArg.isNotEmpty( propertyName, "propertyName" ); - return modeler.run( new TaskWithResult< Boolean >() { + return modelspace.run( new TaskWithResult< Boolean >() { @Override public Boolean run( final Session session ) throws Exception { @@ -438,7 +438,7 @@ public Boolean run( final Session session ) throws Exception { /** * {@inheritDoc} * - * @see org.modeshape.modeler.ModelObject#index() + * @see org.modelspace.ModelObject#index() */ @Override public int index() { @@ -448,11 +448,11 @@ public int index() { /** * {@inheritDoc} * - * @see org.modeshape.modeler.ModelObject#mixinTypes() + * @see org.modelspace.ModelObject#mixinTypes() */ @Override - public Descriptor[] mixinTypes() throws ModelerException { - return modeler.run( new TaskWithResult< Descriptor[] >() { + public Descriptor[] mixinTypes() throws ModelspaceException { + return modelspace.run( new TaskWithResult< Descriptor[] >() { @Override public Descriptor[] run( final Session session ) throws Exception { @@ -462,7 +462,7 @@ public Descriptor[] run( final Session session ) throws Exception { int i = 0; for ( final NodeType nodeType : nodeTypes ) { - mixins[ i++ ] = new DescriptorImpl( modeler, nodeType.getName() ); + mixins[ i++ ] = new DescriptorImpl( modelspace, nodeType.getName() ); } return mixins; @@ -473,26 +473,26 @@ public Descriptor[] run( final Session session ) throws Exception { /** * {@inheritDoc} * - * @see org.modeshape.modeler.ModelObject#model() + * @see org.modelspace.ModelObject#model() */ @Override - public Model model() throws ModelerException { - return modeler.run( new TaskWithResult< Model >() { + public Model model() throws ModelspaceException { + return modelspace.run( new TaskWithResult< Model >() { @Override public Model run( final Session session ) throws Exception { - return new ModelImpl( modeler, modelNode( session ).getPath() ); + return new ModelImpl( modelspace, modelNode( session ).getPath() ); } } ); } - Modeler modeler() { - return this.modeler; + Modelspace modelspace() { + return this.modelspace; } Node modelNode( final Session session ) throws Exception { Node node = session.getNode( path ); - while ( !node.isNodeType( ModelerLexicon.Model.MODEL_MIXIN ) ) + while ( !node.isNodeType( ModelspaceLexicon.Model.MODEL_MIXIN ) ) node = node.getParent(); return node; } @@ -500,11 +500,11 @@ Node modelNode( final Session session ) throws Exception { /** * {@inheritDoc} * - * @see org.modeshape.modeler.ModelObject#modelRelativePath() + * @see org.modelspace.ModelObject#modelRelativePath() */ @Override - public String modelRelativePath() throws ModelerException { - return modeler.run( new TaskWithResult< String >() { + public String modelRelativePath() throws ModelspaceException { + return modelspace.run( new TaskWithResult< String >() { @Override public String run( final Session session ) throws Exception { @@ -516,11 +516,11 @@ public String run( final Session session ) throws Exception { /** * {@inheritDoc} * - * @see org.modeshape.modeler.ModelObject#name() + * @see org.modelspace.ModelObject#name() */ @Override - public String name() throws ModelerException { - return modeler.run( new TaskWithResult< String >() { + public String name() throws ModelspaceException { + return modelspace.run( new TaskWithResult< String >() { @Override public String run( final Session session ) throws Exception { @@ -532,16 +532,16 @@ public String run( final Session session ) throws Exception { /** * {@inheritDoc} * - * @see org.modeshape.modeler.ModelObject#primaryType() + * @see org.modelspace.ModelObject#primaryType() */ @Override - public Descriptor primaryType() throws ModelerException { - return modeler.run( new TaskWithResult< Descriptor >() { + public Descriptor primaryType() throws ModelspaceException { + return modelspace.run( new TaskWithResult< Descriptor >() { @Override public Descriptor run( final Session session ) throws Exception { final NodeType nodeType = session.getNode( path ).getPrimaryNodeType(); - return new DescriptorImpl( modeler, nodeType.getName() ); + return new DescriptorImpl( modelspace, nodeType.getName() ); } } ); } @@ -549,11 +549,11 @@ public Descriptor run( final Session session ) throws Exception { /** * {@inheritDoc} * - * @see org.modeshape.modeler.ModelObject#print() + * @see org.modelspace.ModelObject#print() */ @Override - public void print() throws ModelerException { - modeler.run( new Task() { + public void print() throws ModelspaceException { + modelspace.run( new Task() { @Override public void run( final Session session ) throws Exception { @@ -567,28 +567,28 @@ public void run( final Session session ) throws Exception { /** * {@inheritDoc} * - * @see org.modeshape.modeler.ModelObject#property(java.lang.String) + * @see org.modelspace.ModelObject#property(java.lang.String) */ @Override - public ModelProperty property( final String propertyName ) throws ModelerException { + public ModelProperty property( final String propertyName ) throws ModelspaceException { CheckArg.isNotEmpty( propertyName, "propertyName" ); - return modeler.run( new TaskWithResult< ModelProperty >() { + return modelspace.run( new TaskWithResult< ModelProperty >() { /** * {@inheritDoc} * - * @see org.modeshape.modeler.internal.task.TaskWithResult#run(javax.jcr.Session) + * @see org.modelspace.internal.task.TaskWithResult#run(javax.jcr.Session) */ @Override - public ModelProperty run( final Session session ) throws ModelerException { + public ModelProperty run( final Session session ) throws ModelspaceException { try { final Property jcrProperty = session.getNode( path ).getProperty( propertyName ); return new ModelPropertyImpl( ModelObjectImpl.this, jcrProperty ); } catch ( final PathNotFoundException e ) { return null; } catch ( final Exception e ) { - throw new ModelerException( e, ModelerI18n.localize( UNABLE_TO_FIND_PROPERTY, propertyName, path ) ); + throw new ModelspaceException( e, ModelspaceI18n.localize( UNABLE_TO_FIND_PROPERTY, propertyName, path ) ); } } } ); @@ -597,18 +597,18 @@ public ModelProperty run( final Session session ) throws ModelerException { /** * {@inheritDoc} * - * @see org.modeshape.modeler.ModelObject#propertyNames() + * @see org.modelspace.ModelObject#propertyNames() */ @Override - public String[] propertyNames() throws ModelerException { - return modeler.run( new TaskWithResult< String[] >() { + public String[] propertyNames() throws ModelspaceException { + return modelspace.run( new TaskWithResult< String[] >() { @Override public String[] run( final Session session ) throws Exception { final List< String > names = new ArrayList<>(); for ( final PropertyIterator iter = session.getNode( path ).getProperties(); iter.hasNext(); ) { final String name = iter.nextProperty().getName(); - if ( !name.startsWith( JcrLexicon.Namespace.PREFIX ) && !name.startsWith( ModelerLexicon.NAMESPACE_PREFIX ) ) + if ( !name.startsWith( JcrLexicon.Namespace.PREFIX ) && !name.startsWith( ModelspaceLexicon.NAMESPACE_PREFIX ) ) names.add( name ); } return names.toArray( new String[ names.size() ] ); @@ -619,24 +619,24 @@ public String[] run( final Session session ) throws Exception { /** * {@inheritDoc} * - * @see org.modeshape.modeler.ModelObject#removeChild(java.lang.String, java.lang.String[]) + * @see org.modelspace.ModelObject#removeChild(java.lang.String, java.lang.String[]) */ @Override public void removeChild( final String name, - final String... additionalNames ) throws ModelerException { + final String... additionalNames ) throws ModelspaceException { CheckArg.isNotEmpty( name, "name" ); - modeler.run( new WriteTask() { + modelspace.run( new WriteTask() { @Override public void run( final Session session ) throws Exception { final Node node = session.getNode( path ); if ( node.hasNode( name ) ) node.getNode( name ).remove(); - else throw new ModelerException( ModelerI18n.localize( UNABLE_TO_REMOVE_CHILD, name, path ) ); + else throw new ModelspaceException( ModelspaceI18n.localize( UNABLE_TO_REMOVE_CHILD, name, path ) ); for ( final String additionalName : additionalNames ) { if ( node.hasNode( additionalName ) ) node.getNode( additionalName ).remove(); - else throw new ModelerException( ModelerI18n.localize( UNABLE_TO_REMOVE_CHILD, additionalName, path ) ); + else throw new ModelspaceException( ModelspaceI18n.localize( UNABLE_TO_REMOVE_CHILD, additionalName, path ) ); } } } ); @@ -645,13 +645,13 @@ public void run( final Session session ) throws Exception { /** * {@inheritDoc} * - * @see org.modeshape.modeler.ModelObject#removeMixinType(java.lang.String, java.lang.String[]) + * @see org.modelspace.ModelObject#removeMixinType(java.lang.String, java.lang.String[]) */ @Override public void removeMixinType( final String typeId, - final String... additionalTypeIds ) throws ModelerException { + final String... additionalTypeIds ) throws ModelspaceException { CheckArg.isNotEmpty( typeId, "typeId" ); - modeler.run( new WriteTask() { + modelspace.run( new WriteTask() { @Override public void run( final Session session ) throws Exception { @@ -671,12 +671,12 @@ public void run( final Session session ) throws Exception { /** * {@inheritDoc} * - * @see org.modeshape.modeler.ModelObject#setMixinType(java.lang.String, java.util.Map) + * @see org.modelspace.ModelObject#setMixinType(java.lang.String, java.util.Map) */ @Override public void setMixinType( final String typeId, - final Map< String, ? > valuesByProperty ) throws ModelerException { - modeler.run( new WriteTask() { + final Map< String, ? > valuesByProperty ) throws ModelspaceException { + modelspace.run( new WriteTask() { @Override public void run( final Session session ) throws Exception { @@ -696,11 +696,11 @@ public void run( final Session session ) throws Exception { /** * {@inheritDoc} * - * @see org.modeshape.modeler.ModelObject#setMixinTypes(java.lang.String[]) + * @see org.modelspace.ModelObject#setMixinTypes(java.lang.String[]) */ @Override - public void setMixinTypes( final String... typeIds ) throws ModelerException { - modeler.run( new WriteTask() { + public void setMixinTypes( final String... typeIds ) throws ModelspaceException { + modelspace.run( new WriteTask() { @Override public void run( final Session session ) throws Exception { @@ -737,11 +737,11 @@ void setMultiValuedProperty( final Session session, /** * {@inheritDoc} * - * @see org.modeshape.modeler.ModelObject#setPrimaryType(java.lang.String) + * @see org.modelspace.ModelObject#setPrimaryType(java.lang.String) */ @Override - public void setPrimaryType( final String typeId ) throws ModelerException { - modeler.run( new WriteTask() { + public void setPrimaryType( final String typeId ) throws ModelspaceException { + modelspace.run( new WriteTask() { @Override public void run( final Session session ) throws Exception { @@ -759,12 +759,12 @@ public void run( final Session session ) throws Exception { /** * {@inheritDoc} * - * @see org.modeshape.modeler.ModelObject#setPrimaryType(java.lang.String, java.util.Map) + * @see org.modelspace.ModelObject#setPrimaryType(java.lang.String, java.util.Map) */ @Override public void setPrimaryType( final String typeId, - final Map< String, ? > valuesByProperty ) throws ModelerException { - modeler.run( new WriteTask() { + final Map< String, ? > valuesByProperty ) throws ModelspaceException { + modelspace.run( new WriteTask() { @Override public void run( final Session session ) throws Exception { @@ -805,7 +805,7 @@ void setProperty( final Session session, if ( exists ) { node.getProperty( name ).remove(); } else { - throw new ModelerException( ModelerI18n.localize( UNABLE_TO_REMOVE_PROPERTY_THAT_DOES_NOT_EXIST, + throw new ModelspaceException( ModelspaceI18n.localize( UNABLE_TO_REMOVE_PROPERTY_THAT_DOES_NOT_EXIST, name, node.getName() ) ); } @@ -822,7 +822,7 @@ void setProperty( final Session session, if ( multiple ) { property.remove(); } else { - throw new ModelerException( ModelerI18n.localize( UNABLE_TO_REMOVE_SINGLE_VALUE_PROPERTY_WITH_EMPTY_ARRAY, + throw new ModelspaceException( ModelspaceI18n.localize( UNABLE_TO_REMOVE_SINGLE_VALUE_PROPERTY_WITH_EMPTY_ARRAY, name, node.getName() ) ); } @@ -830,7 +830,7 @@ void setProperty( final Session session, if ( multiple ) { setMultiValuedProperty( session, node, factory, name, values, type ); } else { - throw new ModelerException( ModelerI18n.localize( UNABLE_TO_SET_SINGLE_VALUE_PROPERTY_WITH_MULTIPLE_VALUES, + throw new ModelspaceException( ModelspaceI18n.localize( UNABLE_TO_SET_SINGLE_VALUE_PROPERTY_WITH_MULTIPLE_VALUES, name, node.getName() ) ); } @@ -845,7 +845,7 @@ void setProperty( final Session session, } else { // property does not exist and no values being set if ( count == 0 ) { - throw new ModelerException( ModelerI18n.localize( UNABLE_TO_REMOVE_PROPERTY_THAT_DOES_NOT_EXIST, + throw new ModelspaceException( ModelspaceI18n.localize( UNABLE_TO_REMOVE_PROPERTY_THAT_DOES_NOT_EXIST, name, node.getName() ) ); } @@ -865,19 +865,19 @@ void setProperty( final Session session, /** * {@inheritDoc} * - * @see org.modeshape.modeler.ModelObject#setProperty(java.lang.String, java.lang.Object[]) + * @see org.modelspace.ModelObject#setProperty(java.lang.String, java.lang.Object[]) */ @Override public void setProperty( final String name, - final Object... values ) throws ModelerException { + final Object... values ) throws ModelspaceException { CheckArg.isNotEmpty( name, "name" ); - modeler.run( new WriteTask() { + modelspace.run( new WriteTask() { /** * {@inheritDoc} * - * @see org.modeshape.modeler.internal.task.WriteTask#run(javax.jcr.Session) + * @see org.modelspace.internal.task.WriteTask#run(javax.jcr.Session) */ @Override public void run( final Session session ) throws Exception { diff --git a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/ModelPropertyImpl.java b/modelspace/modelspace-engine/src/main/java/org/modelspace/internal/ModelPropertyImpl.java similarity index 77% rename from modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/ModelPropertyImpl.java rename to modelspace/modelspace-engine/src/main/java/org/modelspace/internal/ModelPropertyImpl.java index e92ab8b..02cb15b 100644 --- a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/ModelPropertyImpl.java +++ b/modelspace/modelspace-engine/src/main/java/org/modelspace/internal/ModelPropertyImpl.java @@ -21,7 +21,7 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler.internal; +package org.modelspace.internal; import java.math.BigDecimal; import java.text.DateFormat; @@ -36,13 +36,13 @@ import javax.jcr.Value; import javax.jcr.ValueFactory; +import org.modelspace.ModelProperty; +import org.modelspace.ModelspaceException; +import org.modelspace.ModelspaceI18n; +import org.modelspace.PropertyDescriptor; +import org.modelspace.internal.task.TaskWithResult; +import org.modelspace.internal.task.WriteTask; import org.modeshape.common.util.CheckArg; -import org.modeshape.modeler.ModelProperty; -import org.modeshape.modeler.ModelerException; -import org.modeshape.modeler.ModelerI18n; -import org.modeshape.modeler.PropertyDescriptor; -import org.modeshape.modeler.internal.task.TaskWithResult; -import org.modeshape.modeler.internal.task.WriteTask; /** * The base class for a {@link ModelProperty model property}. @@ -59,11 +59,11 @@ public class ModelPropertyImpl implements ModelProperty { * @param propertyType * the required type of the property * @return the Object representation of the JCR value (never null) - * @throws ModelerException + * @throws ModelspaceException * if an error occurs */ static Object convert( final Value value, - final int propertyType ) throws ModelerException { + final int propertyType ) throws ModelspaceException { try { switch ( propertyType ) { case PropertyType.BOOLEAN: @@ -80,7 +80,7 @@ static Object convert( final Value value, return value.toString(); } } catch ( final Exception e ) { - throw new ModelerException( e, ModelerI18n.localize( UNABLE_TO_CONVERT_VALUE, propertyType ) ); + throw new ModelspaceException( e, ModelspaceI18n.localize( UNABLE_TO_CONVERT_VALUE, propertyType ) ); } } @@ -193,11 +193,11 @@ static Value[] createValues( final ValueFactory factory, * the property's parent (cannot be null) * @param jcrProperty * the JCR property (cannot be null) - * @throws ModelerException + * @throws ModelspaceException * if there is an error constructing the property */ ModelPropertyImpl( final ModelObjectImpl parent, - final Property jcrProperty ) throws ModelerException { + final Property jcrProperty ) throws ModelspaceException { CheckArg.isNotNull( parent, "parent" ); CheckArg.isNotNull( jcrProperty, "jcrProperty" ); @@ -206,23 +206,23 @@ static Value[] createValues( final ValueFactory factory, try { this.path = jcrProperty.getPath(); } catch ( final Exception e ) { - throw new ModelerException( e, ModelerI18n.localize( UNABLE_TO_CONSTRUCT_PROPERTY, this.parent.name() ) ); + throw new ModelspaceException( e, ModelspaceI18n.localize( UNABLE_TO_CONSTRUCT_PROPERTY, this.parent.name() ) ); } } /** * {@inheritDoc} * - * @see org.modeshape.modeler.ModelProperty#booleanValue() + * @see org.modelspace.ModelProperty#booleanValue() */ @Override - public boolean booleanValue() throws ModelerException { - return modeler().run( new TaskWithResult< Boolean >() { + public boolean booleanValue() throws ModelspaceException { + return modelspace().run( new TaskWithResult< Boolean >() { /** * {@inheritDoc} * - * @see org.modeshape.modeler.internal.task.TaskWithResult#run(javax.jcr.Session) + * @see org.modelspace.internal.task.TaskWithResult#run(javax.jcr.Session) */ @Override public Boolean run( final Session session ) throws Exception { @@ -234,16 +234,16 @@ public Boolean run( final Session session ) throws Exception { /** * {@inheritDoc} * - * @see org.modeshape.modeler.ModelProperty#booleanValues() + * @see org.modelspace.ModelProperty#booleanValues() */ @Override - public boolean[] booleanValues() throws ModelerException { - return modeler().run( new TaskWithResult< boolean[] >() { + public boolean[] booleanValues() throws ModelspaceException { + return modelspace().run( new TaskWithResult< boolean[] >() { /** * {@inheritDoc} * - * @see org.modeshape.modeler.internal.task.TaskWithResult#run(javax.jcr.Session) + * @see org.modelspace.internal.task.TaskWithResult#run(javax.jcr.Session) */ @Override public boolean[] run( final Session session ) throws Exception { @@ -269,16 +269,16 @@ public boolean[] run( final Session session ) throws Exception { /** * {@inheritDoc} * - * @see org.modeshape.modeler.ModelProperty#dateValue() + * @see org.modelspace.ModelProperty#dateValue() */ @Override - public Calendar dateValue() throws ModelerException { - return modeler().run( new TaskWithResult< Calendar >() { + public Calendar dateValue() throws ModelspaceException { + return modelspace().run( new TaskWithResult< Calendar >() { /** * {@inheritDoc} * - * @see org.modeshape.modeler.internal.task.TaskWithResult#run(javax.jcr.Session) + * @see org.modelspace.internal.task.TaskWithResult#run(javax.jcr.Session) */ @Override public Calendar run( final Session session ) throws Exception { @@ -290,16 +290,16 @@ public Calendar run( final Session session ) throws Exception { /** * {@inheritDoc} * - * @see org.modeshape.modeler.ModelProperty#dateValues() + * @see org.modelspace.ModelProperty#dateValues() */ @Override - public Calendar[] dateValues() throws ModelerException { - return modeler().run( new TaskWithResult< Calendar[] >() { + public Calendar[] dateValues() throws ModelspaceException { + return modelspace().run( new TaskWithResult< Calendar[] >() { /** * {@inheritDoc} * - * @see org.modeshape.modeler.internal.task.TaskWithResult#run(javax.jcr.Session) + * @see org.modelspace.internal.task.TaskWithResult#run(javax.jcr.Session) */ @Override public Calendar[] run( final Session session ) throws Exception { @@ -325,16 +325,16 @@ public Calendar[] run( final Session session ) throws Exception { /** * {@inheritDoc} * - * @see org.modeshape.modeler.ModelProperty#decimalValue() + * @see org.modelspace.ModelProperty#decimalValue() */ @Override - public BigDecimal decimalValue() throws ModelerException { - return modeler().run( new TaskWithResult< BigDecimal >() { + public BigDecimal decimalValue() throws ModelspaceException { + return modelspace().run( new TaskWithResult< BigDecimal >() { /** * {@inheritDoc} * - * @see org.modeshape.modeler.internal.task.TaskWithResult#run(javax.jcr.Session) + * @see org.modelspace.internal.task.TaskWithResult#run(javax.jcr.Session) */ @Override public BigDecimal run( final Session session ) throws Exception { @@ -346,16 +346,16 @@ public BigDecimal run( final Session session ) throws Exception { /** * {@inheritDoc} * - * @see org.modeshape.modeler.ModelProperty#decimalValues() + * @see org.modelspace.ModelProperty#decimalValues() */ @Override - public BigDecimal[] decimalValues() throws ModelerException { - return modeler().run( new TaskWithResult< BigDecimal[] >() { + public BigDecimal[] decimalValues() throws ModelspaceException { + return modelspace().run( new TaskWithResult< BigDecimal[] >() { /** * {@inheritDoc} * - * @see org.modeshape.modeler.internal.task.TaskWithResult#run(javax.jcr.Session) + * @see org.modelspace.internal.task.TaskWithResult#run(javax.jcr.Session) */ @Override public BigDecimal[] run( final Session session ) throws Exception { @@ -381,16 +381,16 @@ public BigDecimal[] run( final Session session ) throws Exception { /** * {@inheritDoc} * - * @see org.modeshape.modeler.ModelProperty#descriptor() + * @see org.modelspace.ModelProperty#descriptor() */ @Override - public PropertyDescriptor descriptor() throws ModelerException { - return modeler().run( new TaskWithResult< PropertyDescriptor >() { + public PropertyDescriptor descriptor() throws ModelspaceException { + return modelspace().run( new TaskWithResult< PropertyDescriptor >() { /** * {@inheritDoc} * - * @see org.modeshape.modeler.internal.task.TaskWithResult#run(javax.jcr.Session) + * @see org.modelspace.internal.task.TaskWithResult#run(javax.jcr.Session) */ @Override public PropertyDescriptor run( final Session session ) throws Exception { @@ -403,16 +403,16 @@ public PropertyDescriptor run( final Session session ) throws Exception { /** * {@inheritDoc} * - * @see org.modeshape.modeler.ModelProperty#doubleValue() + * @see org.modelspace.ModelProperty#doubleValue() */ @Override - public double doubleValue() throws ModelerException { - return modeler().run( new TaskWithResult< Double >() { + public double doubleValue() throws ModelspaceException { + return modelspace().run( new TaskWithResult< Double >() { /** * {@inheritDoc} * - * @see org.modeshape.modeler.internal.task.TaskWithResult#run(javax.jcr.Session) + * @see org.modelspace.internal.task.TaskWithResult#run(javax.jcr.Session) */ @Override public Double run( final Session session ) throws Exception { @@ -424,16 +424,16 @@ public Double run( final Session session ) throws Exception { /** * {@inheritDoc} * - * @see org.modeshape.modeler.ModelProperty#doubleValues() + * @see org.modelspace.ModelProperty#doubleValues() */ @Override - public double[] doubleValues() throws ModelerException { - return modeler().run( new TaskWithResult< double[] >() { + public double[] doubleValues() throws ModelspaceException { + return modelspace().run( new TaskWithResult< double[] >() { /** * {@inheritDoc} * - * @see org.modeshape.modeler.internal.task.TaskWithResult#run(javax.jcr.Session) + * @see org.modelspace.internal.task.TaskWithResult#run(javax.jcr.Session) */ @Override public double[] run( final Session session ) throws Exception { @@ -459,16 +459,16 @@ public double[] run( final Session session ) throws Exception { /** * {@inheritDoc} * - * @see org.modeshape.modeler.ModelProperty#longValue() + * @see org.modelspace.ModelProperty#longValue() */ @Override - public long longValue() throws ModelerException { - return modeler().run( new TaskWithResult< Long >() { + public long longValue() throws ModelspaceException { + return modelspace().run( new TaskWithResult< Long >() { /** * {@inheritDoc} * - * @see org.modeshape.modeler.internal.task.TaskWithResult#run(javax.jcr.Session) + * @see org.modelspace.internal.task.TaskWithResult#run(javax.jcr.Session) */ @Override public Long run( final Session session ) throws Exception { @@ -480,16 +480,16 @@ public Long run( final Session session ) throws Exception { /** * {@inheritDoc} * - * @see org.modeshape.modeler.ModelProperty#longValues() + * @see org.modelspace.ModelProperty#longValues() */ @Override - public long[] longValues() throws ModelerException { - return modeler().run( new TaskWithResult< long[] >() { + public long[] longValues() throws ModelspaceException { + return modelspace().run( new TaskWithResult< long[] >() { /** * {@inheritDoc} * - * @see org.modeshape.modeler.internal.task.TaskWithResult#run(javax.jcr.Session) + * @see org.modelspace.internal.task.TaskWithResult#run(javax.jcr.Session) */ @Override public long[] run( final Session session ) throws Exception { @@ -512,23 +512,23 @@ public long[] run( final Session session ) throws Exception { } ); } - ModelerImpl modeler() { - return this.parent.modeler; + ModelspaceImpl modelspace() { + return this.parent.modelspace; } /** * {@inheritDoc} * - * @see org.modeshape.modeler.ModelProperty#set(java.lang.Object[]) + * @see org.modelspace.ModelProperty#set(java.lang.Object[]) */ @Override - public void set( final Object... values ) throws ModelerException { - modeler().run( new WriteTask() { + public void set( final Object... values ) throws ModelspaceException { + modelspace().run( new WriteTask() { /** * {@inheritDoc} * - * @see org.modeshape.modeler.internal.task.WriteTask#run(javax.jcr.Session) + * @see org.modelspace.internal.task.WriteTask#run(javax.jcr.Session) */ @Override public void run( final Session session ) throws Exception { @@ -547,7 +547,7 @@ public void run( final Session session ) throws Exception { property.remove(); } else { // single-valued property - throw new ModelerException( ModelerI18n.localize( ModelObjectImpl.UNABLE_TO_REMOVE_SINGLE_VALUE_PROPERTY_WITH_EMPTY_ARRAY, + throw new ModelspaceException( ModelspaceI18n.localize( ModelObjectImpl.UNABLE_TO_REMOVE_SINGLE_VALUE_PROPERTY_WITH_EMPTY_ARRAY, path, parent.name() ) ); } @@ -555,7 +555,7 @@ public void run( final Session session ) throws Exception { if ( multiple ) { property.setValue( createValues( session.getValueFactory(), values, type ) ); } else { - throw new ModelerException( ModelerI18n.localize( ModelObjectImpl.UNABLE_TO_SET_SINGLE_VALUE_PROPERTY_WITH_MULTIPLE_VALUES, + throw new ModelspaceException( ModelspaceI18n.localize( ModelObjectImpl.UNABLE_TO_SET_SINGLE_VALUE_PROPERTY_WITH_MULTIPLE_VALUES, property.getName(), parent.name() ) ); } @@ -575,16 +575,16 @@ public void run( final Session session ) throws Exception { /** * {@inheritDoc} * - * @see org.modeshape.modeler.ModelProperty#stringValue() + * @see org.modelspace.ModelProperty#stringValue() */ @Override - public String stringValue() throws ModelerException { - return modeler().run( new TaskWithResult< String >() { + public String stringValue() throws ModelspaceException { + return modelspace().run( new TaskWithResult< String >() { /** * {@inheritDoc} * - * @see org.modeshape.modeler.internal.task.TaskWithResult#run(javax.jcr.Session) + * @see org.modelspace.internal.task.TaskWithResult#run(javax.jcr.Session) */ @Override public String run( final Session session ) throws Exception { @@ -596,16 +596,16 @@ public String run( final Session session ) throws Exception { /** * {@inheritDoc} * - * @see org.modeshape.modeler.ModelProperty#stringValues() + * @see org.modelspace.ModelProperty#stringValues() */ @Override - public String[] stringValues() throws ModelerException { - return modeler().run( new TaskWithResult< String[] >() { + public String[] stringValues() throws ModelspaceException { + return modelspace().run( new TaskWithResult< String[] >() { /** * {@inheritDoc} * - * @see org.modeshape.modeler.internal.task.TaskWithResult#run(javax.jcr.Session) + * @see org.modelspace.internal.task.TaskWithResult#run(javax.jcr.Session) */ @Override public String[] run( final Session session ) throws Exception { @@ -641,16 +641,16 @@ public String toString() { /** * {@inheritDoc} * - * @see org.modeshape.modeler.ModelProperty#value() + * @see org.modelspace.ModelProperty#value() */ @Override - public Object value() throws ModelerException { - return modeler().run( new TaskWithResult< Object >() { + public Object value() throws ModelspaceException { + return modelspace().run( new TaskWithResult< Object >() { /** * {@inheritDoc} * - * @see org.modeshape.modeler.internal.task.TaskWithResult#run(javax.jcr.Session) + * @see org.modelspace.internal.task.TaskWithResult#run(javax.jcr.Session) */ @Override public Object run( final Session session ) throws Exception { @@ -666,16 +666,16 @@ public Object run( final Session session ) throws Exception { /** * {@inheritDoc} * - * @see org.modeshape.modeler.ModelProperty#values() + * @see org.modelspace.ModelProperty#values() */ @Override - public Object[] values() throws ModelerException { - return modeler().run( new TaskWithResult< Object[] >() { + public Object[] values() throws ModelspaceException { + return modelspace().run( new TaskWithResult< Object[] >() { /** * {@inheritDoc} * - * @see org.modeshape.modeler.internal.task.TaskWithResult#run(javax.jcr.Session) + * @see org.modelspace.internal.task.TaskWithResult#run(javax.jcr.Session) */ @Override public Object[] run( final Session session ) throws Exception { diff --git a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/ModelerImpl.java b/modelspace/modelspace-engine/src/main/java/org/modelspace/internal/ModelspaceImpl.java similarity index 75% rename from modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/ModelerImpl.java rename to modelspace/modelspace-engine/src/main/java/org/modelspace/internal/ModelspaceImpl.java index b1bf511..8dc3906 100644 --- a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/ModelerImpl.java +++ b/modelspace/modelspace-engine/src/main/java/org/modelspace/internal/ModelspaceImpl.java @@ -21,7 +21,7 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler.internal; +package org.modelspace.internal; import java.io.File; import java.io.FileNotFoundException; @@ -39,6 +39,22 @@ import javax.jcr.RepositoryException; import javax.jcr.Session; +import org.modelspace.Metamodel; +import org.modelspace.MetamodelManager; +import org.modelspace.Model; +import org.modelspace.Modelspace; +import org.modelspace.ModelspaceException; +import org.modelspace.ModelspaceI18n; +import org.modelspace.ModelspaceLexicon; +import org.modelspace.internal.task.SystemTask; +import org.modelspace.internal.task.SystemTaskWithResult; +import org.modelspace.internal.task.Task; +import org.modelspace.internal.task.TaskWithResult; +import org.modelspace.internal.task.WriteSystemTask; +import org.modelspace.internal.task.WriteTask; +import org.modelspace.internal.task.WriteTaskWithResult; +import org.modelspace.spi.DependencyProcessor; +import org.modelspace.spi.Exporter; import org.modeshape.common.collection.Problem; import org.modeshape.common.collection.Problems; import org.modeshape.common.util.CheckArg; @@ -50,27 +66,11 @@ import org.modeshape.jcr.api.JcrTools; import org.modeshape.jcr.api.ValueFactory; import org.modeshape.jcr.api.sequencer.Sequencer; -import org.modeshape.modeler.Metamodel; -import org.modeshape.modeler.MetamodelManager; -import org.modeshape.modeler.Model; -import org.modeshape.modeler.Modeler; -import org.modeshape.modeler.ModelerException; -import org.modeshape.modeler.ModelerI18n; -import org.modeshape.modeler.ModelerLexicon; -import org.modeshape.modeler.internal.task.SystemTask; -import org.modeshape.modeler.internal.task.SystemTaskWithResult; -import org.modeshape.modeler.internal.task.Task; -import org.modeshape.modeler.internal.task.TaskWithResult; -import org.modeshape.modeler.internal.task.WriteSystemTask; -import org.modeshape.modeler.internal.task.WriteTask; -import org.modeshape.modeler.internal.task.WriteTaskWithResult; -import org.modeshape.modeler.spi.metamodel.DependencyProcessor; -import org.modeshape.modeler.spi.metamodel.Exporter; /** * */ -public class ModelerImpl implements Modeler { +public class ModelspaceImpl implements Modelspace { private static final String EXISTING_MODEL_HAS_WRONG_METAMODEL_TYPE = "Existing model at '%s' did not have metamodel type of '%s."; @@ -84,7 +84,7 @@ public class ModelerImpl implements Modeler { /** * */ - public static final String REPOSITORY_STORE_PARENT_PATH_PROPERTY = "org.modeshape.modeler.repositoryStoreParentPath"; + public static final String REPOSITORY_STORE_PARENT_PATH_PROPERTY = "org.modelspace.repositoryStoreParentPath"; private ModeShapeEngine engine; private JcrRepository repository; @@ -97,7 +97,7 @@ public class ModelerImpl implements Modeler { * @param repositoryStoreParentPath * the path to the folder that should contain the repository store */ - public ModelerImpl( final String repositoryStoreParentPath ) { + public ModelspaceImpl( final String repositoryStoreParentPath ) { this( repositoryStoreParentPath, DEFAULT_CONFIGURATION_PATH ); } @@ -107,7 +107,7 @@ public ModelerImpl( final String repositoryStoreParentPath ) { * @param configurationPath * the path to a configuration file */ - public ModelerImpl( final String repositoryStoreParentPath, + public ModelspaceImpl( final String repositoryStoreParentPath, final String configurationPath ) { CheckArg.isNotEmpty( repositoryStoreParentPath, "repositoryStoreParentPath" ); CheckArg.isNotEmpty( configurationPath, "configurationPath" ); @@ -135,19 +135,19 @@ private String absolutePath( String path, * @see AutoCloseable#close() */ @Override - public void close() throws ModelerException { + public void close() throws ModelspaceException { try { if ( engine != null ) engine.shutdown().get(); } catch ( InterruptedException | ExecutionException e ) { - throw new ModelerException( e, "Unable to shutdown modeler engine" ); + throw new ModelspaceException( e, "Unable to shutdown modelspace engine" ); } - Modeler.LOGGER.info( "Modeler stopped" ); + Modelspace.LOGGER.info( "Modelspace stopped" ); } /** * {@inheritDoc} * - * @see Modeler#configurationPath() + * @see Modelspace#configurationPath() */ @Override public String configurationPath() { @@ -166,16 +166,16 @@ Node dataNode( final Session session, /** * {@inheritDoc} * - * @see org.modeshape.modeler.Modeler#deleteModel(java.lang.String) + * @see org.modelspace.Modelspace#deleteModel(java.lang.String) */ @Override - public boolean deleteModel( final String path ) throws ModelerException { + public boolean deleteModel( final String path ) throws ModelspaceException { return run( new WriteTaskWithResult< Boolean >() { /** * {@inheritDoc} * - * @see org.modeshape.modeler.internal.task.WriteTaskWithResult#run(javax.jcr.Session) + * @see org.modelspace.internal.task.WriteTaskWithResult#run(javax.jcr.Session) */ @Override public Boolean run( final Session session ) throws Exception { @@ -184,8 +184,8 @@ public Boolean run( final Session session ) throws Exception { if ( session.nodeExists( absPath ) ) { final Node node = session.getNode( absPath ); - if ( !node.isNodeType( ModelerLexicon.Model.MODEL_MIXIN ) ) { - throw new IllegalArgumentException( ModelerI18n.localize( NOT_MODEL_PATH, absPath ) ); + if ( !node.isNodeType( ModelspaceLexicon.Model.MODEL_MIXIN ) ) { + throw new IllegalArgumentException( ModelspaceI18n.localize( NOT_MODEL_PATH, absPath ) ); } return true; @@ -199,28 +199,28 @@ public Boolean run( final Session session ) throws Exception { /** * {@inheritDoc} * - * @see Modeler#export(Model, File) + * @see Modelspace#export(Model, File) */ @Override public void export( final Model model, - final File file ) throws ModelerException { + final File file ) throws ModelspaceException { CheckArg.isNotNull( model, "model" ); CheckArg.isNotNull( file, "file" ); try { export( model, new FileOutputStream( file ) ); } catch ( final FileNotFoundException e ) { - throw new ModelerException( e, "Unable to export \"%s\" to \"%s\"", model, file ); + throw new ModelspaceException( e, "Unable to export \"%s\" to \"%s\"", model, file ); } } /** * {@inheritDoc} * - * @see Modeler#export(Model, OutputStream) + * @see Modelspace#export(Model, OutputStream) */ @Override public void export( final Model model, - final OutputStream stream ) throws ModelerException { + final OutputStream stream ) throws ModelspaceException { CheckArg.isNotNull( model, "model" ); CheckArg.isNotNull( stream, "stream" ); @@ -234,46 +234,46 @@ public void export( final Model model, } } - throw new ModelerException( "Model '%s' cannot be exported since an exporter was not found", model.name() ); + throw new ModelspaceException( "Model '%s' cannot be exported since an exporter was not found", model.name() ); } /** * {@inheritDoc} * - * @see Modeler#export(Model, URL) + * @see Modelspace#export(Model, URL) */ @Override public void export( final Model model, - final URL url ) throws ModelerException { + final URL url ) throws ModelspaceException { CheckArg.isNotNull( model, "model" ); CheckArg.isNotNull( url, "url" ); try ( OutputStream stream = url.openConnection().getOutputStream() ) { export( model, stream ); } catch ( final IOException e ) { - throw new ModelerException( e, "Unable to export \"%s\" to \"%s\"", model, url ); + throw new ModelspaceException( e, "Unable to export \"%s\" to \"%s\"", model, url ); } } /** * {@inheritDoc} * - * @see Modeler#generateModel(String, String) + * @see Modelspace#generateModel(String, String) */ @Override public Model generateModel( final String dataPath, - final String modelPath ) throws ModelerException { + final String modelPath ) throws ModelspaceException { return generateModel( dataPath, modelPath, null, true ); } /** * {@inheritDoc} * - * @see Modeler#generateModel(String, String, Metamodel) + * @see Modelspace#generateModel(String, String, Metamodel) */ @Override public Model generateModel( final String dataPath, final String modelPath, - final Metamodel metamodel ) throws ModelerException { + final Metamodel metamodel ) throws ModelspaceException { return generateModel( dataPath, modelPath, metamodel, true ); } @@ -287,13 +287,13 @@ public Model generateModel( final String dataPath, * @param persistArtifact * true if the data should be persisted after import * @return the model - * @throws ModelerException + * @throws ModelspaceException * if an error occurs */ public Model generateModel( final String dataPath, final String modelPath, final Metamodel metamodel, - final boolean persistArtifact ) throws ModelerException { + final boolean persistArtifact ) throws ModelspaceException { CheckArg.isNotEmpty( dataPath, "dataPath" ); CheckArg.isNotEmpty( modelPath, "modelPath" ); @@ -309,7 +309,7 @@ public Model run( final Session session ) throws Exception { final MetamodelManagerImpl manager = ( MetamodelManagerImpl ) metamodelManager(); actualMetamodel = manager.defaultMetamodel( dataNode, manager.metamodels( dataNode ) ); if ( actualMetamodel == null ) - throw new IllegalArgumentException( ModelerI18n.localize( "Unable to determine default metamodel for file %s", + throw new IllegalArgumentException( ModelspaceI18n.localize( "Unable to determine default metamodel for file %s", dataPath ) ); throw new UnsupportedOperationException( "Not yet implemented" ); } @@ -317,10 +317,10 @@ public Model run( final Session session ) throws Exception { final ValueFactory valueFactory = ( ValueFactory ) session.getValueFactory(); final Calendar cal = Calendar.getInstance(); final Node modelNode = new JcrTools().findOrCreateNode( session, absolutePath( modelPath ) ); - modelNode.addMixin( ModelerLexicon.Model.MODEL_MIXIN ); - if ( dataNode.hasProperty( ModelerLexicon.Model.EXTERNAL_LOCATION ) ) - modelNode.setProperty( ModelerLexicon.Model.EXTERNAL_LOCATION, - dataNode.getProperty( ModelerLexicon.Model.EXTERNAL_LOCATION ).getString() ); + modelNode.addMixin( ModelspaceLexicon.Model.MODEL_MIXIN ); + if ( dataNode.hasProperty( ModelspaceLexicon.Model.EXTERNAL_LOCATION ) ) + modelNode.setProperty( ModelspaceLexicon.Model.EXTERNAL_LOCATION, + dataNode.getProperty( ModelspaceLexicon.Model.EXTERNAL_LOCATION ).getString() ); final SequencerImporter importer = ( SequencerImporter ) actualMetamodel.importer(); final boolean save = importer.execute( dataNode.getNode( JcrLexicon.CONTENT.getString() ) .getProperty( JcrLexicon.DATA.getString() ), @@ -339,14 +339,14 @@ public ValueFactory valueFactory() { } ); if ( save ) { - modelNode.setProperty( ModelerLexicon.Model.METAMODEL, actualMetamodel.id() ); - final ModelImpl model = new ModelImpl( ModelerImpl.this, modelNode.getPath() ); + modelNode.setProperty( ModelspaceLexicon.Model.METAMODEL, actualMetamodel.id() ); + final ModelImpl model = new ModelImpl( ModelspaceImpl.this, modelNode.getPath() ); session.save(); processDependencies( dataPath, modelNode, model, persistArtifact ); return model; } - throw new ModelerException( "Unable to create %s model \"%s\" from data at \"%s\"", + throw new ModelspaceException( "Unable to create %s model \"%s\" from data at \"%s\"", actualMetamodel.name(), modelPath, dataPath ); } } ); @@ -360,28 +360,28 @@ public ValueFactory valueFactory() { /** * {@inheritDoc} * - * @see Modeler#importData(File, String) + * @see Modelspace#importData(File, String) */ @Override public String importData( final File file, - final String workspaceFolder ) throws ModelerException { + final String workspaceFolder ) throws ModelspaceException { return importData( file, workspaceFolder, null ); } /** * {@inheritDoc} * - * @see Modeler#importData(File, String, String) + * @see Modelspace#importData(File, String, String) */ @Override public String importData( final File file, final String workspaceFolder, - final String workspaceName ) throws ModelerException { + final String workspaceName ) throws ModelspaceException { CheckArg.isNotNull( file, "file" ); try { return importData( file.toURI().toURL(), workspaceFolder, workspaceName ); } catch ( final MalformedURLException e ) { - throw new ModelerException( e, "Unable to import data from \"%s\" to \"%s/%s\"", file, + throw new ModelspaceException( e, "Unable to import data from \"%s\" to \"%s/%s\"", file, workspaceFolder, workspaceName ); } } @@ -389,11 +389,11 @@ public String importData( final File file, /** * {@inheritDoc} * - * @see Modeler#importData(InputStream, String) + * @see Modelspace#importData(InputStream, String) */ @Override public String importData( final InputStream stream, - final String workspacePath ) throws ModelerException { + final String workspacePath ) throws ModelspaceException { CheckArg.isNotNull( stream, "stream" ); CheckArg.isNotEmpty( workspacePath, "workspacePath" ); return run( new WriteTaskWithResult< String >() { @@ -403,7 +403,7 @@ public String run( final Session session ) throws Exception { // Ensure the path is non-null, absolute, and ends with a slash final Node node = new JcrTools().uploadFile( session, absolutePath( workspacePath ), stream ); // Add unstructured mix-in to allow node to contain anything else, like models created later - node.addMixin( ModelerLexicon.UNSTRUCTURED_MIXIN ); + node.addMixin( ModelspaceLexicon.UNSTRUCTURED_MIXIN ); return node.getPath(); } } ); @@ -412,23 +412,23 @@ public String run( final Session session ) throws Exception { /** * {@inheritDoc} * - * @see Modeler#importData(URL, String) + * @see Modelspace#importData(URL, String) */ @Override public String importData( final URL url, - final String workspaceFolder ) throws ModelerException { + final String workspaceFolder ) throws ModelspaceException { return importData( url, workspaceFolder, null ); } /** * {@inheritDoc} * - * @see Modeler#importData(URL, String, String) + * @see Modelspace#importData(URL, String, String) */ @Override public String importData( final URL url, final String workspaceFolder, - final String workspaceName ) throws ModelerException { + final String workspaceName ) throws ModelspaceException { CheckArg.isNotNull( url, "url" ); try { final String path = importData( url.openStream(), absolutePath( workspaceFolder, name( workspaceName, url ) ) ); @@ -437,7 +437,7 @@ public String importData( final URL url, } catch ( final FileNotFoundException e ) { throw new IllegalArgumentException( e ); } catch ( final IOException e ) { - throw new ModelerException( e, "Unable to import data from \"%s\" to \"%s/%s\"", url, + throw new ModelspaceException( e, "Unable to import data from \"%s\" to \"%s/%s\"", url, workspaceFolder, workspaceName ); } } @@ -445,30 +445,30 @@ public String importData( final URL url, /** * {@inheritDoc} * - * @see Modeler#importModel(File, String, Metamodel) + * @see Modelspace#importModel(File, String, Metamodel) */ @Override public Model importModel( final File file, final String modelFolder, - final Metamodel metamodel ) throws ModelerException { + final Metamodel metamodel ) throws ModelspaceException { return importModel( file, modelFolder, null, metamodel ); } /** * {@inheritDoc} * - * @see Modeler#importModel(File, String, String, Metamodel) + * @see Modelspace#importModel(File, String, String, Metamodel) */ @Override public Model importModel( final File file, final String modelFolder, final String modelName, - final Metamodel metamodel ) throws ModelerException { + final Metamodel metamodel ) throws ModelspaceException { CheckArg.isNotNull( file, "file" ); try { return importModel( file.toURI().toURL(), modelFolder, modelName, metamodel ); } catch ( final MalformedURLException e ) { - throw new ModelerException( e, "Unable to import model from \"%s\" to \"%s/%s\"", file, + throw new ModelspaceException( e, "Unable to import model from \"%s\" to \"%s/%s\"", file, modelFolder, modelName ); } } @@ -476,49 +476,49 @@ public Model importModel( final File file, /** * {@inheritDoc} * - * @see Modeler#importModel(InputStream, String, Metamodel) + * @see Modelspace#importModel(InputStream, String, Metamodel) */ @Override public Model importModel( final InputStream stream, final String modelPath, - final Metamodel metamodel ) throws ModelerException { - final String dataPath = importData( stream, ModelerLexicon.TEMP_FOLDER + "/file" ); + final Metamodel metamodel ) throws ModelspaceException { + final String dataPath = importData( stream, ModelspaceLexicon.TEMP_FOLDER + "/file" ); return generateModel( dataPath, modelPath, metamodel, false ); } /** * {@inheritDoc} * - * @see Modeler#importModel(URL, String, Metamodel) + * @see Modelspace#importModel(URL, String, Metamodel) */ @Override public Model importModel( final URL dataUrl, final String modelFolder, - final Metamodel metamodel ) throws ModelerException { + final Metamodel metamodel ) throws ModelspaceException { return importModel( dataUrl, modelFolder, null, metamodel ); } /** * {@inheritDoc} * - * @see Modeler#importModel(URL, String, String, Metamodel) + * @see Modelspace#importModel(URL, String, String, Metamodel) */ @Override public Model importModel( final URL dataUrl, final String modelFolder, final String modelName, - final Metamodel metamodel ) throws ModelerException { - final String dataPath = importData( dataUrl, ModelerLexicon.TEMP_FOLDER ); + final Metamodel metamodel ) throws ModelspaceException { + final String dataPath = importData( dataUrl, ModelspaceLexicon.TEMP_FOLDER ); return generateModel( dataPath, absolutePath( modelFolder, name( modelName, dataUrl ) ), metamodel, false ); } /** * {@inheritDoc} * - * @see Modeler#metamodelManager() + * @see Modelspace#metamodelManager() */ @Override - public MetamodelManager metamodelManager() throws ModelerException { + public MetamodelManager metamodelManager() throws ModelspaceException { if ( metamodelManager == null ) metamodelManager = new MetamodelManagerImpl( this ); return metamodelManager; } @@ -526,10 +526,10 @@ public MetamodelManager metamodelManager() throws ModelerException { /** * {@inheritDoc} * - * @see Modeler#model(String) + * @see Modelspace#model(String) */ @Override - public Model model( final String path ) throws ModelerException { + public Model model( final String path ) throws ModelspaceException { CheckArg.isNotEmpty( path, "path" ); return run( new TaskWithResult< Model >() { @@ -538,9 +538,9 @@ public Model run( final Session session ) throws Exception { try { final String absPath = absolutePath( path ); final Node node = session.getNode( absPath ); - if ( !node.isNodeType( ModelerLexicon.Model.MODEL_MIXIN ) ) - throw new IllegalArgumentException( ModelerI18n.localize( "Not a path to a model: %s", absPath ) ); - return new ModelImpl( ModelerImpl.this, absPath ); + if ( !node.isNodeType( ModelspaceLexicon.Model.MODEL_MIXIN ) ) + throw new IllegalArgumentException( ModelspaceI18n.localize( "Not a path to a model: %s", absPath ) ); + return new ModelImpl( ModelspaceImpl.this, absPath ); } catch ( final PathNotFoundException e ) { return null; } @@ -559,23 +559,23 @@ private String name( String workspaceName, /** * {@inheritDoc} * - * @see org.modeshape.modeler.Modeler#newModel(java.lang.String, java.lang.String) + * @see org.modelspace.Modelspace#newModel(java.lang.String, java.lang.String) */ @Override public Model newModel( final String modelPath, - final String metamodelId ) throws ModelerException { + final String metamodelId ) throws ModelspaceException { return newModel( modelPath, metamodelId, false ); } /** * {@inheritDoc} * - * @see org.modeshape.modeler.Modeler#newModel(java.lang.String, java.lang.String, boolean) + * @see org.modelspace.Modelspace#newModel(java.lang.String, java.lang.String, boolean) */ @Override public Model newModel( final String modelPath, final String metamodelId, - final boolean override ) throws ModelerException { + final boolean override ) throws ModelspaceException { CheckArg.isNotEmpty( modelPath, "modelPath" ); CheckArg.isNotEmpty( metamodelId, "metamodelId" ); @@ -584,7 +584,7 @@ public Model newModel( final String modelPath, /** * {@inheritDoc} * - * @see org.modeshape.modeler.internal.task.TaskWithResult#run(javax.jcr.Session) + * @see org.modelspace.internal.task.TaskWithResult#run(javax.jcr.Session) */ @Override public Model run( final Session session ) throws Exception { @@ -599,10 +599,10 @@ public Model run( final Session session ) throws Exception { final Node node = session.getNode( absPath ); // make sure it is a model with the right metamodel ID - if ( !node.isNodeType( ModelerLexicon.Model.MODEL_MIXIN ) - || !node.hasProperty( ModelerLexicon.Model.METAMODEL ) - || !metamodelId.equals( node.getProperty( ModelerLexicon.Model.METAMODEL ).getValue().getString() ) ) { - throw new ModelerException( ModelerI18n.localize( EXISTING_MODEL_HAS_WRONG_METAMODEL_TYPE, + if ( !node.isNodeType( ModelspaceLexicon.Model.MODEL_MIXIN ) + || !node.hasProperty( ModelspaceLexicon.Model.METAMODEL ) + || !metamodelId.equals( node.getProperty( ModelspaceLexicon.Model.METAMODEL ).getValue().getString() ) ) { + throw new ModelspaceException( ModelspaceI18n.localize( EXISTING_MODEL_HAS_WRONG_METAMODEL_TYPE, absPath, metamodelId ) ); } @@ -613,11 +613,11 @@ public Model run( final Session session ) throws Exception { if ( create ) { final Node modelNode = new JcrTools().findOrCreateNode( session, absPath ); - modelNode.addMixin( ModelerLexicon.Model.MODEL_MIXIN ); - modelNode.setProperty( ModelerLexicon.Model.METAMODEL, metamodelId ); + modelNode.addMixin( ModelspaceLexicon.Model.MODEL_MIXIN ); + modelNode.setProperty( ModelspaceLexicon.Model.METAMODEL, metamodelId ); } - return new ModelImpl( ModelerImpl.this, absPath ); + return new ModelImpl( ModelspaceImpl.this, absPath ); } } ); } @@ -627,20 +627,20 @@ void processDependencies( final String dataPath, final ModelImpl model, final boolean persistArtifacts ) throws Exception { if ( model.metamodel() == null ) { - Modeler.LOGGER.debug( "No metamodel found for model '%s'", modelNode.getName() ); + Modelspace.LOGGER.debug( "No metamodel found for model '%s'", modelNode.getName() ); return; } final DependencyProcessor dependencyProcessor = model.metamodel().dependencyProcessor(); if ( dependencyProcessor == null ) { - Modeler.LOGGER.debug( "No dependency processor found for model '%s'", modelNode.getName() ); + Modelspace.LOGGER.debug( "No dependency processor found for model '%s'", modelNode.getName() ); } else { dependencyProcessor.process( dataPath, modelNode, this, persistArtifacts ); } } - private void removeTemporaryArtifact( final String dataPath ) throws ModelerException { + private void removeTemporaryArtifact( final String dataPath ) throws ModelspaceException { run( new WriteTask() { @Override @@ -650,7 +650,7 @@ public void run( final Session session ) throws Exception { } ); } - JcrRepository repository() throws ModelerException { + JcrRepository repository() throws ModelspaceException { if ( repository == null ) { try { engine = new ModeShapeEngine(); @@ -659,7 +659,7 @@ JcrRepository repository() throws ModelerException { final Problems problems = config.validate(); if ( problems.hasProblems() ) { for ( final Problem problem : problems ) - Modeler.LOGGER.error( problem.getThrowable(), "Invalid repository configuration: %s", + Modelspace.LOGGER.error( problem.getThrowable(), "Invalid repository configuration: %s", problem.getMessageString() ); throw problems.iterator().next().getThrowable(); } @@ -670,9 +670,9 @@ JcrRepository repository() throws ModelerException { repository = engine.deploy( config ); } this.repository = repository; - Modeler.LOGGER.info( "Modeler started" ); + Modelspace.LOGGER.info( "Modelspace started" ); } catch ( final Throwable e ) { - throw new ModelerException( e, "Unable to start repository" ); + throw new ModelspaceException( e, "Unable to start repository" ); } } return repository; @@ -681,7 +681,7 @@ JcrRepository repository() throws ModelerException { /** * {@inheritDoc} * - * @see Modeler#repositoryStoreParentPath() + * @see Modelspace#repositoryStoreParentPath() */ @Override public String repositoryStoreParentPath() { @@ -696,25 +696,25 @@ public String repositoryStoreParentPath() { * the object whose simple class name will be passed as a node to the supplied task * @param task * the system task to run - * @throws ModelerException + * @throws ModelspaceException * if any error occurs */ public void run( final Object systemObject, final SystemTask task - ) throws ModelerException { + ) throws ModelspaceException { try { final Session session = systemSession(); try { task.run( session, systemNode( session, systemObject ) ); - } catch ( final RuntimeException | ModelerException e ) { + } catch ( final RuntimeException | ModelspaceException e ) { throw e; } catch ( final Exception e ) { - throw new ModelerException( e, "Unable to perform system task" ); + throw new ModelspaceException( e, "Unable to perform system task" ); } finally { session.logout(); } } catch ( final RepositoryException e ) { - throw new ModelerException( e, "Unable to open session for system task" ); + throw new ModelspaceException( e, "Unable to open session for system task" ); } } @@ -727,25 +727,25 @@ public void run( final Object systemObject, * @param task * the system task to run * @return the return value of the supplied task - * @throws ModelerException + * @throws ModelspaceException * if any error occurs */ public < T > T run( final Object systemObject, final SystemTaskWithResult< T > task - ) throws ModelerException { + ) throws ModelspaceException { try { final Session session = systemSession(); try { return task.run( session, systemNode( session, systemObject ) ); - } catch ( final RuntimeException | ModelerException e ) { + } catch ( final RuntimeException | ModelspaceException e ) { throw e; } catch ( final Exception e ) { - throw new ModelerException( e, "Unable to perform system task with result" ); + throw new ModelspaceException( e, "Unable to perform system task with result" ); } finally { session.logout(); } } catch ( final RepositoryException e ) { - throw new ModelerException( e, "Unable to open session for system task with result" ); + throw new ModelspaceException( e, "Unable to open session for system task with result" ); } } @@ -757,27 +757,27 @@ public < T > T run( final Object systemObject, * the object whose simple class name will be passed as a node to the supplied task * @param task * the system task to run - * @throws ModelerException + * @throws ModelspaceException * if any error occurs */ public void run( final Object systemObject, final WriteSystemTask task - ) throws ModelerException { + ) throws ModelspaceException { try { final Session session = systemSession(); try { task.run( session, systemNode( session, systemObject ) ); session.save(); LOGGER.debug( "Session saved" ); - } catch ( final RuntimeException | ModelerException e ) { + } catch ( final RuntimeException | ModelspaceException e ) { throw e; } catch ( final Exception e ) { - throw new ModelerException( e, "Unable to perform write system task" ); + throw new ModelspaceException( e, "Unable to perform write system task" ); } finally { session.logout(); } } catch ( final RepositoryException e ) { - throw new ModelerException( e, "Unable to open session for write system task" ); + throw new ModelspaceException( e, "Unable to open session for write system task" ); } } @@ -787,23 +787,23 @@ public void run( final Object systemObject, * * @param task * the task to run - * @throws ModelerException + * @throws ModelspaceException * if any error occurs */ - public void run( final Task task ) throws ModelerException { + public void run( final Task task ) throws ModelspaceException { try { final Session session = session(); try { task.run( session ); - } catch ( final RuntimeException | ModelerException e ) { + } catch ( final RuntimeException | ModelspaceException e ) { throw e; } catch ( final Exception e ) { - throw new ModelerException( e, "Unable to perform task" ); + throw new ModelspaceException( e, "Unable to perform task" ); } finally { session.logout(); } } catch ( final RepositoryException e ) { - throw new ModelerException( e, "Unable to open session for task" ); + throw new ModelspaceException( e, "Unable to open session for task" ); } } @@ -814,23 +814,23 @@ public void run( final Task task ) throws ModelerException { * @param task * the task to run * @return the return value of the supplied task - * @throws ModelerException + * @throws ModelspaceException * if any error occurs */ - public < T > T run( final TaskWithResult< T > task ) throws ModelerException { + public < T > T run( final TaskWithResult< T > task ) throws ModelspaceException { try { final Session session = session(); try { return task.run( session ); - } catch ( final RuntimeException | ModelerException e ) { + } catch ( final RuntimeException | ModelspaceException e ) { throw e; } catch ( final Exception e ) { - throw new ModelerException( e, "Unable to perform task with result" ); + throw new ModelspaceException( e, "Unable to perform task with result" ); } finally { session.logout(); } } catch ( final RepositoryException e ) { - throw new ModelerException( e, "Unable to open session for task with result" ); + throw new ModelspaceException( e, "Unable to open session for task with result" ); } } @@ -840,25 +840,25 @@ public < T > T run( final TaskWithResult< T > task ) throws ModelerException { * * @param task * the write task to run - * @throws ModelerException + * @throws ModelspaceException * if any error occurs */ - void run( final WriteTask task ) throws ModelerException { + void run( final WriteTask task ) throws ModelspaceException { try { final Session session = session(); try { task.run( session ); session.save(); LOGGER.debug( "Session saved" ); - } catch ( final RuntimeException | ModelerException e ) { + } catch ( final RuntimeException | ModelspaceException e ) { throw e; } catch ( final Exception e ) { - throw new ModelerException( e, "Unable to perform write task" ); + throw new ModelspaceException( e, "Unable to perform write task" ); } finally { session.logout(); } } catch ( final RepositoryException e ) { - throw new ModelerException( e, "Unable to open session for write task" ); + throw new ModelspaceException( e, "Unable to open session for write task" ); } } @@ -869,10 +869,10 @@ void run( final WriteTask task ) throws ModelerException { * @param task * the write task to run * @return the return value of the supplied task - * @throws ModelerException + * @throws ModelspaceException * if any error occurs */ - < T > T run( final WriteTaskWithResult< T > task ) throws ModelerException { + < T > T run( final WriteTaskWithResult< T > task ) throws ModelspaceException { try { final Session session = session(); try { @@ -880,30 +880,30 @@ < T > T run( final WriteTaskWithResult< T > task ) throws ModelerException { session.save(); LOGGER.debug( "Session saved" ); return returnValue; - } catch ( final RuntimeException | ModelerException e ) { + } catch ( final RuntimeException | ModelspaceException e ) { throw e; } catch ( final Exception e ) { - throw new ModelerException( e, "Unable to perform write task with result" ); + throw new ModelspaceException( e, "Unable to perform write task with result" ); } finally { session.logout(); } } catch ( final RepositoryException e ) { - throw new ModelerException( e, "Unable to open session for write task with result" ); + throw new ModelspaceException( e, "Unable to open session for write task with result" ); } } private void saveExternalLocation( final String path, - final String location ) throws ModelerException { + final String location ) throws ModelspaceException { run( new WriteTask() { @Override public void run( final Session session ) throws Exception { - session.getNode( path ).setProperty( ModelerLexicon.Model.EXTERNAL_LOCATION, location ); + session.getNode( path ).setProperty( ModelspaceLexicon.Model.EXTERNAL_LOCATION, location ); } } ); } - private Session session() throws ModelerException, RepositoryException { + private Session session() throws ModelspaceException, RepositoryException { return repository().login( "default" ); } @@ -914,7 +914,7 @@ private Node systemNode( final Session session, return session.getRootNode().addNode( path ); } - private Session systemSession() throws ModelerException, RepositoryException { - return repository().login( Modeler.class.getSimpleName() ); + private Session systemSession() throws ModelspaceException, RepositoryException { + return repository().login( Modelspace.class.getSimpleName() ); } } diff --git a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/PropertyDescriptorImpl.java b/modelspace/modelspace-engine/src/main/java/org/modelspace/internal/PropertyDescriptorImpl.java similarity index 87% rename from modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/PropertyDescriptorImpl.java rename to modelspace/modelspace-engine/src/main/java/org/modelspace/internal/PropertyDescriptorImpl.java index 5ab84de..4880f3c 100644 --- a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/PropertyDescriptorImpl.java +++ b/modelspace/modelspace-engine/src/main/java/org/modelspace/internal/PropertyDescriptorImpl.java @@ -21,17 +21,17 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler.internal; +package org.modelspace.internal; import javax.jcr.PropertyType; import javax.jcr.Value; import javax.jcr.nodetype.PropertyDefinition; +import org.modelspace.ModelObject; +import org.modelspace.ModelProperty; +import org.modelspace.ModelspaceException; +import org.modelspace.PropertyDescriptor; import org.modeshape.common.util.CheckArg; -import org.modeshape.modeler.ModelObject; -import org.modeshape.modeler.ModelProperty; -import org.modeshape.modeler.ModelerException; -import org.modeshape.modeler.PropertyDescriptor; /** * A {@link PropertyDescriptor property descriptor} implementation. @@ -62,7 +62,7 @@ static Type convert( final int type ) { /** * @param type * the {@link ModelObject model object} {@link ModelProperty property} - * {@link org.modeshape.modeler.PropertyDescriptor.Type type} being converted (never null) + * {@link org.modelspace.PropertyDescriptor.Type type} being converted (never null) * * @return the {@link PropertyType JCR property type} */ @@ -89,7 +89,7 @@ static int convert( final Type type ) { private final String name; private final Type type; - PropertyDescriptorImpl( final PropertyDefinition propDefn ) throws ModelerException { + PropertyDescriptorImpl( final PropertyDefinition propDefn ) throws ModelspaceException { CheckArg.isNotNull( propDefn, "propDefn" ); this.mandatory = propDefn.isMandatory(); @@ -116,7 +116,7 @@ static int convert( final Type type ) { /** * {@inheritDoc} * - * @see org.modeshape.modeler.PropertyDescriptor#defaultValues() + * @see org.modelspace.PropertyDescriptor#defaultValues() */ @Override public Object[] defaultValues() { @@ -126,7 +126,7 @@ public Object[] defaultValues() { /** * {@inheritDoc} * - * @see org.modeshape.modeler.PropertyDescriptor#mandatory() + * @see org.modelspace.PropertyDescriptor#mandatory() */ @Override public boolean mandatory() { @@ -136,7 +136,7 @@ public boolean mandatory() { /** * {@inheritDoc} * - * @see org.modeshape.modeler.PropertyDescriptor#modifiable() + * @see org.modelspace.PropertyDescriptor#modifiable() */ @Override public boolean modifiable() { @@ -146,7 +146,7 @@ public boolean modifiable() { /** * {@inheritDoc} * - * @see org.modeshape.modeler.PropertyDescriptor#multiple() + * @see org.modelspace.PropertyDescriptor#multiple() */ @Override public boolean multiple() { @@ -156,7 +156,7 @@ public boolean multiple() { /** * {@inheritDoc} * - * @see org.modeshape.modeler.PropertyDescriptor#name() + * @see org.modelspace.PropertyDescriptor#name() */ @Override public String name() { @@ -166,7 +166,7 @@ public String name() { /** * {@inheritDoc} * - * @see org.modeshape.modeler.PropertyDescriptor#type() + * @see org.modelspace.PropertyDescriptor#type() */ @Override public Type type() { diff --git a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/SequencerImporter.java b/modelspace/modelspace-engine/src/main/java/org/modelspace/internal/SequencerImporter.java similarity index 86% rename from modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/SequencerImporter.java rename to modelspace/modelspace-engine/src/main/java/org/modelspace/internal/SequencerImporter.java index 5a8bf8b..2292c10 100644 --- a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/SequencerImporter.java +++ b/modelspace/modelspace-engine/src/main/java/org/modelspace/internal/SequencerImporter.java @@ -21,17 +21,17 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler.internal; +package org.modelspace.internal; import java.io.InputStream; import javax.jcr.Node; import javax.jcr.Property; +import org.modelspace.Data; +import org.modelspace.spi.Importer; import org.modeshape.jcr.api.sequencer.Sequencer; import org.modeshape.jcr.api.sequencer.Sequencer.Context; -import org.modeshape.modeler.Data; -import org.modeshape.modeler.spi.metamodel.Importer; class SequencerImporter implements Importer { @@ -44,7 +44,7 @@ class SequencerImporter implements Importer { /** * {@inheritDoc} * - * @see org.modeshape.modeler.spi.metamodel.Importer#execute(java.io.InputStream, org.modeshape.modeler.Data) + * @see org.modelspace.spi.Importer#execute(java.io.InputStream, org.modelspace.Data) */ @Override public void execute( final InputStream stream, @@ -61,7 +61,7 @@ boolean execute( final Property property, /** * {@inheritDoc} * - * @see org.modeshape.modeler.spi.metamodel.Importer#supports(java.lang.String) + * @see org.modelspace.spi.Importer#supports(java.lang.String) */ @Override public boolean supports( final String mimeType ) { diff --git a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/task/SystemTask.java b/modelspace/modelspace-engine/src/main/java/org/modelspace/internal/task/SystemTask.java similarity index 90% rename from modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/task/SystemTask.java rename to modelspace/modelspace-engine/src/main/java/org/modelspace/internal/task/SystemTask.java index 2457a89..92154f9 100644 --- a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/task/SystemTask.java +++ b/modelspace/modelspace-engine/src/main/java/org/modelspace/internal/task/SystemTask.java @@ -21,12 +21,12 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler.internal.task; +package org.modelspace.internal.task; import javax.jcr.Node; import javax.jcr.Session; -import org.modeshape.modeler.internal.ModelerImpl; +import org.modelspace.internal.ModelspaceImpl; /** * @@ -38,7 +38,7 @@ public interface SystemTask { * a new session * @param systemNode * the node containing the system properties for the system class within which this task is being - * {@link ModelerImpl#run(Object, SystemTask) run}. + * {@link ModelspaceImpl#run(Object, SystemTask) run}. * @throws Exception * if any problem occurs */ diff --git a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/task/SystemTaskWithResult.java b/modelspace/modelspace-engine/src/main/java/org/modelspace/internal/task/SystemTaskWithResult.java similarity index 90% rename from modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/task/SystemTaskWithResult.java rename to modelspace/modelspace-engine/src/main/java/org/modelspace/internal/task/SystemTaskWithResult.java index c9bf6dd..e8aefba 100644 --- a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/task/SystemTaskWithResult.java +++ b/modelspace/modelspace-engine/src/main/java/org/modelspace/internal/task/SystemTaskWithResult.java @@ -21,12 +21,12 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler.internal.task; +package org.modelspace.internal.task; import javax.jcr.Node; import javax.jcr.Session; -import org.modeshape.modeler.internal.ModelerImpl; +import org.modelspace.internal.ModelspaceImpl; /** * @param @@ -39,7 +39,7 @@ public interface SystemTaskWithResult< T > { * a new session * @param systemNode * the node containing the system properties for the system class within which this task is being - * {@link ModelerImpl#run(Object, SystemTaskWithResult) run}. + * {@link ModelspaceImpl#run(Object, SystemTaskWithResult) run}. * @return the task's return value * @throws Exception * if any problem occurs diff --git a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/task/Task.java b/modelspace/modelspace-engine/src/main/java/org/modelspace/internal/task/Task.java similarity index 96% rename from modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/task/Task.java rename to modelspace/modelspace-engine/src/main/java/org/modelspace/internal/task/Task.java index ced8b0b..35eef4a 100644 --- a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/task/Task.java +++ b/modelspace/modelspace-engine/src/main/java/org/modelspace/internal/task/Task.java @@ -21,7 +21,7 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler.internal.task; +package org.modelspace.internal.task; import javax.jcr.Session; diff --git a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/task/TaskWithResult.java b/modelspace/modelspace-engine/src/main/java/org/modelspace/internal/task/TaskWithResult.java similarity index 97% rename from modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/task/TaskWithResult.java rename to modelspace/modelspace-engine/src/main/java/org/modelspace/internal/task/TaskWithResult.java index 9ed5fa7..5ef6e17 100644 --- a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/task/TaskWithResult.java +++ b/modelspace/modelspace-engine/src/main/java/org/modelspace/internal/task/TaskWithResult.java @@ -21,7 +21,7 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler.internal.task; +package org.modelspace.internal.task; import javax.jcr.Session; diff --git a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/task/WriteSystemTask.java b/modelspace/modelspace-engine/src/main/java/org/modelspace/internal/task/WriteSystemTask.java similarity index 90% rename from modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/task/WriteSystemTask.java rename to modelspace/modelspace-engine/src/main/java/org/modelspace/internal/task/WriteSystemTask.java index 8369491..a67beac 100644 --- a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/task/WriteSystemTask.java +++ b/modelspace/modelspace-engine/src/main/java/org/modelspace/internal/task/WriteSystemTask.java @@ -21,12 +21,12 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler.internal.task; +package org.modelspace.internal.task; import javax.jcr.Node; import javax.jcr.Session; -import org.modeshape.modeler.internal.ModelerImpl; +import org.modelspace.internal.ModelspaceImpl; /** * @@ -38,7 +38,7 @@ public interface WriteSystemTask { * a new session * @param systemNode * the node containing the system properties for the system class within which this task is being - * {@link ModelerImpl#run(Object, WriteSystemTask) run}. + * {@link ModelspaceImpl#run(Object, WriteSystemTask) run}. * @throws Exception * if any problem occurs */ diff --git a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/task/WriteTask.java b/modelspace/modelspace-engine/src/main/java/org/modelspace/internal/task/WriteTask.java similarity index 96% rename from modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/task/WriteTask.java rename to modelspace/modelspace-engine/src/main/java/org/modelspace/internal/task/WriteTask.java index d3666c7..8a8d2eb 100644 --- a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/task/WriteTask.java +++ b/modelspace/modelspace-engine/src/main/java/org/modelspace/internal/task/WriteTask.java @@ -21,7 +21,7 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler.internal.task; +package org.modelspace.internal.task; import javax.jcr.Session; diff --git a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/task/WriteTaskWithResult.java b/modelspace/modelspace-engine/src/main/java/org/modelspace/internal/task/WriteTaskWithResult.java similarity index 97% rename from modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/task/WriteTaskWithResult.java rename to modelspace/modelspace-engine/src/main/java/org/modelspace/internal/task/WriteTaskWithResult.java index 9270cab..010578f 100644 --- a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/internal/task/WriteTaskWithResult.java +++ b/modelspace/modelspace-engine/src/main/java/org/modelspace/internal/task/WriteTaskWithResult.java @@ -21,7 +21,7 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler.internal.task; +package org.modelspace.internal.task; import javax.jcr.Session; diff --git a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/spi/metamodel/Dependency.java b/modelspace/modelspace-engine/src/main/java/org/modelspace/spi/Dependency.java similarity index 99% rename from modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/spi/metamodel/Dependency.java rename to modelspace/modelspace-engine/src/main/java/org/modelspace/spi/Dependency.java index 37ea7ef..3a8624c 100644 --- a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/spi/metamodel/Dependency.java +++ b/modelspace/modelspace-engine/src/main/java/org/modelspace/spi/Dependency.java @@ -21,7 +21,7 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler.spi.metamodel; +package org.modelspace.spi; import java.util.ArrayList; import java.util.Collections; diff --git a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/spi/metamodel/DependencyProcessor.java b/modelspace/modelspace-engine/src/main/java/org/modelspace/spi/DependencyProcessor.java similarity index 85% rename from modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/spi/metamodel/DependencyProcessor.java rename to modelspace/modelspace-engine/src/main/java/org/modelspace/spi/DependencyProcessor.java index 23066c2..6d67961 100644 --- a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/spi/metamodel/DependencyProcessor.java +++ b/modelspace/modelspace-engine/src/main/java/org/modelspace/spi/DependencyProcessor.java @@ -21,12 +21,12 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler.spi.metamodel; +package org.modelspace.spi; import javax.jcr.Node; -import org.modeshape.modeler.Modeler; -import org.modeshape.modeler.ModelerException; +import org.modelspace.Modelspace; +import org.modelspace.ModelspaceException; /** * Processes dependencies for a specific metamodel. @@ -53,17 +53,17 @@ public interface DependencyProcessor { * the workspace path of the data whose dependencies are being processed * @param modelNode * the node of the model whose dependencies are being processed (cannot be null) - * @param modeler - * the modeler used to upload dependency data and create models (cannot be null) + * @param modelspace + * the modelspace used to upload dependency data and create models (cannot be null) * @param persistData * true if the auto-imported dependency data should be persisted * @return the path to the dependencies node or null if no dependencies were processed - * @throws ModelerException + * @throws ModelspaceException * if the specified model is not valid for this processor or if there is an error during processing */ String process( final String dataPath, final Node modelNode, - final Modeler modeler, - final boolean persistData ) throws ModelerException; + final Modelspace modelspace, + final boolean persistData ) throws ModelspaceException; } diff --git a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/spi/metamodel/Exporter.java b/modelspace/modelspace-engine/src/main/java/org/modelspace/spi/Exporter.java similarity index 84% rename from modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/spi/metamodel/Exporter.java rename to modelspace/modelspace-engine/src/main/java/org/modelspace/spi/Exporter.java index d2abb4c..cfcff23 100644 --- a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/spi/metamodel/Exporter.java +++ b/modelspace/modelspace-engine/src/main/java/org/modelspace/spi/Exporter.java @@ -21,12 +21,12 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler.spi.metamodel; +package org.modelspace.spi; import java.io.OutputStream; -import org.modeshape.modeler.Model; -import org.modeshape.modeler.ModelerException; +import org.modelspace.Model; +import org.modelspace.ModelspaceException; /** * @@ -38,11 +38,11 @@ public interface Exporter { * a model * @param stream * the output stream to which the model will be exported - * @throws ModelerException + * @throws ModelspaceException * if any error occurs */ void execute( Model model, - OutputStream stream ) throws ModelerException; + OutputStream stream ) throws ModelspaceException; /** * @return the metamodel ID @@ -53,8 +53,8 @@ void execute( Model model, * @param mimeType * a MIME type * @return true if this exporter supports data of the supplied MIME type - * @throws ModelerException + * @throws ModelspaceException * if any error occurs */ - boolean supports( String mimeType ) throws ModelerException; + boolean supports( String mimeType ) throws ModelspaceException; } diff --git a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/spi/metamodel/Importer.java b/modelspace/modelspace-engine/src/main/java/org/modelspace/spi/Importer.java similarity index 84% rename from modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/spi/metamodel/Importer.java rename to modelspace/modelspace-engine/src/main/java/org/modelspace/spi/Importer.java index c5f4495..337dfb6 100644 --- a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/spi/metamodel/Importer.java +++ b/modelspace/modelspace-engine/src/main/java/org/modelspace/spi/Importer.java @@ -21,12 +21,12 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler.spi.metamodel; +package org.modelspace.spi; import java.io.InputStream; -import org.modeshape.modeler.Data; -import org.modeshape.modeler.ModelerException; +import org.modelspace.Data; +import org.modelspace.ModelspaceException; /** * @@ -38,18 +38,18 @@ public interface Importer { * the input stream from which the data will be imported * @param data * the workspace data to which the data will be imported - * @throws ModelerException + * @throws ModelspaceException * if any error occurs */ void execute( InputStream stream, - Data data ) throws ModelerException; + Data data ) throws ModelspaceException; /** * @param mimeType * a MIME type * @return true if this importer supports data of the supplied MIME type - * @throws ModelerException + * @throws ModelspaceException * if any error occurs */ - boolean supports( String mimeType ) throws ModelerException; + boolean supports( String mimeType ) throws ModelspaceException; } diff --git a/modeshape-modeler/modeshape-modeler-engine/src/main/resources/config.json b/modelspace/modelspace-engine/src/main/resources/config.json similarity index 50% rename from modeshape-modeler/modeshape-modeler-engine/src/main/resources/config.json rename to modelspace/modelspace-engine/src/main/resources/config.json index 01d29a4..9cd43ab 100644 --- a/modeshape-modeler/modeshape-modeler-engine/src/main/resources/config.json +++ b/modelspace/modelspace-engine/src/main/resources/config.json @@ -1,15 +1,15 @@ { - "name" : "ModeShape Modeler Repository", + "name" : "Modelspace Repository", "workspaces" : { - "predefined" : ["Modeler"], + "predefined" : ["Modelspace"], "default" : "default" }, "storage" : { - "cacheName" : "ModeShapeModelerRepository", + "cacheName" : "ModelspaceRepository", "cacheConfiguration" : "infinispan.xml", "binaryStorage" : { "type" : "file", - "directory" : "${org.modeshape.modeler.repositoryStoreParentPath}/modelerRepository/binaries" + "directory" : "${org.modelspace.repositoryStoreParentPath}/modelspaceRepository/binaries" } }, "node-types" : ["metamodel.cnd"] diff --git a/modeshape-modeler/modeshape-modeler-engine/src/main/resources/infinispan.xml b/modelspace/modelspace-engine/src/main/resources/infinispan.xml similarity index 82% rename from modeshape-modeler/modeshape-modeler-engine/src/main/resources/infinispan.xml rename to modelspace/modelspace-engine/src/main/resources/infinispan.xml index 94c34b9..b2d259b 100644 --- a/modeshape-modeler/modeshape-modeler-engine/src/main/resources/infinispan.xml +++ b/modelspace/modelspace-engine/src/main/resources/infinispan.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="urn:infinispan:config:6.0 http://www.infinispan.org/schemas/infinispan-config-6.0.xsd" xmlns="urn:infinispan:config:6.0"> - + + location="${org.modelspace.repositoryStoreParentPath}/modelspaceRepository/infinispanStore"> diff --git a/modeshape-modeler/modeshape-modeler-engine/src/main/resources/metamodel.cnd b/modelspace/modelspace-engine/src/main/resources/metamodel.cnd similarity index 97% rename from modeshape-modeler/modeshape-modeler-engine/src/main/resources/metamodel.cnd rename to modelspace/modelspace-engine/src/main/resources/metamodel.cnd index f011ab5..3b9f53d 100644 --- a/modeshape-modeler/modeshape-modeler-engine/src/main/resources/metamodel.cnd +++ b/modelspace/modelspace-engine/src/main/resources/metamodel.cnd @@ -22,7 +22,7 @@ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ - + [mm:unstructured] mixin orderable - * (undefined) multiple diff --git a/modeshape-modeler/modeshape-modeler-engine/src/test/java/org/modeshape/modeler/MockObjectFactory.java b/modelspace/modelspace-engine/src/test/java/org/modelspace/MockObjectFactory.java similarity index 99% rename from modeshape-modeler/modeshape-modeler-engine/src/test/java/org/modeshape/modeler/MockObjectFactory.java rename to modelspace/modelspace-engine/src/test/java/org/modelspace/MockObjectFactory.java index 612454d..c893112 100644 --- a/modeshape-modeler/modeshape-modeler-engine/src/test/java/org/modeshape/modeler/MockObjectFactory.java +++ b/modelspace/modelspace-engine/src/test/java/org/modelspace/MockObjectFactory.java @@ -21,7 +21,7 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler; +package org.modelspace; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/modeshape-modeler/modeshape-modeler-engine/src/test/java/org/modeshape/modeler/ModelerI18nTest.java b/modelspace/modelspace-engine/src/test/java/org/modelspace/ModelspaceI18nTest.java similarity index 93% rename from modeshape-modeler/modeshape-modeler-engine/src/test/java/org/modeshape/modeler/ModelerI18nTest.java rename to modelspace/modelspace-engine/src/test/java/org/modelspace/ModelspaceI18nTest.java index abbc154..ee7a23a 100644 --- a/modeshape-modeler/modeshape-modeler-engine/src/test/java/org/modeshape/modeler/ModelerI18nTest.java +++ b/modelspace/modelspace-engine/src/test/java/org/modelspace/ModelspaceI18nTest.java @@ -21,9 +21,9 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler; +package org.modelspace; import org.polyglotter.common.BaseI8nTest; @SuppressWarnings( "javadoc" ) -public class ModelerI18nTest extends BaseI8nTest {} +public class ModelspaceI18nTest extends BaseI8nTest {} diff --git a/modeshape-modeler/modeshape-modeler-engine/src/test/java/org/modeshape/modeler/internal/MetamodelManagerImplTest.java b/modelspace/modelspace-engine/src/test/java/org/modelspace/internal/MetamodelManagerImplTest.java similarity index 96% rename from modeshape-modeler/modeshape-modeler-engine/src/test/java/org/modeshape/modeler/internal/MetamodelManagerImplTest.java rename to modelspace/modelspace-engine/src/test/java/org/modelspace/internal/MetamodelManagerImplTest.java index 62ceab4..22df14f 100644 --- a/modeshape-modeler/modeshape-modeler-engine/src/test/java/org/modeshape/modeler/internal/MetamodelManagerImplTest.java +++ b/modelspace/modelspace-engine/src/test/java/org/modelspace/internal/MetamodelManagerImplTest.java @@ -21,7 +21,7 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler.internal; +package org.modelspace.internal; import static org.hamcrest.core.Is.is; import static org.hamcrest.core.IsNull.notNullValue; @@ -31,14 +31,16 @@ import java.net.URL; import org.junit.Test; -import org.modeshape.modeler.MetamodelManager; -import org.modeshape.modeler.test.BaseTest; +import org.modelspace.MetamodelManager; +import org.modelspace.internal.MetamodelManagerImpl; +import org.modelspace.internal.ModelspaceImpl; +import org.modelspace.test.BaseTest; @SuppressWarnings( "javadoc" ) public class MetamodelManagerImplTest extends BaseTest { private MetamodelManager metamodelManager() throws Exception { - return new MetamodelManagerImpl( mock( ModelerImpl.class ) ); + return new MetamodelManagerImpl( mock( ModelspaceImpl.class ) ); } @Test( expected = IllegalArgumentException.class ) diff --git a/modeshape-modeler/modeshape-modeler-engine/src/test/java/org/modeshape/modeler/internal/ModelObjectImplTest.java b/modelspace/modelspace-engine/src/test/java/org/modelspace/internal/ModelObjectImplTest.java similarity index 95% rename from modeshape-modeler/modeshape-modeler-engine/src/test/java/org/modeshape/modeler/internal/ModelObjectImplTest.java rename to modelspace/modelspace-engine/src/test/java/org/modelspace/internal/ModelObjectImplTest.java index dac12b8..7e2aeb6 100644 --- a/modeshape-modeler/modeshape-modeler-engine/src/test/java/org/modeshape/modeler/internal/ModelObjectImplTest.java +++ b/modelspace/modelspace-engine/src/test/java/org/modelspace/internal/ModelObjectImplTest.java @@ -21,15 +21,17 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler.internal; +package org.modelspace.internal; import static org.mockito.Mockito.mock; import java.util.Map; import org.junit.Test; -import org.modeshape.modeler.ModelObject; -import org.modeshape.modeler.test.BaseTest; +import org.modelspace.ModelObject; +import org.modelspace.internal.ModelObjectImpl; +import org.modelspace.internal.ModelspaceImpl; +import org.modelspace.test.BaseTest; @SuppressWarnings( "javadoc" ) public class ModelObjectImplTest extends BaseTest { @@ -37,7 +39,7 @@ public class ModelObjectImplTest extends BaseTest { Map< String, ? > NULL_VALUES_BY_PROPERTY = null; protected ModelObject modelObject() { - return new ModelObjectImpl( mock( ModelerImpl.class ), "object", 0 ); + return new ModelObjectImpl( mock( ModelspaceImpl.class ), "object", 0 ); } @Test( expected = IllegalArgumentException.class ) diff --git a/modeshape-modeler/modeshape-modeler-engine/src/test/java/org/modeshape/modeler/internal/ModelerImplTest.java b/modelspace/modelspace-engine/src/test/java/org/modelspace/internal/ModelspaceImplTest.java similarity index 68% rename from modeshape-modeler/modeshape-modeler-engine/src/test/java/org/modeshape/modeler/internal/ModelerImplTest.java rename to modelspace/modelspace-engine/src/test/java/org/modelspace/internal/ModelspaceImplTest.java index 65c9e4d..5becfc8 100644 --- a/modeshape-modeler/modeshape-modeler-engine/src/test/java/org/modeshape/modeler/internal/ModelerImplTest.java +++ b/modelspace/modelspace-engine/src/test/java/org/modelspace/internal/ModelspaceImplTest.java @@ -21,7 +21,7 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler.internal; +package org.modelspace.internal; import static org.hamcrest.core.Is.is; import static org.hamcrest.core.IsNull.nullValue; @@ -35,13 +35,14 @@ import org.junit.Test; import org.mockito.Mock; -import org.modeshape.modeler.Metamodel; -import org.modeshape.modeler.Model; -import org.modeshape.modeler.Modeler; -import org.modeshape.modeler.test.BaseModelerTest; +import org.modelspace.Metamodel; +import org.modelspace.Model; +import org.modelspace.Modelspace; +import org.modelspace.internal.ModelspaceImpl; +import org.modelspace.test.BaseModelspaceTest; @SuppressWarnings( "javadoc" ) -public final class ModelerImplTest extends BaseModelerTest { +public final class ModelspaceImplTest extends BaseModelspaceTest { private static final String MODEL_NAME = "model"; @@ -50,200 +51,200 @@ public final class ModelerImplTest extends BaseModelerTest { @Test( expected = IllegalArgumentException.class ) public void shouldFailToExportIfFileNull() throws Exception { - modeler().export( mock( Model.class ), ( File ) null ); + modelspace().export( mock( Model.class ), ( File ) null ); } @Test( expected = IllegalArgumentException.class ) public void shouldFailToExportIfStreamNull() throws Exception { - modeler().export( mock( Model.class ), ( OutputStream ) null ); + modelspace().export( mock( Model.class ), ( OutputStream ) null ); } @Test( expected = IllegalArgumentException.class ) public void shouldFailToExportIfUrlNull() throws Exception { - modeler().export( mock( Model.class ), ( URL ) null ); + modelspace().export( mock( Model.class ), ( URL ) null ); } @Test( expected = IllegalArgumentException.class ) public void shouldFailToExportToFileIfModelNull() throws Exception { - modeler().export( null, mock( File.class ) ); + modelspace().export( null, mock( File.class ) ); } @Test( expected = IllegalArgumentException.class ) public void shouldFailToExportToStreamIfModelNull() throws Exception { - modeler().export( null, mock( OutputStream.class ) ); + modelspace().export( null, mock( OutputStream.class ) ); } @Test( expected = IllegalArgumentException.class ) public void shouldFailToExportToUrlIfModelNull() throws Exception { - modeler().export( null, new URL( "file:" ) ); + modelspace().export( null, new URL( "file:" ) ); } @Test( expected = IllegalArgumentException.class ) public void shouldFailToGenerateDefaultModelIfArtifactPathEmpty() throws Exception { - modeler().generateModel( " ", null ); + modelspace().generateModel( " ", null ); } @Test( expected = IllegalArgumentException.class ) public void shouldFailToGenerateDefaultModelIfArtifactPathNull() throws Exception { - modeler().generateModel( null, null ); + modelspace().generateModel( null, null ); } @Test( expected = IllegalArgumentException.class ) public void shouldFailToGenerateModelFromStreamIfMetamodelNull() throws Exception { - modeler().importModel( stream( " " ), MODEL_NAME, null ); + modelspace().importModel( stream( " " ), MODEL_NAME, null ); } @Test( expected = IllegalArgumentException.class ) public void shouldFailToGenerateModelFromStreamIfPathEmpty() throws Exception { - modeler().importModel( stream( " " ), " ", metamodel ); + modelspace().importModel( stream( " " ), " ", metamodel ); } @Test( expected = IllegalArgumentException.class ) public void shouldFailToGenerateModelFromStreamIfPathNull() throws Exception { - modeler().importModel( stream( " " ), null, metamodel ); + modelspace().importModel( stream( " " ), null, metamodel ); } @Test( expected = IllegalArgumentException.class ) public void shouldFailToGenerateModelFromStreamIfStreamNull() throws Exception { - modeler().importModel( ( InputStream ) null, MODEL_NAME, metamodel ); + modelspace().importModel( ( InputStream ) null, MODEL_NAME, metamodel ); } @Test( expected = IllegalArgumentException.class ) public void shouldFailToGenerateModelFromWorkspaceArtifactIfArtifactPathNull() throws Exception { - modeler().generateModel( ( String ) null, MODEL_NAME, metamodel ); + modelspace().generateModel( ( String ) null, MODEL_NAME, metamodel ); } @Test( expected = IllegalArgumentException.class ) public void shouldFailToGenerateModelIfArtifactPathEmpty() throws Exception { - modeler().generateModel( " ", MODEL_NAME, metamodel ); + modelspace().generateModel( " ", MODEL_NAME, metamodel ); } @Test( expected = IllegalArgumentException.class ) public void shouldFailToGenerateModelIfArtifactPathNotFound() throws Exception { - modeler().generateModel( "doesNotExist", MODEL_NAME, metamodel ); + modelspace().generateModel( "doesNotExist", MODEL_NAME, metamodel ); } @Test( expected = IllegalArgumentException.class ) public void shouldFailToGenerateModelIfArtifactUrlNotFound() throws Exception { - modeler().importModel( new URL( "file:doesNotExist" ), null, metamodel ); + modelspace().importModel( new URL( "file:doesNotExist" ), null, metamodel ); } @Test( expected = IllegalArgumentException.class ) public void shouldFailToGenerateModelIfArtifactUrlNull() throws Exception { - modeler().importModel( ( URL ) null, null, metamodel ); + modelspace().importModel( ( URL ) null, null, metamodel ); } @Test( expected = IllegalArgumentException.class ) public void shouldFailToGenerateModelIfFileNotFound() throws Exception { - modeler().importModel( new File( "doesNotExist" ), null, metamodel ); + modelspace().importModel( new File( "doesNotExist" ), null, metamodel ); } @Test( expected = IllegalArgumentException.class ) public void shouldFailToGenerateModelIfFileNull() throws Exception { - modeler().importModel( ( File ) null, null, metamodel ); + modelspace().importModel( ( File ) null, null, metamodel ); } @Test( expected = IllegalArgumentException.class ) public void shouldFailToGetModelIfPathEmpty() throws Exception { - modeler().model( " " ); + modelspace().model( " " ); } @Test( expected = IllegalArgumentException.class ) public void shouldFailToGetModelIfPathNotModel() throws Exception { - modeler().importData( stream( " " ), MODEL_NAME ); - modeler().model( MODEL_NAME ); + modelspace().importData( stream( " " ), MODEL_NAME ); + modelspace().model( MODEL_NAME ); } @Test( expected = IllegalArgumentException.class ) public void shouldFailToGetModelIfPathNull() throws Exception { - modeler().model( null ); + modelspace().model( null ); } @Test( expected = IllegalArgumentException.class ) public void shouldFailToImportArtifactIfNotFound() throws Exception { - modeler().importData( new URL( "file:doesNotExist" ), null ); + modelspace().importData( new URL( "file:doesNotExist" ), null ); } @Test( expected = IllegalArgumentException.class ) public void shouldFailToImportArtifactIfPathEmpty() throws Exception { - modeler().importData( stream( "stuff" ), " " ); + modelspace().importData( stream( "stuff" ), " " ); } @Test( expected = IllegalArgumentException.class ) public void shouldFailToImportArtifactIfPathNull() throws Exception { - modeler().importData( stream( "stuff" ), null ); + modelspace().importData( stream( "stuff" ), null ); } @Test( expected = IllegalArgumentException.class ) public void shouldFailToImportArtifactIfStreamNull() throws Exception { - modeler().importData( ( InputStream ) null, MODEL_NAME ); + modelspace().importData( ( InputStream ) null, MODEL_NAME ); } @Test( expected = IllegalArgumentException.class ) public void shouldFailToImportArtifactIfUrlNull() throws Exception { - modeler().importData( ( URL ) null, null ); + modelspace().importData( ( URL ) null, null ); } @Test( expected = IllegalArgumentException.class ) public void shouldFailToImportFileIfFileNull() throws Exception { - modeler().importData( ( File ) null, null ); + modelspace().importData( ( File ) null, null ); } @Test( expected = IllegalArgumentException.class ) public void shouldFailToImportFileIfNotFound() throws Exception { - modeler().importData( new File( "doesNotExist" ), null ); + modelspace().importData( new File( "doesNotExist" ), null ); } @Test( expected = IllegalArgumentException.class ) public void shouldFailToImportFileUrlIfNotFound() throws Exception { - modeler().importData( new URL( "file:doesNotExist" ), null ); + modelspace().importData( new URL( "file:doesNotExist" ), null ); } @Test public void shouldGetChangedConfigurationPath() throws Exception { - assertThat( modeler().configurationPath(), is( TEST_CONFIGURATION_PATH ) ); + assertThat( modelspace().configurationPath(), is( TEST_CONFIGURATION_PATH ) ); } @Test public void shouldGetDefaultConfigurationPathIfNotSet() throws Exception { - try ( final Modeler modeler = new ModelerImpl( TEST_REPOSITORY_STORE_PARENT_PATH ) ) { - assertThat( modeler.configurationPath(), is( ModelerImpl.DEFAULT_CONFIGURATION_PATH ) ); + try ( final Modelspace modelspace = new ModelspaceImpl( TEST_REPOSITORY_STORE_PARENT_PATH ) ) { + assertThat( modelspace.configurationPath(), is( ModelspaceImpl.DEFAULT_CONFIGURATION_PATH ) ); } } @Test public void shouldGetNullModelIfPathNotFound() throws Exception { - assertThat( modeler().model( "pathNotFound" ), nullValue() ); + assertThat( modelspace().model( "pathNotFound" ), nullValue() ); } @Test public void shouldGetRepositoryStoreParentPath() throws Exception { - assertThat( modeler().repositoryStoreParentPath(), is( TEST_REPOSITORY_STORE_PARENT_PATH ) ); + assertThat( modelspace().repositoryStoreParentPath(), is( TEST_REPOSITORY_STORE_PARENT_PATH ) ); } @Test public void shouldImportArtifact() throws Exception { - final String path = modeler().importData( stream( "stuff" ), "stuff" ); + final String path = modelspace().importData( stream( "stuff" ), "stuff" ); assertThat( path, is( "/stuff" ) ); } @Test public void shouldImportArtifactToSuppliedPath() throws Exception { - final String path = modeler().importData( stream( "stuff" ), "test/stuff" ); + final String path = modelspace().importData( stream( "stuff" ), "test/stuff" ); assertThat( path, is( "/test/stuff" ) ); } @Test public void shouldImportFile() throws Exception { final String path = - modeler().importData( new File( getClass().getClassLoader().getResource( "log4j.properties" ).toURI() ), null ); + modelspace().importData( new File( getClass().getClassLoader().getResource( "log4j.properties" ).toURI() ), null ); assertThat( path, is( "/log4j.properties" ) ); } @Test public void shouldImportFileToSuppliedPath() throws Exception { final String path = - modeler().importData( new File( getClass().getClassLoader().getResource( "log4j.properties" ).toURI() ), "/test" ); + modelspace().importData( new File( getClass().getClassLoader().getResource( "log4j.properties" ).toURI() ), "/test" ); assertThat( path, is( "/test/log4j.properties" ) ); } } diff --git a/modeshape-modeler/modeshape-modeler-engine/src/test/java/org/modeshape/modeler/spi/metamodel/DependencyTest.java b/modelspace/modelspace-engine/src/test/java/org/modelspace/spi/metamodel/DependencyTest.java similarity index 98% rename from modeshape-modeler/modeshape-modeler-engine/src/test/java/org/modeshape/modeler/spi/metamodel/DependencyTest.java rename to modelspace/modelspace-engine/src/test/java/org/modelspace/spi/metamodel/DependencyTest.java index d343e24..8104c23 100644 --- a/modeshape-modeler/modeshape-modeler-engine/src/test/java/org/modeshape/modeler/spi/metamodel/DependencyTest.java +++ b/modelspace/modelspace-engine/src/test/java/org/modelspace/spi/metamodel/DependencyTest.java @@ -21,7 +21,7 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler.spi.metamodel; +package org.modelspace.spi.metamodel; import static org.hamcrest.core.Is.is; import static org.junit.Assert.assertThat; @@ -31,7 +31,7 @@ import java.util.List; import org.junit.Test; -import org.modeshape.modeler.spi.metamodel.Dependency; +import org.modelspace.spi.Dependency; /** * A test for the {@link Dependency} class. diff --git a/modeshape-modeler/modeshape-modeler-engine/src/test/java/org/modeshape/modeler/test/BaseIntegrationTest.java b/modelspace/modelspace-engine/src/test/java/org/modelspace/test/BaseIntegrationTest.java similarity index 91% rename from modeshape-modeler/modeshape-modeler-engine/src/test/java/org/modeshape/modeler/test/BaseIntegrationTest.java rename to modelspace/modelspace-engine/src/test/java/org/modelspace/test/BaseIntegrationTest.java index 6fdec5e..35b72bd 100644 --- a/modeshape-modeler/modeshape-modeler-engine/src/test/java/org/modeshape/modeler/test/BaseIntegrationTest.java +++ b/modelspace/modelspace-engine/src/test/java/org/modelspace/test/BaseIntegrationTest.java @@ -21,7 +21,7 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler.test; +package org.modelspace.test; @SuppressWarnings( "javadoc" ) -public abstract class BaseIntegrationTest extends BaseModelerTest {} +public abstract class BaseIntegrationTest extends BaseModelspaceTest {} diff --git a/modeshape-modeler/modeshape-modeler-engine/src/test/java/org/modeshape/modeler/test/BaseModelerTest.java b/modelspace/modelspace-engine/src/test/java/org/modelspace/test/BaseModelspaceTest.java similarity index 83% rename from modeshape-modeler/modeshape-modeler-engine/src/test/java/org/modeshape/modeler/test/BaseModelerTest.java rename to modelspace/modelspace-engine/src/test/java/org/modelspace/test/BaseModelspaceTest.java index 670322e..72455e2 100644 --- a/modeshape-modeler/modeshape-modeler-engine/src/test/java/org/modeshape/modeler/test/BaseModelerTest.java +++ b/modelspace/modelspace-engine/src/test/java/org/modelspace/test/BaseModelspaceTest.java @@ -21,7 +21,7 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler.test; +package org.modelspace.test; import java.io.File; import java.io.IOException; @@ -34,11 +34,11 @@ import java.nio.file.attribute.BasicFileAttributes; import org.junit.After; -import org.modeshape.modeler.MetamodelManager; -import org.modeshape.modeler.Modeler; +import org.modelspace.MetamodelManager; +import org.modelspace.Modelspace; @SuppressWarnings( "javadoc" ) -public abstract class BaseModelerTest extends BaseTest { +public abstract class BaseModelspaceTest extends BaseTest { protected static final String TEST_CONFIGURATION_PATH = "testConfig.json"; protected static final String TEST_REPOSITORY_STORE_PARENT_PATH; @@ -59,15 +59,15 @@ public abstract class BaseModelerTest extends BaseTest { } } - private Modeler modeler; + private Modelspace modelspace; @After public void after() throws Exception { - if ( modeler != null ) { - modeler.close(); - modeler = null; + if ( modelspace != null ) { + modelspace.close(); + modelspace = null; } - deleteFolder( TEST_REPOSITORY_STORE_PARENT_PATH + "/modelerRepository" ); + deleteFolder( TEST_REPOSITORY_STORE_PARENT_PATH + "/modelspaceRepository" ); deleteFolder( System.getProperty( "java.io.tmpdir" ) + "/modeshape-binary-store" ); } @@ -94,17 +94,17 @@ public FileVisitResult visitFile( final Path file, } public MetamodelManager metamodelManager() throws Exception { - return modeler().metamodelManager(); + return modelspace().metamodelManager(); } - public Modeler modeler() throws Exception { - if ( modeler == null ) { - modeler = Modeler.Factory.instance( TEST_REPOSITORY_STORE_PARENT_PATH, TEST_CONFIGURATION_PATH ); - for ( final URL url : modeler.metamodelManager().metamodelRepositories() ) - modeler.metamodelManager().unregisterMetamodelRepository( url ); + public Modelspace modelspace() throws Exception { + if ( modelspace == null ) { + modelspace = Modelspace.Factory.instance( TEST_REPOSITORY_STORE_PARENT_PATH, TEST_CONFIGURATION_PATH ); + for ( final URL url : modelspace.metamodelManager().metamodelRepositories() ) + modelspace.metamodelManager().unregisterMetamodelRepository( url ); metamodelManager().registerMetamodelRepository( MODULE_TEST_METAMODEL_REPOSITORY_URL ); metamodelManager().registerMetamodelRepository( INTEGRATION_TEST_METAMODEL_REPOSITORY_URL ); } - return modeler; + return modelspace; } } diff --git a/modeshape-modeler/modeshape-modeler-engine/src/test/java/org/modeshape/modeler/test/BaseTest.java b/modelspace/modelspace-engine/src/test/java/org/modelspace/test/BaseTest.java similarity index 97% rename from modeshape-modeler/modeshape-modeler-engine/src/test/java/org/modeshape/modeler/test/BaseTest.java rename to modelspace/modelspace-engine/src/test/java/org/modelspace/test/BaseTest.java index b5e4965..67e237d 100644 --- a/modeshape-modeler/modeshape-modeler-engine/src/test/java/org/modeshape/modeler/test/BaseTest.java +++ b/modelspace/modelspace-engine/src/test/java/org/modelspace/test/BaseTest.java @@ -21,7 +21,7 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler.test; +package org.modelspace.test; import java.io.ByteArrayInputStream; import java.io.InputStream; diff --git a/modeshape-modeler/modeshape-modeler-engine/src/test/java/org/modeshape/modeler/test/TestRunner.java b/modelspace/modelspace-engine/src/test/java/org/modelspace/test/TestRunner.java similarity index 98% rename from modeshape-modeler/modeshape-modeler-engine/src/test/java/org/modeshape/modeler/test/TestRunner.java rename to modelspace/modelspace-engine/src/test/java/org/modelspace/test/TestRunner.java index 26ca183..03e38fe 100644 --- a/modeshape-modeler/modeshape-modeler-engine/src/test/java/org/modeshape/modeler/test/TestRunner.java +++ b/modelspace/modelspace-engine/src/test/java/org/modelspace/test/TestRunner.java @@ -21,7 +21,7 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler.test; +package org.modelspace.test; import java.text.CharacterIterator; import java.text.StringCharacterIterator; diff --git a/modeshape-modeler/modeshape-modeler-engine/src/test/resources/log4j.properties b/modelspace/modelspace-engine/src/test/resources/log4j.properties similarity index 71% rename from modeshape-modeler/modeshape-modeler-engine/src/test/resources/log4j.properties rename to modelspace/modelspace-engine/src/test/resources/log4j.properties index 5df863a..7c714d2 100644 --- a/modeshape-modeler/modeshape-modeler-engine/src/test/resources/log4j.properties +++ b/modelspace/modelspace-engine/src/test/resources/log4j.properties @@ -10,7 +10,7 @@ log4j.rootLogger=ERROR, stdout # Set up the default logging to be ERROR level, then override specific units log4j.logger.org.modeshape=WARN log4j.logger.org.polyglotter=WARN -log4j.logger.org.modeshape.modeler=WARN +log4j.logger.org.modelspace=WARN -#log4j.logger.org.modeshape.modeler.internal.ExtensionInstaller=DEBUG -#log4j.logger.org.modeshape.modeler.internal.ModelTypeManagerImpl=DEBUG +#log4j.logger.org.modelspace.internal.ExtensionInstaller=DEBUG +#log4j.logger.org.modelspace.internal.ModelTypeManagerImpl=DEBUG diff --git a/modeshape-modeler/modeshape-modeler-engine/src/test/resources/testConfig.json b/modelspace/modelspace-engine/src/test/resources/testConfig.json similarity index 54% rename from modeshape-modeler/modeshape-modeler-engine/src/test/resources/testConfig.json rename to modelspace/modelspace-engine/src/test/resources/testConfig.json index 6fd5fce..1a4b4d0 100644 --- a/modeshape-modeler/modeshape-modeler-engine/src/test/resources/testConfig.json +++ b/modelspace/modelspace-engine/src/test/resources/testConfig.json @@ -1,7 +1,7 @@ { - "name" : "ModeShape Modeler Repository", + "name" : "Modelspace Repository", "workspaces" : { - "predefined" : ["Modeler"], + "predefined" : ["Modelspace"], "default" : "default" }, "node-types" : ["metamodel.cnd"] diff --git a/modeshape-modeler/modeshape-modeler-java/pom.xml b/modelspace/modelspace-java/pom.xml similarity index 86% rename from modeshape-modeler/modeshape-modeler-java/pom.xml rename to modelspace/modelspace-java/pom.xml index 22b77bd..cb85653 100644 --- a/modeshape-modeler/modeshape-modeler-java/pom.xml +++ b/modelspace/modelspace-java/pom.xml @@ -7,16 +7,16 @@ org.polyglotter - modeshape-modeler + modelspace 0.0.1-SNAPSHOT - modeshape-modeler-java - ModeShape Modeler for Java - An implementation of a Java dependency processor. + modelspace-java + Modelspace for Java + Java SPI implementation for Modelspace. @@ -28,12 +28,12 @@ org.polyglotter - modeshape-modeler-engine + modelspace-engine org.polyglotter - modeshape-modeler-engine + modelspace-engine test-jar @@ -85,8 +85,8 @@ src/assembly/module-with-dependencies.xml - ${project.build.directory}/org/modeshape/modeshape-modeler-java/${modeshape.version} - modeshape-modeler-java-${modeshape.version} + ${project.build.directory}/org/polyglotter/modelspace-java/${modeshape.version} + modelspace-java-${modeshape.version} diff --git a/modeshape-modeler/modeshape-modeler-java/src/assembly/module-with-dependencies.xml b/modelspace/modelspace-java/src/assembly/module-with-dependencies.xml similarity index 100% rename from modeshape-modeler/modeshape-modeler-java/src/assembly/module-with-dependencies.xml rename to modelspace/modelspace-java/src/assembly/module-with-dependencies.xml diff --git a/modeshape-modeler/modeshape-modeler-java/src/main/java/org/modeshape/modeler/java/JavaDependencyProcessor.java b/modelspace/modelspace-java/src/main/java/org/modelspace/java/JavaDependencyProcessor.java similarity index 73% rename from modeshape-modeler/modeshape-modeler-java/src/main/java/org/modeshape/modeler/java/JavaDependencyProcessor.java rename to modelspace/modelspace-java/src/main/java/org/modelspace/java/JavaDependencyProcessor.java index cb76c24..5bfa260 100644 --- a/modeshape-modeler/modeshape-modeler-java/src/main/java/org/modeshape/modeler/java/JavaDependencyProcessor.java +++ b/modelspace/modelspace-java/src/main/java/org/modelspace/java/JavaDependencyProcessor.java @@ -21,15 +21,15 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler.java; +package org.modelspace.java; import javax.jcr.Node; import javax.jcr.RepositoryException; +import org.modelspace.Modelspace; +import org.modelspace.ModelspaceException; +import org.modelspace.spi.DependencyProcessor; import org.modeshape.jcr.api.JcrTools; -import org.modeshape.modeler.Modeler; -import org.modeshape.modeler.ModelerException; -import org.modeshape.modeler.spi.metamodel.DependencyProcessor; /** * @@ -39,29 +39,29 @@ public class JavaDependencyProcessor implements DependencyProcessor { /** * {@inheritDoc} * - * @see org.modeshape.modeler.spi.metamodel.DependencyProcessor#metamodelId() + * @see org.modelspace.spi.DependencyProcessor#metamodelId() */ @Override public String metamodelId() { - return "org.modeshape.modeler.java.JavaFile"; + return "org.modelspace.java.JavaFile"; } /** * {@inheritDoc} * - * @see org.modeshape.modeler.spi.metamodel.DependencyProcessor#process(java.lang.String, javax.jcr.Node, - * org.modeshape.modeler.Modeler, boolean) + * @see org.modelspace.spi.DependencyProcessor#process(java.lang.String, javax.jcr.Node, + * org.modelspace.Modelspace, boolean) */ @Override public String process( final String dataPath, final Node modelNode, - final Modeler modeler, - final boolean persistArtifacts ) throws ModelerException { + final Modelspace modelspace, + final boolean persistArtifacts ) throws ModelspaceException { try { new JcrTools().printSubgraph( modelNode ); return null; } catch ( final RepositoryException e ) { - throw new ModelerException( e, "Unable to resolve dependencies for \"%s\"", modelNode ); + throw new ModelspaceException( e, "Unable to resolve dependencies for \"%s\"", modelNode ); } } diff --git a/modeshape-modeler/modeshape-modeler-java/src/test/java/org/modeshape/modeler/ITMetamodel.java b/modelspace/modelspace-java/src/test/java/org/modelspace/ITMetamodel.java similarity index 87% rename from modeshape-modeler/modeshape-modeler-java/src/test/java/org/modeshape/modeler/ITMetamodel.java rename to modelspace/modelspace-java/src/test/java/org/modelspace/ITMetamodel.java index d0f0c4c..0c13e12 100644 --- a/modeshape-modeler/modeshape-modeler-java/src/test/java/org/modeshape/modeler/ITMetamodel.java +++ b/modelspace/modelspace-java/src/test/java/org/modelspace/ITMetamodel.java @@ -21,21 +21,23 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler; +package org.modelspace; import static org.hamcrest.core.IsNot.not; import static org.hamcrest.core.IsNull.notNullValue; import static org.junit.Assert.assertThat; import org.junit.Test; -import org.modeshape.modeler.test.JavaIntegrationTest; +import org.modelspace.Descriptor; +import org.modelspace.Metamodel; +import org.modelspace.test.JavaIntegrationTest; @SuppressWarnings( "javadoc" ) public class ITMetamodel extends JavaIntegrationTest { @Test public void shouldGetDescriptors() throws Exception { - final Metamodel metamodel = modeler().metamodelManager().metamodel( METAMODEL_ID ); + final Metamodel metamodel = modelspace().metamodelManager().metamodel( METAMODEL_ID ); assertThat( metamodel, notNullValue() ); final Descriptor[] descriptors = metamodel.descriptors(); assertThat( descriptors, notNullValue() ); diff --git a/modeshape-modeler/modeshape-modeler-java/src/test/java/org/modeshape/modeler/ITMetamodelManager.java b/modelspace/modelspace-java/src/test/java/org/modelspace/ITMetamodelManager.java similarity index 69% rename from modeshape-modeler/modeshape-modeler-java/src/test/java/org/modeshape/modeler/ITMetamodelManager.java rename to modelspace/modelspace-java/src/test/java/org/modelspace/ITMetamodelManager.java index 5b817d5..89cdff9 100644 --- a/modeshape-modeler/modeshape-modeler-java/src/test/java/org/modeshape/modeler/ITMetamodelManager.java +++ b/modelspace/modelspace-java/src/test/java/org/modelspace/ITMetamodelManager.java @@ -21,7 +21,7 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler; +package org.modelspace; import static org.hamcrest.core.Is.is; import static org.hamcrest.core.IsNot.not; @@ -31,15 +31,18 @@ import java.net.URL; import org.junit.Test; -import org.modeshape.modeler.internal.ModelerImpl; -import org.modeshape.modeler.test.JavaIntegrationTest; +import org.modelspace.Metamodel; +import org.modelspace.MetamodelManager; +import org.modelspace.Modelspace; +import org.modelspace.internal.ModelspaceImpl; +import org.modelspace.test.JavaIntegrationTest; @SuppressWarnings( "javadoc" ) public class ITMetamodelManager extends JavaIntegrationTest { @Test public void shouldGetApplicableMetamodelManager() throws Exception { - final Metamodel[] metamodels = metamodelManager().metamodelsForArtifact( modeler().importData( MODEL_FILE, null ) ); + final Metamodel[] metamodels = metamodelManager().metamodelsForArtifact( modelspace().importData( MODEL_FILE, null ) ); assertThat( metamodels, notNullValue() ); assertThat( metamodels.length == 0, is( false ) ); } @@ -70,12 +73,12 @@ public void shouldGetMetamodelCategories() throws Exception { @Test public void shouldIniitializeMetamodelRepositories() throws Exception { - modeler().close(); - try ( final Modeler modeler = Modeler.Factory.instance( TEST_REPOSITORY_STORE_PARENT_PATH, TEST_CONFIGURATION_PATH ) ) + modelspace().close(); + try ( final Modelspace modelspace = Modelspace.Factory.instance( TEST_REPOSITORY_STORE_PARENT_PATH, TEST_CONFIGURATION_PATH ) ) { - assertThat( modeler.metamodelManager().metamodelRepositories()[ 0 ], is( new URL( + assertThat( modelspace.metamodelManager().metamodelRepositories()[ 0 ], is( new URL( MetamodelManager.JBOSS_METAMODEL_REPOSITORY ) ) ); - assertThat( modeler.metamodelManager().metamodelRepositories()[ 1 ], is( new URL( + assertThat( modelspace.metamodelManager().metamodelRepositories()[ 1 ], is( new URL( MetamodelManager.MAVEN_METAMODEL_REPOSITORY ) ) ); } } @@ -89,27 +92,27 @@ public void shouldInstallMetamodels() throws Exception { @Test public void shouldMoveMetamodelRepositoryDown() throws Exception { - modeler().close(); - try ( Modeler modeler = Modeler.Factory.instance( TEST_REPOSITORY_STORE_PARENT_PATH, TEST_CONFIGURATION_PATH ) ) { + modelspace().close(); + try ( Modelspace modelspace = Modelspace.Factory.instance( TEST_REPOSITORY_STORE_PARENT_PATH, TEST_CONFIGURATION_PATH ) ) { final URL url = new URL( MetamodelManager.JBOSS_METAMODEL_REPOSITORY ); - final int size = modeler.metamodelManager().metamodelRepositories().length; - assertThat( modeler.metamodelManager().metamodelRepositories()[ 0 ], is( url ) ); - modeler.metamodelManager().moveMetamodelRepositoryDown( url ); - assertThat( modeler.metamodelManager().metamodelRepositories()[ 1 ], is( url ) ); - assertThat( modeler.metamodelManager().metamodelRepositories().length, is( size ) ); + final int size = modelspace.metamodelManager().metamodelRepositories().length; + assertThat( modelspace.metamodelManager().metamodelRepositories()[ 0 ], is( url ) ); + modelspace.metamodelManager().moveMetamodelRepositoryDown( url ); + assertThat( modelspace.metamodelManager().metamodelRepositories()[ 1 ], is( url ) ); + assertThat( modelspace.metamodelManager().metamodelRepositories().length, is( size ) ); } } @Test public void shouldMoveMetamodelRepositoryUp() throws Exception { - modeler().close(); - try ( Modeler modeler = Modeler.Factory.instance( TEST_REPOSITORY_STORE_PARENT_PATH, TEST_CONFIGURATION_PATH ) ) { + modelspace().close(); + try ( Modelspace modelspace = Modelspace.Factory.instance( TEST_REPOSITORY_STORE_PARENT_PATH, TEST_CONFIGURATION_PATH ) ) { final URL url = new URL( MetamodelManager.MAVEN_METAMODEL_REPOSITORY ); - final int size = modeler.metamodelManager().metamodelRepositories().length; - assertThat( modeler.metamodelManager().metamodelRepositories()[ 1 ], is( url ) ); - modeler.metamodelManager().moveMetamodelRepositoryUp( url ); - assertThat( modeler.metamodelManager().metamodelRepositories()[ 0 ], is( url ) ); - assertThat( modeler.metamodelManager().metamodelRepositories().length, is( size ) ); + final int size = modelspace.metamodelManager().metamodelRepositories().length; + assertThat( modelspace.metamodelManager().metamodelRepositories()[ 1 ], is( url ) ); + modelspace.metamodelManager().moveMetamodelRepositoryUp( url ); + assertThat( modelspace.metamodelManager().metamodelRepositories()[ 0 ], is( url ) ); + assertThat( modelspace.metamodelManager().metamodelRepositories().length, is( size ) ); } } @@ -124,12 +127,12 @@ public void shouldNotInstallMetamodelCategoryIfAlreadyInstalled() throws Excepti @Test public void shouldNotMoveMetamodelRepositoryDownIfUrlLast() throws Exception { - modeler().close(); - try ( Modeler modeler = Modeler.Factory.instance( TEST_REPOSITORY_STORE_PARENT_PATH, TEST_CONFIGURATION_PATH ) ) { - final URL[] urls = modeler.metamodelManager().metamodelRepositories(); + modelspace().close(); + try ( Modelspace modelspace = Modelspace.Factory.instance( TEST_REPOSITORY_STORE_PARENT_PATH, TEST_CONFIGURATION_PATH ) ) { + final URL[] urls = modelspace.metamodelManager().metamodelRepositories(); final URL url = new URL( MetamodelManager.MAVEN_METAMODEL_REPOSITORY ); - modeler.metamodelManager().moveMetamodelRepositoryDown( url ); - assertThat( modeler.metamodelManager().metamodelRepositories(), is( urls ) ); + modelspace.metamodelManager().moveMetamodelRepositoryDown( url ); + assertThat( modelspace.metamodelManager().metamodelRepositories(), is( urls ) ); } } @@ -151,16 +154,16 @@ public void shouldOnlyInstallMetamodelCategoryOnce() throws Exception { @Test public void shouldRestorePreviouslySavedState() throws Exception { - modeler().close(); - try ( Modeler modeler = new ModelerImpl( TEST_REPOSITORY_STORE_PARENT_PATH ) ) { - final MetamodelManager metamodelManager = modeler.metamodelManager(); + modelspace().close(); + try ( Modelspace modelspace = new ModelspaceImpl( TEST_REPOSITORY_STORE_PARENT_PATH ) ) { + final MetamodelManager metamodelManager = modelspace.metamodelManager(); for ( final URL url : metamodelManager.metamodelRepositories() ) metamodelManager.unregisterMetamodelRepository( url ); metamodelManager.registerMetamodelRepository( INTEGRATION_TEST_METAMODEL_REPOSITORY_URL ); metamodelManager.install( "java" ); } - try ( Modeler modeler = new ModelerImpl( TEST_REPOSITORY_STORE_PARENT_PATH ) ) { - final MetamodelManager metamodelManager = modeler.metamodelManager(); + try ( Modelspace modelspace = new ModelspaceImpl( TEST_REPOSITORY_STORE_PARENT_PATH ) ) { + final MetamodelManager metamodelManager = modelspace.metamodelManager(); assertThat( metamodelManager.metamodelRepositories().length, is( 1 ) ); assertThat( metamodelManager.metamodelCategories().length, is( 1 ) ); assertThat( metamodelManager.metamodels().length, is( 2 ) ); diff --git a/modeshape-modeler/modeshape-modeler-java/src/test/java/org/modeshape/modeler/ITModel.java b/modelspace/modelspace-java/src/test/java/org/modelspace/ITModel.java similarity index 89% rename from modeshape-modeler/modeshape-modeler-java/src/test/java/org/modeshape/modeler/ITModel.java rename to modelspace/modelspace-java/src/test/java/org/modelspace/ITModel.java index 4af7780..fac960e 100644 --- a/modeshape-modeler/modeshape-modeler-java/src/test/java/org/modeshape/modeler/ITModel.java +++ b/modelspace/modelspace-java/src/test/java/org/modelspace/ITModel.java @@ -21,14 +21,17 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler; +package org.modelspace; import static org.hamcrest.core.Is.is; import static org.hamcrest.core.IsNull.notNullValue; import static org.junit.Assert.assertThat; import org.junit.Test; -import org.modeshape.modeler.test.JavaIntegrationTest; +import org.modelspace.Metamodel; +import org.modelspace.Model; +import org.modelspace.ModelspaceLexicon; +import org.modelspace.test.JavaIntegrationTest; @SuppressWarnings( "javadoc" ) public class ITModel extends JavaIntegrationTest { @@ -42,7 +45,7 @@ public void shouldGetDependencies() throws Exception { public void shouldGetExternalLocation() throws Exception { final Model model = importModel(); assertThat( model, notNullValue() ); - assertThat( model.property( ModelerLexicon.Model.EXTERNAL_LOCATION ).stringValue().endsWith( MODEL_PATH ), is( true ) ); + assertThat( model.property( ModelspaceLexicon.Model.EXTERNAL_LOCATION ).stringValue().endsWith( MODEL_PATH ), is( true ) ); } @Test diff --git a/modeshape-modeler/modeshape-modeler-java/src/test/java/org/modeshape/modeler/ITModelObject.java b/modelspace/modelspace-java/src/test/java/org/modelspace/ITModelObject.java similarity index 95% rename from modeshape-modeler/modeshape-modeler-java/src/test/java/org/modeshape/modeler/ITModelObject.java rename to modelspace/modelspace-java/src/test/java/org/modelspace/ITModelObject.java index 358a005..2db3d1c 100644 --- a/modeshape-modeler/modeshape-modeler-java/src/test/java/org/modeshape/modeler/ITModelObject.java +++ b/modelspace/modelspace-java/src/test/java/org/modelspace/ITModelObject.java @@ -21,7 +21,7 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler; +package org.modelspace; import static org.hamcrest.core.Is.is; import static org.hamcrest.core.IsNot.not; @@ -33,9 +33,9 @@ import java.util.Map; import org.junit.Test; +import org.modelspace.test.JavaIntegrationTest; import org.modeshape.jcr.JcrLexicon; import org.modeshape.jcr.JcrNtLexicon; -import org.modeshape.modeler.test.JavaIntegrationTest; import org.modeshape.sequencer.classfile.ClassFileSequencerLexicon; @SuppressWarnings( "javadoc" ) @@ -121,7 +121,7 @@ public void shouldAddChildOfTypeWithProperties() throws Exception { public void shouldAddMixinType() throws Exception { final ModelObject obj = modelObject(); final int mixins = obj.mixinTypes().length; - obj.addMixinType( ModelerLexicon.UNSTRUCTURED_MIXIN, ModelerLexicon.Model.MODEL_MIXIN ); + obj.addMixinType( ModelspaceLexicon.UNSTRUCTURED_MIXIN, ModelspaceLexicon.Model.MODEL_MIXIN ); assertThat( obj.mixinTypes().length, is( mixins + 2 ) ); } @@ -130,7 +130,7 @@ public void shouldAddMixinTypeWithProperties() throws Exception { final ModelObject obj = modelObject(); final int mixins = obj.mixinTypes().length; final Map< String, ? > props = primaryTypeProperties(); - obj.addMixinType( ModelerLexicon.UNSTRUCTURED_MIXIN, props ); + obj.addMixinType( ModelspaceLexicon.UNSTRUCTURED_MIXIN, props ); assertThat( obj.mixinTypes().length, is( mixins + 1 ) ); assertThat( obj.hasProperty( ClassFileSequencerLexicon.VISIBILITY ), is( true ) ); assertThat( obj.property( ClassFileSequencerLexicon.VISIBILITY ).stringValue(), is( "public" ) ); @@ -211,41 +211,41 @@ public void shouldFailToAddMixinTypeWithPropertiesIfMissingMandatoryProperties() modelObject().addMixinType( ClassFileSequencerLexicon.CLASS, NULL_VALUES_BY_PROPERTY ); } - @Test( expected = ModelerException.class ) + @Test( expected = ModelspaceException.class ) public void shouldFailToGetBooleanValueIfMultiValuedProperty() throws Exception { final ModelObject obj = modelObject(); obj.setProperty( "blah", true, true ); obj.property( "blah" ).booleanValue(); } - @Test( expected = ModelerException.class ) + @Test( expected = ModelspaceException.class ) public void shouldFailToGetBooleanValueIfNonBooleanProperty() throws Exception { modelObject().property( JcrLexicon.PRIMARY_TYPE.toString() ).booleanValue(); } - @Test( expected = ModelerException.class ) + @Test( expected = ModelspaceException.class ) public void shouldFailToGetBooleanValuesIfNonBooleanProperty() throws Exception { modelObject().property( JcrLexicon.PRIMARY_TYPE.toString() ).booleanValues(); } - @Test( expected = ModelerException.class ) + @Test( expected = ModelspaceException.class ) public void shouldFailToGetLongValueIfMultiValuedProperty() throws Exception { final ModelObject obj = modelObject(); obj.setProperty( "blah", 0L, 0L ); obj.property( "blah" ).longValue(); } - @Test( expected = ModelerException.class ) + @Test( expected = ModelspaceException.class ) public void shouldFailToGetLongValueIfNonLongCompatibleProperty() throws Exception { modelObject().property( JcrLexicon.PRIMARY_TYPE.toString() ).longValue(); } - @Test( expected = ModelerException.class ) + @Test( expected = ModelspaceException.class ) public void shouldFailToGetLongValuesIfNonLongCompatibleProperty() throws Exception { modelObject().property( JcrLexicon.PRIMARY_TYPE.toString() ).longValues(); } - @Test( expected = ModelerException.class ) + @Test( expected = ModelspaceException.class ) public void shouldFailToGetStringValueIfMultiValuedProperty() throws Exception { modelObject().property( JcrLexicon.MIXIN_TYPES.getString() ).stringValue(); } @@ -313,9 +313,9 @@ public void shouldFailToSetPrimaryTypeWithPropertiesIfInvalidType() throws Excep modelObject().setPrimaryType( ClassFileSequencerLexicon.PACKAGE, NULL_VALUES_BY_PROPERTY ); } - @Test( expected = ModelerException.class ) + @Test( expected = ModelspaceException.class ) public void shouldFailToSetPropertyIfNotMultiValuedProperty() throws Exception { - importModel().property( ModelerLexicon.Model.EXTERNAL_LOCATION ).set( " ", " " ); + importModel().property( ModelspaceLexicon.Model.EXTERNAL_LOCATION ).set( " ", " " ); } @Test( expected = IllegalArgumentException.class ) @@ -335,9 +335,9 @@ public void shouldGetAbsolutePath() throws Exception { @Test public void shouldGetChild() throws Exception { - final ModelObject child = modelObject().child( "modeshape" ); + final ModelObject child = modelObject().child( "modelspace" ); assertThat( child, notNullValue() ); - assertThat( child.name(), is( "modeshape" ) ); + assertThat( child.name(), is( "modelspace" ) ); assertThat( child.child( "blah" ), nullValue() ); } @@ -346,7 +346,7 @@ public void shouldGetChildren() throws Exception { ModelObject[] children = modelObject().children(); assertThat( children, notNullValue() ); assertThat( children.length, not( 0 ) ); - children = children[ 0 ].children()[ 0 ].children()[ 0 ].children()[ 0 ].children()[ 0 ].children(); + children = children[ 0 ].children()[ 0 ].children()[ 0 ].children()[ 0 ].children(); assertThat( children, notNullValue() ); assertThat( children.length, is( 0 ) ); } @@ -357,7 +357,7 @@ public void shouldGetChildrenMatchingPattern() throws Exception { assertThat( children, notNullValue() ); assertThat( children.length, not( 0 ) ); final ModelObject child = children[ 0 ]; - assertThat( child.name(), is( "modeshape" ) ); + assertThat( child.name(), is( "modelspace" ) ); children = child.children( "blah" ); assertThat( children, notNullValue() ); assertThat( children.length, is( 0 ) ); @@ -440,7 +440,7 @@ public void shouldIndicateIfChildHasSameNameSiblings() throws Exception { @Test public void shouldIndicateIfHasChild() throws Exception { final ModelObject obj = modelObject(); - assertThat( obj.hasChild( "modeshape" ), is( true ) ); + assertThat( obj.hasChild( "modelspace" ), is( true ) ); assertThat( obj.hasChild( "blah" ), is( false ) ); } @@ -493,9 +493,9 @@ public void shouldRemoveChild() throws Exception { public void shouldRemoveMixinType() throws Exception { final ModelObject obj = modelObject(); assertThat( obj.mixinTypes().length, is( 1 ) ); - obj.addMixinType( ModelerLexicon.UNSTRUCTURED_MIXIN ); + obj.addMixinType( ModelspaceLexicon.UNSTRUCTURED_MIXIN ); assertThat( obj.mixinTypes().length, is( 2 ) ); - obj.removeMixinType( ClassFileSequencerLexicon.PACKAGE, ModelerLexicon.UNSTRUCTURED_MIXIN ); + obj.removeMixinType( ClassFileSequencerLexicon.PACKAGE, ModelspaceLexicon.UNSTRUCTURED_MIXIN ); assertThat( obj.mixinTypes().length, is( 0 ) ); } @@ -505,7 +505,7 @@ public void shouldSetMixinTypes() throws Exception { assertThat( obj.mixinTypes().length, not( 0 ) ); obj.setMixinTypes(); assertThat( obj.mixinTypes().length, is( 0 ) ); - obj.setMixinTypes( ClassFileSequencerLexicon.PACKAGE, ModelerLexicon.Model.MODEL_MIXIN ); + obj.setMixinTypes( ClassFileSequencerLexicon.PACKAGE, ModelspaceLexicon.Model.MODEL_MIXIN ); assertThat( obj.mixinTypes().length, is( 2 ) ); obj.setMixinTypes(); assertThat( obj.mixinTypes().length, is( 0 ) ); @@ -524,7 +524,7 @@ public void shouldSetMixinTypeWithProperties() throws Exception { assertThat( mixinTypes[ 0 ].name(), is( ClassFileSequencerLexicon.PACKAGE ) ); assertThat( obj.hasProperty( ClassFileSequencerLexicon.VISIBILITY ), is( true ) ); assertThat( obj.property( ClassFileSequencerLexicon.VISIBILITY ).stringValue(), is( "public" ) ); - final ModelObject child = obj.child( "modeshape" ); + final ModelObject child = obj.child( "modelspace" ); child.setMixinType( null, props ); assertThat( child.mixinTypes().length, is( 0 ) ); mixinTypes = child.mixinTypes(); diff --git a/modeshape-modeler/modeshape-modeler-java/src/test/java/org/modeshape/modeler/ITModeler.java b/modelspace/modelspace-java/src/test/java/org/modelspace/ITModelspace.java similarity index 70% rename from modeshape-modeler/modeshape-modeler-java/src/test/java/org/modeshape/modeler/ITModeler.java rename to modelspace/modelspace-java/src/test/java/org/modelspace/ITModelspace.java index 6e94e3d..c5e5bbb 100644 --- a/modeshape-modeler/modeshape-modeler-java/src/test/java/org/modeshape/modeler/ITModeler.java +++ b/modelspace/modelspace-java/src/test/java/org/modelspace/ITModelspace.java @@ -21,7 +21,7 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler; +package org.modelspace; import static org.hamcrest.core.Is.is; import static org.hamcrest.core.IsNull.notNullValue; @@ -30,30 +30,32 @@ import java.io.InputStream; import org.junit.Test; -import org.modeshape.modeler.test.JavaIntegrationTest; +import org.modelspace.Model; +import org.modelspace.ModelspaceException; +import org.modelspace.test.JavaIntegrationTest; @SuppressWarnings( "javadoc" ) -public class ITModeler extends JavaIntegrationTest { +public class ITModelspace extends JavaIntegrationTest { @Test public void shouldDeleteTemporaryDataAfterImportingModel() throws Exception { - final String path = modeler().importData( MODEL_FILE, null ); - final Model model = modeler().generateModel( path, "model", metamodel() ); + final String path = modelspace().importData( MODEL_FILE, null ); + final Model model = modelspace().generateModel( path, "model", metamodel() ); assertThat( model, notNullValue() ); // TODO: Complete when task #185 is complete - // final Model model = modeler().generateModel( path, "model", metamodel(), false ); + // final Model model = modelspace().generateModel( path, "model", metamodel(), false ); // assertThat( model, notNullValue() ); } - @Test( expected = ModelerException.class ) + @Test( expected = ModelspaceException.class ) public void shouldFailToCreateModelIfMetamodelIsInapplicable() throws Exception { - modeler().importModel( stream( "stuff" ), MODEL_NAME, metamodel() ); + modelspace().importModel( stream( "stuff" ), MODEL_NAME, metamodel() ); } @Test public void shouldGetModel() throws Exception { final Model importedModel = importModel(); - final Model model = modeler().model( MODEL_NAME ); + final Model model = modelspace().model( MODEL_NAME ); assertThat( model, is( importedModel ) ); } @@ -64,7 +66,7 @@ public void shouldImportModelFromFile() throws Exception { @Test public void shouldImportModelFromFileWithSuppliedName() throws Exception { - final Model model = modeler().importModel( MODEL_FILE, null, MODEL_NAME, metamodel() ); + final Model model = modelspace().importModel( MODEL_FILE, null, MODEL_NAME, metamodel() ); assertThat( model, notNullValue() ); assertThat( model.name(), is( MODEL_NAME ) ); } @@ -72,28 +74,28 @@ public void shouldImportModelFromFileWithSuppliedName() throws Exception { @Test public void shouldImportModelFromStream() throws Exception { try ( InputStream stream = MODEL_FILE.toURI().toURL().openStream() ) { - final Model model = modeler().importModel( stream, MODEL_NAME, metamodel() ); + final Model model = modelspace().importModel( stream, MODEL_NAME, metamodel() ); assertThat( model, notNullValue() ); } } @Test public void shouldImportModelFromUrl() throws Exception { - final Model model = modeler().importModel( MODEL_FILE.toURI().toURL(), null, metamodel() ); + final Model model = modelspace().importModel( MODEL_FILE.toURI().toURL(), null, metamodel() ); assertThat( model, notNullValue() ); } @Test public void shouldImportModelFromUrlWithSuppliedName() throws Exception { - final Model model = modeler().importModel( MODEL_FILE.toURI().toURL(), null, MODEL_NAME, metamodel() ); + final Model model = modelspace().importModel( MODEL_FILE.toURI().toURL(), null, MODEL_NAME, metamodel() ); assertThat( model, notNullValue() ); assertThat( model.name(), is( MODEL_NAME ) ); } @Test public void shouldImportModelFromWorkspace() throws Exception { - final String path = modeler().importData( MODEL_FILE, null ); - final Model model = modeler().generateModel( path, "model", metamodel() ); + final String path = modelspace().importData( MODEL_FILE, null ); + final Model model = modelspace().generateModel( path, "model", metamodel() ); assertThat( model, notNullValue() ); } } diff --git a/modeshape-modeler/modeshape-modeler-java/src/test/java/org/modeshape/modeler/java/ITJava.java b/modelspace/modelspace-java/src/test/java/org/modelspace/java/ITJava.java similarity index 86% rename from modeshape-modeler/modeshape-modeler-java/src/test/java/org/modeshape/modeler/java/ITJava.java rename to modelspace/modelspace-java/src/test/java/org/modelspace/java/ITJava.java index e30a220..a4aad5d 100644 --- a/modeshape-modeler/modeshape-modeler-java/src/test/java/org/modeshape/modeler/java/ITJava.java +++ b/modelspace/modelspace-java/src/test/java/org/modelspace/java/ITJava.java @@ -21,13 +21,13 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler.java; +package org.modelspace.java; import static org.hamcrest.core.IsNull.notNullValue; import static org.junit.Assert.assertThat; import org.junit.Test; -import org.modeshape.modeler.test.JavaIntegrationTest; +import org.modelspace.test.JavaIntegrationTest; @SuppressWarnings( "javadoc" ) public class ITJava extends JavaIntegrationTest { @@ -39,16 +39,16 @@ public void shouldGetDependencyProcessor() throws Exception { // private Node createDependenciesNode( final Session session, // final Model model ) throws Exception { - // final Node dependenciesNode = session.getNode( model.absolutePath() ).addNode( ModelerLexicon.Model.DEPENDENCIES ); + // final Node dependenciesNode = session.getNode( model.absolutePath() ).addNode( ModelspaceLexicon.Model.DEPENDENCIES ); // return dependenciesNode; // } // // private Node createDependencyNode( final Node dependenciesNode, // final String dependencyNodeName, // final String dependencyWorkspacePath ) throws Exception { - // final Node dependencyNode = dependenciesNode.addNode( dependencyNodeName, ModelerLexicon.Dependency.DEPENDENCY ); - // dependencyNode.setProperty( ModelerLexicon.Dependency.PATH, dependencyWorkspacePath ); - // dependencyNode.setProperty( ModelerLexicon.Dependency.SOURCE_REFERENCE_PROPERTY, new String[] { "import" } ); // mandatory + // final Node dependencyNode = dependenciesNode.addNode( dependencyNodeName, ModelspaceLexicon.Dependency.DEPENDENCY ); + // dependencyNode.setProperty( ModelspaceLexicon.Dependency.PATH, dependencyWorkspacePath ); + // dependencyNode.setProperty( ModelspaceLexicon.Dependency.SOURCE_REFERENCE_PROPERTY, new String[] { "import" } ); // mandatory // // property // return dependencyNode; // } @@ -61,14 +61,14 @@ public void shouldGetDependencyProcessor() throws Exception { // @Test // public void shouldRecordExternalLocationIfImportArtifact() throws Exception { // final URL url = new URL( "File:src/test/resources/Books.xsd" ); - // final String path = modeler().importArtifact( url, null ); - // modeler().run( new TaskWithResult< Void >() { + // final String path = modelspace().importArtifact( url, null ); + // modelspace().run( new TaskWithResult< Void >() { // // @Override // public Void run( final Session session ) throws Exception { // final Node node = session.getNode( path ); // assertThat( node, notNullValue() ); - // assertThat( node.getProperty( ModelerLexicon.Model.EXTERNAL_LOCATION ).getString(), is( url.toString() ) ); + // assertThat( node.getProperty( ModelspaceLexicon.Model.EXTERNAL_LOCATION ).getString(), is( url.toString() ) ); // return null; // } // } ); @@ -77,21 +77,21 @@ public void shouldGetDependencyProcessor() throws Exception { // @Test // public void shouldRecordUrlIfImportFile() throws Exception { // final URI uri = getClass().getClassLoader().getResource( "Books.xsd" ).toURI(); - // final String path = modeler().importFile( new File( uri ), null ); - // modeler().run( new TaskWithResult< Void >() { + // final String path = modelspace().importFile( new File( uri ), null ); + // modelspace().run( new TaskWithResult< Void >() { // // @Override // public Void run( final Session session ) throws Exception { // final Node node = session.getNode( path ); // assertThat( node, notNullValue() ); - // assertThat( node.getProperty( ModelerLexicon.Model.EXTERNAL_LOCATION ).getString(), is( uri.toString() ) ); + // assertThat( node.getProperty( ModelspaceLexicon.Model.EXTERNAL_LOCATION ).getString(), is( uri.toString() ) ); // return null; // } // } ); // } // // private void verifyPathExistsWithContent( final String path ) throws Exception { - // modeler().run( new TaskWithResult< Void >() { + // modelspace().run( new TaskWithResult< Void >() { // // @Override // public Void run( final Session session ) throws Exception { @@ -105,7 +105,7 @@ public void shouldGetDependencyProcessor() throws Exception { // } // @Test // public void shouldObtainDependencies() throws Exception { - // modeler().run( new TaskWithResult< Void >() { + // modelspace().run( new TaskWithResult< Void >() { // // @Override // public Void run( final Session session ) throws Exception { @@ -145,7 +145,7 @@ public void shouldGetDependencyProcessor() throws Exception { // // @Test // public void shouldObtainMissingDependencies() throws Exception { - // modeler().run( new TaskWithResult< Void >() { + // modelspace().run( new TaskWithResult< Void >() { // // @Override // public Void run( final Session session ) throws Exception { @@ -168,7 +168,7 @@ public void shouldGetDependencyProcessor() throws Exception { // // @Test // public void shouldVerifyDependenciesAllExist() throws Exception { - // modeler().run( new TaskWithResult< Void >() { + // modelspace().run( new TaskWithResult< Void >() { // // @Override // public Void run( final Session session ) throws Exception { @@ -190,7 +190,7 @@ public void shouldGetDependencyProcessor() throws Exception { // // @Test // public void shouldVerifyDependenciesDoNotAllExist() throws Exception { - // modeler().run( new TaskWithResult< Void >() { + // modelspace().run( new TaskWithResult< Void >() { // // @Override // public Void run( final Session session ) throws Exception { @@ -211,7 +211,7 @@ public void shouldGetDependencyProcessor() throws Exception { // // @Test // public void shouldVerifyDependencyExists() throws Exception { - // modeler().run( new TaskWithResult< Void >() { + // modelspace().run( new TaskWithResult< Void >() { // // @Override // public Void run( final Session session ) throws Exception { diff --git a/modeshape-modeler/modeshape-modeler-java/src/test/java/org/modeshape/modeler/java/ITJavaDependencyProcessor.java b/modelspace/modelspace-java/src/test/java/org/modelspace/java/ITJavaDependencyProcessor.java similarity index 82% rename from modeshape-modeler/modeshape-modeler-java/src/test/java/org/modeshape/modeler/java/ITJavaDependencyProcessor.java rename to modelspace/modelspace-java/src/test/java/org/modelspace/java/ITJavaDependencyProcessor.java index ea5bf2d..f07f5c1 100644 --- a/modeshape-modeler/modeshape-modeler-java/src/test/java/org/modeshape/modeler/java/ITJavaDependencyProcessor.java +++ b/modelspace/modelspace-java/src/test/java/org/modelspace/java/ITJavaDependencyProcessor.java @@ -21,10 +21,10 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler.java; +package org.modelspace.java; import org.junit.Test; -import org.modeshape.modeler.test.JavaIntegrationTest; +import org.modelspace.test.JavaIntegrationTest; @SuppressWarnings( "javadoc" ) public class ITJavaDependencyProcessor extends JavaIntegrationTest { @@ -34,12 +34,12 @@ public void should() {} // @Test // public void shouldFindDependencyProcessor() throws Exception { - // modeler().run( new TaskWithResult< Void >() { + // modelspace().run( new TaskWithResult< Void >() { // // @Override // public Void run( final Session session ) throws Exception { // metamodelManager().install( "java" ); - // final Metamodel metamodel = metamodelManager().metamodel( "org.modeshape.modeler.java.JavaFile" ); + // final Metamodel metamodel = metamodelManager().metamodel( "org.modelspace.java.JavaFile" ); // assertThat( metamodel, is( notNullValue() ) ); // assertThat( metamodel.dependencyProcessor(), is( notNullValue() ) ); // return null; @@ -53,23 +53,23 @@ public void should() {} // final String name = JavaDependencyProcessor.class.getName(); // // final File file = new File( "src/main/java/" + name.replace( '.', '/' ) + ".java" ); // // assertThat( file.exists(), is( true ) ); - // // final Metamodel metamodel = metamodelManager().metamodel( "org.modeshape.modeler.java.JavaFile" ); - // final Metamodel metamodel = metamodelManager().metamodel( "org.modeshape.modeler.java.ClassFile" ); + // // final Metamodel metamodel = metamodelManager().metamodel( "org.modelspace.java.JavaFile" ); + // final Metamodel metamodel = metamodelManager().metamodel( "org.modelspace.java.ClassFile" ); // assertThat( metamodel, notNullValue() ); // // final Model model = - // // modeler().generateModel( file, JavaDependencyProcessor.class.getPackage().getName().replace( '.', '/' ), metamodel ); + // // modelspace().generateModel( file, JavaDependencyProcessor.class.getPackage().getName().replace( '.', '/' ), metamodel ); // final Model model = - // modeler().generateModel( getClass().getClassLoader().getResourceAsStream( name.replace( '.', '/' ) + ".class" ), + // modelspace().generateModel( getClass().getClassLoader().getResourceAsStream( name.replace( '.', '/' ) + ".class" ), // JavaDependencyProcessor.class.getName().replace( '.', '/' ) + ".java", metamodel ); // assertThat( model, notNullValue() ); - // modeler().run( new TaskWithResult< Void >() { + // modelspace().run( new TaskWithResult< Void >() { // // @Override // public Void run( final Session session ) throws Exception { // final Node modelNode = // session.getNode( '/' + JavaDependencyProcessor.class.getName().replace( '.', '/' ) + ".java" ); // final JavaDependencyProcessor processor = new JavaDependencyProcessor(); - // processor.process( modelNode, modeler() ); + // processor.process( modelNode, modelspace() ); // return null; // } // } ); diff --git a/modeshape-modeler/modeshape-modeler-java/src/test/java/org/modeshape/modeler/test/JavaIntegrationTest.java b/modelspace/modelspace-java/src/test/java/org/modelspace/test/JavaIntegrationTest.java similarity index 83% rename from modeshape-modeler/modeshape-modeler-java/src/test/java/org/modeshape/modeler/test/JavaIntegrationTest.java rename to modelspace/modelspace-java/src/test/java/org/modelspace/test/JavaIntegrationTest.java index 22f9bf8..97f983e 100644 --- a/modeshape-modeler/modeshape-modeler-java/src/test/java/org/modeshape/modeler/test/JavaIntegrationTest.java +++ b/modelspace/modelspace-java/src/test/java/org/modelspace/test/JavaIntegrationTest.java @@ -21,7 +21,7 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler.test; +package org.modelspace.test; import static org.hamcrest.core.IsNull.notNullValue; import static org.junit.Assert.assertThat; @@ -29,14 +29,15 @@ import java.io.File; import org.junit.Before; -import org.modeshape.modeler.Model; -import org.modeshape.modeler.Metamodel; +import org.modelspace.Metamodel; +import org.modelspace.Model; +import org.modelspace.test.BaseIntegrationTest; @SuppressWarnings( "javadoc" ) public abstract class JavaIntegrationTest extends BaseIntegrationTest { protected static final String CATEGORY = "java"; - protected static final String METAMODEL_ID = "org.modeshape.modeler.java.JavaFile"; + protected static final String METAMODEL_ID = "org.modelspace.java.JavaFile"; protected static final String MODEL_NAME = "Mock.java"; protected static final String MODEL_PATH = "src/test/resources/" + MODEL_NAME; @@ -50,13 +51,13 @@ public void before() throws Exception { } protected Model importModel() throws Exception { - final Model model = modeler().importModel( MODEL_FILE, null, metamodel() ); + final Model model = modelspace().importModel( MODEL_FILE, null, metamodel() ); assertThat( model, notNullValue() ); return model; } protected Metamodel metamodel() throws Exception { - final Metamodel metamodel = modeler().metamodelManager().metamodel( METAMODEL_ID ); + final Metamodel metamodel = modelspace().metamodelManager().metamodel( METAMODEL_ID ); assertThat( metamodel, notNullValue() ); return metamodel; } diff --git a/modeshape-modeler/modeshape-modeler-java/src/test/resources/Mock.java b/modelspace/modelspace-java/src/test/resources/Mock.java similarity index 97% rename from modeshape-modeler/modeshape-modeler-java/src/test/resources/Mock.java rename to modelspace/modelspace-java/src/test/resources/Mock.java index 8337a7f..8c9e668 100644 --- a/modeshape-modeler/modeshape-modeler-java/src/test/resources/Mock.java +++ b/modelspace/modelspace-java/src/test/resources/Mock.java @@ -21,7 +21,7 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler.java; +package org.modelspace.java; /** * diff --git a/modeshape-modeler/modeshape-modeler-java/src/test/resources/log4j.properties b/modelspace/modelspace-java/src/test/resources/log4j.properties similarity index 84% rename from modeshape-modeler/modeshape-modeler-java/src/test/resources/log4j.properties rename to modelspace/modelspace-java/src/test/resources/log4j.properties index 4afc2d0..dc5f7eb 100644 --- a/modeshape-modeler/modeshape-modeler-java/src/test/resources/log4j.properties +++ b/modelspace/modelspace-java/src/test/resources/log4j.properties @@ -10,5 +10,5 @@ log4j.rootLogger=ERROR, stdout # Set up the default logging to be ERROR level, then override specific units log4j.logger.org.modeshape=WARN log4j.logger.org.polyglotter=WARN -log4j.logger.org.modeshape.modeler=WARN -log4j.logger.org.modeshape.modeler.java=WARN +log4j.logger.org.modelspace=WARN +log4j.logger.org.modelspace.java=WARN diff --git a/modeshape-modeler/modeshape-modeler-eclipse/pom.xml b/modelspace/modelspace-ui/pom.xml similarity index 70% rename from modeshape-modeler/modeshape-modeler-eclipse/pom.xml rename to modelspace/modelspace-ui/pom.xml index ea79dc0..57c6553 100644 --- a/modeshape-modeler/modeshape-modeler-eclipse/pom.xml +++ b/modelspace/modelspace-ui/pom.xml @@ -2,9 +2,9 @@ 4.0.0 org.polyglotter - modeshape-modeler + modelspace 0.0.1-SNAPSHOT - modeshape-modeler-eclipse - ModeShape Modeler for Eclipse + modelspace-ui + Modelspace UI \ No newline at end of file diff --git a/modeshape-modeler/modeshape-modeler-ui/src/main/java/org/modeshape/modeler/ui/FocusTreeController.java b/modelspace/modelspace-ui/src/main/java/org/modeshape/modeler/ui/FocusTreeController.java similarity index 100% rename from modeshape-modeler/modeshape-modeler-ui/src/main/java/org/modeshape/modeler/ui/FocusTreeController.java rename to modelspace/modelspace-ui/src/main/java/org/modeshape/modeler/ui/FocusTreeController.java diff --git a/modeshape-modeler/modeshape-modeler-ui/src/main/java/org/modeshape/modeler/ui/FocusTreeModel.java b/modelspace/modelspace-ui/src/main/java/org/modeshape/modeler/ui/FocusTreeModel.java similarity index 100% rename from modeshape-modeler/modeshape-modeler-ui/src/main/java/org/modeshape/modeler/ui/FocusTreeModel.java rename to modelspace/modelspace-ui/src/main/java/org/modeshape/modeler/ui/FocusTreeModel.java diff --git a/modeshape-modeler/modeshape-modeler-ui/src/main/java/org/modeshape/modeler/ui/FocusTreeView.java b/modelspace/modelspace-ui/src/main/java/org/modeshape/modeler/ui/FocusTreeView.java similarity index 100% rename from modeshape-modeler/modeshape-modeler-ui/src/main/java/org/modeshape/modeler/ui/FocusTreeView.java rename to modelspace/modelspace-ui/src/main/java/org/modeshape/modeler/ui/FocusTreeView.java diff --git a/modeshape-modeler/modeshape-modeler-ui/src/main/java/org/modeshape/modeler/ui/UiI18n.java b/modelspace/modelspace-ui/src/main/java/org/modeshape/modeler/ui/UiI18n.java similarity index 100% rename from modeshape-modeler/modeshape-modeler-ui/src/main/java/org/modeshape/modeler/ui/UiI18n.java rename to modelspace/modelspace-ui/src/main/java/org/modeshape/modeler/ui/UiI18n.java diff --git a/modeshape-modeler/modeshape-modeler-ui/src/main/java/org/modeshape/modeler/ui/UiUtil.java b/modelspace/modelspace-ui/src/main/java/org/modeshape/modeler/ui/UiUtil.java similarity index 100% rename from modeshape-modeler/modeshape-modeler-ui/src/main/java/org/modeshape/modeler/ui/UiUtil.java rename to modelspace/modelspace-ui/src/main/java/org/modeshape/modeler/ui/UiUtil.java diff --git a/modeshape-modeler/modeshape-modeler-ui/src/main/resources/images/close.gif b/modelspace/modelspace-ui/src/main/resources/images/close.gif similarity index 100% rename from modeshape-modeler/modeshape-modeler-ui/src/main/resources/images/close.gif rename to modelspace/modelspace-ui/src/main/resources/images/close.gif diff --git a/modeshape-modeler/modeshape-modeler-ui/src/main/resources/images/copy.gif b/modelspace/modelspace-ui/src/main/resources/images/copy.gif similarity index 100% rename from modeshape-modeler/modeshape-modeler-ui/src/main/resources/images/copy.gif rename to modelspace/modelspace-ui/src/main/resources/images/copy.gif diff --git a/modeshape-modeler/modeshape-modeler-ui/src/main/resources/images/minimize.gif b/modelspace/modelspace-ui/src/main/resources/images/minimize.gif similarity index 100% rename from modeshape-modeler/modeshape-modeler-ui/src/main/resources/images/minimize.gif rename to modelspace/modelspace-ui/src/main/resources/images/minimize.gif diff --git a/modeshape-modeler/modeshape-modeler-ui/src/main/resources/images/scrollLeft.png b/modelspace/modelspace-ui/src/main/resources/images/scrollLeft.png similarity index 100% rename from modeshape-modeler/modeshape-modeler-ui/src/main/resources/images/scrollLeft.png rename to modelspace/modelspace-ui/src/main/resources/images/scrollLeft.png diff --git a/modeshape-modeler/modeshape-modeler-ui/src/main/resources/images/scrollRight.png b/modelspace/modelspace-ui/src/main/resources/images/scrollRight.png similarity index 100% rename from modeshape-modeler/modeshape-modeler-ui/src/main/resources/images/scrollRight.png rename to modelspace/modelspace-ui/src/main/resources/images/scrollRight.png diff --git a/modeshape-modeler/modeshape-modeler-xsd/pom.xml b/modelspace/modelspace-xsd/pom.xml similarity index 86% rename from modeshape-modeler/modeshape-modeler-xsd/pom.xml rename to modelspace/modelspace-xsd/pom.xml index 4053ccc..aae062a 100644 --- a/modeshape-modeler/modeshape-modeler-xsd/pom.xml +++ b/modelspace/modelspace-xsd/pom.xml @@ -7,16 +7,16 @@ org.polyglotter - modeshape-modeler + modelspace 0.0.1-SNAPSHOT - modeshape-modeler-xsd - ModeShape Modeler XSD Project - An implementation of an XSD dependency processor. + modelspace-xsd + Modelspace for XSD + XSD SPI implementation for Modelspace. @@ -33,12 +33,12 @@ org.polyglotter - modeshape-modeler-engine + modelspace-engine org.polyglotter - modeshape-modeler-engine + modelspace-engine test-jar @@ -90,8 +90,8 @@ src/assembly/module-with-dependencies.xml - ${project.build.directory}/org/modeshape/modeshape-modeler-xsd/${modeshape.version} - modeshape-modeler-xsd-${modeshape.version} + ${project.build.directory}/org/polyglotter/modelspace-xsd/${modeshape.version} + modelspace-xsd-${modeshape.version} diff --git a/modeshape-modeler/modeshape-modeler-xsd/src/assembly/module-with-dependencies.xml b/modelspace/modelspace-xsd/src/assembly/module-with-dependencies.xml similarity index 100% rename from modeshape-modeler/modeshape-modeler-xsd/src/assembly/module-with-dependencies.xml rename to modelspace/modelspace-xsd/src/assembly/module-with-dependencies.xml diff --git a/modeshape-modeler/modeshape-modeler-xsd/src/main/java/org/modeshape/modeler/xsd/XsdDependencyProcessor.java b/modelspace/modelspace-xsd/src/main/java/org/modelspace/xsd/XsdDependencyProcessor.java similarity index 85% rename from modeshape-modeler/modeshape-modeler-xsd/src/main/java/org/modeshape/modeler/xsd/XsdDependencyProcessor.java rename to modelspace/modelspace-xsd/src/main/java/org/modelspace/xsd/XsdDependencyProcessor.java index 7bc1ce6..1b0c471 100644 --- a/modeshape-modeler/modeshape-modeler-xsd/src/main/java/org/modeshape/modeler/xsd/XsdDependencyProcessor.java +++ b/modelspace/modelspace-xsd/src/main/java/org/modelspace/xsd/XsdDependencyProcessor.java @@ -21,7 +21,7 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler.xsd; +package org.modelspace.xsd; import java.net.URI; import java.net.URL; @@ -32,22 +32,22 @@ import javax.jcr.NodeIterator; import javax.jcr.Property; +import org.modelspace.Metamodel; +import org.modelspace.Modelspace; +import org.modelspace.ModelspaceException; +import org.modelspace.ModelspaceLexicon; +import org.modelspace.internal.ModelspaceImpl; +import org.modelspace.spi.DependencyProcessor; import org.modeshape.common.util.StringUtil; -import org.modeshape.modeler.Metamodel; -import org.modeshape.modeler.Modeler; -import org.modeshape.modeler.ModelerException; -import org.modeshape.modeler.ModelerLexicon; -import org.modeshape.modeler.internal.ModelerImpl; -import org.modeshape.modeler.spi.metamodel.DependencyProcessor; import org.modeshape.sequencer.xsd.XsdLexicon; import org.polyglotter.common.Logger; /** - * The XSD dependency processor for the modeler. + * The XSD dependency processor for the modelspace. */ public final class XsdDependencyProcessor implements DependencyProcessor { - private static final Logger LOGGER = Logger.logger( XsdModelerI18n.class ); + private static final Logger LOGGER = Logger.logger( XsdI18n.class ); /** * @param path @@ -94,24 +94,24 @@ private boolean dependencyNode( final Node node ) throws Exception { /** * {@inheritDoc} * - * @see org.modeshape.modeler.spi.metamodel.DependencyProcessor#metamodelId() + * @see org.modelspace.spi.DependencyProcessor#metamodelId() */ @Override public String metamodelId() { - return "org.modeshape.modeler.xsd.Xsd"; + return "org.modelspace.xsd.Xsd"; } /** * {@inheritDoc} * - * @see org.modeshape.modeler.spi.metamodel.DependencyProcessor#process(java.lang.String, javax.jcr.Node, - * org.modeshape.modeler.Modeler, boolean) + * @see org.modelspace.spi.DependencyProcessor#process(java.lang.String, javax.jcr.Node, + * org.modelspace.Modelspace, boolean) */ @Override public String process( final String dataPath, final Node modelNode, - final Modeler modeler, - final boolean persistArtifacts ) throws ModelerException { + final Modelspace modelspace, + final boolean persistArtifacts ) throws ModelspaceException { List< MissingDependency > pathsToMissingDependencies = null; try { @@ -158,23 +158,23 @@ public String process( final String dataPath, // create dependencies folder node if not already created if ( dependenciesNode == null ) { - if ( modelNode.hasNode( ModelerLexicon.Model.DEPENDENCIES ) ) { - dependenciesNode = modelNode.getNode( ModelerLexicon.Model.DEPENDENCIES ); + if ( modelNode.hasNode( ModelspaceLexicon.Model.DEPENDENCIES ) ) { + dependenciesNode = modelNode.getNode( ModelspaceLexicon.Model.DEPENDENCIES ); } else { - dependenciesNode = modelNode.addNode( ModelerLexicon.Model.DEPENDENCIES, - ModelerLexicon.Model.DEPENDENCIES ); + dependenciesNode = modelNode.addNode( ModelspaceLexicon.Model.DEPENDENCIES, + ModelspaceLexicon.Model.DEPENDENCIES ); LOGGER.debug( "Created dependencies folder node '%s'", dependenciesNode.getPath() ); } } // create dependency node @SuppressWarnings( "null" ) final Node dependencyNode = - dependenciesNode.addNode( ModelerLexicon.Dependency.DEPENDENCY, ModelerLexicon.Dependency.DEPENDENCY ); + dependenciesNode.addNode( ModelspaceLexicon.Dependency.DEPENDENCY, ModelspaceLexicon.Dependency.DEPENDENCY ); // set input property final Property locationProp = kid.getProperty( XsdLexicon.SCHEMA_LOCATION ); final String location = locationProp.getString(); - dependencyNode.setProperty( ModelerLexicon.Dependency.SOURCE_REFERENCE_PROPERTY, new String[] { location } ); + dependencyNode.setProperty( ModelspaceLexicon.Dependency.SOURCE_REFERENCE_PROPERTY, new String[] { location } ); LOGGER.debug( "Setting dependency source reference property to '%s'", location ); // derive path using model node parent as starting point @@ -208,7 +208,7 @@ public String process( final String dataPath, } final String fullModelPath = parentModelPath + path; - dependencyNode.setProperty( ModelerLexicon.Dependency.PATH, fullModelPath ); + dependencyNode.setProperty( ModelspaceLexicon.Dependency.PATH, fullModelPath ); LOGGER.debug( "Setting dependency path property to '%s'", fullModelPath ); final boolean exists = node.hasNode( path ); @@ -221,8 +221,8 @@ public String process( final String dataPath, LOGGER.debug( "Found absolute dependency path '%s'", path ); // find common part of path and external location to determine workspace location - if ( modelNode.hasProperty( ModelerLexicon.Model.EXTERNAL_LOCATION ) ) { - String extLocation = modelNode.getProperty( ModelerLexicon.Model.EXTERNAL_LOCATION ).getString(); + if ( modelNode.hasProperty( ModelspaceLexicon.Model.EXTERNAL_LOCATION ) ) { + String extLocation = modelNode.getProperty( ModelspaceLexicon.Model.EXTERNAL_LOCATION ).getString(); extLocation = normalizePath( extLocation ); extLocation = extLocation.substring( 0, extLocation.lastIndexOf( "/" ) ); @@ -282,7 +282,7 @@ public String process( final String dataPath, } dependencyModelPath = parentPath + dependencyModelPath; - dependencyNode.setProperty( ModelerLexicon.Dependency.PATH, dependencyModelPath ); + dependencyNode.setProperty( ModelspaceLexicon.Dependency.PATH, dependencyModelPath ); LOGGER.debug( "Setting dependency path property to '%s'", dependencyModelPath ); if ( !exists ) { @@ -301,37 +301,37 @@ public String process( final String dataPath, // process any missing dependencies if ( !pathsToMissingDependencies.isEmpty() ) { - uploadMissingDependencies( dataPath, modelNode, pathsToMissingDependencies, modeler, persistArtifacts ); + uploadMissingDependencies( dataPath, modelNode, pathsToMissingDependencies, modelspace, persistArtifacts ); } modelNode.getSession().save(); return dependenciesNode.getPath(); } catch ( final Exception e ) { - if ( e instanceof ModelerException ) throw ( ModelerException ) e; - throw new ModelerException( e, "Unable to resolve dependencies for \"%s\"", modelNode ); + if ( e instanceof ModelspaceException ) throw ( ModelspaceException ) e; + throw new ModelspaceException( e, "Unable to resolve dependencies for \"%s\"", modelNode ); } } void uploadMissingDependencies( final String dataPath, final Node modelNode, final List< MissingDependency > missingDependencies, - final Modeler modeler, + final Modelspace modelspace, final boolean persistArtifacts ) throws Exception { assert ( modelNode != null ); assert ( missingDependencies != null ); - assert ( modeler != null ); + assert ( modelspace != null ); - if ( !modelNode.hasProperty( ModelerLexicon.Model.EXTERNAL_LOCATION ) - || !modelNode.hasProperty( ModelerLexicon.Model.METAMODEL ) + if ( !modelNode.hasProperty( ModelspaceLexicon.Model.EXTERNAL_LOCATION ) + || !modelNode.hasProperty( ModelspaceLexicon.Model.METAMODEL ) || missingDependencies.isEmpty() ) { return; } final String modelName = modelNode.getName(); - final String id = modelNode.getProperty( ModelerLexicon.Model.METAMODEL ).getString(); - final Metamodel metamodel = modeler.metamodelManager().metamodel( id ); + final String id = modelNode.getProperty( ModelspaceLexicon.Model.METAMODEL ).getString(); + final Metamodel metamodel = modelspace.metamodelManager().metamodel( id ); - String externalLocation = modelNode.getProperty( ModelerLexicon.Model.EXTERNAL_LOCATION ).getString(); + String externalLocation = modelNode.getProperty( ModelspaceLexicon.Model.EXTERNAL_LOCATION ).getString(); externalLocation = externalLocation.substring( 0, ( externalLocation.lastIndexOf( "/" ) ) ); final String dataDir = dataPath.substring( 0, ( dataPath.lastIndexOf( "/" ) ) ); @@ -377,11 +377,11 @@ void uploadMissingDependencies( final String dataPath, try { LOGGER.debug( "Importing XSD dependency from external path '%s' for source '%s' and path '%s'", extPath, modelName, dataLocation ); - final String dependencyArtifactPath = modeler.importData( new URL( extPath ).openStream(), dataLocation ); + final String dependencyArtifactPath = modelspace.importData( new URL( extPath ).openStream(), dataLocation ); // create model LOGGER.debug( "Generating model for XSD dependency of model '%s' from path '%s'", modelName, modelPath ); - ( ( ModelerImpl ) modeler ).generateModel( dependencyArtifactPath, modelPath, metamodel, persistArtifacts ); + ( ( ModelspaceImpl ) modelspace ).generateModel( dependencyArtifactPath, modelPath, metamodel, persistArtifacts ); } catch ( final Exception e ) { LOGGER.error( e, "Error uploading XSD dependency from '%s' for node '%s'", extPath, modelName ); } diff --git a/modeshape-modeler/modeshape-modeler-xsd/src/main/java/org/modeshape/modeler/xsd/XsdExporter.java b/modelspace/modelspace-xsd/src/main/java/org/modelspace/xsd/XsdExporter.java similarity index 94% rename from modeshape-modeler/modeshape-modeler-xsd/src/main/java/org/modeshape/modeler/xsd/XsdExporter.java rename to modelspace/modelspace-xsd/src/main/java/org/modelspace/xsd/XsdExporter.java index ebdac6d..8b810b6 100644 --- a/modeshape-modeler/modeshape-modeler-xsd/src/main/java/org/modeshape/modeler/xsd/XsdExporter.java +++ b/modelspace/modelspace-xsd/src/main/java/org/modelspace/xsd/XsdExporter.java @@ -21,7 +21,7 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler.xsd; +package org.modelspace.xsd; import java.io.OutputStream; import java.io.PrintWriter; @@ -34,8 +34,8 @@ import javax.jcr.PropertyIterator; import javax.jcr.RepositoryException; -import org.modeshape.modeler.Model; -import org.modeshape.modeler.spi.metamodel.Exporter; +import org.modelspace.Model; +import org.modelspace.spi.Exporter; import org.modeshape.sequencer.sramp.SrampLexicon; import org.modeshape.sequencer.xsd.XsdLexicon; @@ -53,12 +53,12 @@ public class XsdExporter implements Exporter { /** * {@inheritDoc} * - * @see org.modeshape.modeler.spi.metamodel.Exporter#execute(org.modeshape.modeler.Model, java.io.OutputStream) + * @see org.modelspace.spi.Exporter#execute(org.modelspace.Model, java.io.OutputStream) */ @Override public void execute( final Model model, final OutputStream stream ) { - // ( ( ModelImpl ) model ).modeler.run( new TaskWithResult< Void >() { + // ( ( ModelImpl ) model ).modelspace.run( new TaskWithResult< Void >() { // // @Override // public Void run( final Session session ) throws Exception { @@ -89,11 +89,11 @@ public void execute( final Model model, /** * {@inheritDoc} * - * @see org.modeshape.modeler.spi.metamodel.Exporter#metamodelId() + * @see org.modelspace.spi.Exporter#metamodelId() */ @Override public String metamodelId() { - return "org.modeshape.modeler.xsd.Xsd"; + return "org.modelspace.xsd.Xsd"; } void print( final int indentLevel, @@ -207,7 +207,7 @@ private void printIndent( final int indentLevel ) { /** * {@inheritDoc} * - * @see org.modeshape.modeler.spi.metamodel.Exporter#supports(java.lang.String) + * @see org.modelspace.spi.Exporter#supports(java.lang.String) */ @Override public boolean supports( final String mimeType ) { diff --git a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/ModelerI18n.java b/modelspace/modelspace-xsd/src/main/java/org/modelspace/xsd/XsdI18n.java similarity index 89% rename from modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/ModelerI18n.java rename to modelspace/modelspace-xsd/src/main/java/org/modelspace/xsd/XsdI18n.java index c930f00..6309714 100644 --- a/modeshape-modeler/modeshape-modeler-engine/src/main/java/org/modeshape/modeler/ModelerI18n.java +++ b/modelspace/modelspace-xsd/src/main/java/org/modelspace/xsd/XsdI18n.java @@ -21,19 +21,18 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler; +package org.modelspace.xsd; import org.polyglotter.common.I18n; /** - * Internationalized string constants, in alphabetical order, for the Modeler project. + * Internationalized string constants, in alphabetical order, for the XSD Modelspace project. */ @SuppressWarnings( "javadoc" ) -public final class ModelerI18n { +public class XsdI18n { public static String localize( final String text, final Object... arguments ) { - return I18n.localize( ModelerI18n.class, text, arguments ); + return I18n.localize( XsdI18n.class, text, arguments ); } - } diff --git a/modeshape-modeler/modeshape-modeler-xsd/src/main/java/org/modeshape/modeler/xsd/XsdLexicon.java b/modelspace/modelspace-xsd/src/main/java/org/modelspace/xsd/XsdLexicon.java similarity index 90% rename from modeshape-modeler/modeshape-modeler-xsd/src/main/java/org/modeshape/modeler/xsd/XsdLexicon.java rename to modelspace/modelspace-xsd/src/main/java/org/modelspace/xsd/XsdLexicon.java index dfbddc1..8caba2d 100644 --- a/modeshape-modeler/modeshape-modeler-xsd/src/main/java/org/modeshape/modeler/xsd/XsdLexicon.java +++ b/modelspace/modelspace-xsd/src/main/java/org/modelspace/xsd/XsdLexicon.java @@ -21,15 +21,15 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler.xsd; +package org.modelspace.xsd; /** - * The model lexicon for the XSD modeler. + * The model lexicon for the XSD modelspace. */ public interface XsdLexicon { /** * The name of the XSD model node. Value is {@value} . */ - String METAMODEL_ID = "org.modeshape.modeler.xsd.Xsd"; + String METAMODEL_ID = "org.modelspace.xsd.Xsd"; } diff --git a/modeshape-modeler/modeshape-modeler-xsd/src/test/java/org/modeshape/modeler/xsd/ITXsdDependencyProcessor.java b/modelspace/modelspace-xsd/src/test/java/org/modelspace/xsd/ITXsdDependencyProcessor.java similarity index 76% rename from modeshape-modeler/modeshape-modeler-xsd/src/test/java/org/modeshape/modeler/xsd/ITXsdDependencyProcessor.java rename to modelspace/modelspace-xsd/src/test/java/org/modelspace/xsd/ITXsdDependencyProcessor.java index e18a756..e025592 100644 --- a/modeshape-modeler/modeshape-modeler-xsd/src/test/java/org/modeshape/modeler/xsd/ITXsdDependencyProcessor.java +++ b/modelspace/modelspace-xsd/src/test/java/org/modelspace/xsd/ITXsdDependencyProcessor.java @@ -21,11 +21,12 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler.xsd; +package org.modelspace.xsd; import org.junit.Test; -import org.modeshape.modeler.spi.metamodel.DependencyProcessor; -import org.modeshape.modeler.test.BaseTest; +import org.modelspace.spi.DependencyProcessor; +import org.modelspace.test.BaseTest; +import org.modelspace.xsd.XsdDependencyProcessor; /** * An integration test for the {@link XsdDependencyProcessor}. @@ -33,7 +34,7 @@ @SuppressWarnings( "javadoc" ) public class ITXsdDependencyProcessor extends BaseTest { - // private static final String XSD_METAMODEL_ID = "org.modeshape.modeler.xsd.Xsd"; + // private static final String XSD_METAMODEL_ID = "org.modelspace.xsd.Xsd"; DependencyProcessor processor; @@ -43,7 +44,7 @@ public void should() {} // /** // * {@inheritDoc} // * - // * @see org.modeshape.modeler.test.BaseTest#before() + // * @see org.modelspace.test.BaseTest#before() // */ // @Override // public void before() throws Exception { @@ -68,8 +69,8 @@ public void should() {} // assertThat( xsdMetamodel, notNullValue() ); // // final String path = importArtifact( XSD_ARTIFACT ); - // final ModelImpl model = ( ModelImpl ) modeler().generateModel( path, ARTIFACT_NAME, xsdMetamodel, true ); - // modeler().run( new TaskWithResult< Void >() { + // final ModelImpl model = ( ModelImpl ) modelspace().generateModel( path, ARTIFACT_NAME, xsdMetamodel, true ); + // modelspace().run( new TaskWithResult< Void >() { // // @Override // public Void run( final Session session ) throws Exception { @@ -105,26 +106,26 @@ public void should() {} // // // create XSD workspace data // final String xsdName = xsd.getName(); - // final String workspacePath = modeler().importFile( xsd, "data" ); + // final String workspacePath = modelspace().importFile( xsd, "data" ); // assertThat( workspacePath, is( "/data/" + xsdName ) ); // // // create model // final Metamodel xsdMetamodel = xsdMetamodel(); // final String modelPath = "model/dependentXsd"; - // final ModelImpl model = ( ModelImpl ) modeler().generateModel( workspacePath, modelPath, xsdMetamodel, true ); + // final ModelImpl model = ( ModelImpl ) modelspace().generateModel( workspacePath, modelPath, xsdMetamodel, true ); // // // check dependencies - // modeler().run( new TaskWithResult< Node >() { + // modelspace().run( new TaskWithResult< Node >() { // // @Override // public Node run( final Session session ) throws Exception { - // final String dependenciesPath = ( '/' + modelPath + '/' + ModelerLexicon.Model.DEPENDENCIES ); + // final String dependenciesPath = ( '/' + modelPath + '/' + ModelspaceLexicon.Model.DEPENDENCIES ); // final Node dependenciesNode = session.getNode( dependenciesPath ); // assertThat( dependenciesNode.getNodes().getSize(), is( 1L ) ); // // final Node dependencyNode = dependenciesNode.getNodes().nextNode(); // final String dependencyModelName = "/model/" + c.getFileName() + '/' + dependencyXsdPath.getFileName(); - // assertThat( dependencyNode.getProperty( ModelerLexicon.Dependency.PATH ).getString(), is( dependencyModelName ) ); + // assertThat( dependencyNode.getProperty( ModelspaceLexicon.Dependency.PATH ).getString(), is( dependencyModelName ) ); // // // TODO uncomment this test out when the data path is correct // // session.getNode( "/data/" + c.getFileName().toString() + '/' + dependencyXsdPath.getFileName() ); @@ -137,17 +138,17 @@ public void should() {} // @Test // public void shouldNotFindDependenciesInMusicXsd() throws Exception { // final URL xsdUrl = getClass().getClassLoader().getResource( "music.xsd" ); - // final String path = modeler().importFile( new File( xsdUrl.toURI() ), null ); + // final String path = modelspace().importFile( new File( xsdUrl.toURI() ), null ); // assertThat( path, is( "/music.xsd" ) ); // // final Metamodel xsdMetamodel = xsdMetamodel(); - // modeler().generateModel( path, MODEL_NAME, xsdMetamodel, true ); + // modelspace().generateModel( path, MODEL_NAME, xsdMetamodel, true ); // - // modeler().run( new TaskWithResult< Node >() { + // modelspace().run( new TaskWithResult< Node >() { // // @Override // public Node run( final Session session ) throws Exception { - // final String dependenciesPath = ( '/' + MODEL_NAME + '/' + ModelerLexicon.Model.DEPENDENCIES ); + // final String dependenciesPath = ( '/' + MODEL_NAME + '/' + ModelspaceLexicon.Model.DEPENDENCIES ); // // final Node modelNode = session.getNode( model.absolutePath() ); // assertThat( session.itemExists( dependenciesPath ), is( false ) ); // @@ -159,18 +160,18 @@ public void should() {} // @Test // public void shouldProcessBooksSoapEncodingXsd() throws Exception { // final URL xsdUrl = getClass().getClassLoader().getResource( "Books/SOAP/BooksWithSOAPEncoding.xsd" ); - // final String dataPath = modeler().importFile( new File( xsdUrl.toURI() ), "Artifact/Books/SOAP" ); + // final String dataPath = modelspace().importFile( new File( xsdUrl.toURI() ), "Artifact/Books/SOAP" ); // assertThat( dataPath, is( "/Artifact/Books/SOAP/BooksWithSOAPEncoding.xsd" ) ); // // final Metamodel xsdMetamodel = xsdMetamodel(); // final String modelPath = "Model/Books/SOAP/BooksWithSOAPEncoding.xsd"; - // modeler().generateModel( dataPath, modelPath, xsdMetamodel, true ); + // modelspace().generateModel( dataPath, modelPath, xsdMetamodel, true ); // - // modeler().run( new TaskWithResult< Node >() { + // modelspace().run( new TaskWithResult< Node >() { // // @Override // public Node run( final Session session ) throws Exception { - // final String dependenciesPath = ( '/' + modelPath + '/' + ModelerLexicon.Model.DEPENDENCIES ); + // final String dependenciesPath = ( '/' + modelPath + '/' + ModelspaceLexicon.Model.DEPENDENCIES ); // final Node dependenciesNode = session.getNode( dependenciesPath ); // assertThat( dependenciesNode.getNodes().getSize(), is( 2L ) ); // @@ -185,15 +186,15 @@ public void should() {} // final String soapEncodingSourceRef = "./encoding/soap_encoding.xsd"; // // final Node depOneNode = itr.nextNode(); - // assertThat( depOneNode.getPrimaryNodeType().getName(), is( ModelerLexicon.Dependency.DEPENDENCY ) ); + // assertThat( depOneNode.getPrimaryNodeType().getName(), is( ModelspaceLexicon.Dependency.DEPENDENCY ) ); // // final Node depTwoNode = itr.nextNode(); - // assertThat( depOneNode.getPrimaryNodeType().getName(), is( ModelerLexicon.Dependency.DEPENDENCY ) ); + // assertThat( depOneNode.getPrimaryNodeType().getName(), is( ModelspaceLexicon.Dependency.DEPENDENCY ) ); // - // if ( depOneNode.getProperty( ModelerLexicon.Dependency.PATH ).getString().equals( dataTypesModelPath ) ) { + // if ( depOneNode.getProperty( ModelspaceLexicon.Dependency.PATH ).getString().equals( dataTypesModelPath ) ) { // { // first dependency node is datatypes // final String input = - // depOneNode.getProperty( ModelerLexicon.Dependency.SOURCE_REFERENCE_PROPERTY ).getValues()[ 0 ].getString(); + // depOneNode.getProperty( ModelspaceLexicon.Dependency.SOURCE_REFERENCE_PROPERTY ).getValues()[ 0 ].getString(); // assertThat( input, is( dataTypesSourceRef ) ); // // // make sure dependency resource was imported and model created (getNode throws exception if path not found) @@ -203,17 +204,17 @@ public void should() {} // // { // dependency two must be soap encoding // final String input = - // depTwoNode.getProperty( ModelerLexicon.Dependency.SOURCE_REFERENCE_PROPERTY ).getValues()[ 0 ].getString(); + // depTwoNode.getProperty( ModelspaceLexicon.Dependency.SOURCE_REFERENCE_PROPERTY ).getValues()[ 0 ].getString(); // assertThat( input, is( soapEncodingSourceRef ) ); // // // make sure dependency resource was imported and model created (getNode throws exception if path not found) // session.getNode( soapEncodingArtifactPath ); // session.getNode( soapEncodingModelPath ); // } - // } else if ( depOneNode.getProperty( ModelerLexicon.Dependency.PATH ).getString().equals( soapEncodingModelPath ) ) { + // } else if ( depOneNode.getProperty( ModelspaceLexicon.Dependency.PATH ).getString().equals( soapEncodingModelPath ) ) { // { // first dependency is soap encoding // final String input = - // depOneNode.getProperty( ModelerLexicon.Dependency.SOURCE_REFERENCE_PROPERTY ).getValues()[ 0 ].getString(); + // depOneNode.getProperty( ModelspaceLexicon.Dependency.SOURCE_REFERENCE_PROPERTY ).getValues()[ 0 ].getString(); // assertThat( input, is( soapEncodingSourceRef ) ); // // // make sure dependency resource was imported and model created (getNode throws exception if path not found) @@ -223,7 +224,7 @@ public void should() {} // // { // dependency two must be datatypes // final String input = - // depTwoNode.getProperty( ModelerLexicon.Dependency.SOURCE_REFERENCE_PROPERTY ).getValues()[ 0 ].getString(); + // depTwoNode.getProperty( ModelspaceLexicon.Dependency.SOURCE_REFERENCE_PROPERTY ).getValues()[ 0 ].getString(); // assertThat( input, is( dataTypesSourceRef ) ); // // // make sure dependency resource was imported and model created (getNode throws exception if path not found) @@ -231,7 +232,7 @@ public void should() {} // session.getNode( dataTypesModelPath ); // } // } else { - // fail( "path=" + depOneNode.getProperty( ModelerLexicon.Dependency.PATH ).getString() ); + // fail( "path=" + depOneNode.getProperty( ModelspaceLexicon.Dependency.PATH ).getString() ); // } // // return null; @@ -242,29 +243,29 @@ public void should() {} // @Test // public void shouldProcessBooksXsd() throws Exception { // final URL xsdUrl = getClass().getClassLoader().getResource( "Books/Books.xsd" ); - // final String dataPath = modeler().importFile( new File( xsdUrl.toURI() ), "Artifact/Books" ); + // final String dataPath = modelspace().importFile( new File( xsdUrl.toURI() ), "Artifact/Books" ); // assertThat( dataPath, is( "/Artifact/Books/Books.xsd" ) ); // // final Metamodel xsdMetamodel = xsdMetamodel(); // final String modelPath = "Model/Books/Books.xsd"; - // modeler().generateModel( dataPath, modelPath, xsdMetamodel, true ); + // modelspace().generateModel( dataPath, modelPath, xsdMetamodel, true ); // - // modeler().run( new TaskWithResult< Node >() { + // modelspace().run( new TaskWithResult< Node >() { // // @Override // public Node run( final Session session ) throws Exception { - // final String dependenciesPath = ( '/' + modelPath + '/' + ModelerLexicon.Model.DEPENDENCIES ); + // final String dependenciesPath = ( '/' + modelPath + '/' + ModelspaceLexicon.Model.DEPENDENCIES ); // final Node dependenciesNode = session.getNode( dependenciesPath ); // assertThat( dependenciesNode.getNodes().getSize(), is( 1L ) ); // // final Node dependencyNode = dependenciesNode.getNodes().nextNode(); - // assertThat( dependencyNode.getPrimaryNodeType().getName(), is( ModelerLexicon.Dependency.DEPENDENCY ) ); + // assertThat( dependencyNode.getPrimaryNodeType().getName(), is( ModelspaceLexicon.Dependency.DEPENDENCY ) ); // // final String dependencyPath = "/Model/Books/data/types/BookDatatypes.xsd"; - // assertThat( dependencyNode.getProperty( ModelerLexicon.Dependency.PATH ).getString(), is( dependencyPath ) ); + // assertThat( dependencyNode.getProperty( ModelspaceLexicon.Dependency.PATH ).getString(), is( dependencyPath ) ); // // final String input = - // dependencyNode.getProperty( ModelerLexicon.Dependency.SOURCE_REFERENCE_PROPERTY ).getValues()[ 0 ].getString(); + // dependencyNode.getProperty( ModelspaceLexicon.Dependency.SOURCE_REFERENCE_PROPERTY ).getValues()[ 0 ].getString(); // assertThat( input, is( "./data/types/BookDatatypes.xsd" ) ); // // // make sure dependency resource was imported and model created (getNode throws exception if path not found) @@ -279,27 +280,27 @@ public void should() {} // @Test // public void shouldProcessDependencyWithInvalidRelativePath() throws Exception { // final URL xsdUrl = getClass().getClassLoader().getResource( "Books/SOAP/BooksWithSOAPEncoding.xsd" ); - // final String dataPath = modeler().importFile( new File( xsdUrl.toURI() ), null ); + // final String dataPath = modelspace().importFile( new File( xsdUrl.toURI() ), null ); // // final Metamodel xsdMetamodel = xsdMetamodel(); // // // relative path of ../data/types/BookDatatypes.xsd dependency is not valid since there is no parent folder // final String modelPath = "Books.xsd"; - // modeler().generateModel( dataPath, modelPath, xsdMetamodel, true ); + // modelspace().generateModel( dataPath, modelPath, xsdMetamodel, true ); // - // modeler().run( new TaskWithResult< Node >() { + // modelspace().run( new TaskWithResult< Node >() { // // @Override // public Node run( final Session session ) throws Exception { - // final String dependenciesPath = ( '/' + modelPath + '/' + ModelerLexicon.Model.DEPENDENCIES ); + // final String dependenciesPath = ( '/' + modelPath + '/' + ModelspaceLexicon.Model.DEPENDENCIES ); // final Node dependenciesNode = session.getNode( dependenciesPath ); // assertThat( dependenciesNode.getNodes().getSize(), is( 2L ) ); // // // the node with the invalid relative path should not have its path set // final NodeIterator itr = dependenciesNode.getNodes(); // - // if ( itr.nextNode().hasProperty( ModelerLexicon.Dependency.PATH ) && itr.nextNode().hasProperty( - // ModelerLexicon.Dependency.PATH ) ) { + // if ( itr.nextNode().hasProperty( ModelspaceLexicon.Dependency.PATH ) && itr.nextNode().hasProperty( + // ModelspaceLexicon.Dependency.PATH ) ) { // fail( "Invalid dependency relative path should not have a path property on its dependency node" ); // } // @@ -311,29 +312,29 @@ public void should() {} // @Test // public void shouldProcessMoviesXsd() throws Exception { // final URL xsdUrl = getClass().getClassLoader().getResource( "Movies/Movies.xsd" ); - // final String dataPath = modeler().importFile( new File( xsdUrl.toURI() ), null ); + // final String dataPath = modelspace().importFile( new File( xsdUrl.toURI() ), null ); // assertThat( dataPath, is( "/Movies.xsd" ) ); // // final Metamodel xsdMetamodel = xsdMetamodel(); // final String modelPath = "Model/Movies.xsd"; - // modeler().generateModel( dataPath, modelPath, xsdMetamodel, true ); + // modelspace().generateModel( dataPath, modelPath, xsdMetamodel, true ); // - // modeler().run( new TaskWithResult< Node >() { + // modelspace().run( new TaskWithResult< Node >() { // // @Override // public Node run( final Session session ) throws Exception { - // final String dependenciesPath = ( '/' + modelPath + '/' + ModelerLexicon.Model.DEPENDENCIES ); + // final String dependenciesPath = ( '/' + modelPath + '/' + ModelspaceLexicon.Model.DEPENDENCIES ); // final Node dependenciesNode = session.getNode( dependenciesPath ); // assertThat( dependenciesNode.getNodes().getSize(), is( 1L ) ); // // final Node dependencyNode = dependenciesNode.getNodes().nextNode(); - // assertThat( dependencyNode.getPrimaryNodeType().getName(), is( ModelerLexicon.Dependency.DEPENDENCY ) ); + // assertThat( dependencyNode.getPrimaryNodeType().getName(), is( ModelspaceLexicon.Dependency.DEPENDENCY ) ); // // final String dependencyPath = "/Model/MovieDatatypes.xsd"; - // assertThat( dependencyNode.getProperty( ModelerLexicon.Dependency.PATH ).getString(), is( dependencyPath ) ); + // assertThat( dependencyNode.getProperty( ModelspaceLexicon.Dependency.PATH ).getString(), is( dependencyPath ) ); // // final String input = - // dependencyNode.getProperty( ModelerLexicon.Dependency.SOURCE_REFERENCE_PROPERTY ).getValues()[ 0 ].getString(); + // dependencyNode.getProperty( ModelspaceLexicon.Dependency.SOURCE_REFERENCE_PROPERTY ).getValues()[ 0 ].getString(); // assertThat( input, is( "MovieDatatypes.xsd" ) ); // // // make sure dependency resource was imported and model created (getNode throws exception if path not found) diff --git a/modeshape-modeler/modeshape-modeler-xsd/src/test/java/org/modeshape/modeler/xsd/ITXsdDesquencerTest.java b/modelspace/modelspace-xsd/src/test/java/org/modelspace/xsd/ITXsdDesquencerTest.java similarity index 90% rename from modeshape-modeler/modeshape-modeler-xsd/src/test/java/org/modeshape/modeler/xsd/ITXsdDesquencerTest.java rename to modelspace/modelspace-xsd/src/test/java/org/modelspace/xsd/ITXsdDesquencerTest.java index 2391e75..c272979 100644 --- a/modeshape-modeler/modeshape-modeler-xsd/src/test/java/org/modeshape/modeler/xsd/ITXsdDesquencerTest.java +++ b/modelspace/modelspace-xsd/src/test/java/org/modelspace/xsd/ITXsdDesquencerTest.java @@ -21,10 +21,10 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler.xsd; +package org.modelspace.xsd; import org.junit.Test; -import org.modeshape.modeler.xsd.test.XsdIntegrationTest; +import org.modelspace.xsd.test.XsdIntegrationTest; @SuppressWarnings( "javadoc" ) public class ITXsdDesquencerTest extends XsdIntegrationTest { @@ -36,7 +36,7 @@ public void should() {} // public void shouldExport() throws Exception { // metamodelManager().install( SRAMP_METAMODEL_CATEGORY ); // metamodelManager().install( XSD_METAMODEL_CATEGORY ); - // final Model model = modeler().generateModel( new File( "src/test/resources/Books/Books.xsd" ), + // final Model model = modelspace().generateModel( new File( "src/test/resources/Books/Books.xsd" ), // null, // metamodelManager().metamodel( XSD_METAMODEL_ID ) ); // final Exporter exporter = model.metamodel().exporter(); diff --git a/modeshape-modeler/modeshape-modeler-xsd/src/test/java/org/modeshape/modeler/xsd/test/XsdIntegrationTest.java b/modelspace/modelspace-xsd/src/test/java/org/modelspace/xsd/test/XsdIntegrationTest.java similarity index 92% rename from modeshape-modeler/modeshape-modeler-xsd/src/test/java/org/modeshape/modeler/xsd/test/XsdIntegrationTest.java rename to modelspace/modelspace-xsd/src/test/java/org/modelspace/xsd/test/XsdIntegrationTest.java index 248ae00..0e7a2b3 100644 --- a/modeshape-modeler/modeshape-modeler-xsd/src/test/java/org/modeshape/modeler/xsd/test/XsdIntegrationTest.java +++ b/modelspace/modelspace-xsd/src/test/java/org/modelspace/xsd/test/XsdIntegrationTest.java @@ -21,18 +21,18 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.modeshape.modeler.xsd.test; +package org.modelspace.xsd.test; -import org.modeshape.modeler.test.BaseTest; +import org.modelspace.test.BaseTest; @SuppressWarnings( "javadoc" ) public abstract class XsdIntegrationTest extends BaseTest { protected static final String SRAMP_METAMODEL_CATEGORY = "sramp"; protected static final String XSD_METAMODEL_CATEGORY = "xsd"; - protected static final String XSD_METAMODEL_ID = "org.modeshape.modeler.xsd.Xsd"; + protected static final String XSD_METAMODEL_ID = "org.modelspace.xsd.Xsd"; // protected static final String XML_METAMODEL_CATEGORY = "xml"; - // protected static final String XML_METAMODEL_ID = "org.modeshape.modeler.xml.Xml"; + // protected static final String XML_METAMODEL_ID = "org.modelspace.xml.Xml"; // protected static final String XML_ROOT = "root"; // protected static final String XML_ROOT_PROPERTY = "property"; // protected static final String XML_LEAF = "child"; diff --git a/modeshape-modeler/modeshape-modeler-xsd/src/test/resources/Books/Books.xsd b/modelspace/modelspace-xsd/src/test/resources/Books/Books.xsd similarity index 100% rename from modeshape-modeler/modeshape-modeler-xsd/src/test/resources/Books/Books.xsd rename to modelspace/modelspace-xsd/src/test/resources/Books/Books.xsd diff --git a/modeshape-modeler/modeshape-modeler-xsd/src/test/resources/Books/SOAP/BooksWithSOAPEncoding.xsd b/modelspace/modelspace-xsd/src/test/resources/Books/SOAP/BooksWithSOAPEncoding.xsd similarity index 100% rename from modeshape-modeler/modeshape-modeler-xsd/src/test/resources/Books/SOAP/BooksWithSOAPEncoding.xsd rename to modelspace/modelspace-xsd/src/test/resources/Books/SOAP/BooksWithSOAPEncoding.xsd diff --git a/modeshape-modeler/modeshape-modeler-xsd/src/test/resources/Books/SOAP/encoding/soap_encoding.xsd b/modelspace/modelspace-xsd/src/test/resources/Books/SOAP/encoding/soap_encoding.xsd similarity index 100% rename from modeshape-modeler/modeshape-modeler-xsd/src/test/resources/Books/SOAP/encoding/soap_encoding.xsd rename to modelspace/modelspace-xsd/src/test/resources/Books/SOAP/encoding/soap_encoding.xsd diff --git a/modeshape-modeler/modeshape-modeler-xsd/src/test/resources/Books/data/types/BookDatatypes.xsd b/modelspace/modelspace-xsd/src/test/resources/Books/data/types/BookDatatypes.xsd similarity index 100% rename from modeshape-modeler/modeshape-modeler-xsd/src/test/resources/Books/data/types/BookDatatypes.xsd rename to modelspace/modelspace-xsd/src/test/resources/Books/data/types/BookDatatypes.xsd diff --git a/modeshape-modeler/modeshape-modeler-xsd/src/test/resources/Movies/MovieDatatypes.xsd b/modelspace/modelspace-xsd/src/test/resources/Movies/MovieDatatypes.xsd similarity index 100% rename from modeshape-modeler/modeshape-modeler-xsd/src/test/resources/Movies/MovieDatatypes.xsd rename to modelspace/modelspace-xsd/src/test/resources/Movies/MovieDatatypes.xsd diff --git a/modeshape-modeler/modeshape-modeler-xsd/src/test/resources/Movies/Movies.xsd b/modelspace/modelspace-xsd/src/test/resources/Movies/Movies.xsd similarity index 100% rename from modeshape-modeler/modeshape-modeler-xsd/src/test/resources/Movies/Movies.xsd rename to modelspace/modelspace-xsd/src/test/resources/Movies/Movies.xsd diff --git a/modeshape-modeler/modeshape-modeler-ddl/src/test/resources/log4j.properties b/modelspace/modelspace-xsd/src/test/resources/log4j.properties similarity index 83% rename from modeshape-modeler/modeshape-modeler-ddl/src/test/resources/log4j.properties rename to modelspace/modelspace-xsd/src/test/resources/log4j.properties index 9ebce64..b31b35c 100644 --- a/modeshape-modeler/modeshape-modeler-ddl/src/test/resources/log4j.properties +++ b/modelspace/modelspace-xsd/src/test/resources/log4j.properties @@ -10,5 +10,5 @@ log4j.rootLogger=ERROR, stdout # Set up the default logging to be ERROR level, then override specific units log4j.logger.org.modeshape=WARN log4j.logger.org.polyglotter=WARN -log4j.logger.org.modeshape.modeler=WARN -log4j.logger.org.modeshape.modeler.teiid.ddl=WARN +log4j.logger.org.modelspace=WARN +log4j.logger.org.modelspace.xsd=WARN diff --git a/modeshape-modeler/modeshape-modeler-xsd/src/test/resources/music.xsd b/modelspace/modelspace-xsd/src/test/resources/music.xsd similarity index 100% rename from modeshape-modeler/modeshape-modeler-xsd/src/test/resources/music.xsd rename to modelspace/modelspace-xsd/src/test/resources/music.xsd diff --git a/modeshape-modeler/pom.xml b/modelspace/pom.xml similarity index 73% rename from modeshape-modeler/pom.xml rename to modelspace/pom.xml index 2785414..e9a8f0a 100644 --- a/modeshape-modeler/pom.xml +++ b/modelspace/pom.xml @@ -14,19 +14,19 @@ - modeshape-modeler - ModeShape Modeler - A modeler implementation backed by a ModeShape repository. + modelspace + Modelspace + A library for managing models in a workspace. pom - modeshape-modeler-engine - modeshape-modeler-java - modeshape-modeler-xsd - modeshape-modeler-ddl + modelspace-engine + modelspace-java + modelspace-xsd + modelspace-ddl diff --git a/modeshape-modeler/modeshape-modeler-engine/src/test/resources/Teiid-MySQLAccounts.ddl b/modeshape-modeler/modeshape-modeler-engine/src/test/resources/Teiid-MySQLAccounts.ddl deleted file mode 100644 index de58510..0000000 --- a/modeshape-modeler/modeshape-modeler-engine/src/test/resources/Teiid-MySQLAccounts.ddl +++ /dev/null @@ -1,40 +0,0 @@ -CREATE FOREIGN TABLE "accounts.ACCOUNT" ( - ACCOUNT_ID long NOT NULL DEFAULT '0' OPTIONS (ANNOTATION '', NAMEINSOURCE '`ACCOUNT_ID`', NATIVE_TYPE 'INT'), - SSN string(10) OPTIONS (ANNOTATION '', NAMEINSOURCE '`SSN`', NATIVE_TYPE 'CHAR'), - STATUS string(10) OPTIONS (ANNOTATION '', NAMEINSOURCE '`STATUS`', NATIVE_TYPE 'CHAR'), - TYPE string(10) OPTIONS (ANNOTATION '', NAMEINSOURCE '`TYPE`', NATIVE_TYPE 'CHAR'), - DATEOPENED timestamp NOT NULL DEFAULT 'CURRENT_TIMESTAMP' OPTIONS (ANNOTATION '', NAMEINSOURCE '`DATEOPENED`', NATIVE_TYPE 'TIMESTAMP'), - DATECLOSED timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' OPTIONS (ANNOTATION '', NAMEINSOURCE '`DATECLOSED`', NATIVE_TYPE 'TIMESTAMP') -) OPTIONS (ANNOTATION '', NAMEINSOURCE '`accounts`.`ACCOUNT`', UPDATABLE TRUE); - -CREATE FOREIGN TABLE "accounts.CUSTOMER" ( - SSN string(10) NOT NULL DEFAULT '' OPTIONS (ANNOTATION '', NAMEINSOURCE '`SSN`', NATIVE_TYPE 'CHAR'), - FIRSTNAME string(64) OPTIONS (ANNOTATION '', NAMEINSOURCE '`FIRSTNAME`', NATIVE_TYPE 'VARCHAR'), - LASTNAME string(64) OPTIONS (ANNOTATION '', NAMEINSOURCE '`LASTNAME`', NATIVE_TYPE 'VARCHAR'), - ST_ADDRESS string(256) OPTIONS (ANNOTATION '', NAMEINSOURCE '`ST_ADDRESS`', NATIVE_TYPE 'VARCHAR'), - APT_NUMBER string(32) OPTIONS (ANNOTATION '', NAMEINSOURCE '`APT_NUMBER`', NATIVE_TYPE 'VARCHAR'), - CITY string(64) OPTIONS (ANNOTATION '', NAMEINSOURCE '`CITY`', NATIVE_TYPE 'VARCHAR'), - STATE string(32) OPTIONS (ANNOTATION '', NAMEINSOURCE '`STATE`', NATIVE_TYPE 'VARCHAR'), - ZIPCODE string(10) OPTIONS (ANNOTATION '', NAMEINSOURCE '`ZIPCODE`', NATIVE_TYPE 'VARCHAR'), - PHONE string(15) OPTIONS (ANNOTATION '', NAMEINSOURCE '`PHONE`', NATIVE_TYPE 'VARCHAR') -) OPTIONS (ANNOTATION '', NAMEINSOURCE '`accounts`.`CUSTOMER`', UPDATABLE TRUE); - -CREATE FOREIGN TABLE "accounts.HOLDINGS" ( - TRANSACTION_ID long NOT NULL AUTO_INCREMENT OPTIONS (ANNOTATION '', NAMEINSOURCE '`TRANSACTION_ID`', NATIVE_TYPE 'INT'), - ACCOUNT_ID long OPTIONS (ANNOTATION '', NAMEINSOURCE '`ACCOUNT_ID`', NATIVE_TYPE 'INT'), - PRODUCT_ID long OPTIONS (ANNOTATION '', NAMEINSOURCE '`PRODUCT_ID`', NATIVE_TYPE 'INT'), - PURCHASE_DATE timestamp NOT NULL DEFAULT 'CURRENT_TIMESTAMP' OPTIONS (ANNOTATION '', NAMEINSOURCE '`PURCHASE_DATE`', NATIVE_TYPE 'TIMESTAMP'), - SHARES_COUNT long OPTIONS (ANNOTATION '', NAMEINSOURCE '`SHARES_COUNT`', NATIVE_TYPE 'INT') -) OPTIONS (ANNOTATION '', NAMEINSOURCE '`accounts`.`HOLDINGS`', UPDATABLE TRUE); - -CREATE FOREIGN TABLE "accounts.PRODUCT" ( - ID long NOT NULL DEFAULT '0' OPTIONS (ANNOTATION '', NAMEINSOURCE '`ID`', NATIVE_TYPE 'INT'), - SYMBOL string(16) OPTIONS (ANNOTATION '', NAMEINSOURCE '`SYMBOL`', NATIVE_TYPE 'VARCHAR'), - COMPANY_NAME string(256) OPTIONS (ANNOTATION '', NAMEINSOURCE '`COMPANY_NAME`', NATIVE_TYPE 'VARCHAR') -) OPTIONS (ANNOTATION '', NAMEINSOURCE '`accounts`.`PRODUCT`', UPDATABLE TRUE); - -CREATE FOREIGN TABLE "accounts.SUBSCRIPTIONS" ( - "value" string(15) NOT NULL DEFAULT '' OPTIONS (ANNOTATION '', NAMEINSOURCE '`value`', NATIVE_TYPE 'CHAR'), - type string(45) NOT NULL DEFAULT '' OPTIONS (ANNOTATION '', NAMEINSOURCE '`type`', NATIVE_TYPE 'CHAR'), - end_date date NOT NULL DEFAULT '2012-12-31' OPTIONS (ANNOTATION '', NAMEINSOURCE '`end_date`', NATIVE_TYPE 'DATE') -) OPTIONS (ANNOTATION '', NAMEINSOURCE '`accounts`.`SUBSCRIPTIONS`', UPDATABLE TRUE); \ No newline at end of file diff --git a/polyglotter-engine/pom.xml b/polyglotter-engine/pom.xml index 75f200f..0af6910 100644 --- a/polyglotter-engine/pom.xml +++ b/polyglotter-engine/pom.xml @@ -34,7 +34,7 @@ org.polyglotter - modeshape-modeler-engine + modelspace-engine diff --git a/polyglotter-engine/src/integration/java/org/polyglotter/transformation/ITJava2JavaTransformation.java b/polyglotter-engine/src/integration/java/org/polyglotter/transformation/ITJava2JavaTransformation.java index 724bdbc..9c0123f 100644 --- a/polyglotter-engine/src/integration/java/org/polyglotter/transformation/ITJava2JavaTransformation.java +++ b/polyglotter-engine/src/integration/java/org/polyglotter/transformation/ITJava2JavaTransformation.java @@ -34,9 +34,9 @@ import org.junit.Before; import org.junit.Test; -import org.modeshape.modeler.Metamodel; -import org.modeshape.modeler.Model; -import org.modeshape.modeler.ModelObject; +import org.modelspace.Metamodel; +import org.modelspace.Model; +import org.modelspace.ModelObject; import org.polyglotter.operation.Map; import org.polyglotter.operation.OperationTestConstants; import org.polyglotter.test.BaseTest; @@ -45,7 +45,7 @@ public final class ITJava2JavaTransformation extends BaseTest { protected static final String CATEGORY = "java"; - private static final String METAMODEL_ID = "org.modeshape.modeler.java.JavaFile"; + private static final String METAMODEL_ID = "org.modelspace.java.JavaFile"; private static final String SOURCE_MODEL_NAME = "RocketSkates.java"; private static final String SOURCE_MODEL_PATH = "src/test/resources/org/acme/" + SOURCE_MODEL_NAME; diff --git a/polyglotter-engine/src/main/java/org/polyglotter/Polyglotter.java b/polyglotter-engine/src/main/java/org/polyglotter/Polyglotter.java index abd1bba..25848fa 100644 --- a/polyglotter-engine/src/main/java/org/polyglotter/Polyglotter.java +++ b/polyglotter-engine/src/main/java/org/polyglotter/Polyglotter.java @@ -28,24 +28,24 @@ import java.io.OutputStream; import java.net.URL; -import org.modeshape.modeler.Metamodel; -import org.modeshape.modeler.MetamodelManager; -import org.modeshape.modeler.Model; -import org.modeshape.modeler.Modeler; -import org.modeshape.modeler.ModelerException; +import org.modelspace.Metamodel; +import org.modelspace.MetamodelManager; +import org.modelspace.Model; +import org.modelspace.Modelspace; +import org.modelspace.ModelspaceException; import org.polyglotter.common.Logger; /** * */ -public final class Polyglotter implements Modeler { +public final class Polyglotter implements Modelspace { /** * */ public static final Logger LOGGER = Logger.logger( PolyglotterI18n.class ); - private final Modeler modeler; + private final Modelspace modelspace; /** * The Polyglotter namespace. Value is {@value} . @@ -64,7 +64,7 @@ public final class Polyglotter implements Modeler { * the file path to the folder that should contain the repository store */ public Polyglotter( final String repositoryStoreParentPath ) { - modeler = Modeler.Factory.instance( repositoryStoreParentPath ); + modelspace = Modelspace.Factory.instance( repositoryStoreParentPath ); } /** @@ -75,7 +75,7 @@ public Polyglotter( final String repositoryStoreParentPath ) { */ public Polyglotter( final String repositoryStoreParentPath, final String configurationPath ) { - modeler = Modeler.Factory.instance( repositoryStoreParentPath, configurationPath ); + modelspace = Modelspace.Factory.instance( repositoryStoreParentPath, configurationPath ); } /** @@ -85,254 +85,254 @@ public Polyglotter( final String repositoryStoreParentPath, */ @Override public void close() throws Exception { - modeler.close(); + modelspace.close(); } /** * {@inheritDoc} * - * @see Modeler#configurationPath() + * @see Modelspace#configurationPath() */ @Override public String configurationPath() { - return modeler.configurationPath(); + return modelspace.configurationPath(); } /** * {@inheritDoc} * - * @see org.modeshape.modeler.Modeler#deleteModel(java.lang.String) + * @see org.modelspace.Modelspace#deleteModel(java.lang.String) */ @Override - public boolean deleteModel( final String path ) throws ModelerException { - return modeler.deleteModel( path ); + public boolean deleteModel( final String path ) throws ModelspaceException { + return modelspace.deleteModel( path ); } /** * {@inheritDoc} * - * @see org.modeshape.modeler.Modeler#export(org.modeshape.modeler.Model, java.io.File) + * @see org.modelspace.Modelspace#export(org.modelspace.Model, java.io.File) */ @Override public void export( final Model model, - final File file ) throws ModelerException { - modeler.export( model, file ); + final File file ) throws ModelspaceException { + modelspace.export( model, file ); } /** * {@inheritDoc} * - * @see org.modeshape.modeler.Modeler#export(org.modeshape.modeler.Model, java.io.OutputStream) + * @see org.modelspace.Modelspace#export(org.modelspace.Model, java.io.OutputStream) */ @Override public void export( final Model model, - final OutputStream stream ) throws ModelerException { - modeler.export( model, stream ); + final OutputStream stream ) throws ModelspaceException { + modelspace.export( model, stream ); } /** * {@inheritDoc} * - * @see org.modeshape.modeler.Modeler#export(org.modeshape.modeler.Model, java.net.URL) + * @see org.modelspace.Modelspace#export(org.modelspace.Model, java.net.URL) */ @Override public void export( final Model model, - final URL url ) throws ModelerException { - modeler.export( model, url ); + final URL url ) throws ModelspaceException { + modelspace.export( model, url ); } /** * {@inheritDoc} * - * @see Modeler#generateModel(String, String) + * @see Modelspace#generateModel(String, String) */ @Override public Model generateModel( final String dataPath, - final String modelPath ) throws ModelerException { - return modeler.generateModel( dataPath, modelPath ); + final String modelPath ) throws ModelspaceException { + return modelspace.generateModel( dataPath, modelPath ); } /** * {@inheritDoc} * - * @see Modeler#generateModel(String, String, Metamodel) + * @see Modelspace#generateModel(String, String, Metamodel) */ @Override public Model generateModel( final String dataPath, final String modelPath, - final Metamodel metamodel ) throws ModelerException { - return modeler.generateModel( dataPath, modelPath, metamodel ); + final Metamodel metamodel ) throws ModelspaceException { + return modelspace.generateModel( dataPath, modelPath, metamodel ); } /** * {@inheritDoc} * - * @see Modeler#importData(File, String) + * @see Modelspace#importData(File, String) */ @Override public String importData( final File file, - final String workspaceFolder ) throws ModelerException { - return modeler.importData( file, workspaceFolder ); + final String workspaceFolder ) throws ModelspaceException { + return modelspace.importData( file, workspaceFolder ); } /** * {@inheritDoc} * - * @see Modeler#importData(File, String, String) + * @see Modelspace#importData(File, String, String) */ @Override public String importData( final File file, final String workspaceFolder, - final String workspaceName ) throws ModelerException { - return modeler.importData( file, workspaceFolder, workspaceName ); + final String workspaceName ) throws ModelspaceException { + return modelspace.importData( file, workspaceFolder, workspaceName ); } /** * {@inheritDoc} * - * @see Modeler#importData(InputStream, String) + * @see Modelspace#importData(InputStream, String) */ @Override public String importData( final InputStream stream, - final String workspacePath ) throws ModelerException { - return modeler.importData( stream, workspacePath ); + final String workspacePath ) throws ModelspaceException { + return modelspace.importData( stream, workspacePath ); } /** * {@inheritDoc} * - * @see Modeler#importData(URL, String) + * @see Modelspace#importData(URL, String) */ @Override public String importData( final URL url, - final String workspaceFolder ) throws ModelerException { - return modeler.importData( url, workspaceFolder ); + final String workspaceFolder ) throws ModelspaceException { + return modelspace.importData( url, workspaceFolder ); } /** * {@inheritDoc} * - * @see Modeler#importData(URL, String, String) + * @see Modelspace#importData(URL, String, String) */ @Override public String importData( final URL url, final String workspaceFolder, - final String workspaceName ) throws ModelerException { - return modeler.importData( url, workspaceFolder, workspaceName ); + final String workspaceName ) throws ModelspaceException { + return modelspace.importData( url, workspaceFolder, workspaceName ); } /** * {@inheritDoc} * - * @see Modeler#importModel(File, String, Metamodel) + * @see Modelspace#importModel(File, String, Metamodel) */ @Override public Model importModel( final File file, final String modelFolder, - final Metamodel metamodel ) throws ModelerException { - return modeler.importModel( file, modelFolder, metamodel ); + final Metamodel metamodel ) throws ModelspaceException { + return modelspace.importModel( file, modelFolder, metamodel ); } /** * {@inheritDoc} * - * @see Modeler#importModel(File, String, String, Metamodel) + * @see Modelspace#importModel(File, String, String, Metamodel) */ @Override public Model importModel( final File file, final String modelFolder, final String modelName, - final Metamodel metamodel ) throws ModelerException { - return modeler.importModel( file, modelFolder, modelName, metamodel ); + final Metamodel metamodel ) throws ModelspaceException { + return modelspace.importModel( file, modelFolder, modelName, metamodel ); } /** * {@inheritDoc} * - * @see Modeler#importModel(InputStream, String, Metamodel) + * @see Modelspace#importModel(InputStream, String, Metamodel) */ @Override public Model importModel( final InputStream stream, final String modelPath, - final Metamodel metamodel ) throws ModelerException { - return modeler.importModel( stream, modelPath, metamodel ); + final Metamodel metamodel ) throws ModelspaceException { + return modelspace.importModel( stream, modelPath, metamodel ); } /** * {@inheritDoc} * - * @see Modeler#importModel(URL, String, Metamodel) + * @see Modelspace#importModel(URL, String, Metamodel) */ @Override public Model importModel( final URL dataUrl, final String modelFolder, - final Metamodel metamodel ) throws ModelerException { - return modeler.importModel( dataUrl, modelFolder, metamodel ); + final Metamodel metamodel ) throws ModelspaceException { + return modelspace.importModel( dataUrl, modelFolder, metamodel ); } /** * {@inheritDoc} * - * @see Modeler#importModel(URL, String, String, Metamodel) + * @see Modelspace#importModel(URL, String, String, Metamodel) */ @Override public Model importModel( final URL dataUrl, final String modelFolder, final String modelName, - final Metamodel metamodel ) throws ModelerException { - return modeler.importModel( dataUrl, modelFolder, modelName, metamodel ); + final Metamodel metamodel ) throws ModelspaceException { + return modelspace.importModel( dataUrl, modelFolder, modelName, metamodel ); } /** * {@inheritDoc} * - * @see Modeler#metamodelManager() + * @see Modelspace#metamodelManager() */ @Override - public MetamodelManager metamodelManager() throws ModelerException { - return modeler.metamodelManager(); + public MetamodelManager metamodelManager() throws ModelspaceException { + return modelspace.metamodelManager(); } /** * {@inheritDoc} * - * @see Modeler#model(String) + * @see Modelspace#model(String) */ @Override - public Model model( final String path ) throws ModelerException { - return modeler.model( path ); + public Model model( final String path ) throws ModelspaceException { + return modelspace.model( path ); } /** * {@inheritDoc} * - * @see org.modeshape.modeler.Modeler#newModel(java.lang.String, java.lang.String) + * @see org.modelspace.Modelspace#newModel(java.lang.String, java.lang.String) */ @Override public Model newModel( final String modelPath, - final String metamodelId ) throws ModelerException { - return modeler.newModel( modelPath, metamodelId ); + final String metamodelId ) throws ModelspaceException { + return modelspace.newModel( modelPath, metamodelId ); } /** * {@inheritDoc} * - * @see org.modeshape.modeler.Modeler#newModel(java.lang.String, java.lang.String, boolean) + * @see org.modelspace.Modelspace#newModel(java.lang.String, java.lang.String, boolean) */ @Override public Model newModel( final String modelPath, final String metamodelId, - final boolean override ) throws ModelerException { - return modeler.newModel( modelPath, metamodelId, override ); + final boolean override ) throws ModelspaceException { + return modelspace.newModel( modelPath, metamodelId, override ); } /** * {@inheritDoc} * - * @see Modeler#repositoryStoreParentPath() + * @see Modelspace#repositoryStoreParentPath() */ @Override public String repositoryStoreParentPath() { - return modeler.repositoryStoreParentPath(); + return modelspace.repositoryStoreParentPath(); } } diff --git a/polyglotter-engine/src/main/java/org/polyglotter/operation/Map.java b/polyglotter-engine/src/main/java/org/polyglotter/operation/Map.java index 6b35187..b86d376 100644 --- a/polyglotter-engine/src/main/java/org/polyglotter/operation/Map.java +++ b/polyglotter-engine/src/main/java/org/polyglotter/operation/Map.java @@ -25,8 +25,8 @@ import java.util.List; -import org.modeshape.modeler.Model; -import org.modeshape.modeler.ModelObject; +import org.modelspace.Model; +import org.modelspace.ModelObject; import org.polyglotter.Polyglotter; import org.polyglotter.PolyglotterException; import org.polyglotter.PolyglotterI18n; @@ -157,7 +157,7 @@ protected Void calculate() throws PolyglotterException { try { final Object value = sourceModel.value( sourceProp ); targetModel.setProperty( targetProp, value ); - } catch ( final ModelerException e ) { + } catch ( final ModelspaceException e ) { throw new PolyglotterException( e, "Unable to calculate operation result" ); } */ diff --git a/polyglotter-engine/src/main/java/org/polyglotter/transformation/Transformation.java b/polyglotter-engine/src/main/java/org/polyglotter/transformation/Transformation.java index 35d66ca..078bb8c 100644 --- a/polyglotter-engine/src/main/java/org/polyglotter/transformation/Transformation.java +++ b/polyglotter-engine/src/main/java/org/polyglotter/transformation/Transformation.java @@ -23,7 +23,7 @@ */ package org.polyglotter.transformation; -import org.modeshape.modeler.Model; +import org.modelspace.Model; import org.polyglotter.PolyglotterException; import org.polyglotter.common.CheckArg; diff --git a/polyglotter-engine/src/main/java/org/polyglotter/transformation/TransformationFactory.java b/polyglotter-engine/src/main/java/org/polyglotter/transformation/TransformationFactory.java index 7101c2d..9a6948f 100644 --- a/polyglotter-engine/src/main/java/org/polyglotter/transformation/TransformationFactory.java +++ b/polyglotter-engine/src/main/java/org/polyglotter/transformation/TransformationFactory.java @@ -31,8 +31,8 @@ import java.util.List; import java.util.Map; -import org.modeshape.modeler.Model; -import org.modeshape.modeler.ModelerException; +import org.modelspace.Model; +import org.modelspace.ModelspaceException; import org.polyglotter.Polyglotter; import org.polyglotter.PolyglotterException; import org.polyglotter.PolyglotterI18n; @@ -758,7 +758,7 @@ public TransformationImpl( final String tranformationId ) { * {@inheritDoc} * * @see org.polyglotter.transformation.Transformation#add(org.polyglotter.transformation.Transformation.ModelType, - * org.modeshape.modeler.Model[]) + * org.modelspace.Model[]) */ @Override public void add( final ModelType modelType, @@ -784,7 +784,7 @@ public void add( final ModelType modelType, try { modelName = model.name(); - } catch ( final ModelerException e ) { + } catch ( final ModelspaceException e ) { throw new PolyglotterException( e, PolyglotterI18n.errorAddingTransformationModel, id(), @@ -860,7 +860,7 @@ public String id() { /** * {@inheritDoc} * - * @see org.polyglotter.transformation.Transformation#remove(org.modeshape.modeler.Model[]) + * @see org.polyglotter.transformation.Transformation#remove(org.modelspace.Model[]) */ @Override public void remove( final Model... modelsBeingRemoved ) throws PolyglotterException { @@ -880,7 +880,7 @@ public void remove( final Model... modelsBeingRemoved ) throws PolyglotterExcept try { modelName = model.name(); - } catch ( final ModelerException e ) { + } catch ( final ModelspaceException e ) { throw new PolyglotterException( e, PolyglotterI18n.errorRemovingUnaddedTransformationModel, id() ); @@ -899,7 +899,7 @@ public void remove( final Model... modelsBeingRemoved ) throws PolyglotterExcept * {@inheritDoc} * * @see org.polyglotter.transformation.Transformation#remove(org.polyglotter.transformation.Transformation.ModelType, - * org.modeshape.modeler.Model[]) + * org.modelspace.Model[]) */ @Override public void remove( final ModelType modelType, @@ -921,7 +921,7 @@ public void remove( final ModelType modelType, try { modelName = model.name(); - } catch ( final ModelerException e ) { + } catch ( final ModelspaceException e ) { throw new PolyglotterException( e, PolyglotterI18n.errorRemovingUnaddedTransformationModel, id() ); @@ -946,7 +946,7 @@ public void remove( final ModelType modelType, try { modelName = model.name(); - } catch ( final ModelerException e ) { + } catch ( final ModelspaceException e ) { throw new PolyglotterException( e, PolyglotterI18n.errorRemovingTransformationModel, id(), diff --git a/polyglotter-engine/src/test/java/org/polyglotter/operation/MapTest.java b/polyglotter-engine/src/test/java/org/polyglotter/operation/MapTest.java index 3933cf4..0b0a994 100644 --- a/polyglotter-engine/src/test/java/org/polyglotter/operation/MapTest.java +++ b/polyglotter-engine/src/test/java/org/polyglotter/operation/MapTest.java @@ -30,7 +30,7 @@ import org.junit.Before; import org.junit.Test; -import org.modeshape.modeler.Model; +import org.modelspace.Model; import org.polyglotter.PolyglotterException; import org.polyglotter.transformation.OperationCategory.BuiltInCategory; diff --git a/polyglotter-engine/src/test/java/org/polyglotter/test/BaseTest.java b/polyglotter-engine/src/test/java/org/polyglotter/test/BaseTest.java index fc65979..68cf1fb 100644 --- a/polyglotter-engine/src/test/java/org/polyglotter/test/BaseTest.java +++ b/polyglotter-engine/src/test/java/org/polyglotter/test/BaseTest.java @@ -48,7 +48,7 @@ public abstract class BaseTest { protected static final String TEST_REPOSITORY_STORE_PARENT_PATH; protected static final String XML_METAMODEL_CATEGORY = "xml"; - protected static final String XML_METAMODEL_NAME = "org.modeshape.modeler.xml.Xml"; + protected static final String XML_METAMODEL_NAME = "org.modelspace.xml.Xml"; protected static final String XML_DECLARATION = ""; protected static final String XML_ROOT = "root"; protected static final String XML_ROOT_PROPERTY = "property"; diff --git a/polyglotter-engine/src/test/java/org/polyglotter/transformation/TransformationImplTest.java b/polyglotter-engine/src/test/java/org/polyglotter/transformation/TransformationImplTest.java index 1cbebd1..4b30c48 100644 --- a/polyglotter-engine/src/test/java/org/polyglotter/transformation/TransformationImplTest.java +++ b/polyglotter-engine/src/test/java/org/polyglotter/transformation/TransformationImplTest.java @@ -35,7 +35,7 @@ import org.junit.Before; import org.junit.Test; -import org.modeshape.modeler.Model; +import org.modelspace.Model; import org.polyglotter.PolyglotterException; import org.polyglotter.operation.OperationTestConstants; import org.polyglotter.transformation.Transformation.ModelType; diff --git a/pom.xml b/pom.xml index 863c000..8b674f3 100644 --- a/pom.xml +++ b/pom.xml @@ -121,9 +121,9 @@ ${project.version} ${project.version} ${project.version} - ${project.version} - ${project.version} - ${project.version} + ${project.version} + ${project.version} + ${project.version} @@ -392,28 +392,28 @@ org.polyglotter - modeshape-modeler-engine - ${modeshape.modeler.engine.version} + modelspace-engine + ${modelspace.engine.version} org.polyglotter - modeshape-modeler-engine - ${modeshape.modeler.engine.version} + modelspace-engine + ${modelspace.engine.version} test-jar test org.polyglotter - modeshape-modeler-java - ${modeshape.modeler.java.version} + modelspace-java + ${modelspace.java.version} org.polyglotter - modeshape-modeler-xsd - ${modeshape.modeler.xsd.version} + modelspace-xsd + ${modelspace.xsd.version} @@ -626,7 +626,7 @@ - modeshape-modeler + modelspace polyglotter-common polyglotter-engine