Skip to content

Commit

Permalink
Merge pull request #19 from SBI-/api-proxy
Browse files Browse the repository at this point in the history
Add custom proxy functionality
  • Loading branch information
SBI- committed Jul 24, 2018
2 parents 2a99c89 + 3715772 commit df639c1
Show file tree
Hide file tree
Showing 17 changed files with 248 additions and 255 deletions.
11 changes: 6 additions & 5 deletions .mvn/extensions.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<extensions>
<extension>
<groupId>org.eclipse.tycho.extras</groupId>
<artifactId>tycho-pomless</artifactId>
<version>1.0.0</version>
</extension>
<extension>
<groupId>org.eclipse.tycho.extras</groupId>
<artifactId>tycho-pomless</artifactId>
<version>1.0.0</version>
</extension>
</extensions>
89 changes: 34 additions & 55 deletions feature/feature.xml
Original file line number Diff line number Diff line change
@@ -1,57 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<feature
id="org.jazzcommunity.GitConnectorService.feature"
label="REST Service"
version="1.8.2.qualifier"
provider-name="PROVIDER">

<description url="http://www.example.com/description">
REST Service for interacting with ClearQuest from Jazz.
</description>

<copyright url="http://www.example.com/copyright">
[Enter Copyright Description here.]
</copyright>

<license url="http://www.example.com/license">
[Enter License Description here.]
</license>

<requires>
<import plugin="com.ibm.team.repository.common"/>
<import plugin="com.ibm.team.repository.service"/>
<import plugin="com.ibm.team.repository.common.transport"/>
<import plugin="org.apache.http.client" version="4.1.2" match="greaterOrEqual"/>
<import plugin="org.apache.http" version="4.1.100" match="greaterOrEqual"/>
<import plugin="com.hp.hpl.jena" version="2.7.4" match="greaterOrEqual"/>
<import plugin="javax.xml.stream" version="1.0.0" match="greaterOrEqual"/>
<import plugin="javax.xml" version="1.3.4" match="greaterOrEqual"/>
<import plugin="org.apache.log4j"/>
<import plugin="com.ibm.icu"/>
<import plugin="org.apache.commons.codec"/>
<import plugin="org.apache.commons.lang"/>
<import plugin="org.apache.xerces"/>
<import plugin="com.ibm.team.workitem.service" version="3.1.1100" match="greaterOrEqual"/>
<import plugin="com.ibm.team.workitem.common" version="3.2.300" match="greaterOrEqual"/>
<import plugin="org.eclipse.core.runtime" version="3.6.0" match="greaterOrEqual"/>
<import plugin="com.ibm.team.jfs.app.friendsconfig" match="greaterOrEqual"/>
<import plugin="com.ibm.team.jfs.app.discovery" version="1.2.2000" match="greaterOrEqual"/>
<import plugin="com.ibm.team.jfs.app.http" version="1.4.1000" match="greaterOrEqual"/>
<import plugin="com.ibm.team.jfs.app.http.client" version="1.2.1000" match="greaterOrEqual"/>
<import plugin="com.ibm.team.jfs.app.util" version="1.3.1000" match="greaterOrEqual"/>
<import plugin="com.ibm.team.jfs.app.resource" version="1.3.0" match="greaterOrEqual"/>
<import plugin="com.ibm.team.jfs.app.error" version="1.1.3000" match="greaterOrEqual"/>
<import plugin="com.ibm.team.jfs.app"/>
<import plugin="javax.servlet" version="2.5.0" match="greaterOrEqual"/>
<import plugin="org.apache.commons.logging"/>
<import plugin="org.eclipse.osgi"/>
</requires>

<plugin
id="org.jazzcommunity.GitConnectorService"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>

<feature id="org.jazzcommunity.GitConnectorService.feature" label="REST Service" version="1.8.3.qualifier" provider-name="PROVIDER">
<description url="http://www.example.com/description">REST Service for interacting with ClearQuest from Jazz.</description>
<copyright url="http://www.example.com/copyright">[Enter Copyright Description here.]</copyright>
<license url="http://www.example.com/license">[Enter License Description here.]</license>
<requires>
<import plugin="com.ibm.team.repository.common"/>
<import plugin="com.ibm.team.repository.service"/>
<import plugin="com.ibm.team.repository.common.transport"/>
<import plugin="org.apache.http.client" version="4.1.2" match="greaterOrEqual"/>
<import plugin="org.apache.http" version="4.1.100" match="greaterOrEqual"/>
<import plugin="com.hp.hpl.jena" version="2.7.4" match="greaterOrEqual"/>
<import plugin="javax.xml.stream" version="1.0.0" match="greaterOrEqual"/>
<import plugin="javax.xml" version="1.3.4" match="greaterOrEqual"/>
<import plugin="org.apache.log4j"/>
<import plugin="com.ibm.icu"/>
<import plugin="org.apache.commons.codec"/>
<import plugin="org.apache.commons.lang"/>
<import plugin="org.apache.xerces"/>
<import plugin="com.ibm.team.workitem.service" version="3.1.1100" match="greaterOrEqual"/>
<import plugin="com.ibm.team.workitem.common" version="3.2.300" match="greaterOrEqual"/>
<import plugin="org.eclipse.core.runtime" version="3.6.0" match="greaterOrEqual"/>
<import plugin="com.ibm.team.jfs.app.friendsconfig" match="greaterOrEqual"/>
<import plugin="com.ibm.team.jfs.app.discovery" version="1.2.2000" match="greaterOrEqual"/>
<import plugin="com.ibm.team.jfs.app.http" version="1.4.1000" match="greaterOrEqual"/>
<import plugin="com.ibm.team.jfs.app.http.client" version="1.2.1000" match="greaterOrEqual"/>
<import plugin="com.ibm.team.jfs.app.util" version="1.3.1000" match="greaterOrEqual"/>
<import plugin="com.ibm.team.jfs.app.resource" version="1.3.0" match="greaterOrEqual"/>
<import plugin="com.ibm.team.jfs.app.error" version="1.1.3000" match="greaterOrEqual"/>
<import plugin="com.ibm.team.jfs.app"/>
<import plugin="javax.servlet" version="2.5.0" match="greaterOrEqual"/>
<import plugin="org.apache.commons.logging"/>
<import plugin="org.eclipse.osgi"/>
</requires>
<plugin id="org.jazzcommunity.GitConnectorService" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
</feature>
8 changes: 2 additions & 6 deletions feature/pom.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>org.jazzcommunity.GitConnectorService.feature</artifactId>
<packaging>eclipse-feature</packaging>

<parent>
<groupId>org.jazzcommunity.GitConnectorService</groupId>
<artifactId>org.jazzcommunity.GitConnectorService.parent</artifactId>
<version>1.8.2-SNAPSHOT</version>
<version>1.8.3-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

</project>
4 changes: 2 additions & 2 deletions plugin/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: org.jazzcommunity.GitConnectorService
Bundle-SymbolicName: org.jazzcommunity.GitConnectorService;singleton:=true
Bundle-Version: 1.8.2.qualifier
Bundle-Version: 1.8.3.qualifier
Bundle-Vendor: VENDOR
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Require-Bundle:
Expand Down Expand Up @@ -34,7 +34,7 @@ Require-Bundle:
com.ibm.team.build.common,
com.ibm.team.build.service
Bundle-ClassPath: target/dependency/gson-2.8.2.jar,
target/dependency/com.siemens.bt.jazz.services.base-3.0.2-SNAPSHOT.jar,
target/dependency/com.siemens.bt.jazz.services.base-3.0.3-SNAPSHOT.jar,
target/dependency/com.siemens.bt.jazz.services.PersonalTokenService-1.0.2-SNAPSHOT.jar,
target/dependency/asm-5.0.3.jar,
target/dependency/asm-analysis-5.0.3.jar,
Expand Down
133 changes: 46 additions & 87 deletions plugin/plugin.xml
Original file line number Diff line number Diff line change
@@ -1,90 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<?xml version="1.0" encoding="UTF-8"?><?eclipse version="3.4"?>

<!-- https://jazz.net/wiki/bin/view/Main/JAFServiceFramework -->
<plugin>
<extension
point="com.ibm.team.repository.common.components">
<component
id="org.jazzcommunity.GitConnectorService"
name="REST service">
<service
name="REST Service"
kind="MODELLED_REST"
uri="org.jazzcommunity.GitConnectorService.IGitConnectorService"
version="${qualifiedVersion}">
</service>
</component>
</extension>
<extension
point="com.ibm.team.repository.service.serviceProvider">
<serviceProvider
componentId="org.jazzcommunity.GitConnectorService"
implementationClass="org.jazzcommunity.GitConnectorService.GitConnectorService">
<provides>
<providedService interface="org.jazzcommunity.GitConnectorService.IGitConnectorService"/>
</provides>
<prerequisites>
<requiredService interface="com.siemens.bt.jazz.services.PersonalTokenService.IPersonalTokenService"/>
<requiredService interface="com.ibm.team.repository.common.service.IContributorService"/>
<requiredService interface="com.ibm.team.repository.service.IRepositoryItemService"/>
<requiredService interface="com.ibm.team.repository.common.service.IQueryService"/>
<requiredService interface="com.ibm.team.repository.service.IServerQueryService"/>
<requiredService interface="com.ibm.team.build.internal.common.ITeamBuildService"/>
</prerequisites>
</serviceProvider>
</extension>
<extension
point="com.ibm.team.repository.common.linkTypes">
<linkType
constrained="true"
id="org.jazzcommunity.git.link.git_mergerequest"
internal="false">
<source>
<endpoint
displayName="Git Merge / Pull Requests"
icon="src/main/resources/images/request_16x16.png"
id="workitem_to_request"
multiplicity="0..n">
<itemReferenceType
itemTypeName="WorkItem"
packageURI="com.ibm.team.workitem"/>
</endpoint>
</source>
<target>
<endpoint
displayName="Git Merge / Pull Requests"
icon="src/main/resources/images/request_16x16.png"
id="request_target"
multiplicity="0..n">
</endpoint>
</target>
</linkType>
</extension>
<extension
point="com.ibm.team.repository.common.linkTypes">
<linkType
constrained="true"
id="org.jazzcommunity.git.link.git_issue"
internal="false">
<source>
<endpoint
displayName="Git Issues"
icon="src/main/resources/images/issue_gitlab_16x16.png"
id="workitem_to_issue"
multiplicity="0..n">
<itemReferenceType
itemTypeName="WorkItem"
packageURI="com.ibm.team.workitem"/>
</endpoint>
</source>
<target>
<endpoint
displayName="Git Issues"
icon="src/main/resources/images/issue_gitlab_16x16.png"
id="issue_target"
multiplicity="0..n">
</endpoint>
</target>
</linkType>
</extension>
<extension point="com.ibm.team.repository.common.components">
<component id="org.jazzcommunity.GitConnectorService" name="REST service">
<service name="REST Service" kind="MODELLED_REST" uri="org.jazzcommunity.GitConnectorService.IGitConnectorService" version="${qualifiedVersion}"/>
</component>
</extension>
<extension point="com.ibm.team.repository.service.serviceProvider">
<serviceProvider componentId="org.jazzcommunity.GitConnectorService" implementationClass="org.jazzcommunity.GitConnectorService.GitConnectorService">
<provides>
<providedService interface="org.jazzcommunity.GitConnectorService.IGitConnectorService"/>
</provides>
<prerequisites>
<requiredService interface="com.siemens.bt.jazz.services.PersonalTokenService.IPersonalTokenService"/>
<requiredService interface="com.ibm.team.repository.common.service.IContributorService"/>
<requiredService interface="com.ibm.team.repository.service.IRepositoryItemService"/>
<requiredService interface="com.ibm.team.repository.common.service.IQueryService"/>
<requiredService interface="com.ibm.team.repository.service.IServerQueryService"/>
<requiredService interface="com.ibm.team.build.internal.common.ITeamBuildService"/>
</prerequisites>
</serviceProvider>
</extension>
<extension point="com.ibm.team.repository.common.linkTypes">
<linkType constrained="true" id="org.jazzcommunity.git.link.git_mergerequest" internal="false">
<source>
<endpoint displayName="Git Merge / Pull Requests" icon="src/main/resources/images/request_16x16.png" id="workitem_to_request" multiplicity="0..n">
<itemReferenceType itemTypeName="WorkItem" packageURI="com.ibm.team.workitem"/>
</endpoint>
</source>
<target>
<endpoint displayName="Git Merge / Pull Requests" icon="src/main/resources/images/request_16x16.png" id="request_target" multiplicity="0..n"/>
</target>
</linkType>
</extension>
<extension point="com.ibm.team.repository.common.linkTypes">
<linkType constrained="true" id="org.jazzcommunity.git.link.git_issue" internal="false">
<source>
<endpoint displayName="Git Issues" icon="src/main/resources/images/issue_gitlab_16x16.png" id="workitem_to_issue" multiplicity="0..n">
<itemReferenceType itemTypeName="WorkItem" packageURI="com.ibm.team.workitem"/>
</endpoint>
</source>
<target>
<endpoint displayName="Git Issues" icon="src/main/resources/images/issue_gitlab_16x16.png" id="issue_target" multiplicity="0..n"/>
</target>
</linkType>
</extension>
</plugin>
9 changes: 2 additions & 7 deletions plugin/pom.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>org.jazzcommunity.GitConnectorService</artifactId>
<packaging>eclipse-plugin</packaging>

<parent>
<groupId>org.jazzcommunity.GitConnectorService</groupId>
<artifactId>org.jazzcommunity.GitConnectorService.parent</artifactId>
<version>1.8.2-SNAPSHOT</version>
<version>1.8.3-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

<build>
<resources>
<resource>
Expand Down Expand Up @@ -70,5 +66,4 @@
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.jazzcommunity.GitConnectorService.service.gitlab.IssuePreviewService;
import org.jazzcommunity.GitConnectorService.service.gitlab.RequestLinkService;
import org.jazzcommunity.GitConnectorService.service.gitlab.RequestPreviewService;
import org.jazzcommunity.GitConnectorService.service.proxy.ProxyService;
import org.jazzcommunity.GitConnectorService.service.resource.ImageService;

/**
Expand Down Expand Up @@ -43,6 +44,9 @@ public GitConnectorService() {

router.get("img/{filename}", ImageService.class);

router.get("proxy/{host}", ProxyService.class);
router.post("proxy/{host}", ProxyService.class);

/**
* This code is purposely commented out and not deleted! We have decided to use the IBM rich
* hovers for now, but potential support will remain built into the service until the decision
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import com.siemens.bt.jazz.services.base.rest.parameters.PathParameters;
import com.siemens.bt.jazz.services.base.rest.parameters.RestRequest;
import com.siemens.bt.jazz.services.base.rest.service.AbstractRestService;
import java.io.IOException;
import java.util.ResourceBundle;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
Expand All @@ -29,8 +28,4 @@ public RequestLinkService(
public void execute() throws Exception {
throw new RuntimeException(messages.getString("exception.not-implemented"));
}

private void sendLinkResponse() throws IOException {
throw new RuntimeException(messages.getString("exception.not-implemented"));
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package org.jazzcommunity.GitConnectorService.service.gitlab;

import ch.sbi.minigit.type.gitlab.commit.Commit;
import ch.sbi.minigit.type.gitlab.project.Project;
import com.ibm.team.repository.service.TeamRawService;
import com.siemens.bt.jazz.services.base.rest.parameters.PathParameters;
import com.siemens.bt.jazz.services.base.rest.parameters.RestRequest;
Expand All @@ -11,7 +9,6 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
import org.jazzcommunity.GitConnectorService.net.GitServiceArtifact;

/**
* Since the decision to use the built-in IBM rich hover and link functionality, our custom commit
Expand All @@ -37,17 +34,4 @@ public CommitLinkService(
public void execute() throws IOException {
throw new RuntimeException(messages.getString("exception.not-implemented"));
}

private void sendLinkResponse(Commit commit, GitServiceArtifact parameters, String webUrl)
throws IOException {
throw new RuntimeException(messages.getString("exception.not-implemented"));
}

private Commit getCommit() throws IOException {
throw new RuntimeException(messages.getString("exception.not-implemented"));
}

private Project getProject() throws IOException {
throw new RuntimeException(messages.getString("exception.not-implemented"));
}
}
Loading

0 comments on commit df639c1

Please sign in to comment.