You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "markap14 (via GitHub)" <gi...@apache.org> on 2023/08/03 22:49:45 UTC
[GitHub] [nifi] markap14 opened a new pull request, #7575: NIFI-11911: Support Export API for Google Docs, Presentations, Spread…
markap14 opened a new pull request, #7575:
URL: https://github.com/apache/nifi/pull/7575
…sheets, Drawings, and AppScripts
<!-- Licensed to the Apache Software Foundation (ASF) under one or more -->
<!-- contributor license agreements. See the NOTICE file distributed with -->
<!-- this work for additional information regarding copyright ownership. -->
<!-- The ASF licenses this file to You under the Apache License, Version 2.0 -->
<!-- (the "License"); you may not use this file except in compliance with -->
<!-- the License. You may obtain a copy of the License at -->
<!-- http://www.apache.org/licenses/LICENSE-2.0 -->
<!-- Unless required by applicable law or agreed to in writing, software -->
<!-- distributed under the License is distributed on an "AS IS" BASIS, -->
<!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -->
<!-- See the License for the specific language governing permissions and -->
<!-- limitations under the License. -->
# Summary
[NIFI-00000](https://issues.apache.org/jira/browse/NIFI-00000)
# Tracking
Please complete the following tracking steps prior to pull request creation.
### Issue Tracking
- [ ] [Apache NiFi Jira](https://issues.apache.org/jira/browse/NIFI) issue created
### Pull Request Tracking
- [ ] Pull Request title starts with Apache NiFi Jira issue number, such as `NIFI-00000`
- [ ] Pull Request commit message starts with Apache NiFi Jira issue number, as such `NIFI-00000`
### Pull Request Formatting
- [ ] Pull Request based on current revision of the `main` branch
- [ ] Pull Request refers to a feature branch with one commit containing changes
# Verification
Please indicate the verification steps performed prior to pull request creation.
### Build
- [ ] Build completed using `mvn clean install -P contrib-check`
- [ ] JDK 17
### Licensing
- [ ] New dependencies are compatible with the [Apache License 2.0](https://apache.org/licenses/LICENSE-2.0) according to the [License Policy](https://www.apache.org/legal/resolved.html)
- [ ] New dependencies are documented in applicable `LICENSE` and `NOTICE` files
### Documentation
- [ ] Documentation formatting appears as expected in rendered files
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nifi] exceptionfactory commented on a diff in pull request #7575: NIFI-11911: Support Export API for Google Docs, Presentations, Spread…
Posted by "exceptionfactory (via GitHub)" <gi...@apache.org>.
exceptionfactory commented on code in PR #7575:
URL: https://github.com/apache/nifi/pull/7575#discussion_r1284578562
##########
nifi-nar-bundles/nifi-gcp-bundle/nifi-gcp-processors/src/main/java/org/apache/nifi/processors/gcp/drive/FetchGoogleDrive.java:
##########
@@ -80,6 +84,62 @@
})
public class FetchGoogleDrive extends AbstractProcessor implements GoogleDriveTrait {
+ // Google Docs Export Types
+ private static final AllowableValue EXPORT_MS_WORD = new AllowableValue("application/vnd.openxmlformats-officedocument.wordprocessingml.document", "Microsoft Word");
+ private static final AllowableValue EXPORT_OPEN_DOCUMENT = new AllowableValue("application/vnd.oasis.opendocument.text", "OpenDocument");
+ private static final AllowableValue EXPORT_PDF = new AllowableValue("application/pdf", "PDF");
+ private static final AllowableValue EXPORT_RICH_TEXT = new AllowableValue("application/rtf", "Rich Text");
+ private static final AllowableValue EXPORT_EPUB = new AllowableValue("application/epub+zip", "EPUB");
+
+ // Shared Export Types
+ private static final AllowableValue EXPORT_HTML_DOC = new AllowableValue("application/zip", "Web Page (HTML)");
+ private static final AllowableValue EXPORT_PLAIN_TEXT = new AllowableValue("text/plain", "Plain Text");
+
+ // Google Spreadsheet Export Types
+ private static final AllowableValue EXPORT_MS_EXCEL = new AllowableValue("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "Microsoft Excel");
+ private static final AllowableValue EXPORT_OPEN_SPREADSHEET = new AllowableValue("application/x-vnd.oasis.opendocument.spreadsheet", "OpenDocument Spreadsheet");
+ private static final AllowableValue EXPORT_PDF_SPREADSHEET = new AllowableValue("application/pdf", "PDF");
+ private static final AllowableValue EXPORT_CSV = new AllowableValue("text/csv", "CSV (first sheet only)",
+ "Comma-separated values. Only the first sheet will be exported.");
+ private static final AllowableValue EXPORT_TSV = new AllowableValue("text/tab-separated-values", "TSV (first sheet only)",
+ "Tab-separate values. Only the first sheet will be exported.");
+ private static final AllowableValue EXPORT_HTML_SPREADSHEET = new AllowableValue("text/html", "Web Page (HTML)");
+
+ // Google Presentation Export Types
+ private static final AllowableValue EXPORT_MS_POWERPOINT = new AllowableValue("application/vnd.openxmlformats-officedocument.presentationml.presentation", "Microsoft PowerPoint");
+ private static final AllowableValue EXPORT_OPEN_PRESENTATION = new AllowableValue("application/vnd.oasis.opendocument.presentation", "OpenDocument Presentation");
+ private static final AllowableValue EXPORT_PNG = new AllowableValue("image/png", "PNG (first slide only)");
+ private static final AllowableValue EXPORT_JPEG = new AllowableValue("image/jpeg", "JPEG (first slide only)");
+ private static final AllowableValue EXPORT_SVG = new AllowableValue("image/svg+xml", "SVG (first slide only)",
+ "Scalable Vector Graphics. Only the first slide will be exported.");
+
+ // Drawings Export Types
+ private static final AllowableValue EXPORT_PNG_DRAWING = new AllowableValue("image/png", "PNG");
+ private static final AllowableValue EXPORT_JPEG_DRAWING = new AllowableValue("image/jpeg", "JPEG");
+ private static final AllowableValue EXPORT_SVG_DRAWING = new AllowableValue("image/svg+xml", "SVG");
+
+ private static final Map<String, String> fileExtensions = new HashMap<>();
+ static {
+ fileExtensions.put("application/vnd.openxmlformats-officedocument.wordprocessingml.document", ".docx");
Review Comment:
Thanks for the reply @markap14, that's a good point, and makes sense on further review.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nifi] ChrisSamo632 commented on a diff in pull request #7575: NIFI-11911: Support Export API for Google Docs, Presentations, Spread…
Posted by "ChrisSamo632 (via GitHub)" <gi...@apache.org>.
ChrisSamo632 commented on code in PR #7575:
URL: https://github.com/apache/nifi/pull/7575#discussion_r1284363010
##########
nifi-nar-bundles/nifi-gcp-bundle/nifi-gcp-processors/src/main/java/org/apache/nifi/processors/gcp/drive/FetchGoogleDrive.java:
##########
@@ -80,6 +84,62 @@
})
public class FetchGoogleDrive extends AbstractProcessor implements GoogleDriveTrait {
+ // Google Docs Export Types
+ private static final AllowableValue EXPORT_MS_WORD = new AllowableValue("application/vnd.openxmlformats-officedocument.wordprocessingml.document", "Microsoft Word");
+ private static final AllowableValue EXPORT_OPEN_DOCUMENT = new AllowableValue("application/vnd.oasis.opendocument.text", "OpenDocument");
+ private static final AllowableValue EXPORT_PDF = new AllowableValue("application/pdf", "PDF");
+ private static final AllowableValue EXPORT_RICH_TEXT = new AllowableValue("application/rtf", "Rich Text");
+ private static final AllowableValue EXPORT_EPUB = new AllowableValue("application/epub+zip", "EPUB");
+
+ // Shared Export Types
+ private static final AllowableValue EXPORT_HTML_DOC = new AllowableValue("application/zip", "Web Page (HTML)");
+ private static final AllowableValue EXPORT_PLAIN_TEXT = new AllowableValue("text/plain", "Plain Text");
+
+ // Google Spreadsheet Export Types
+ private static final AllowableValue EXPORT_MS_EXCEL = new AllowableValue("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "Microsoft Excel");
+ private static final AllowableValue EXPORT_OPEN_SPREADSHEET = new AllowableValue("application/x-vnd.oasis.opendocument.spreadsheet", "OpenDocument Spreadsheet");
+ private static final AllowableValue EXPORT_PDF_SPREADSHEET = new AllowableValue("application/pdf", "PDF");
+ private static final AllowableValue EXPORT_CSV = new AllowableValue("text/csv", "CSV (first sheet only)",
+ "Comma-separated values. Only the first sheet will be exported.");
+ private static final AllowableValue EXPORT_TSV = new AllowableValue("text/tab-separated-values", "TSV (first sheet only)",
+ "Tab-separate values. Only the first sheet will be exported.");
+ private static final AllowableValue EXPORT_HTML_SPREADSHEET = new AllowableValue("text/html", "Web Page (HTML)");
+
+ // Google Presentation Export Types
+ private static final AllowableValue EXPORT_MS_POWERPOINT = new AllowableValue("application/vnd.openxmlformats-officedocument.presentationml.presentation", "Microsoft PowerPoint");
+ private static final AllowableValue EXPORT_OPEN_PRESENTATION = new AllowableValue("application/vnd.oasis.opendocument.presentation", "OpenDocument Presentation");
+ private static final AllowableValue EXPORT_PNG = new AllowableValue("image/png", "PNG (first slide only)");
+ private static final AllowableValue EXPORT_JPEG = new AllowableValue("image/jpeg", "JPEG (first slide only)");
+ private static final AllowableValue EXPORT_SVG = new AllowableValue("image/svg+xml", "SVG (first slide only)",
+ "Scalable Vector Graphics. Only the first slide will be exported.");
+
+ // Drawings Export Types
+ private static final AllowableValue EXPORT_PNG_DRAWING = new AllowableValue("image/png", "PNG");
+ private static final AllowableValue EXPORT_JPEG_DRAWING = new AllowableValue("image/jpeg", "JPEG");
+ private static final AllowableValue EXPORT_SVG_DRAWING = new AllowableValue("image/svg+xml", "SVG");
+
+ private static final Map<String, String> fileExtensions = new HashMap<>();
+ static {
+ fileExtensions.put("application/vnd.openxmlformats-officedocument.wordprocessingml.document", ".docx");
Review Comment:
```suggestion
fileExtensions.put(EXPORT_MS_WORD.getValue(), ".docx");
```
Is it worth using the MIME Type strings from the `AllowableValues`, rather than duplicating the hardcoded String - more likely to ensure consistency and prevent future maintenance headaches
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nifi] markap14 commented on a diff in pull request #7575: NIFI-11911: Support Export API for Google Docs, Presentations, Spread…
Posted by "markap14 (via GitHub)" <gi...@apache.org>.
markap14 commented on code in PR #7575:
URL: https://github.com/apache/nifi/pull/7575#discussion_r1284553535
##########
nifi-nar-bundles/nifi-gcp-bundle/nifi-gcp-processors/src/main/java/org/apache/nifi/processors/gcp/drive/FetchGoogleDrive.java:
##########
@@ -80,6 +84,62 @@
})
public class FetchGoogleDrive extends AbstractProcessor implements GoogleDriveTrait {
+ // Google Docs Export Types
+ private static final AllowableValue EXPORT_MS_WORD = new AllowableValue("application/vnd.openxmlformats-officedocument.wordprocessingml.document", "Microsoft Word");
+ private static final AllowableValue EXPORT_OPEN_DOCUMENT = new AllowableValue("application/vnd.oasis.opendocument.text", "OpenDocument");
+ private static final AllowableValue EXPORT_PDF = new AllowableValue("application/pdf", "PDF");
+ private static final AllowableValue EXPORT_RICH_TEXT = new AllowableValue("application/rtf", "Rich Text");
+ private static final AllowableValue EXPORT_EPUB = new AllowableValue("application/epub+zip", "EPUB");
+
+ // Shared Export Types
+ private static final AllowableValue EXPORT_HTML_DOC = new AllowableValue("application/zip", "Web Page (HTML)");
+ private static final AllowableValue EXPORT_PLAIN_TEXT = new AllowableValue("text/plain", "Plain Text");
+
+ // Google Spreadsheet Export Types
+ private static final AllowableValue EXPORT_MS_EXCEL = new AllowableValue("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "Microsoft Excel");
+ private static final AllowableValue EXPORT_OPEN_SPREADSHEET = new AllowableValue("application/x-vnd.oasis.opendocument.spreadsheet", "OpenDocument Spreadsheet");
+ private static final AllowableValue EXPORT_PDF_SPREADSHEET = new AllowableValue("application/pdf", "PDF");
+ private static final AllowableValue EXPORT_CSV = new AllowableValue("text/csv", "CSV (first sheet only)",
+ "Comma-separated values. Only the first sheet will be exported.");
+ private static final AllowableValue EXPORT_TSV = new AllowableValue("text/tab-separated-values", "TSV (first sheet only)",
+ "Tab-separate values. Only the first sheet will be exported.");
+ private static final AllowableValue EXPORT_HTML_SPREADSHEET = new AllowableValue("text/html", "Web Page (HTML)");
+
+ // Google Presentation Export Types
+ private static final AllowableValue EXPORT_MS_POWERPOINT = new AllowableValue("application/vnd.openxmlformats-officedocument.presentationml.presentation", "Microsoft PowerPoint");
+ private static final AllowableValue EXPORT_OPEN_PRESENTATION = new AllowableValue("application/vnd.oasis.opendocument.presentation", "OpenDocument Presentation");
+ private static final AllowableValue EXPORT_PNG = new AllowableValue("image/png", "PNG (first slide only)");
+ private static final AllowableValue EXPORT_JPEG = new AllowableValue("image/jpeg", "JPEG (first slide only)");
+ private static final AllowableValue EXPORT_SVG = new AllowableValue("image/svg+xml", "SVG (first slide only)",
+ "Scalable Vector Graphics. Only the first slide will be exported.");
+
+ // Drawings Export Types
+ private static final AllowableValue EXPORT_PNG_DRAWING = new AllowableValue("image/png", "PNG");
+ private static final AllowableValue EXPORT_JPEG_DRAWING = new AllowableValue("image/jpeg", "JPEG");
+ private static final AllowableValue EXPORT_SVG_DRAWING = new AllowableValue("image/svg+xml", "SVG");
+
+ private static final Map<String, String> fileExtensions = new HashMap<>();
+ static {
+ fileExtensions.put("application/vnd.openxmlformats-officedocument.wordprocessingml.document", ".docx");
Review Comment:
Thanks @ChrisSamo632 , that's a good call. Pushed an update to handle that.
@exceptionfactory I did look at an `enum` but ultimately didn't go that route simply because several of the values are shared both multiple properties. For example, 3 of the types I think support `text/plain` as well as `pdf`. Two also support HTML and 2 support png/jpeg, etc.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nifi] exceptionfactory commented on a diff in pull request #7575: NIFI-11911: Support Export API for Google Docs, Presentations, Spread…
Posted by "exceptionfactory (via GitHub)" <gi...@apache.org>.
exceptionfactory commented on code in PR #7575:
URL: https://github.com/apache/nifi/pull/7575#discussion_r1284463438
##########
nifi-nar-bundles/nifi-gcp-bundle/nifi-gcp-processors/src/main/java/org/apache/nifi/processors/gcp/drive/FetchGoogleDrive.java:
##########
@@ -80,6 +84,62 @@
})
public class FetchGoogleDrive extends AbstractProcessor implements GoogleDriveTrait {
+ // Google Docs Export Types
+ private static final AllowableValue EXPORT_MS_WORD = new AllowableValue("application/vnd.openxmlformats-officedocument.wordprocessingml.document", "Microsoft Word");
+ private static final AllowableValue EXPORT_OPEN_DOCUMENT = new AllowableValue("application/vnd.oasis.opendocument.text", "OpenDocument");
+ private static final AllowableValue EXPORT_PDF = new AllowableValue("application/pdf", "PDF");
+ private static final AllowableValue EXPORT_RICH_TEXT = new AllowableValue("application/rtf", "Rich Text");
+ private static final AllowableValue EXPORT_EPUB = new AllowableValue("application/epub+zip", "EPUB");
+
+ // Shared Export Types
+ private static final AllowableValue EXPORT_HTML_DOC = new AllowableValue("application/zip", "Web Page (HTML)");
+ private static final AllowableValue EXPORT_PLAIN_TEXT = new AllowableValue("text/plain", "Plain Text");
+
+ // Google Spreadsheet Export Types
+ private static final AllowableValue EXPORT_MS_EXCEL = new AllowableValue("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "Microsoft Excel");
+ private static final AllowableValue EXPORT_OPEN_SPREADSHEET = new AllowableValue("application/x-vnd.oasis.opendocument.spreadsheet", "OpenDocument Spreadsheet");
+ private static final AllowableValue EXPORT_PDF_SPREADSHEET = new AllowableValue("application/pdf", "PDF");
+ private static final AllowableValue EXPORT_CSV = new AllowableValue("text/csv", "CSV (first sheet only)",
+ "Comma-separated values. Only the first sheet will be exported.");
+ private static final AllowableValue EXPORT_TSV = new AllowableValue("text/tab-separated-values", "TSV (first sheet only)",
+ "Tab-separate values. Only the first sheet will be exported.");
+ private static final AllowableValue EXPORT_HTML_SPREADSHEET = new AllowableValue("text/html", "Web Page (HTML)");
+
+ // Google Presentation Export Types
+ private static final AllowableValue EXPORT_MS_POWERPOINT = new AllowableValue("application/vnd.openxmlformats-officedocument.presentationml.presentation", "Microsoft PowerPoint");
+ private static final AllowableValue EXPORT_OPEN_PRESENTATION = new AllowableValue("application/vnd.oasis.opendocument.presentation", "OpenDocument Presentation");
+ private static final AllowableValue EXPORT_PNG = new AllowableValue("image/png", "PNG (first slide only)");
+ private static final AllowableValue EXPORT_JPEG = new AllowableValue("image/jpeg", "JPEG (first slide only)");
+ private static final AllowableValue EXPORT_SVG = new AllowableValue("image/svg+xml", "SVG (first slide only)",
+ "Scalable Vector Graphics. Only the first slide will be exported.");
+
+ // Drawings Export Types
+ private static final AllowableValue EXPORT_PNG_DRAWING = new AllowableValue("image/png", "PNG");
+ private static final AllowableValue EXPORT_JPEG_DRAWING = new AllowableValue("image/jpeg", "JPEG");
+ private static final AllowableValue EXPORT_SVG_DRAWING = new AllowableValue("image/svg+xml", "SVG");
+
+ private static final Map<String, String> fileExtensions = new HashMap<>();
+ static {
+ fileExtensions.put("application/vnd.openxmlformats-officedocument.wordprocessingml.document", ".docx");
Review Comment:
Related to this point, it might be more efficient to use an `enum` that implements `DescribedValue` to define the allowed values, and then all properties could be kept together.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nifi] exceptionfactory closed pull request #7575: NIFI-11911: Support Export API for Google Docs, Presentations, Spread…
Posted by "exceptionfactory (via GitHub)" <gi...@apache.org>.
exceptionfactory closed pull request #7575: NIFI-11911: Support Export API for Google Docs, Presentations, Spread…
URL: https://github.com/apache/nifi/pull/7575
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org