Skip to content

Commit 4b7acd0

Browse files
authored
Issue 47818 : export options to containing metadata only (#108)
1 parent 65a2e34 commit 4b7acd0

File tree

2 files changed

+68
-16
lines changed

2 files changed

+68
-16
lines changed

src/org/labkey/trialshare/TrialShareController.java

Lines changed: 67 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,18 @@ public static class TrialShareExportForm
106106
private boolean webpartPropertiesAndLayout;
107107
private boolean containerSpecificModuleProperties;
108108
private boolean roleAssignmentsForUsersAndGroups;
109-
private boolean lists;
109+
private boolean listDesigns;
110+
private boolean listData;
110111
private boolean queries;
111112
private boolean gridViews;
112113
private boolean reportsAndCharts;
113114
private boolean externalSchemaDefinitions;
114115
private boolean wikisAndTheirAttachments;
115116
private boolean notificationSettings;
116-
private boolean sampleTypesAndDataClasses;
117+
private boolean sampleTypeDesigns;
118+
private boolean sampleTypeData;
119+
private boolean dataClassDesigns;
120+
private boolean dataClassData;
117121
private boolean inventoryLocationsAndItems;
118122
private boolean experimentsAndRuns;
119123

@@ -347,14 +351,24 @@ public void setRoleAssignmentsForUsersAndGroups(boolean roleAssignmentsForUsersA
347351
this.roleAssignmentsForUsersAndGroups = roleAssignmentsForUsersAndGroups;
348352
}
349353

350-
public boolean getLists()
354+
public boolean isListDesigns()
351355
{
352-
return lists;
356+
return listDesigns;
353357
}
354358

355-
public void setLists(boolean lists)
359+
public void setListDesigns(boolean listDesigns)
356360
{
357-
this.lists = lists;
361+
this.listDesigns = listDesigns;
362+
}
363+
364+
public boolean isListData()
365+
{
366+
return listData;
367+
}
368+
369+
public void setListData(boolean listData)
370+
{
371+
this.listData = listData;
358372
}
359373

360374
public boolean getQueries()
@@ -417,14 +431,44 @@ public void setNotificationSettings(boolean notificationSettings)
417431
this.notificationSettings = notificationSettings;
418432
}
419433

420-
public boolean getSampleTypesAndDataClasses()
434+
public boolean getSampleTypeDesigns()
435+
{
436+
return sampleTypeDesigns;
437+
}
438+
439+
public void setSampleTypeDesigns(boolean sampleTypeDesigns)
440+
{
441+
this.sampleTypeDesigns = sampleTypeDesigns;
442+
}
443+
444+
public boolean getSampleTypeData()
445+
{
446+
return sampleTypeData;
447+
}
448+
449+
public void setSampleTypeData(boolean sampleTypeData)
450+
{
451+
this.sampleTypeData = sampleTypeData;
452+
}
453+
454+
public boolean getDataClassDesigns()
455+
{
456+
return dataClassDesigns;
457+
}
458+
459+
public void setDataClassDesigns(boolean dataClassDesigns)
460+
{
461+
this.dataClassDesigns = dataClassDesigns;
462+
}
463+
464+
public boolean getDataClassData()
421465
{
422-
return sampleTypesAndDataClasses;
466+
return dataClassData;
423467
}
424468

425-
public void setSampleTypesAndDataClasses(boolean sampleTypesAndDataClasses)
469+
public void setDataClassData(boolean dataClassData)
426470
{
427-
this.sampleTypesAndDataClasses = sampleTypesAndDataClasses;
471+
this.dataClassData = dataClassData;
428472
}
429473

430474
public boolean getInventoryLocationsAndItems()
@@ -547,10 +591,14 @@ private static Set<FolderDataTypes> getDefaultExportDataTypes()
547591
FolderDataTypes.reportsAndCharts,
548592
FolderDataTypes.externalSchemaDefinitions,
549593
FolderDataTypes.etlDefinitions,
550-
FolderDataTypes.lists,
594+
FolderDataTypes.listDesigns,
595+
FolderDataTypes.listData,
551596
FolderDataTypes.wikisAndAttachments,
552597
FolderDataTypes.notificationSettings,
553-
FolderDataTypes.sampleTypesAndDataClasses,
598+
FolderDataTypes.sampleTypeDesigns,
599+
FolderDataTypes.sampleTypeData,
600+
FolderDataTypes.dataClassDesigns,
601+
FolderDataTypes.dataClassData,
554602
FolderDataTypes.inventoryLocationsAndItems,
555603
FolderDataTypes.experiments
556604
);
@@ -584,14 +632,18 @@ enum FolderDataTypes
584632
webpartProperties("Webpart properties and layout", TrialShareExportForm::getWebpartPropertiesAndLayout),
585633
moduleProperties("Container specific module properties", TrialShareExportForm::getContainerSpecificModuleProperties),
586634
roleAssignments("Role assignments for users and groups", TrialShareExportForm::getRoleAssignmentsForUsersAndGroups),
587-
lists("Lists", TrialShareExportForm::getLists),
635+
listDesigns("List Designs", TrialShareExportForm::isListDesigns),
636+
listData("List Data", TrialShareExportForm::isListData),
588637
queries("Queries", TrialShareExportForm::getQueries),
589638
gridViews("Grid Views", TrialShareExportForm::getGridViews),
590639
reportsAndCharts("Reports and Charts", TrialShareExportForm::getReportsAndCharts),
591640
externalSchemaDefinitions("External schema definitions", TrialShareExportForm::getExternalSchemaDefinitions),
592641
wikisAndAttachments("Wikis and their attachments", TrialShareExportForm::getWikisAndTheirAttachments),
593642
notificationSettings("Notification settings", TrialShareExportForm::getNotificationSettings),
594-
sampleTypesAndDataClasses("Sample Types and Data Classes", TrialShareExportForm::getSampleTypesAndDataClasses),
643+
sampleTypeDesigns("Sample Type Designs", TrialShareExportForm::getSampleTypeDesigns),
644+
sampleTypeData("Sample Type Data", TrialShareExportForm::getSampleTypeData),
645+
dataClassDesigns("Data Class Designs", TrialShareExportForm::getDataClassDesigns),
646+
dataClassData("Data Class Data", TrialShareExportForm::getDataClassData),
595647
inventoryLocationsAndItems("Inventory locations and items", TrialShareExportForm::getInventoryLocationsAndItems),
596648
experiments("Experiments, Protocols, and Runs", TrialShareExportForm::getExperimentsAndRuns);
597649

@@ -667,7 +719,7 @@ public Set<String> getRegisteredDataTypes(boolean onlyDefault)
667719
Set<String> dataTypes = new HashSet<>();
668720
Set<FolderWriter> filteredFolderWriters;
669721
if (onlyDefault)
670-
filteredFolderWriters = folderWriters.stream().filter(fw -> fw.selectedByDefault(ExportType.ALL)).collect(Collectors.toSet());
722+
filteredFolderWriters = folderWriters.stream().filter(fw -> fw.selectedByDefault(ExportType.ALL, false)).collect(Collectors.toSet());
671723
else
672724
filteredFolderWriters = new HashSet<>(folderWriters);
673725

test/src/org/labkey/test/tests/trialshare/TrialShareExportTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public void testTrialShareExportActionDefault() throws Exception
4545
goToModule("FileContent");
4646
_fileBrowserHelper.selectFileBrowserItem("/export/folder.xml");
4747
List<String> fileList = _fileBrowserHelper.getFileList();
48-
List<String> expectedFiles = Arrays.asList("etls", "inventory", "sample-types", "wikis", "xar", "data_states.xml", "folder.xml", "pages.xml");
48+
List<String> expectedFiles = Arrays.asList("data-classes", "etls", "inventory", "sample-types", "wikis", "xar", "data_states.xml", "folder.xml", "pages.xml");
4949
assertEquals("Default export should include several folder objects", expectedFiles, fileList);
5050
}
5151

0 commit comments

Comments
 (0)