Skip to content

Commit

Permalink
Issue 47818 : export options to containing metadata only (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
labkey-klum authored Jun 28, 2023
1 parent 65a2e34 commit 4b7acd0
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 16 deletions.
82 changes: 67 additions & 15 deletions src/org/labkey/trialshare/TrialShareController.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,18 @@ public static class TrialShareExportForm
private boolean webpartPropertiesAndLayout;
private boolean containerSpecificModuleProperties;
private boolean roleAssignmentsForUsersAndGroups;
private boolean lists;
private boolean listDesigns;
private boolean listData;
private boolean queries;
private boolean gridViews;
private boolean reportsAndCharts;
private boolean externalSchemaDefinitions;
private boolean wikisAndTheirAttachments;
private boolean notificationSettings;
private boolean sampleTypesAndDataClasses;
private boolean sampleTypeDesigns;
private boolean sampleTypeData;
private boolean dataClassDesigns;
private boolean dataClassData;
private boolean inventoryLocationsAndItems;
private boolean experimentsAndRuns;

Expand Down Expand Up @@ -347,14 +351,24 @@ public void setRoleAssignmentsForUsersAndGroups(boolean roleAssignmentsForUsersA
this.roleAssignmentsForUsersAndGroups = roleAssignmentsForUsersAndGroups;
}

public boolean getLists()
public boolean isListDesigns()
{
return lists;
return listDesigns;
}

public void setLists(boolean lists)
public void setListDesigns(boolean listDesigns)
{
this.lists = lists;
this.listDesigns = listDesigns;
}

public boolean isListData()
{
return listData;
}

public void setListData(boolean listData)
{
this.listData = listData;
}

public boolean getQueries()
Expand Down Expand Up @@ -417,14 +431,44 @@ public void setNotificationSettings(boolean notificationSettings)
this.notificationSettings = notificationSettings;
}

public boolean getSampleTypesAndDataClasses()
public boolean getSampleTypeDesigns()
{
return sampleTypeDesigns;
}

public void setSampleTypeDesigns(boolean sampleTypeDesigns)
{
this.sampleTypeDesigns = sampleTypeDesigns;
}

public boolean getSampleTypeData()
{
return sampleTypeData;
}

public void setSampleTypeData(boolean sampleTypeData)
{
this.sampleTypeData = sampleTypeData;
}

public boolean getDataClassDesigns()
{
return dataClassDesigns;
}

public void setDataClassDesigns(boolean dataClassDesigns)
{
this.dataClassDesigns = dataClassDesigns;
}

public boolean getDataClassData()
{
return sampleTypesAndDataClasses;
return dataClassData;
}

public void setSampleTypesAndDataClasses(boolean sampleTypesAndDataClasses)
public void setDataClassData(boolean dataClassData)
{
this.sampleTypesAndDataClasses = sampleTypesAndDataClasses;
this.dataClassData = dataClassData;
}

public boolean getInventoryLocationsAndItems()
Expand Down Expand Up @@ -547,10 +591,14 @@ private static Set<FolderDataTypes> getDefaultExportDataTypes()
FolderDataTypes.reportsAndCharts,
FolderDataTypes.externalSchemaDefinitions,
FolderDataTypes.etlDefinitions,
FolderDataTypes.lists,
FolderDataTypes.listDesigns,
FolderDataTypes.listData,
FolderDataTypes.wikisAndAttachments,
FolderDataTypes.notificationSettings,
FolderDataTypes.sampleTypesAndDataClasses,
FolderDataTypes.sampleTypeDesigns,
FolderDataTypes.sampleTypeData,
FolderDataTypes.dataClassDesigns,
FolderDataTypes.dataClassData,
FolderDataTypes.inventoryLocationsAndItems,
FolderDataTypes.experiments
);
Expand Down Expand Up @@ -584,14 +632,18 @@ enum FolderDataTypes
webpartProperties("Webpart properties and layout", TrialShareExportForm::getWebpartPropertiesAndLayout),
moduleProperties("Container specific module properties", TrialShareExportForm::getContainerSpecificModuleProperties),
roleAssignments("Role assignments for users and groups", TrialShareExportForm::getRoleAssignmentsForUsersAndGroups),
lists("Lists", TrialShareExportForm::getLists),
listDesigns("List Designs", TrialShareExportForm::isListDesigns),
listData("List Data", TrialShareExportForm::isListData),
queries("Queries", TrialShareExportForm::getQueries),
gridViews("Grid Views", TrialShareExportForm::getGridViews),
reportsAndCharts("Reports and Charts", TrialShareExportForm::getReportsAndCharts),
externalSchemaDefinitions("External schema definitions", TrialShareExportForm::getExternalSchemaDefinitions),
wikisAndAttachments("Wikis and their attachments", TrialShareExportForm::getWikisAndTheirAttachments),
notificationSettings("Notification settings", TrialShareExportForm::getNotificationSettings),
sampleTypesAndDataClasses("Sample Types and Data Classes", TrialShareExportForm::getSampleTypesAndDataClasses),
sampleTypeDesigns("Sample Type Designs", TrialShareExportForm::getSampleTypeDesigns),
sampleTypeData("Sample Type Data", TrialShareExportForm::getSampleTypeData),
dataClassDesigns("Data Class Designs", TrialShareExportForm::getDataClassDesigns),
dataClassData("Data Class Data", TrialShareExportForm::getDataClassData),
inventoryLocationsAndItems("Inventory locations and items", TrialShareExportForm::getInventoryLocationsAndItems),
experiments("Experiments, Protocols, and Runs", TrialShareExportForm::getExperimentsAndRuns);

Expand Down Expand Up @@ -667,7 +719,7 @@ public Set<String> getRegisteredDataTypes(boolean onlyDefault)
Set<String> dataTypes = new HashSet<>();
Set<FolderWriter> filteredFolderWriters;
if (onlyDefault)
filteredFolderWriters = folderWriters.stream().filter(fw -> fw.selectedByDefault(ExportType.ALL)).collect(Collectors.toSet());
filteredFolderWriters = folderWriters.stream().filter(fw -> fw.selectedByDefault(ExportType.ALL, false)).collect(Collectors.toSet());
else
filteredFolderWriters = new HashSet<>(folderWriters);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public void testTrialShareExportActionDefault() throws Exception
goToModule("FileContent");
_fileBrowserHelper.selectFileBrowserItem("/export/folder.xml");
List<String> fileList = _fileBrowserHelper.getFileList();
List<String> expectedFiles = Arrays.asList("etls", "inventory", "sample-types", "wikis", "xar", "data_states.xml", "folder.xml", "pages.xml");
List<String> expectedFiles = Arrays.asList("data-classes", "etls", "inventory", "sample-types", "wikis", "xar", "data_states.xml", "folder.xml", "pages.xml");
assertEquals("Default export should include several folder objects", expectedFiles, fileList);
}

Expand Down

0 comments on commit 4b7acd0

Please sign in to comment.