[MGNLDMS-129] Zip-upload reverses order of files Created: 14/Jul/08  Updated: 28/Jul/15  Resolved: 28/Jul/15

Status: Closed
Project: Document Management System (closed)
Component/s: None
Affects Version/s: 1.5.3, 1.6.1
Fix Version/s: 1.x

Type: Bug Priority: Minor
Reporter: Will Scheidegger Assignee: Unassigned
Resolution: Won't Fix Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File mgnl446_unzippedFile.png     PNG File zipFile_local.png    
Issue Links:
relation
is related to MGNLUI-3538 Zip upload reverses the order of file... Closed
Template:
Acceptance criteria:
Empty
Date of First Response:

 Description   

When uploading a zip file to the DMS, the DMS reverses the order of the files when unpacking the Zip file. This is highly annoying when you upload a big number of files that need to be in a specific order because ordering them by hand takes a lot of time.



 Comments   
Comment by Magnolia International [ 10/Sep/08 ]

fixed in trunk, will be available with dms 1.2.6

Comment by Magnolia International [ 10/Sep/08 ]

This is actually caused by the ant zip classes that we use; the java.util.zip package does not show this behaviour. We're currently using the ant classes to circumvent an encoding issue with the sun implementation: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4244499
I quickly checked with ant-1.7.1 (we're using 1.6.5) and the order isn't better there (it seems to be either alphabetical or just plain random), so we should be careful when updating.
We could maybe consider alternatives like truezip: https://truezip.dev.java.net/

Comment by Antti Hietala [ 05/May/11 ]

This issue is not resolved. It still exists in Magnolia 4.4.2 and DMS 1.5.1.

Workaround is to reorder the nodes with a Groovy script. Here is an example of sorting alphabetically by name.

hm = MgnlContext.getHierarchyManager('dms')
parent = hm.getContent('/folderName')
children = ContentUtil.getAllChildren(parent)

children.sort([compare:{a,b-> b.getNodeData('name').string.compareTo(a.getNodeData('name').string) } ] as Comparator)

previous = null

children.each{ content ->
   if(previous)
   parent.orderBefore(content.name, previous.name)
   previous = content
}

hm.save()

Where:

  • /foldername is the path to the folder where the documents reside
  • name is the document property to sort by. Instead of name you could sort by title.
Comment by Natascha Desmarais [ 12/Jun/12 ]

This issue still persists with dms 1.5.3 (tested on Magnolia EE 4.4.6) and 1.6.1 (Magnolia EE 4.5.2)

Comment by Natascha Desmarais [ 12/Jun/12 ]

Like written in the reopening comment, this issue still seems to be there. I have just tested and verified this quickly locally on an EE 4.4.6 bundle (due to the customer report, since they are also running 4.4.6) and I also quickly tested it on our demo instance online which is running on 4.5.2. Always the same outcome, filenames are not ordered by name and neither creation date. Otherwise my files would have had to be ordered like this > 02, 03, 01 (oldest first/date ASC) or other way round.

Comment by Jan Haderka [ 24/Jul/12 ]

Fixing this issue would require update in used libraries, hence it can be fixed only for next major version of DMS.

Generated at Mon Feb 12 00:48:42 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.