-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Templates] Use ES6 imports instead of require (#4282)
- Loading branch information
Showing
91 changed files
with
684 additions
and
595 deletions.
There are no files selected for viewing
45 changes: 21 additions & 24 deletions
45
components/api/api-http/src/test/resources/META-INF/dirigible/http-tests/upload.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,24 @@ | ||
import { Request, Response, Upload } from "sdk/http"; | ||
|
||
var upload = require('http/upload'); | ||
var request = require('http/request'); | ||
var response = require('http/response'); | ||
|
||
if (request.getMethod() === "POST") { | ||
if (upload.isMultipartContent()) { | ||
var fileItems = upload.parseRequest(); | ||
for (i=0; i<fileItems.size(); i++) { | ||
var fileItem = fileItems.get(i); | ||
if (!fileItem.isFormField()) { | ||
response.println("File Name: " + fileItem.getName()); | ||
response.println("File Bytes (as text): " + String.fromCharCode.apply(null, fileItem.getBytes())); | ||
} else { | ||
response.println("Field Name: " + fileItem.getFieldName()); | ||
response.println("Field Text: " + fileItem.getText()); | ||
} | ||
} | ||
} else { | ||
response.println("The request's content must be 'multipart'"); | ||
} | ||
} else if (request.getMethod() === "GET") { | ||
response.println("Use POST request."); | ||
if (Request.getMethod() === "POST") { | ||
if (Upload.isMultipartContent()) { | ||
const fileItems = Upload.parseRequest(); | ||
for (let i = 0; i < fileItems.size(); i++) { | ||
var fileItem = fileItems.get(i); | ||
if (!fileItem.isEmpty()) { | ||
Response.println("File Name: " + fileItem.getName()); | ||
Response.println("File Bytes (as text): " + String.fromCharCode.apply(null, fileItem.getBytes())); | ||
} else { | ||
Response.println("Field Name: " + fileItem.getName()); | ||
Response.println("Field Text: " + fileItem.getText()); | ||
} | ||
} | ||
} else { | ||
Response.println("The request's content must be 'multipart'"); | ||
} | ||
} else if (Request.getMethod() === "GET") { | ||
Response.println("Use POST Request."); | ||
} | ||
|
||
response.flush(); | ||
response.close(); | ||
Response.flush(); | ||
Response.close(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 7 additions & 8 deletions
15
...ain/resources/META-INF/dirigible/ide-bpm-menu/services/workspace-menu-new-template-bpm.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.