-
-
-
+
+
+ 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/model/ModelEMFResource.java b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/model/ModelEMFResource.java
index 13eacfd287..1cce2f70a3 100644
--- a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/model/ModelEMFResource.java
+++ b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/model/ModelEMFResource.java
@@ -26,9 +26,10 @@
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.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;
+
/**
* @author Alexander Edelmann - Robert Bosch (SEA) Pte. Ltd.
diff --git a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/resolver/Lwm2mObjectIdResolver.java b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/resolver/Lwm2mObjectIdResolver.java
index a6ca2236db..441fb76533 100644
--- a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/resolver/Lwm2mObjectIdResolver.java
+++ b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/resolver/Lwm2mObjectIdResolver.java
@@ -22,10 +22,10 @@
import org.eclipse.vorto.core.api.model.mapping.MappingModel;
import org.eclipse.vorto.core.api.model.mapping.MappingRule;
import org.eclipse.vorto.core.api.model.mapping.StereoTypeTarget;
+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.IModelContent;
-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.resolver.IModelIdResolver;
import org.eclipse.vorto.repository.service.IModelRepository;
import org.eclipse.vorto.repository.service.IModelRepository.ContentType;
diff --git a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/DefaultRepositoryManager.java b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/DefaultRepositoryManager.java
index 16aab22389..3fd5e9660c 100644
--- a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/DefaultRepositoryManager.java
+++ b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/DefaultRepositoryManager.java
@@ -25,8 +25,8 @@
import javax.jcr.RepositoryException;
import javax.jcr.Session;
-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.FatalModelRepositoryException;
import org.eclipse.vorto.repository.service.IModelRepository;
import org.eclipse.vorto.repository.service.IRepositoryManager;
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 6cc204ced8..5a127d4e99 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
@@ -47,6 +47,9 @@
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.model.DefaultModelContent;
import org.eclipse.vorto.repository.internal.model.ModelEMFResource;
import org.eclipse.vorto.repository.internal.service.notification.INotificationService;
@@ -58,9 +61,6 @@
import org.eclipse.vorto.repository.internal.service.validation.ModelReferencesValidation;
import org.eclipse.vorto.repository.internal.service.validation.ValidationException;
import org.eclipse.vorto.repository.model.IModelContent;
-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.service.FatalModelRepositoryException;
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/comment/CommentService.java b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/comment/CommentService.java
index 6777604e6e..e938b72951 100644
--- a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/comment/CommentService.java
+++ b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/comment/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.eclipse.vorto.repository.service.ICommentService;
import org.eclipse.vorto.repository.service.IModelRepository;
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 48fe5209d4..e0a169d545 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,12 +23,12 @@
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.model.ModelEMFResource;
import org.eclipse.vorto.repository.internal.service.IModelParser;
import org.eclipse.vorto.repository.internal.service.validation.ValidationException;
-import org.eclipse.vorto.repository.model.ModelId;
-import org.eclipse.vorto.repository.model.ModelResource;
-import org.eclipse.vorto.repository.model.ModelType;
import org.eclipse.xtext.linking.impl.XtextLinkingDiagnostic;
import org.eclipse.xtext.resource.XtextResource;
import org.eclipse.xtext.resource.XtextResourceSet;
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/notification/message/CheckinMessage.java b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/notification/message/CheckinMessage.java
index bc251dae57..0c8b676ba1 100644
--- a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/notification/message/CheckinMessage.java
+++ b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/notification/message/CheckinMessage.java
@@ -14,12 +14,12 @@
*/
package org.eclipse.vorto.repository.internal.service.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/internal/service/sequencer/ModelSequencer.java b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/sequencer/ModelSequencer.java
index b4effc2dcc..c7593fe5ac 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 a12d3606fb..5b5951076c 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
@@ -32,6 +32,7 @@
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.io.IOUtils;
+import org.eclipse.vorto.http.model.ModelResource;
import org.eclipse.vorto.repository.internal.model.ModelEMFResource;
import org.eclipse.vorto.repository.internal.service.ModelParserFactory;
import org.eclipse.vorto.repository.internal.service.validation.BulkModelDuplicateIdValidation;
@@ -40,7 +41,6 @@
import org.eclipse.vorto.repository.internal.service.validation.IModelValidator;
import org.eclipse.vorto.repository.internal.service.validation.ValidationException;
import org.eclipse.vorto.repository.model.ModelHandle;
-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/DependencyManager.java b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/utils/DependencyManager.java
index 2adf5f899a..8043845e33 100644
--- a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/utils/DependencyManager.java
+++ b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/utils/DependencyManager.java
@@ -19,8 +19,10 @@
import java.util.List;
import java.util.Set;
-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;
+
+
public class DependencyManager {
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 60cc95007e..a91db2e169 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;
public class BulkModelDuplicateIdValidation extends ModelReferencesValidation {
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 9abf957fff..8425f7542d 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;
/**
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 820534558f..2465d5ab05 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;
/**
diff --git a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/validation/IModelValidator.java b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/validation/IModelValidator.java
index 467cebd49a..4c6580baf8 100644
--- a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/validation/IModelValidator.java
+++ b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/validation/IModelValidator.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;
/**
* @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/ModelReferencesValidation.java b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/validation/ModelReferencesValidation.java
index e21464247c..602e1b88cd 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;
/**
diff --git a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/validation/ValidationException.java b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/validation/ValidationException.java
index 0e861cc710..eb1f09b9ca 100644
--- a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/validation/ValidationException.java
+++ b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/validation/ValidationException.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;
/**
* @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/exception/CouldNotResolveReferenceException.java b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/internal/service/validation/exception/CouldNotResolveReferenceException.java
index e882ed9a6a..2040e5e40c 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,9 +17,10 @@
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.ValidationException;
-import org.eclipse.vorto.repository.model.ModelId;
-import org.eclipse.vorto.repository.model.ModelResource;
+
public class CouldNotResolveReferenceException extends ValidationException {
private static final long serialVersionUID = -6078848052990402848L;
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/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 fe077b4ec3..f26506bf20 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.ValidationException;
import org.eclipse.vorto.repository.internal.service.validation.exception.CouldNotResolveReferenceException;
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
new file mode 100644
index 0000000000..d8eaf216df
--- /dev/null
+++ b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/model/ZipData.java
@@ -0,0 +1,70 @@
+/**
+ * Copyright (c) 2015-2016 Bosch Software Innovations GmbH and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution.
+ *
+ * The Eclipse Public License is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * The Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Bosch Software Innovations GmbH - Please refer to git log
+ */
+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;
+
+/**
+ * Class to hold model related data for upload and extraction tasks.
+ * @author Nagavijay Sivakumar - Robert Bosch (SEA) Pte. Ltd.
+ *
+ */
+public class ZipData {
+
+ private ModelId modelId;
+ private String fileName;
+ private ModelType modelType;
+
+ public ZipData(String fileName, ModelType modelType) {
+ this.fileName = fileName;
+ this.modelType = modelType;
+ }
+ public String getFileName() {
+ return fileName;
+ }
+ public void setFileName(String fileName) {
+ this.fileName = fileName;
+ }
+ public ModelType getModelType() {
+ return modelType;
+ }
+ public void setModelType(ModelType modelType) {
+ this.modelType = modelType;
+ }
+ public ModelId getModelId() {
+ return modelId;
+ }
+ public void setModelId(ModelId modelId) {
+ this.modelId = modelId;
+ }
+
+ public boolean equals(Object obj) {
+ if (obj == null) {
+ return false;
+ }
+ if (obj == this) {
+ return true;
+ }
+ if (this.getClass() != obj.getClass()) {
+ return false;
+ }
+ ZipData other = (ZipData) obj;
+ return Objects.equal(this.getModelType(), other.getModelType())
+ && Objects.equal(this.getFileName(), other.getFileName());
+ }
+}
diff --git a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/resolver/IModelIdResolver.java b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/resolver/IModelIdResolver.java
index 45c3591a1c..e8595d0efd 100644
--- a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/resolver/IModelIdResolver.java
+++ b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/resolver/IModelIdResolver.java
@@ -14,7 +14,7 @@
*/
package org.eclipse.vorto.repository.resolver;
-import org.eclipse.vorto.repository.model.ModelId;
+import org.eclipse.vorto.http.model.ModelId;
public interface IModelIdResolver {
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 b3156d3a48..0cf58b6a37 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,9 +16,9 @@
import java.util.List;
+import org.eclipse.vorto.http.model.ModelId;
+import org.eclipse.vorto.http.model.ModelResource;
import org.eclipse.vorto.repository.model.IModelContent;
-import org.eclipse.vorto.repository.model.ModelId;
-import org.eclipse.vorto.repository.model.ModelResource;
import org.eclipse.vorto.repository.model.UploadModelResult;
/**
diff --git a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/service/IRepositoryManager.java b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/service/IRepositoryManager.java
index ae7e372f1c..72f6b67003 100644
--- a/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/service/IRepositoryManager.java
+++ b/server/repo/repo-core/src/main/java/org/eclipse/vorto/repository/service/IRepositoryManager.java
@@ -14,7 +14,9 @@
*/
package org.eclipse.vorto.repository.service;
-import org.eclipse.vorto.repository.model.ModelId;
+
+import org.eclipse.vorto.http.model.ModelId;
+
public interface IRepositoryManager {
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 a13fa93413..07c11358d6 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/test/java/org/eclipse/vorto/repository/resolver/Lwm2mObjectIdResolverTest.java b/server/repo/repo-core/src/test/java/org/eclipse/vorto/repository/resolver/Lwm2mObjectIdResolverTest.java
index 224dd4b338..4bdce5e9bf 100644
--- a/server/repo/repo-core/src/test/java/org/eclipse/vorto/repository/resolver/Lwm2mObjectIdResolverTest.java
+++ b/server/repo/repo-core/src/test/java/org/eclipse/vorto/repository/resolver/Lwm2mObjectIdResolverTest.java
@@ -18,8 +18,8 @@
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
+import org.eclipse.vorto.http.model.ModelId;
import org.eclipse.vorto.repository.internal.resolver.Lwm2mObjectIdResolver;
-import org.eclipse.vorto.repository.model.ModelId;
import org.eclipse.vorto.repository.service.AbstractIntegrationTest;
import org.junit.Test;
diff --git a/server/repo/repo-core/src/test/java/org/eclipse/vorto/repository/service/DependencyManagerTest.java b/server/repo/repo-core/src/test/java/org/eclipse/vorto/repository/service/DependencyManagerTest.java
index dc7098013b..aff2ef86ff 100644
--- a/server/repo/repo-core/src/test/java/org/eclipse/vorto/repository/service/DependencyManagerTest.java
+++ b/server/repo/repo-core/src/test/java/org/eclipse/vorto/repository/service/DependencyManagerTest.java
@@ -5,10 +5,10 @@
import java.util.Arrays;
import java.util.stream.Collectors;
+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.DependencyManager;
-import org.eclipse.vorto.repository.model.ModelId;
-import org.eclipse.vorto.repository.model.ModelResource;
-import org.eclipse.vorto.repository.model.ModelType;
import org.junit.Before;
import org.junit.Test;
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 516d25b76e..1d77d4cb0b 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
@@ -27,9 +27,9 @@
import java.util.Collection;
import org.apache.commons.io.IOUtils;
-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.UploadModelResult;
import org.eclipse.vorto.repository.model.User;
import org.eclipse.vorto.repository.service.IModelRepository.ContentType;
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 e2fac48fac..9dec64bfdd 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,12 +19,12 @@
import java.util.Date;
+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.notification.EmailNotificationService;
import org.eclipse.vorto.repository.internal.service.notification.message.CheckinMessage;
import org.eclipse.vorto.repository.internal.service.notification.message.RegistrationMessage;
-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.User;
import org.junit.AfterClass;
import org.junit.Before;
diff --git a/server/repo/repo-core/src/test/java/org/eclipse/vorto/repository/service/RepositoryAdminTest.java b/server/repo/repo-core/src/test/java/org/eclipse/vorto/repository/service/RepositoryAdminTest.java
index e9a32824ec..376976c907 100644
--- a/server/repo/repo-core/src/test/java/org/eclipse/vorto/repository/service/RepositoryAdminTest.java
+++ b/server/repo/repo-core/src/test/java/org/eclipse/vorto/repository/service/RepositoryAdminTest.java
@@ -6,8 +6,9 @@
import static org.junit.Assert.fail;
import org.apache.commons.io.IOUtils;
+import org.eclipse.vorto.http.model.ModelId;
import org.eclipse.vorto.repository.internal.service.DefaultRepositoryManager;
-import org.eclipse.vorto.repository.model.ModelId;
+
import org.junit.Test;
import org.springframework.core.io.ClassPathResource;
diff --git a/server/repo/repo-http-models/pom.xml b/server/repo/repo-http-models/pom.xml
new file mode 100644
index 0000000000..d14d57fe10
--- /dev/null
+++ b/server/repo/repo-http-models/pom.xml
@@ -0,0 +1,34 @@
+
+ 4.0.0
+
+ org.eclipse.vorto
+ repo
+ 0.9.0-SNAPSHOT
+
+ repo-http-models
+ jar
+
+
+
+
+ org.eclipse.vorto
+ org.eclipse.vorto.core
+
+
+ org.eclipse.xtext
+ org.eclipse.xtext
+
+
+ com.google.guava
+ guava
+
+
+
+
+ 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 9d2c89987e..30846730ad 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;
@@ -184,4 +183,4 @@ public String getPrettyFormat() {
public String getFileName() {
return namespace.replace(".", "_")+"-"+name+"-"+version.replace(".", "_");
}
-}
+}
\ 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 1487f1e3e2..cfb0f49e6c 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;
@@ -168,5 +168,4 @@ public void addReferencedBy(ModelId id) {
this.referencedBy.add(id);
}
-
-}
+}
\ 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/AdminController.java b/server/repo/repo-ui/src/main/java/org/eclipse/vorto/repository/web/AdminController.java
index 417e50a7cb..a0f511cdac 100644
--- a/server/repo/repo-ui/src/main/java/org/eclipse/vorto/repository/web/AdminController.java
+++ b/server/repo/repo-ui/src/main/java/org/eclipse/vorto/repository/web/AdminController.java
@@ -23,7 +23,7 @@
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.io.IOUtils;
-import org.eclipse.vorto.repository.model.ModelId;
+import org.eclipse.vorto.http.model.ModelId;
import org.eclipse.vorto.repository.service.IRepositoryManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.annotation.Secured;
diff --git a/server/repo/repo-ui/src/main/java/org/eclipse/vorto/repository/web/ModelDetailsResolver.java b/server/repo/repo-ui/src/main/java/org/eclipse/vorto/repository/web/ModelDetailsResolver.java
index e6cb74a99a..d8c63543b1 100644
--- a/server/repo/repo-ui/src/main/java/org/eclipse/vorto/repository/web/ModelDetailsResolver.java
+++ b/server/repo/repo-ui/src/main/java/org/eclipse/vorto/repository/web/ModelDetailsResolver.java
@@ -14,9 +14,9 @@
*/
package org.eclipse.vorto.repository.web;
+import org.eclipse.vorto.http.model.ModelId;
import org.eclipse.vorto.repository.internal.resolver.ModelIdResolverFactory;
import org.eclipse.vorto.repository.internal.resolver.UnknownModelIdResolverException;
-import org.eclipse.vorto.repository.model.ModelId;
import org.eclipse.vorto.repository.resolver.IModelIdResolver;
import org.eclipse.vorto.repository.service.ModelNotFoundException;
import org.springframework.beans.factory.annotation.Autowired;
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 d7d375560a..a84038a406 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
@@ -27,9 +27,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 4bf67423e8..9a97fb44d3 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.IModelRepository.ContentType;
import org.eclipse.vorto.repository.service.ModelNotFoundException;
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.