acs-aem-tools
acs-aem-tools copied to clipboard
CSV importer enhancement to enable to users to upload a consolidated …
Hi @justinedelson @davidjgonzalez ,
Hi,
At present the CSV importer doesn't support bulk asset upload from a system other than the one on which AEM instance is running.
We have been receiving many requests from the customers for enabling their respective business teams to do bulk upload of images in an archive format along with the metadata.
We have made some enhancements to the CSV importer tool to incorporate the aforesaid feature.
Kindly allow me to commit the changes.
Regards, Namit
Please do not make unrelated formatting changes. That makes it very difficult to see what is actually being changed as part of this request.
At present the CSV importer doesn't support bulk asset upload from a system other than the one on which AEM instance is running.
FWIW, this statement is incorrect. The only requirement is that the files must be accessible from the AEM system. This could be on a shared file server. Theoretically, the CSV importer could also be enhanced to support, for example, FTP or S3 URLs.
@justinedelson
Apologies!
I have reverted the formatting changes.
Please review now.
i tested this with open jdk n oracle jdk on windows, mac n centOS.
however, i can incorporate the suggested changes in case there are specific failure scenarios.
On May 9, 2017 8:36 PM, "justinedelson" [email protected] wrote:
@justinedelson commented on this pull request.
In bundle/src/main/java/com/adobe/acs/tools/csv_asset_importer/impl/ CsvAssetImporterServlet.java https://github.com/Adobe-Consulting-Services/acs-aem-tools/pull/189#discussion_r115514299 :
@@ -89,8 +89,30 @@ protected final void doPost(final SlingHttpServletRequest request, final SlingHt final Parameters params = new Parameters(request); if (params.getFile() != null) {
-
final long start = System.currentTimeMillis();
-
final Iterator<String[]> rows = this.getRowsFromCsv(params);
-
Iterator<String[]> rows = null;
-
final long start = System.currentTimeMillis();
-
String inFileMimeType = params.getInFileMimeType();
-
final String tempDir = System.getProperty("java.io.tmpdir") + start;
I'm not sure that java.io.tmpdir is guaranteed to end in a slash. It seems like it would be better to do something like:
final File tmpDir = new File(FileUtils.getTempDirectory(), "acs-tools-csv-importer-" + start); tmpDir.mkdir();
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Adobe-Consulting-Services/acs-aem-tools/pull/189#pullrequestreview-37058250, or mute the thread https://github.com/notifications/unsubscribe-auth/ACClss7CeK-7ORClPhXhZ34hUOSBbMLLks5r4ID3gaJpZM4NVWVM .
Hi @justinedelson
Incorporated review comments:
-
java.io.tmpdir is not guaranteed to end with slash: fixed.
-
Formatting issue: Fixed
-
Temp files not removed: fixed.
-
Rename getInFileMimeType() : fixed.
5.missing license header in UnzipUtility.java: fixed.
-
remove boilerplate code from unzipUtility.java: fixed.
-
pick first file in the zip as the import seed file: I have not fixed this as the idea behind this is to impose a standard zip structure.
-
embed https://github.com/zeroturnaround/zt-zip for unzipping function: This library has got a lot of code which is not needed in our case. Therefore, we should stick with the UnzipUtility.java.