added code to sort custom fields before publishing products
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-catalogue/ckan-util-library@139746 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
305b470532
commit
0ccf090e14
|
@ -14,6 +14,8 @@ import java.sql.PreparedStatement;
|
|||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
|
@ -819,6 +821,14 @@ public class DataCatalogueImpl implements DataCatalogue{
|
|||
}
|
||||
}
|
||||
|
||||
// sort them
|
||||
Collections.sort(extras, new Comparator<CkanPair>() {
|
||||
@Override public int compare(CkanPair b1, CkanPair b2) {
|
||||
return b1.getKey().compareTo(b2.getKey());
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
dataset.setExtras(extras);
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue