Skip to content

Commit

Permalink
Merge pull request #7 from OpenNTF/feature/buildDirectToGitHubRepo
Browse files Browse the repository at this point in the history
Bump Version and CID Handling in MIME
  • Loading branch information
guedeWebGate authored Aug 31, 2023
2 parents cb71951 + e3791af commit b500651
Show file tree
Hide file tree
Showing 36 changed files with 110 additions and 47 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ designer/org.openntf.xrest.designer.updatesite/artifacts.jar
designer/org.openntf.xrest.designer.updatesite/content.jar
designer/org.openntf.xrest.designer.updatesite/features/
designer/org.openntf.xrest.designer.updatesite/plugins/
designer/target/
server/org.openntf.xrest.xsp.p2/.project
server/org.openntf.xrest.xsp.p2/.settings/
server/org.openntf.xrest.xsp.p2/target/category.xml
Expand Down
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"java.configuration.updateBuildConfiguration": "interactive"
}
2 changes: 1 addition & 1 deletion assembly/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.openntf.xrest</groupId>
<artifactId>xrest.parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>10.0.1-SNAPSHOT</version>
</parent>
<artifactId>xrest.assembly</artifactId>
<packaging>pom</packaging>
Expand Down
2 changes: 1 addition & 1 deletion designer/org.openntf.xrest.designer.feature/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<feature
id="org.openntf.xrest.designer.feature"
label="XREST Api Designer Feature"
version="1.0.0.qualifier">
version="10.0.1.qualifier">

<description url="https://smartnsf.openntf.org">
Transform your own NSF to a Microservice!
Expand Down
2 changes: 1 addition & 1 deletion designer/org.openntf.xrest.designer.feature/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>org.openntf.xrest</groupId>
<artifactId>xrest.designer.parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>10.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.openntf.xrest.designer.feature</artifactId>
<packaging>eclipse-feature</packaging>
Expand Down
2 changes: 1 addition & 1 deletion designer/org.openntf.xrest.designer.updatesite/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>org.openntf.xrest</groupId>
<artifactId>xrest.designer.parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>10.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.openntf.xrest.designer.updatesite</artifactId>
<packaging>eclipse-update-site</packaging>
Expand Down
2 changes: 1 addition & 1 deletion designer/org.openntf.xrest.designer.updatesite/site.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<site>
<feature url="features/org.openntf.xrest.designer.feature_1.0.0.qualifier.jar" id="org.openntf.xrest.designer.feature" version="1.0.0.qualifier">
<feature url="features/org.openntf.xrest.designer.feature_10.0.1.qualifier.jar" id="org.openntf.xrest.designer.feature" version="10.0.1.qualifier">
<category name="OpenNTF XREST API"/>
</feature>
<category-def name="OpenNTF XREST API" label="OpenNTF XREST API"/>
Expand Down
10 changes: 7 additions & 3 deletions designer/org.openntf.xrest.designer/.classpath
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
<classpathentry kind="src" path="src/"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
2 changes: 1 addition & 1 deletion designer/org.openntf.xrest.designer/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: XREST API Designer
Bundle-SymbolicName: org.openntf.xrest.designer;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Version: 10.0.1.qualifier
Bundle-Activator: org.openntf.xrest.designer.XRestUIActivator
Bundle-Vendor: WebGate Consulting AG
Require-Bundle: org.eclipse.ui,
Expand Down
2 changes: 1 addition & 1 deletion designer/org.openntf.xrest.designer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>org.openntf.xrest</groupId>
<artifactId>xrest.designer.parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>10.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.openntf.xrest.designer</artifactId>
<name>XRest Designer Plugin</name>
Expand Down
12 changes: 8 additions & 4 deletions designer/org.openntf.xrestapi.designer.testsuite/.classpath
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry exported="true" kind="lib" path="lib/cglib-nodep.jar"/>
<classpathentry exported="true" kind="lib" path="lib/commons-io.jar"/>
<classpathentry exported="true" kind="lib" path="lib/easymock.jar"/>
<classpathentry exported="true" kind="lib" path="lib/objenesis.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
<classpathentry kind="src" path="src/"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Testsuite
Bundle-SymbolicName: org.openntf.xrestapi.designer.testsuite;singleton:=true
Bundle-Version: 1.0.0.qualifier
Fragment-Host: org.openntf.xrest.designer;bundle-version="1.0.0"
Bundle-Version: 10.0.1.qualifier
Fragment-Host: org.openntf.xrest.designer;bundle-version="10.0.1"
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: org.junit;bundle-version="4.11.0",
com.ibm.notes.java.api,
Expand Down
2 changes: 1 addition & 1 deletion designer/org.openntf.xrestapi.designer.testsuite/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>org.openntf.xrest</groupId>
<artifactId>xrest.designer.parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>10.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.openntf.xrestapi.designer.testsuite</artifactId>
<packaging>eclipse-test-plugin</packaging>
Expand Down
2 changes: 1 addition & 1 deletion designer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.openntf.xrest</groupId>
<artifactId>xrest.parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>10.0.1-SNAPSHOT</version>
</parent>
<artifactId>xrest.designer.parent</artifactId>
<packaging>pom</packaging>
Expand Down
1 change: 0 additions & 1 deletion designer/target/.gitignore

This file was deleted.

2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.openntf.xrest</groupId>
<artifactId>xrest.parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>10.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<xrest.root>${project.basedir}</xrest.root>
Expand Down
2 changes: 1 addition & 1 deletion server/org.openntf.xrest.libraries/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: XRest API Libraries
Bundle-SymbolicName: org.openntf.xrest.libraries;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Version: 10.0.1.qualifier
Bundle-Vendor: WebGate Consulting AG
Bundle-ActivationPolicy: lazy
Require-Bundle: org.eclipse.core.runtime;resolution:=optional
Expand Down
2 changes: 1 addition & 1 deletion server/org.openntf.xrest.libraries/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.openntf.xrest</groupId>
<artifactId>xrest.xsp.parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>10.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.openntf.xrest.libraries</artifactId>
<build>
Expand Down
2 changes: 1 addition & 1 deletion server/org.openntf.xrest.xsp.feature.source/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<feature
id="org.openntf.xrest.xsp.feature.source"
label="XREST XSP Source Feature"
version="1.0.0.qualifier"
version="10.0.1.qualifier"
provider-name="WebGate Consulting AG">

<description url="https://smartnsf.openntf.org">
Expand Down
2 changes: 1 addition & 1 deletion server/org.openntf.xrest.xsp.feature.source/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>org.openntf.xrest</groupId>
<artifactId>xrest.xsp.parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>10.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.openntf.xrest.xsp.feature.source</artifactId>
<packaging>eclipse-feature</packaging>
Expand Down
2 changes: 1 addition & 1 deletion server/org.openntf.xrest.xsp.feature/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<feature
id="org.openntf.xrest.xsp.feature"
label="XREST XSP Feature"
version="1.0.0.qualifier"
version="10.0.1.qualifier"
provider-name="WebGate Consulting AG">

<description url="https://smartnsf.openntf.org">
Expand Down
2 changes: 1 addition & 1 deletion server/org.openntf.xrest.xsp.feature/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.openntf.xrest</groupId>
<artifactId>xrest.xsp.parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>10.0.1-SNAPSHOT</version>
</parent>
<properties>
</properties>
Expand Down
4 changes: 2 additions & 2 deletions server/org.openntf.xrest.xsp.p2/category.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<site>
<feature url="features/org.openntf.xrest.xsp.feature_1.0.0.qualifier.jar" id="org.openntf.xrest.xsp.feature" version="1.0.0.qualifier">
<feature url="features/org.openntf.xrest.xsp.feature_10.0.1.qualifier.jar" id="org.openntf.xrest.xsp.feature" version="10.0.1.qualifier">
<category name="SmartNSF_XSP"/>
</feature>
<feature url="features/org.openntf.xrest.xsp.feature.source_1.0.0.qualifier.jar" id="org.openntf.xrest.xsp.feature.source" version="1.0.0.qualifier"/>
<feature url="features/org.openntf.xrest.xsp.feature.source_10.0.1.qualifier.jar" id="org.openntf.xrest.xsp.feature.source" version="10.0.1.qualifier"/>
<category-def name="SmartNSF_XSP" label="SmartNSF Server Part"/>
</site>
2 changes: 1 addition & 1 deletion server/org.openntf.xrest.xsp.p2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>org.openntf.xrest</groupId>
<artifactId>xrest.xsp.parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>10.0.1-SNAPSHOT</version>
</parent>
<groupId>org.openntf.xrest.xsp.p2</groupId>
<artifactId>org.openntf.xrest.xsp.p2</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion server/org.openntf.xrest.xsp.swaggui/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: XRest Swagger UI Wrapper
Bundle-SymbolicName: org.openntf.xrest.xsp.swaggui;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Version: 10.0.1.qualifier
Bundle-Vendor: WebGate Consulting AG
Bundle-ActivationPolicy: lazy
Require-Bundle: org.eclipse.core.runtime;resolution:=optional,
Expand Down
2 changes: 1 addition & 1 deletion server/org.openntf.xrest.xsp.swaggui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.openntf.xrest</groupId>
<artifactId>xrest.xsp.parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>10.0.1-SNAPSHOT</version>
</parent>
<groupId>org.openntf.xrest.xsp.swaggui</groupId>
<artifactId>org.openntf.xrest.xsp.swaggui</artifactId>
Expand Down
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: XREST API Plugin
Bundle-SymbolicName: org.openntf.xrest.xsp.testsuite
Bundle-Version: 1.0.0.qualifier
Bundle-Version: 10.0.1.qualifier
Bundle-Vendor: WebGate Consulting AG
Fragment-Host: org.openntf.xrest.xsp
Require-Bundle: org.junit;bundle-version="4.11.0"
Expand Down
2 changes: 1 addition & 1 deletion server/org.openntf.xrest.xsp.testsuite/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.openntf.xrest</groupId>
<artifactId>xrest.xsp.parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>10.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.openntf.xrest.xsp.testsuite</artifactId>
<packaging>eclipse-test-plugin</packaging>
Expand Down
2 changes: 1 addition & 1 deletion server/org.openntf.xrest.xsp.updatesite/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.openntf.xrest</groupId>
<artifactId>xrest.xsp.parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>10.0.1-SNAPSHOT</version>
</parent>
<properties>
</properties>
Expand Down
2 changes: 1 addition & 1 deletion server/org.openntf.xrest.xsp.updatesite/site.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<site>
<feature url="features/org.openntf.xrest.xsp.feature_1.0.0.qualifier.jar" id="org.openntf.xrest.xsp.feature" version="1.0.0.qualifier">
<feature url="features/org.openntf.xrest.xsp.feature_10.0.1.qualifier.jar" id="org.openntf.xrest.xsp.feature" version="10.0.1.qualifier">
<category name="OpenNTFExtension"/>
</feature>
<category-def name="OpenNTFExtension" label="OpenNTFExtension"/>
Expand Down
2 changes: 1 addition & 1 deletion server/org.openntf.xrest.xsp/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: XRest API Server
Bundle-SymbolicName: org.openntf.xrest.xsp;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Version: 10.0.1.qualifier
Bundle-Vendor: WebGate Consulting AG
Bundle-ActivationPolicy: lazy
Require-Bundle: org.eclipse.core.runtime;resolution:=optional,
Expand Down
2 changes: 1 addition & 1 deletion server/org.openntf.xrest.xsp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.openntf.xrest</groupId>
<artifactId>xrest.xsp.parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>10.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.openntf.xrest.xsp</artifactId>
<name>XRest Server Package XSP</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ public class MimeMapJsonTypeProcessor extends AbstractMapJsonTypeProcessor {
private static final String BINARY_HEADER_VALUE = "binary";
private static final String CONTENT_TRANSFER_ENCODING = "Content-Transfer-Encoding";
private static final String CONTENT_DISPOSITION = "Content-Disposition";
private static final String CONTENT_ID = "Content-ID";
protected static final String MULTIPART_MIXED = "multipart/mixed";
protected static final String CONTENT_TYPE = "Content-Type";
public static final String CONTENT_TYPE = "Content-Type";
private static final String TEXT_HTML_CHARSET_UTF_8 = "text/html;charset=UTF-8";
private static final String CHARSET_UTF_8 = "charset=UTF-8";

Expand Down Expand Up @@ -333,6 +334,17 @@ protected MIMEEntity findAttachment(final MIMEEntity entity, final String attach
childCurrent.recycle();
}
}
String contentId = getContentIDHeaderValue(entity);
if (!StringUtil.isEmpty(contentId)) {
String attachmentNameEnhanced = "<"+attachmentName.toLowerCase() +">";
String attachmentNameCleaned = attachmentNameEnhanced.toLowerCase().replaceAll("[^\\w\\s]","").replace(" ", "");
String contentIdCleaned = contentId.toLowerCase().replaceAll("[^\\w\\s]","").replace(" ", "");
if (contentId.toLowerCase().equals(attachmentName.toLowerCase())
|| contentId.toLowerCase().equals(attachmentNameEnhanced)
|| contentIdCleaned.equals(attachmentNameCleaned)) {
return entity;
}
}
String dispositionValue = getContentDispositionHeaderValue(entity);
if (!StringUtil.isEmpty(dispositionValue) && dispositionValue.startsWith(ATTACHMENT_HEADER_VALUE)) {
// System.out.println(dispositionValue);
Expand All @@ -353,6 +365,16 @@ protected String getContentDispositionHeaderValue(final MIMEEntity entity) throw
return null;
}

protected String getContentIDHeaderValue(final MIMEEntity entity) throws NotesException {
MIMEHeader mimeheader = entity.getNthHeader(CONTENT_ID);
if (mimeheader != null) {
String val = mimeheader.getHeaderValAndParams(false, true);
mimeheader.recycle();
return val;
}
return null;
}

protected String getContentHeaderValue(final MIMEEntity entity) throws NotesException {
MIMEHeader mimeHeader = entity.getNthHeader(CONTENT_TYPE);
if (mimeHeader != null) {
Expand Down
Loading

0 comments on commit b500651

Please sign in to comment.