-
-
-
+
+
+ Could not open project : {{projectName}}
+
+
+
+
+
+
+
+
+
+
+ Describe your Vorto Model
+
+ Hint: Press Ctrl + Space for Content Assist
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+
+
+ Name |
+ Details |
+
+
+
+
+ {{ model.id.name }} |
+
+
+
+
+ |
+
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/server/devtool/src/main/resources/static/templates/project-template.html b/server/devtool/src/main/resources/static/templates/project-template.html
new file mode 100644
index 0000000000..1793c172a6
--- /dev/null
+++ b/server/devtool/src/main/resources/static/templates/project-template.html
@@ -0,0 +1,70 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/server/devtool/src/test/java/org/eclipse/vorto/server/devtool/service/ProjectRepositoryServiceTest.java b/server/devtool/src/test/java/org/eclipse/vorto/server/devtool/service/ProjectRepositoryServiceTest.java
new file mode 100644
index 0000000000..edd01e778c
--- /dev/null
+++ b/server/devtool/src/test/java/org/eclipse/vorto/server/devtool/service/ProjectRepositoryServiceTest.java
@@ -0,0 +1,59 @@
+package org.eclipse.vorto.server.devtool.service;
+
+import static org.junit.Assert.assertNotNull;
+import static org.mockito.Mockito.when;
+
+import org.eclipse.vorto.editor.web.resource.WebEditorResourceSetProvider;
+import org.eclipse.vorto.server.devtool.exception.ProjectAlreadyExistsException;
+import org.eclipse.vorto.server.devtool.exception.ProjectNotFoundException;
+import org.eclipse.vorto.server.devtool.service.impl.ProjectRepositoryServiceImpl;
+import org.eclipse.xtext.web.server.model.IWebResourceSetProvider;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+
+import com.google.inject.Injector;
+
+public class ProjectRepositoryServiceTest {
+
+ @InjectMocks
+ private IProjectRepositoryService projectRepositoryService = new ProjectRepositoryServiceImpl();
+
+ @Mock
+ private IProjectRespositoryDAO projectRespositoryDAO;
+
+ @Mock
+ private Injector injector;
+
+ @Mock
+ private WebEditorResourceSetProvider webEditorResourceSetProvider;
+
+ private String sessionId = "sessionId";
+ private String projectName = "Project";
+
+ @Before
+ public void initMocks() {
+ MockitoAnnotations.initMocks(this);
+ }
+
+ @Test(expected = ProjectAlreadyExistsException.class)
+ public void checkProjectExistsTest() throws ProjectAlreadyExistsException{
+ when(injector.getInstance(IWebResourceSetProvider.class)).thenReturn(webEditorResourceSetProvider);
+ when(projectRespositoryDAO.projectExists(projectName, sessionId)).thenReturn(true);
+ projectRepositoryService.createProject(sessionId, projectName);
+ }
+
+ @Test(expected = ProjectNotFoundException.class)
+ public void openNonExistantProjectTest() throws ProjectNotFoundException{
+ when(projectRespositoryDAO.openProject(projectName, sessionId)).thenReturn(null);
+ projectRepositoryService.openProject(sessionId, projectName);
+ }
+
+ @Test
+ public void getProjectListTest() throws ProjectNotFoundException{
+ assertNotNull(projectRepositoryService.getProjects(sessionId));
+ }
+
+}
diff --git a/server/devtool/src/test/java/org/eclipse/vorto/server/devtool/service/impl/ProjectRepositoryDAOTest.java b/server/devtool/src/test/java/org/eclipse/vorto/server/devtool/service/impl/ProjectRepositoryDAOTest.java
new file mode 100644
index 0000000000..8f55f55c32
--- /dev/null
+++ b/server/devtool/src/test/java/org/eclipse/vorto/server/devtool/service/impl/ProjectRepositoryDAOTest.java
@@ -0,0 +1,56 @@
+package org.eclipse.vorto.server.devtool.service.impl;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import org.eclipse.vorto.server.devtool.models.Project;
+import org.junit.Test;
+import org.mockito.InjectMocks;
+
+public class ProjectRepositoryDAOTest {
+
+ @InjectMocks
+ private MapProjectRespositoryDAOImpl projectRepositoryDAO = new MapProjectRespositoryDAOImpl();
+
+ private String sessionId = "sessionId";
+ private String projectName = "Project";
+
+ @Test
+ public void uniqueProjectNameTest(){
+ Project project1 = new Project(projectName);
+ projectRepositoryDAO.createProject(project1, sessionId);
+ assertEquals(1, projectRepositoryDAO.getProjects(sessionId).size());
+ Project project2 = new Project(projectName);
+ projectRepositoryDAO.createProject(project2, sessionId);
+ assertEquals(1, projectRepositoryDAO.getProjects(sessionId).size());
+ }
+
+ @Test
+ public void checkProjectExistsTest(){
+ Project project1 = new Project(projectName);
+ projectRepositoryDAO.createProject(project1, sessionId);
+ assertTrue(projectRepositoryDAO.projectExists(projectName, sessionId));
+ assertFalse(projectRepositoryDAO.projectExists(Long.toString(System.currentTimeMillis()), sessionId));
+ }
+
+
+ @Test
+ public void openProjectTest(){
+ Project project1 = new Project(projectName);
+ projectRepositoryDAO.createProject(project1, sessionId);
+ assertNotNull(projectRepositoryDAO.openProject(projectName, sessionId));
+ assertNull((projectRepositoryDAO.openProject(Long.toString(System.currentTimeMillis()), sessionId)));
+ }
+
+ @Test
+ public void getProjectsTest(){
+ Project project1 = new Project(projectName);
+ projectRepositoryDAO.createProject(project1, sessionId);
+ assertEquals(1, projectRepositoryDAO.getProjects(sessionId).size());
+ assertEquals(projectName, projectRepositoryDAO.getProjects(sessionId).get(0).getProjectName());
+ }
+
+}
diff --git a/server/pom.xml b/server/pom.xml
index 27fd7ef854..50f06f4620 100644
--- a/server/pom.xml
+++ b/server/pom.xml
@@ -44,6 +44,7 @@
generators
repo
+ devtool
diff --git a/server/repo/pom.xml b/server/repo/pom.xml
index b84cbcec88..5542fbb85a 100644
--- a/server/repo/pom.xml
+++ b/server/repo/pom.xml
@@ -17,6 +17,7 @@
repo-core
repo-ui
+ repo-http-models
diff --git a/server/repo/repo-core/pom.xml b/server/repo/repo-core/pom.xml
index e116ae193d..64affaca14 100644
--- a/server/repo/repo-core/pom.xml
+++ b/server/repo/repo-core/pom.xml
@@ -67,6 +67,11 @@
org.eclipse.vorto
org.eclipse.vorto.core
+
+ org.eclipse.vorto
+ repo-http-models
+ ${project.version}
+
org.eclipse.vorto
org.eclipse.vorto.editor
diff --git a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/IModelParser.java b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/IModelParser.java
index 5b42988c9d..0beca4c225 100644
--- a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/IModelParser.java
+++ b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/IModelParser.java
@@ -16,7 +16,7 @@
import java.io.InputStream;
-import org.eclipse.vorto.repository.model.ModelResource;
+import org.eclipse.vorto.http.model.ModelResource;
/**
* @author Alexander Edelmann - Robert Bosch (SEA) Pte. Ltd.
diff --git a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/JcrModelRepository.java b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/JcrModelRepository.java
index 59592f08ff..d696c216db 100644
--- a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/JcrModelRepository.java
+++ b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/JcrModelRepository.java
@@ -48,14 +48,14 @@
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.io.IOUtils;
import org.apache.log4j.Logger;
+import org.eclipse.vorto.http.model.ModelId;
+import org.eclipse.vorto.http.model.ModelResource;
+import org.eclipse.vorto.http.model.ModelType;
import org.eclipse.vorto.repository.internal.service.utils.ModelReferencesHelper;
import org.eclipse.vorto.repository.internal.service.utils.ModelSearchUtil;
import org.eclipse.vorto.repository.internal.service.validation.DuplicateModelValidation;
import org.eclipse.vorto.repository.internal.service.validation.ModelReferencesValidation;
import org.eclipse.vorto.repository.model.ModelEMFResource;
-import org.eclipse.vorto.repository.model.ModelId;
-import org.eclipse.vorto.repository.model.ModelResource;
-import org.eclipse.vorto.repository.model.ModelType;
import org.eclipse.vorto.repository.model.UploadModelResult;
import org.eclipse.vorto.repository.model.User;
import org.eclipse.vorto.repository.notification.INotificationService;
diff --git a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/ModelParserFactory.java b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/ModelParserFactory.java
index 6c320a6826..6b4f0cddb6 100644
--- a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/ModelParserFactory.java
+++ b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/ModelParserFactory.java
@@ -14,17 +14,17 @@
*/
package org.eclipse.vorto.repository.internal.service;
+import org.eclipse.vorto.http.model.ModelType;
import org.eclipse.vorto.repository.internal.service.emf.DatatypeModelParser;
import org.eclipse.vorto.repository.internal.service.emf.FunctionblockModelParser;
import org.eclipse.vorto.repository.internal.service.emf.InformationModelParser;
import org.eclipse.vorto.repository.internal.service.emf.MappingModelParser;
-import org.eclipse.vorto.repository.model.ModelType;
/**
* @author Alexander Edelmann - Robert Bosch (SEA) Pte. Ltd.
*/
public class ModelParserFactory {
-
+
public static IModelParser getParser(String fileName) {
if (fileName.endsWith(ModelType.Datatype.getExtension())) {
return new DatatypeModelParser(fileName);
@@ -34,7 +34,7 @@ public static IModelParser getParser(String fileName) {
return new InformationModelParser(fileName);
} else if (fileName.endsWith(ModelType.Mapping.getExtension())) {
return new MappingModelParser(fileName);
- }else {
+ } else {
throw new UnsupportedOperationException("File cannot be parsed, because it is not supported");
}
}
diff --git a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/emf/AbstractModelParser.java b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/emf/AbstractModelParser.java
index 52a9d3cff4..6b9b296a7e 100644
--- a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/emf/AbstractModelParser.java
+++ b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/emf/AbstractModelParser.java
@@ -23,11 +23,11 @@
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.vorto.core.api.model.model.Model;
+import org.eclipse.vorto.http.model.ModelId;
+import org.eclipse.vorto.http.model.ModelResource;
+import org.eclipse.vorto.http.model.ModelType;
import org.eclipse.vorto.repository.internal.service.IModelParser;
import org.eclipse.vorto.repository.model.ModelEMFResource;
-import org.eclipse.vorto.repository.model.ModelId;
-import org.eclipse.vorto.repository.model.ModelResource;
-import org.eclipse.vorto.repository.model.ModelType;
import org.eclipse.vorto.repository.validation.ValidationException;
import org.eclipse.xtext.linking.impl.XtextLinkingDiagnostic;
import org.eclipse.xtext.resource.XtextResource;
diff --git a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/generation/GenerationDelegateProxyService.java b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/generation/GenerationDelegateProxyService.java
index 781111799c..7103439468 100644
--- a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/generation/GenerationDelegateProxyService.java
+++ b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/generation/GenerationDelegateProxyService.java
@@ -23,12 +23,12 @@
import java.util.Map;
import java.util.Set;
+import org.eclipse.vorto.http.model.ModelId;
+import org.eclipse.vorto.http.model.ModelResource;
+import org.eclipse.vorto.http.model.ModelType;
import org.eclipse.vorto.repository.model.GeneratedOutput;
import org.eclipse.vorto.repository.model.Generator;
import org.eclipse.vorto.repository.model.GeneratorServiceInfo;
-import org.eclipse.vorto.repository.model.ModelId;
-import org.eclipse.vorto.repository.model.ModelResource;
-import org.eclipse.vorto.repository.model.ModelType;
import org.eclipse.vorto.repository.model.ServiceClassifier;
import org.eclipse.vorto.repository.service.GenerationException;
import org.eclipse.vorto.repository.service.GeneratorAlreadyExistsException;
@@ -198,4 +198,4 @@ public int compare(Generator o1, Generator o2) {
return result;
}
-}
+}
\ No newline at end of file
diff --git a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/sequencer/ModelSequencer.java b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/sequencer/ModelSequencer.java
index 9fdf1c47a2..28ad1fe217 100644
--- a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/sequencer/ModelSequencer.java
+++ b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/sequencer/ModelSequencer.java
@@ -25,10 +25,10 @@
import javax.jcr.RepositoryException;
import javax.jcr.Value;
+import org.eclipse.vorto.http.model.ModelId;
+import org.eclipse.vorto.http.model.ModelResource;
import org.eclipse.vorto.repository.internal.service.ModelParserFactory;
import org.eclipse.vorto.repository.internal.service.utils.ModelReferencesHelper;
-import org.eclipse.vorto.repository.model.ModelId;
-import org.eclipse.vorto.repository.model.ModelResource;
import org.modeshape.common.util.CheckArg;
import org.modeshape.jcr.api.nodetype.NodeTypeManager;
import org.modeshape.jcr.api.sequencer.Sequencer;
diff --git a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/utils/BulkUploadHelper.java b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/utils/BulkUploadHelper.java
index 3444d126a6..f98ecad568 100644
--- a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/utils/BulkUploadHelper.java
+++ b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/utils/BulkUploadHelper.java
@@ -25,11 +25,11 @@
import java.util.zip.ZipFile;
import org.apache.commons.io.IOUtils;
+import org.eclipse.vorto.http.model.ModelResource;
import org.eclipse.vorto.repository.internal.service.ModelParserFactory;
import org.eclipse.vorto.repository.internal.service.validation.BulkModelDuplicateIdValidation;
import org.eclipse.vorto.repository.internal.service.validation.BulkModelReferencesValidation;
import org.eclipse.vorto.repository.internal.service.validation.DuplicateModelValidation;
-import org.eclipse.vorto.repository.model.ModelResource;
import org.eclipse.vorto.repository.model.UploadModelResult;
import org.eclipse.vorto.repository.service.FatalModelRepositoryException;
import org.eclipse.vorto.repository.service.IModelRepository;
diff --git a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/utils/ModelReferencesHelper.java b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/utils/ModelReferencesHelper.java
index ae9e6fbede..afbd5ba33d 100644
--- a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/utils/ModelReferencesHelper.java
+++ b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/utils/ModelReferencesHelper.java
@@ -17,7 +17,7 @@
import java.util.ArrayList;
import java.util.List;
-import org.eclipse.vorto.repository.model.ModelId;
+import org.eclipse.vorto.http.model.ModelId;
/**
* @author Alexander Edelmann - Robert Bosch (SEA) Pte. Ltd.
diff --git a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/validation/BulkModelDuplicateIdValidation.java b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/validation/BulkModelDuplicateIdValidation.java
index 9aa31f948d..00740eabd4 100644
--- a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/validation/BulkModelDuplicateIdValidation.java
+++ b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/validation/BulkModelDuplicateIdValidation.java
@@ -19,8 +19,8 @@
import java.util.Set;
import java.util.stream.Collectors;
-import org.eclipse.vorto.repository.model.ModelId;
-import org.eclipse.vorto.repository.model.ModelResource;
+import org.eclipse.vorto.http.model.ModelId;
+import org.eclipse.vorto.http.model.ModelResource;
import org.eclipse.vorto.repository.service.IModelRepository;
import org.eclipse.vorto.repository.validation.ValidationException;
diff --git a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/validation/BulkModelReferencesValidation.java b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/validation/BulkModelReferencesValidation.java
index 65aadb8965..7d3617a1f7 100644
--- a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/validation/BulkModelReferencesValidation.java
+++ b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/validation/BulkModelReferencesValidation.java
@@ -19,9 +19,9 @@
import java.util.Set;
import java.util.stream.Collectors;
+import org.eclipse.vorto.http.model.ModelId;
+import org.eclipse.vorto.http.model.ModelResource;
import org.eclipse.vorto.repository.internal.service.validation.exception.CouldNotResolveReferenceException;
-import org.eclipse.vorto.repository.model.ModelId;
-import org.eclipse.vorto.repository.model.ModelResource;
import org.eclipse.vorto.repository.service.IModelRepository;
import org.eclipse.vorto.repository.validation.ValidationException;
diff --git a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/validation/DuplicateModelValidation.java b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/validation/DuplicateModelValidation.java
index 3261b9d68b..e4ec1d9475 100644
--- a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/validation/DuplicateModelValidation.java
+++ b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/validation/DuplicateModelValidation.java
@@ -14,7 +14,7 @@
*/
package org.eclipse.vorto.repository.internal.service.validation;
-import org.eclipse.vorto.repository.model.ModelResource;
+import org.eclipse.vorto.http.model.ModelResource;
import org.eclipse.vorto.repository.service.IModelRepository;
import org.eclipse.vorto.repository.validation.IModelValidator;
import org.eclipse.vorto.repository.validation.ValidationException;
diff --git a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/validation/ModelReferencesValidation.java b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/validation/ModelReferencesValidation.java
index b143d6e783..0ddee5a801 100644
--- a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/validation/ModelReferencesValidation.java
+++ b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/validation/ModelReferencesValidation.java
@@ -17,9 +17,9 @@
import java.util.ArrayList;
import java.util.List;
+import org.eclipse.vorto.http.model.ModelId;
+import org.eclipse.vorto.http.model.ModelResource;
import org.eclipse.vorto.repository.internal.service.validation.exception.CouldNotResolveReferenceException;
-import org.eclipse.vorto.repository.model.ModelId;
-import org.eclipse.vorto.repository.model.ModelResource;
import org.eclipse.vorto.repository.service.IModelRepository;
import org.eclipse.vorto.repository.validation.IModelValidator;
import org.eclipse.vorto.repository.validation.ValidationException;
diff --git a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/validation/exception/CouldNotResolveReferenceException.java b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/validation/exception/CouldNotResolveReferenceException.java
index 159a18d3bb..ae00d05fe4 100644
--- a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/validation/exception/CouldNotResolveReferenceException.java
+++ b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/validation/exception/CouldNotResolveReferenceException.java
@@ -17,8 +17,8 @@
import java.util.List;
import java.util.Objects;
-import org.eclipse.vorto.repository.model.ModelId;
-import org.eclipse.vorto.repository.model.ModelResource;
+import org.eclipse.vorto.http.model.ModelId;
+import org.eclipse.vorto.http.model.ModelResource;
import org.eclipse.vorto.repository.validation.ValidationException;
public class CouldNotResolveReferenceException extends ValidationException {
diff --git a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/model/Comment.java b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/model/Comment.java
index 057005ff90..03de780bde 100644
--- a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/model/Comment.java
+++ b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/model/Comment.java
@@ -24,6 +24,8 @@
import javax.persistence.Id;
import javax.validation.constraints.NotNull;
+import org.eclipse.vorto.http.model.ModelId;
+
/**
* @author Alexander Edelmann - Robert Bosch (SEA) Pte. Ltd.
*/
diff --git a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/model/ModelEMFResource.java b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/model/ModelEMFResource.java
index cce9fc1ff0..21a025f87b 100644
--- a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/model/ModelEMFResource.java
+++ b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/model/ModelEMFResource.java
@@ -26,6 +26,9 @@
import org.eclipse.vorto.core.api.model.mapping.MappingModel;
import org.eclipse.vorto.core.api.model.model.Model;
import org.eclipse.vorto.core.api.model.model.ModelReference;
+import org.eclipse.vorto.http.model.ModelId;
+import org.eclipse.vorto.http.model.ModelResource;
+import org.eclipse.vorto.http.model.ModelType;
/**
* @author Alexander Edelmann - Robert Bosch (SEA) Pte. Ltd.
diff --git a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/model/ModelHandle.java b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/model/ModelHandle.java
index 429f8e850a..d59fa1b1ed 100644
--- a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/model/ModelHandle.java
+++ b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/model/ModelHandle.java
@@ -14,7 +14,7 @@
*/
package org.eclipse.vorto.repository.model;
-import org.eclipse.vorto.repository.model.ModelId;
+import org.eclipse.vorto.http.model.ModelId;
/**
* Model class to hold file handle id and associated model details.
diff --git a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/model/ModelUploadHandle.java b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/model/ModelUploadHandle.java
index f9a113e364..21fe98d444 100644
--- a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/model/ModelUploadHandle.java
+++ b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/model/ModelUploadHandle.java
@@ -14,6 +14,9 @@
*/
package org.eclipse.vorto.repository.model;
+import org.eclipse.vorto.http.model.ModelId;
+import org.eclipse.vorto.http.model.ModelType;
+
/**
* @author Alexander Edelmann - Robert Bosch (SEA) Pte. Ltd.
*/
diff --git a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/model/UploadModelResult.java b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/model/UploadModelResult.java
index f4e1d5a992..df6f2a711c 100644
--- a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/model/UploadModelResult.java
+++ b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/model/UploadModelResult.java
@@ -19,6 +19,8 @@
import java.util.List;
import java.util.Objects;
+import org.eclipse.vorto.http.model.ModelId;
+import org.eclipse.vorto.http.model.ModelResource;
import org.eclipse.vorto.repository.internal.service.validation.exception.CouldNotResolveReferenceException;
import org.eclipse.vorto.repository.validation.ValidationException;
diff --git a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/model/ZipData.java b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/model/ZipData.java
index a1177a4052..d8eaf216df 100644
--- a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/model/ZipData.java
+++ b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/model/ZipData.java
@@ -14,6 +14,9 @@
*/
package org.eclipse.vorto.repository.model;
+import org.eclipse.vorto.http.model.ModelId;
+import org.eclipse.vorto.http.model.ModelType;
+
import com.google.common.base.Objects;
/**
diff --git a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/notification/message/CheckinMessage.java b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/notification/message/CheckinMessage.java
index d2c6fb049a..95c45c7177 100644
--- a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/notification/message/CheckinMessage.java
+++ b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/notification/message/CheckinMessage.java
@@ -14,12 +14,12 @@
*/
package org.eclipse.vorto.repository.notification.message;
-import org.eclipse.vorto.repository.model.ModelResource;
-import org.eclipse.vorto.repository.model.User;
-
import java.util.HashMap;
import java.util.Map;
+import org.eclipse.vorto.http.model.ModelResource;
+import org.eclipse.vorto.repository.model.User;
+
public class CheckinMessage extends AbstractMessage {
private ModelResource modelResource;
diff --git a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/service/CommentService.java b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/service/CommentService.java
index 8fec3ec8bc..8f60938dfb 100644
--- a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/service/CommentService.java
+++ b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/service/CommentService.java
@@ -19,9 +19,9 @@
import javax.jcr.PathNotFoundException;
+import org.eclipse.vorto.http.model.ModelId;
import org.eclipse.vorto.repository.internal.service.CommentRepository;
import org.eclipse.vorto.repository.model.Comment;
-import org.eclipse.vorto.repository.model.ModelId;
import org.eclipse.vorto.repository.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
diff --git a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/service/ICommentService.java b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/service/ICommentService.java
index 23f931f1a9..3fde180d63 100644
--- a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/service/ICommentService.java
+++ b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/service/ICommentService.java
@@ -16,8 +16,8 @@
import java.util.List;
+import org.eclipse.vorto.http.model.ModelId;
import org.eclipse.vorto.repository.model.Comment;
-import org.eclipse.vorto.repository.model.ModelId;
/**
* @author Alexander Edelmann - Robert Bosch (SEA) Pte. Ltd.
diff --git a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/service/IGeneratorService.java b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/service/IGeneratorService.java
index a9b574b84c..e6cd2379f5 100644
--- a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/service/IGeneratorService.java
+++ b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/service/IGeneratorService.java
@@ -18,9 +18,9 @@
import java.util.Map;
import java.util.Set;
+import org.eclipse.vorto.http.model.ModelId;
import org.eclipse.vorto.repository.model.GeneratedOutput;
import org.eclipse.vorto.repository.model.GeneratorServiceInfo;
-import org.eclipse.vorto.repository.model.ModelId;
import org.eclipse.vorto.repository.model.ServiceClassifier;
/**
diff --git a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/service/IModelRepository.java b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/service/IModelRepository.java
index 659b3ba010..0ce4fa81fa 100644
--- a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/service/IModelRepository.java
+++ b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/service/IModelRepository.java
@@ -16,8 +16,8 @@
import java.util.List;
-import org.eclipse.vorto.repository.model.ModelId;
-import org.eclipse.vorto.repository.model.ModelResource;
+import org.eclipse.vorto.http.model.ModelId;
+import org.eclipse.vorto.http.model.ModelResource;
import org.eclipse.vorto.repository.model.UploadModelResult;
/**
diff --git a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/service/ModelReferentialIntegrityException.java b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/service/ModelReferentialIntegrityException.java
index 9a1cebaea4..10cbe769e8 100644
--- a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/service/ModelReferentialIntegrityException.java
+++ b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/service/ModelReferentialIntegrityException.java
@@ -17,7 +17,7 @@
import java.util.ArrayList;
import java.util.List;
-import org.eclipse.vorto.repository.model.ModelId;
+import org.eclipse.vorto.http.model.ModelId;
/**
* @author Alexander Edelmann - Robert Bosch (SEA) Pte. Ltd.
diff --git a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/validation/IModelValidator.java b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/validation/IModelValidator.java
index f32cc36b2e..09fb6835d3 100644
--- a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/validation/IModelValidator.java
+++ b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/validation/IModelValidator.java
@@ -14,7 +14,7 @@
*/
package org.eclipse.vorto.repository.validation;
-import org.eclipse.vorto.repository.model.ModelResource;
+import org.eclipse.vorto.http.model.ModelResource;
/**
* @author Alexander Edelmann - Robert Bosch (SEA) Pte. Ltd.
diff --git a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/validation/ValidationException.java b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/validation/ValidationException.java
index 42bd685133..3cb9d9ebf7 100644
--- a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/validation/ValidationException.java
+++ b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/validation/ValidationException.java
@@ -14,7 +14,7 @@
*/
package org.eclipse.vorto.repository.validation;
-import org.eclipse.vorto.repository.model.ModelResource;
+import org.eclipse.vorto.http.model.ModelResource;
/**
* @author Alexander Edelmann - Robert Bosch (SEA) Pte. Ltd.
diff --git a/server/repo/repo-core/src/test/java/org/eclipse/vorto/repository/service/ModelRepositoryTest.java b/server/repo/repo-core/src/test/java/org/eclipse/vorto/repository/service/ModelRepositoryTest.java
index c99b719921..04d8c08b1d 100644
--- a/server/repo/repo-core/src/test/java/org/eclipse/vorto/repository/service/ModelRepositoryTest.java
+++ b/server/repo/repo-core/src/test/java/org/eclipse/vorto/repository/service/ModelRepositoryTest.java
@@ -19,8 +19,8 @@
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
-import static org.mockito.Mockito.when;
import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
import java.io.FileNotFoundException;
import java.io.IOException;
@@ -29,11 +29,11 @@
import java.util.Collections;
import org.apache.commons.io.IOUtils;
+import org.eclipse.vorto.http.model.ModelId;
+import org.eclipse.vorto.http.model.ModelResource;
+import org.eclipse.vorto.http.model.ModelType;
import org.eclipse.vorto.repository.internal.service.JcrModelRepository;
import org.eclipse.vorto.repository.internal.service.utils.ModelSearchUtil;
-import org.eclipse.vorto.repository.model.ModelId;
-import org.eclipse.vorto.repository.model.ModelResource;
-import org.eclipse.vorto.repository.model.ModelType;
import org.eclipse.vorto.repository.model.UploadModelResult;
import org.eclipse.vorto.repository.model.User;
import org.eclipse.vorto.repository.notification.INotificationService;
diff --git a/server/repo/repo-core/src/test/java/org/eclipse/vorto/repository/service/NotificationServiceTest.java b/server/repo/repo-core/src/test/java/org/eclipse/vorto/repository/service/NotificationServiceTest.java
index c98dbb0f36..02c69f72c9 100644
--- a/server/repo/repo-core/src/test/java/org/eclipse/vorto/repository/service/NotificationServiceTest.java
+++ b/server/repo/repo-core/src/test/java/org/eclipse/vorto/repository/service/NotificationServiceTest.java
@@ -19,9 +19,9 @@
import java.util.Date;
-import org.eclipse.vorto.repository.model.ModelId;
-import org.eclipse.vorto.repository.model.ModelResource;
-import org.eclipse.vorto.repository.model.ModelType;
+import org.eclipse.vorto.http.model.ModelId;
+import org.eclipse.vorto.http.model.ModelResource;
+import org.eclipse.vorto.http.model.ModelType;
import org.eclipse.vorto.repository.model.User;
import org.eclipse.vorto.repository.notification.EmailNotificationService;
import org.eclipse.vorto.repository.notification.message.CheckinMessage;
diff --git a/server/repo/repo-http-models/pom.xml b/server/repo/repo-http-models/pom.xml
new file mode 100644
index 0000000000..a17f5b3954
--- /dev/null
+++ b/server/repo/repo-http-models/pom.xml
@@ -0,0 +1,19 @@
+
+ 4.0.0
+
+ org.eclipse.vorto
+ repo
+ 0.9.0-SNAPSHOT
+
+ repo-http-models
+ jar
+
+
+
+ com.google.guava
+ guava
+ 18.0
+
+
+
diff --git a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/model/ModelId.java b/server/repo/repo-http-models/src/main/java/org/eclipse/vorto/http/model/ModelId.java
similarity index 99%
rename from server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/model/ModelId.java
rename to server/repo/repo-http-models/src/main/java/org/eclipse/vorto/http/model/ModelId.java
index ce235965f4..541b297c5d 100644
--- a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/model/ModelId.java
+++ b/server/repo/repo-http-models/src/main/java/org/eclipse/vorto/http/model/ModelId.java
@@ -12,8 +12,7 @@
* Contributors:
* Bosch Software Innovations GmbH - Please refer to git log
*/
-package org.eclipse.vorto.repository.model;
-
+package org.eclipse.vorto.http.model;
import java.util.Iterator;
import java.util.StringTokenizer;
@@ -174,4 +173,4 @@ public boolean equals(Object obj) {
public String getPrettyFormat() {
return namespace + "." + name + ":" +version;
}
-}
+}
\ No newline at end of file
diff --git a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/model/ModelResource.java b/server/repo/repo-http-models/src/main/java/org/eclipse/vorto/http/model/ModelResource.java
similarity index 98%
rename from server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/model/ModelResource.java
rename to server/repo/repo-http-models/src/main/java/org/eclipse/vorto/http/model/ModelResource.java
index abe3ae8fbb..3b45fea982 100644
--- a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/model/ModelResource.java
+++ b/server/repo/repo-http-models/src/main/java/org/eclipse/vorto/http/model/ModelResource.java
@@ -12,7 +12,7 @@
* Contributors:
* Bosch Software Innovations GmbH - Please refer to git log
*/
-package org.eclipse.vorto.repository.model;
+package org.eclipse.vorto.http.model;
import java.util.ArrayList;
import java.util.Date;
@@ -164,4 +164,4 @@ public void addTargetPlatform(String targetPlatform) {
}
}
-}
+}
\ No newline at end of file
diff --git a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/model/ModelType.java b/server/repo/repo-http-models/src/main/java/org/eclipse/vorto/http/model/ModelType.java
similarity index 97%
rename from server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/model/ModelType.java
rename to server/repo/repo-http-models/src/main/java/org/eclipse/vorto/http/model/ModelType.java
index ff36092911..eb606e1a24 100644
--- a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/model/ModelType.java
+++ b/server/repo/repo-http-models/src/main/java/org/eclipse/vorto/http/model/ModelType.java
@@ -12,7 +12,7 @@
* Contributors:
* Bosch Software Innovations GmbH - Please refer to git log
*/
-package org.eclipse.vorto.repository.model;
+package org.eclipse.vorto.http.model;
/**
* @author Alexander Edelmann - Robert Bosch (SEA) Pte. Ltd.
@@ -47,4 +47,4 @@ public static ModelType fromFileName(String fileName) {
throw new IllegalArgumentException(fileName);
}
}
-}
+}
\ No newline at end of file
diff --git a/server/repo/repo-ui/pom.xml b/server/repo/repo-ui/pom.xml
index 5e7850ef5c..4b43d922e0 100644
--- a/server/repo/repo-ui/pom.xml
+++ b/server/repo/repo-ui/pom.xml
@@ -19,6 +19,11 @@
repo-core
${project.version}
+
+ org.eclipse.vorto
+ repo-http-models
+ ${project.version}
+
diff --git a/server/repo/repo-ui/src/main/java/org/eclipse/vorto/repository/web/ModelGenerationController.java b/server/repo/repo-ui/src/main/java/org/eclipse/vorto/repository/web/ModelGenerationController.java
index b54984e5be..199a12dcec 100644
--- a/server/repo/repo-ui/src/main/java/org/eclipse/vorto/repository/web/ModelGenerationController.java
+++ b/server/repo/repo-ui/src/main/java/org/eclipse/vorto/repository/web/ModelGenerationController.java
@@ -29,9 +29,9 @@
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.io.IOUtils;
+import org.eclipse.vorto.http.model.ModelId;
import org.eclipse.vorto.repository.model.GeneratedOutput;
import org.eclipse.vorto.repository.model.GeneratorServiceInfo;
-import org.eclipse.vorto.repository.model.ModelId;
import org.eclipse.vorto.repository.model.ServiceClassifier;
import org.eclipse.vorto.repository.service.IGeneratorService;
import org.slf4j.Logger;
diff --git a/server/repo/repo-ui/src/main/java/org/eclipse/vorto/repository/web/ModelRepositoryController.java b/server/repo/repo-ui/src/main/java/org/eclipse/vorto/repository/web/ModelRepositoryController.java
index cc9c19ddcd..8c3d7c202b 100644
--- a/server/repo/repo-ui/src/main/java/org/eclipse/vorto/repository/web/ModelRepositoryController.java
+++ b/server/repo/repo-ui/src/main/java/org/eclipse/vorto/repository/web/ModelRepositoryController.java
@@ -26,8 +26,8 @@
import org.apache.commons.io.IOUtils;
import org.apache.log4j.Logger;
-import org.eclipse.vorto.repository.model.ModelId;
-import org.eclipse.vorto.repository.model.ModelResource;
+import org.eclipse.vorto.http.model.ModelId;
+import org.eclipse.vorto.http.model.ModelResource;
import org.eclipse.vorto.repository.service.IModelRepository;
import org.eclipse.vorto.repository.service.ModelNotFoundException;
import org.eclipse.vorto.repository.service.IModelRepository.ContentType;
diff --git a/server/repo/repo-ui/src/main/java/org/eclipse/vorto/repository/web/comment/CommentController.java b/server/repo/repo-ui/src/main/java/org/eclipse/vorto/repository/web/comment/CommentController.java
index b248af0c8f..a8c0ce7068 100644
--- a/server/repo/repo-ui/src/main/java/org/eclipse/vorto/repository/web/comment/CommentController.java
+++ b/server/repo/repo-ui/src/main/java/org/eclipse/vorto/repository/web/comment/CommentController.java
@@ -18,8 +18,8 @@
import javax.validation.Valid;
+import org.eclipse.vorto.http.model.ModelId;
import org.eclipse.vorto.repository.model.Comment;
-import org.eclipse.vorto.repository.model.ModelId;
import org.eclipse.vorto.repository.service.ICommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
@@ -35,8 +35,8 @@
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
-import io.swagger.annotations.ApiResponses;
import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
/**
* @author Alexander Edelmann - Robert Bosch (SEA) Pte. Ltd.