diff --git a/resourcemanager/.classpath b/resourcemanager/.classpath new file mode 100644 index 0000000..e801ebf --- /dev/null +++ b/resourcemanager/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/resourcemanager/.gitignore b/resourcemanager/.gitignore new file mode 100644 index 0000000..ae3c172 --- /dev/null +++ b/resourcemanager/.gitignore @@ -0,0 +1 @@ +/bin/ diff --git a/resourcemanager/.project b/resourcemanager/.project new file mode 100644 index 0000000..54800d1 --- /dev/null +++ b/resourcemanager/.project @@ -0,0 +1,28 @@ + + + ccims-eclipse-plugin-resourcemanager + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/resourcemanager/.settings/org.eclipse.jdt.core.prefs b/resourcemanager/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..c9545f0 --- /dev/null +++ b/resourcemanager/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,9 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 +org.eclipse.jdt.core.compiler.compliance=11 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/resourcemanager/META-INF/MANIFEST.MF b/resourcemanager/META-INF/MANIFEST.MF new file mode 100644 index 0000000..8e44ada --- /dev/null +++ b/resourcemanager/META-INF/MANIFEST.MF @@ -0,0 +1,12 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Ccims-eclipse-plugin-resourcemanager +Bundle-SymbolicName: ccims-eclipse-plugin-resourcemanager +Bundle-Version: 1.0.0.qualifier +Automatic-Module-Name: ccims.eclipse.plugin.resourcemanager +Bundle-RequiredExecutionEnvironment: JavaSE-11 +Require-Bundle: ccims-eclipse-plugin-data;bundle-version="1.0.0", + com.google.gson;bundle-version="2.8.2", + ccims-eclipse-plugin-apiBindings;bundle-version="1.0.0" +Import-Package: org.osgi.framework +Export-Package: de.unistuttgart.iste.rss.ccims.eclipseplugin.resourcemanager diff --git a/resourcemanager/build.properties b/resourcemanager/build.properties new file mode 100644 index 0000000..34d2e4d --- /dev/null +++ b/resourcemanager/build.properties @@ -0,0 +1,4 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + . diff --git a/resourcemanager/src/de/unistuttgart/iste/rss/ccims/eclipseplugin/resourcemanager/CcimsResource.java b/resourcemanager/src/de/unistuttgart/iste/rss/ccims/eclipseplugin/resourcemanager/CcimsResource.java new file mode 100644 index 0000000..2f6f50e --- /dev/null +++ b/resourcemanager/src/de/unistuttgart/iste/rss/ccims/eclipseplugin/resourcemanager/CcimsResource.java @@ -0,0 +1,69 @@ +package de.unistuttgart.iste.rss.ccims.eclipseplugin.resourcemanager; + +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.net.URISyntaxException; +import java.util.Map; + +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.resource.impl.ResourceImpl; + +import de.unistuttgart.iste.rss.ccims.eclipseplugin.apibindings.Query; +import de.unistuttgart.iste.rss.ccims.eclipseplugin.datamodel.CrossComponentIssueManagementSystem; +import de.unistuttgart.iste.rss.ccims.eclipseplugin.resourcemanager.apiadapter.ApiQueryManager; + +public class CcimsResource extends ResourceImpl { + + private ApiQueryManager apiQueryManager; + private DataMapper dataMapper; + + public CcimsResource(URI uri) { + super(uri); + try { + java.net.URI apiUri = convertUri(uri); + apiQueryManager = new ApiQueryManager(apiUri); + dataMapper = new DataMapper(apiUri.toString()); + } catch (URISyntaxException | UnsupportedEncodingException e) { + throw new IllegalStateException("Could not generate api request uri", e); + } + } + + /** + * This implementation directly loads the EObjects from the API without + * deserialization. Therefore this does call neither + * {@link ResourceImpl#load(Map)} nor {@link #load(InputStream, Map)}. + *

+ * As all currently defined options only relate to the format of the file on + * disk, the options parameter is not used here. + * + * @param options Options for loading. Not used. + */ + @Override + public void load(Map options) throws IOException { + try { + Query apiQuery = apiQueryManager.query(); + CrossComponentIssueManagementSystem ccims = dataMapper.mapToEObject(apiQuery); + this.getContents().add(ccims); + } catch (IOException | InterruptedException e) { + throw new IOException("Failed to load data from api", e); + } + } + + @Override + public void save(Map options) throws IOException { + // TODO: implememnt + } + + /** + * Converts eclispe ecore uri with ccims schema to java.net uri with http schema. + * @param uri The eclipse ecore uri with a ccims based schema + * @return The java.net uri with a http based schema + * @throws URISyntaxException When the resulting uri is not legal + */ + private java.net.URI convertUri(URI uri) throws URISyntaxException{ + return new java.net.URI(uri.scheme().replace("ccims", "http"), uri.userInfo(), uri.host(), uri.port() == null ? -1 : Integer.parseInt(uri.port()), uri.path(), uri.query(), + uri.fragment()); + } + +} diff --git a/resourcemanager/src/de/unistuttgart/iste/rss/ccims/eclipseplugin/resourcemanager/CcimsResourceFactory.java b/resourcemanager/src/de/unistuttgart/iste/rss/ccims/eclipseplugin/resourcemanager/CcimsResourceFactory.java new file mode 100644 index 0000000..5786a14 --- /dev/null +++ b/resourcemanager/src/de/unistuttgart/iste/rss/ccims/eclipseplugin/resourcemanager/CcimsResourceFactory.java @@ -0,0 +1,14 @@ +package de.unistuttgart.iste.rss.ccims.eclipseplugin.resourcemanager; + +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl; + +public class CcimsResourceFactory implements Resource.Factory { + + @Override + public Resource createResource(URI uri) { + return new CcimsResource(uri); + } + +} diff --git a/resourcemanager/src/de/unistuttgart/iste/rss/ccims/eclipseplugin/resourcemanager/DataMapper.java b/resourcemanager/src/de/unistuttgart/iste/rss/ccims/eclipseplugin/resourcemanager/DataMapper.java new file mode 100644 index 0000000..c04df5a --- /dev/null +++ b/resourcemanager/src/de/unistuttgart/iste/rss/ccims/eclipseplugin/resourcemanager/DataMapper.java @@ -0,0 +1,163 @@ +package de.unistuttgart.iste.rss.ccims.eclipseplugin.resourcemanager; + +import java.util.HashMap; +import java.util.Map; + +import com.shopify.graphql.support.ID; + +import de.unistuttgart.iste.rss.ccims.eclipseplugin.apibindings.Component; +import de.unistuttgart.iste.rss.ccims.eclipseplugin.apibindings.ComponentInterface; +import de.unistuttgart.iste.rss.ccims.eclipseplugin.apibindings.Issue; +import de.unistuttgart.iste.rss.ccims.eclipseplugin.apibindings.Label; +import de.unistuttgart.iste.rss.ccims.eclipseplugin.apibindings.Project; +import de.unistuttgart.iste.rss.ccims.eclipseplugin.apibindings.Query; +import de.unistuttgart.iste.rss.ccims.eclipseplugin.apibindings.User; +import de.unistuttgart.iste.rss.ccims.eclipseplugin.datamodel.CcimsDatamodelFactory; +import de.unistuttgart.iste.rss.ccims.eclipseplugin.datamodel.CrossComponentIssue; +import de.unistuttgart.iste.rss.ccims.eclipseplugin.datamodel.CrossComponentIssueManagementSystem; +import de.unistuttgart.iste.rss.ccims.eclipseplugin.datamodel.Developer; +import de.unistuttgart.iste.rss.ccims.eclipseplugin.datamodel.Interface; + +public class DataMapper { + + private Map componentMap; + private Map interfaceMap; + private Map developerMap; + private Map labelMap; + private Map issueMap; + + private CcimsDatamodelFactory fac; + + private String apiLocationUri; + + public DataMapper(String apiLocationUri) { + this.apiLocationUri = apiLocationUri; + fac = CcimsDatamodelFactory.eINSTANCE; + componentMap = new HashMap<>(); + interfaceMap = new HashMap<>(); + developerMap = new HashMap<>(); + labelMap = new HashMap<>(); + issueMap = new HashMap<>(); + } + + public CrossComponentIssueManagementSystem mapToEObject(Query apiQuery) { + CrossComponentIssueManagementSystem result = fac.createCrossComponentIssueManagementSystem(); + result.setLocationUri(apiLocationUri); + + //components and provided interfaces + for (Project project: apiQuery.getProjects().getNodes()) { + for(Component component : project.getComponents().getNodes()) { + var ecoreComponent = getEcoreComponent(component); + result.getComponents().add(ecoreComponent); + + for(ComponentInterface compInterface : component.getInterfaces().getNodes()) { + var ecoreInterface = getEcoreInterface(compInterface); + ecoreComponent.getProvidedInterfaces().add(ecoreInterface); + } + } + } + + //consumed interfaces + for (Project project: apiQuery.getProjects().getNodes()) { + for (Component component : project.getComponents().getNodes()) { + for (ComponentInterface compInteface : component.getConsumedInterfaces().getNodes()) { + componentMap.get(component.getId()).getConsumedInterfaces().add(interfaceMap.get(compInteface.getId())); + } + } + } + + //developers + for (Project project: apiQuery.getProjects().getNodes()) { + for (User user: project.getUsers().getNodes()) { + result.getDevelopers().add(getEcoreDeveloper(user)); + } + } + + //issues + for (Project project: apiQuery.getProjects().getNodes()) { + for (Issue issue: project.getIssues().getNodes()) { + result.getManagedCroCoIssues().add(getEcoreIssue(issue)); + } + } + + //issue link + for (Project project: apiQuery.getProjects().getNodes()) { + for (Issue issue: project.getIssues().getNodes()) { + for(Issue linkedIssue : issue.getLinkedIssues().getNodes()) { + issueMap.get(issue.getId()).getLinkedIssues().add(issueMap.get(linkedIssue.getId())); + } + } + } + + return result; + } + + private de.unistuttgart.iste.rss.ccims.eclipseplugin.datamodel.Component getEcoreComponent(Component component) { + ID id = component.getId(); + if(componentMap.containsKey(id)) { + return componentMap.get(id); + } + + var result = fac.createComponent(); + result.setName(component.getName()); + componentMap.put(id, result); + return result; + } + + private Interface getEcoreInterface(ComponentInterface compInterface) { + ID id = compInterface.getId(); + if(interfaceMap.containsKey(id)) { + return interfaceMap.get(id); + } + + var result = fac.createInterface(); + result.setName(compInterface.getName()); + interfaceMap.put(id, result); + return result; + } + + private Developer getEcoreDeveloper(User user) { + ID id = user.getId(); + if(developerMap.containsKey(id)) { + return developerMap.get(id); + } + var result = fac.createDeveloper(); + result.setName(user.getUsername()); + developerMap.put(id, result); + return result; + } + + private CrossComponentIssue getEcoreIssue(Issue issue) { + ID id = issue.getId(); + if(issueMap.containsKey(id)) { + return issueMap.get(id); + } + var result = fac.createCrossComponentIssue(); + result.setTitle(issue.getTitle()); + result.setTextBody(issue.getBody()); + result.setIsOpen(issue.getIsOpen()); + + for(User user: issue.getAssignees().getNodes()) { + result.getAssignees().add(developerMap.get(user.getId())); + } + + for(Label label: issue.getLabels().getNodes()) { + result.getLabels().add(getEcoreLabel(label)); + } + + issueMap.put(id, result); + return result; + } + + private de.unistuttgart.iste.rss.ccims.eclipseplugin.datamodel.Label getEcoreLabel(Label label) { + ID id = label.getId(); + if(labelMap.containsKey(id)) { + return labelMap.get(id); + } + var result = fac.createLabel(); + result.setName(label.getName()); + + labelMap.put(id, result); + return result; + } +} diff --git a/resourcemanager/src/de/unistuttgart/iste/rss/ccims/eclipseplugin/resourcemanager/apiadapter/ApiQueries.java b/resourcemanager/src/de/unistuttgart/iste/rss/ccims/eclipseplugin/resourcemanager/apiadapter/ApiQueries.java new file mode 100644 index 0000000..d97cbff --- /dev/null +++ b/resourcemanager/src/de/unistuttgart/iste/rss/ccims/eclipseplugin/resourcemanager/apiadapter/ApiQueries.java @@ -0,0 +1,155 @@ +package de.unistuttgart.iste.rss.ccims.eclipseplugin.resourcemanager.apiadapter; + +import java.util.ArrayList; +import java.util.Arrays; + +import de.unistuttgart.iste.rss.ccims.eclipseplugin.apibindings.ComponentInterfaceQuery; +import de.unistuttgart.iste.rss.ccims.eclipseplugin.apibindings.ComponentInterfaceQueryDefinition; +import de.unistuttgart.iste.rss.ccims.eclipseplugin.apibindings.ComponentPageQueryDefinition; +import de.unistuttgart.iste.rss.ccims.eclipseplugin.apibindings.ComponentQueryDefinition; +import de.unistuttgart.iste.rss.ccims.eclipseplugin.apibindings.IssuePageQueryDefinition; +import de.unistuttgart.iste.rss.ccims.eclipseplugin.apibindings.ProjectFilter; +import de.unistuttgart.iste.rss.ccims.eclipseplugin.apibindings.ProjectQueryDefinition; +import de.unistuttgart.iste.rss.ccims.eclipseplugin.apibindings.QueryQuery.ProjectsArgumentsDefinition; +import de.unistuttgart.iste.rss.ccims.eclipseplugin.apibindings.QueryQueryDefinition; +import de.unistuttgart.iste.rss.ccims.eclipseplugin.apibindings.ReactionGroupPageQueryDefinition; +import de.unistuttgart.iste.rss.ccims.eclipseplugin.apibindings.UserPageQueryDefinition; +import de.unistuttgart.iste.rss.ccims.eclipseplugin.apibindings.UserQueryDefinition; + +/** + * A collection of graphQl queries used by this project. + * + * @author Tim Neumann + */ +public class ApiQueries { + + private ApiQueries() { + //hide + } + + /** + * Get the username of the user being queried + */ + public static final UserQueryDefinition USER_USERNAME; + + /** + * Get all users of the queried list and for each user get the username + */ + public static final UserPageQueryDefinition ALL_USERS_USERNAME; + + /** + * Get all reactions of the queried list and for each reaction get the reaction and the users + */ + public static final ReactionGroupPageQueryDefinition ALL_REACTIONS; + + /** + * Get all data about the queried project + */ + public static final ProjectQueryDefinition PROJECT_ALL_DATA; + + public static final QueryQueryDefinition ALL_PROJECTS_ALL_DATA; + + static { + + USER_USERNAME = u -> u.username(); + ALL_USERS_USERNAME = p_u -> p_u.nodes(USER_USERNAME); + + ALL_REACTIONS = p_r -> p_r.nodes(r -> r + .reaction() + .users(USER_USERNAME)); + + PROJECT_ALL_DATA = projectAllData(); + + ALL_PROJECTS_ALL_DATA = q -> q.projects(p_p -> p_p.nodes(PROJECT_ALL_DATA)); + } + + /** + * Get a complete query for all data about the project with the given name. + * @param projectName The project name to get + * @return + */ + public static QueryQueryDefinition getQueryForAllDataAboutProject(String projectName) { + ProjectFilter filter = new ProjectFilter(); + filter.setName(Arrays.asList(projectName)); + + ProjectsArgumentsDefinition argsDef = args -> args.filterBy(filter); + return q -> q.projects(argsDef, p_p -> p_p.nodes(PROJECT_ALL_DATA)); + } + + private static ProjectQueryDefinition projectAllData() { + return p -> p + .components(allComponents()) + .issues(allIssues()) + .name() + .owner(USER_USERNAME) + .users(allUsers()); + } + + private static ComponentPageQueryDefinition allComponents() { + return p_c -> p_c.nodes(c -> c + .consumedInterfaces(p_i -> p_i.nodes(i -> i + .name())) + .description() + .imsData() + .imsType() + .interfaces(p_i -> p_i.nodes(i -> i + .description() + .name() + .owner(USER_USERNAME) + .consumedBy(c_p_c -> c_p_c.nodes(c_c -> c_c.name())))) + .name() + .owner(USER_USERNAME)); + } + + private static UserPageQueryDefinition allUsers() { + return p_u -> p_u.nodes(u -> u + .displayName() + .email() + .username()); + } + + private static IssuePageQueryDefinition allIssues() { + return p_i -> p_i.nodes(i -> i + .assignees(ALL_USERS_USERNAME) + .body() + .category() + .components(p_c -> p_c.nodes(c -> c.name())) + .createdAt() + .createdBy(USER_USERNAME) + .currentUserCanComment() + .currentUserCanEdit() + .dueDate() + .editedAt() + .editedBy(USER_USERNAME) + .estimatedTime() + .id() + .isDuplicate() + .isOpen() + .issueComments(p_c -> p_c.nodes(c -> c + .body() + .createdAt() + .createdBy(USER_USERNAME) + .currentUserCanEdit() + .editedAt() + .editedBy(USER_USERNAME) + .reactions(ALL_REACTIONS))) + .labels(p_l -> p_l.nodes(l -> l + .colour() + .description() + .name())) + .linkedIssues(p_li -> p_li.nodes(li -> li.id())) + .locations(p_l -> p_l.nodes(l -> l + .onComponent(c -> c.name()) + .onComponentInterface(ci -> ci.name()))) + .participants(ALL_USERS_USERNAME) + .pinnedOn(p_c -> p_c.nodes(c -> c.name())) + .reactions(ALL_REACTIONS) + .spentTime() + .startDate() + //.timeline() //Not fetching timeline for now. + .title() + .updatedAt() + ); + } + +} diff --git a/resourcemanager/src/de/unistuttgart/iste/rss/ccims/eclipseplugin/resourcemanager/apiadapter/ApiQueryManager.java b/resourcemanager/src/de/unistuttgart/iste/rss/ccims/eclipseplugin/resourcemanager/apiadapter/ApiQueryManager.java new file mode 100644 index 0000000..3640cb4 --- /dev/null +++ b/resourcemanager/src/de/unistuttgart/iste/rss/ccims/eclipseplugin/resourcemanager/apiadapter/ApiQueryManager.java @@ -0,0 +1,57 @@ +package de.unistuttgart.iste.rss.ccims.eclipseplugin.resourcemanager.apiadapter; + +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URLEncoder; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.net.http.HttpResponse.BodyHandlers; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; + +import de.unistuttgart.iste.rss.ccims.eclipseplugin.apibindings.Operations; +import de.unistuttgart.iste.rss.ccims.eclipseplugin.apibindings.Query; + +public class ApiQueryManager { + private final URI requestUri; + private Gson gsonInstance; + private HttpClient httpClient; + + + public ApiQueryManager(final URI apiUri) throws UnsupportedEncodingException, URISyntaxException { + this.gsonInstance = new GsonBuilder().registerTypeAdapter(Query.class, new QueryDeserializer()).create(); + + String query = Operations.query(ApiQueries.ALL_PROJECTS_ALL_DATA).toString(); + + HttpClient.Builder httpClientBuilder = HttpClient.newBuilder(); + httpClient = httpClientBuilder.build(); + + String queryString = "query=" + URLEncoder.encode(query, "UTF-8"); + requestUri = new URI(apiUri.getScheme() + "://" + apiUri.getRawAuthority() + apiUri.getRawPath() + "?" + queryString); + } + + public Query query() throws IOException, InterruptedException { + HttpRequest.Builder requestBuilder = HttpRequest.newBuilder(); + requestBuilder.GET(); + requestBuilder.uri(requestUri); + + HttpResponse response = httpClient.send(requestBuilder.build(), BodyHandlers.ofString()); + + if(response.statusCode() != 200) { + throw new IOException("Reuqest failed with " + response.statusCode() + ". Body:\n" + response.body()); + } + + String body = response.body(); + + // Cut {"data": and } + // This is probably a mismatch between the server and the apibindings generator + body = body.substring(8, body.length() - 1); + + return gsonInstance.fromJson(body, Query.class); + } + +} diff --git a/resourcemanager/src/de/unistuttgart/iste/rss/ccims/eclipseplugin/resourcemanager/apiadapter/QueryDeserializer.java b/resourcemanager/src/de/unistuttgart/iste/rss/ccims/eclipseplugin/resourcemanager/apiadapter/QueryDeserializer.java new file mode 100644 index 0000000..26a1ffe --- /dev/null +++ b/resourcemanager/src/de/unistuttgart/iste/rss/ccims/eclipseplugin/resourcemanager/apiadapter/QueryDeserializer.java @@ -0,0 +1,22 @@ +package de.unistuttgart.iste.rss.ccims.eclipseplugin.resourcemanager.apiadapter; + +import java.lang.reflect.Type; + +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonParseException; +import com.shopify.graphql.support.SchemaViolationError; + +import de.unistuttgart.iste.rss.ccims.eclipseplugin.apibindings.Query; + +public class QueryDeserializer implements JsonDeserializer{ + @Override + public Query deserialize(JsonElement json, Type type, JsonDeserializationContext context) throws JsonParseException { + try { + return new Query(json.getAsJsonObject()); + } catch (SchemaViolationError e) { + throw new JsonParseException(e); + } + } +} diff --git a/resourcemanager/src/de/unistuttgart/iste/rss/ccims/eclipseplugin/resourcemanager/apiadapter/QueryExecutor.java b/resourcemanager/src/de/unistuttgart/iste/rss/ccims/eclipseplugin/resourcemanager/apiadapter/QueryExecutor.java new file mode 100644 index 0000000..fa8c05a --- /dev/null +++ b/resourcemanager/src/de/unistuttgart/iste/rss/ccims/eclipseplugin/resourcemanager/apiadapter/QueryExecutor.java @@ -0,0 +1,6 @@ +package de.unistuttgart.iste.rss.ccims.eclipseplugin.resourcemanager.apiadapter; + +public class QueryExecutor { + + +} diff --git a/ui/META-INF/MANIFEST.MF b/ui/META-INF/MANIFEST.MF index 3bb34d7..d3e4191 100644 --- a/ui/META-INF/MANIFEST.MF +++ b/ui/META-INF/MANIFEST.MF @@ -12,7 +12,8 @@ Require-Bundle: org.eclipse.core.runtime, org.eclipse.emf.parsley.views, org.eclipse.xtext.xbase.lib, ccims-eclipse-plugin-data;bundle-version="1.0.0", - ccims-eclipse-plugin-logic;bundle-version="1.0.0" + ccims-eclipse-plugin-logic;bundle-version="1.0.0", + ccims-eclipse-plugin-resourcemanager;bundle-version="1.0.0" Import-Package: org.apache.log4j, org.apache.commons.logging Bundle-RequiredExecutionEnvironment: JavaSE-11 diff --git a/ui/src/de/unistuttgart/iste/rss/ccims/eclipseplugin/ui/Activator.java b/ui/src/de/unistuttgart/iste/rss/ccims/eclipseplugin/ui/Activator.java index 6e9a9cc..b76260f 100644 --- a/ui/src/de/unistuttgart/iste/rss/ccims/eclipseplugin/ui/Activator.java +++ b/ui/src/de/unistuttgart/iste/rss/ccims/eclipseplugin/ui/Activator.java @@ -2,11 +2,14 @@ import org.osgi.framework.BundleContext; +import de.unistuttgart.iste.rss.ccims.eclipseplugin.resourcemanager.CcimsResourceFactory; + import java.lang.reflect.InvocationTargetException; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.preferences.InstanceScope; +import org.eclipse.emf.ecore.resource.Resource; import org.eclipse.jface.preference.IPersistentPreferenceStore; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.ui.plugin.AbstractUIPlugin; @@ -39,6 +42,10 @@ public Activator() { public void start(BundleContext context) throws Exception { super.start(context); plugin = this; + + var resourceFactory = new CcimsResourceFactory(); + Resource.Factory.Registry.INSTANCE.getProtocolToFactoryMap().put("ccims", resourceFactory); + Resource.Factory.Registry.INSTANCE.getProtocolToFactoryMap().put("ccimss", resourceFactory); } /* diff --git a/ui/src/de/unistuttgart/iste/rss/ccims/eclipseplugin/ui/ui.parsley b/ui/src/de/unistuttgart/iste/rss/ccims/eclipseplugin/ui/ui.parsley index 642f1f3..0caf918 100644 --- a/ui/src/de/unistuttgart/iste/rss/ccims/eclipseplugin/ui/ui.parsley +++ b/ui/src/de/unistuttgart/iste/rss/ccims/eclipseplugin/ui/ui.parsley @@ -76,11 +76,11 @@ module de.unistuttgart.iste.rss.ccims.eclipseplugin.ui { resourceURI { IssueListView -> { - return URI.createFileURI(System.getProperty("user.home") + "/MyIssues.issues"); + return URI.createURI("ccims://localhost:8080/api"); } DebugMasterView -> { - return URI.createFileURI(System.getProperty("user.home") + "/MyIssues.issues"); + return URI.createURI("ccims://localhost:8080/api"); } } }