Skip to content

Commit c3e16c6

Browse files
Export DataObject and BusinessObject in full export feature (UI)
Fix #145
1 parent 27aea10 commit c3e16c6

File tree

4 files changed

+58
-41
lines changed

4 files changed

+58
-41
lines changed

src/main/java/com/mauvaisetroupe/eadesignit/service/importfile/ExportFullDataService.java

+46-41
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,11 @@ public ByteArrayOutputStream getallData(
6666
) throws IOException {
6767
Workbook workbook = new XSSFWorkbook();
6868
Sheet summarySheet = workbook.createSheet(SummaryImporterService.SUMMARY_SHEET);
69-
Sheet appliSheet = workbook.createSheet(ApplicationImportService.APPLICATION_SHEET_NAME);
70-
Sheet componentSheet = workbook.createSheet(ComponentImportService.COMPONENT_SHEET_NAME);
71-
Sheet ownerSheet = workbook.createSheet(ApplicationImportService.OWNER_SHEET_NAME);
72-
Sheet externalSystemSheet = workbook.createSheet(ExternalSystemImportService.SHEET_NAME);
73-
Sheet capabilitiesSheet = workbook.createSheet(CapabilityImportService.CAPABILITY_SHEET_NAME);
74-
Sheet businessObjectsSheet = workbook.createSheet(DataObjectImportService.DATA_OBJECT_SHEET_NAME);
69+
70+
Sheet appliSheet = null;
71+
Sheet componentSheet = null;
72+
Sheet ownerSheet = null;
73+
Sheet externalSystemSheet = null;
7574

7675
int lineNb = 0;
7776
int nbcolumn = 0;
@@ -83,36 +82,32 @@ public ByteArrayOutputStream getallData(
8382

8483
// External Systems
8584
if (exportExternalSystem) {
85+
externalSystemSheet = workbook.createSheet(ExternalSystemImportService.SHEET_NAME);
8686
externalSystemExportService.writeExternalSytemSheet(externalSystemSheet, workbook);
8787
ExcelUtils.autoSizeAllColumns(externalSystemSheet);
8888
ExcelUtils.addHeaderColorAndFilte(workbook, externalSystemSheet);
8989
}
9090

9191
// Application, ApplicationComponent, Owner & ExternalSystem
9292
if (exportApplications) {
93+
appliSheet = workbook.createSheet(ApplicationImportService.APPLICATION_SHEET_NAME);
9394
applicationExportService.writeApplication(appliSheet);
9495
ExcelUtils.autoSizeAllColumns(appliSheet);
9596
ExcelUtils.addHeaderColorAndFilte(workbook, appliSheet);
9697
}
9798
if (exportComponents) {
99+
componentSheet = workbook.createSheet(ComponentImportService.COMPONENT_SHEET_NAME);
98100
applicationExportService.writeComponent(componentSheet);
99101
ExcelUtils.autoSizeAllColumns(componentSheet);
100102
ExcelUtils.addHeaderColorAndFilte(workbook, componentSheet);
101103
}
102104
if (exportOwner) {
105+
ownerSheet = workbook.createSheet(ApplicationImportService.OWNER_SHEET_NAME);
103106
applicationExportService.writeOwner(ownerSheet);
104107
ExcelUtils.autoSizeAllColumns(ownerSheet);
105108
ExcelUtils.addHeaderColorAndFilte(workbook, ownerSheet);
106109
}
107-
addApplicationSummary(
108-
workbook,
109-
summarySheet,
110-
appliSheet.getSheetName(),
111-
componentSheet.getSheetName(),
112-
ownerSheet.getSheetName(),
113-
externalSystemSheet.getSheetName(),
114-
lineNb
115-
);
110+
addApplicationSummary(workbook, summarySheet, appliSheet, componentSheet, ownerSheet, externalSystemSheet, lineNb);
116111
lineNb += 4;
117112

118113
// Landcsacpes
@@ -147,6 +142,7 @@ public ByteArrayOutputStream getallData(
147142

148143
// Capabilities
149144
if (exportCapabilities) {
145+
Sheet capabilitiesSheet = workbook.createSheet(CapabilityImportService.CAPABILITY_SHEET_NAME);
150146
capabilityExportService.writeCapabilities(capabilitiesSheet, workbook);
151147
ExcelUtils.autoSizeAllColumns(capabilitiesSheet);
152148
ExcelUtils.addHeaderColorAndFilte(workbook, capabilitiesSheet);
@@ -164,6 +160,7 @@ public ByteArrayOutputStream getallData(
164160

165161
// Business and Data Objects
166162
if (businessAndDataObjects) {
163+
Sheet businessObjectsSheet = workbook.createSheet(DataObjectImportService.DATA_OBJECT_SHEET_NAME);
167164
addBusinessAndDataObjectsSummary(workbook, summarySheet, businessObjectsSheet.getSheetName(), lineNb);
168165
businessAndDataObjectExportService.writeDatObjects(businessObjectsSheet);
169166
ExcelUtils.autoSizeAllColumns(businessObjectsSheet);
@@ -185,35 +182,43 @@ public ByteArrayOutputStream getallData(
185182
private void addApplicationSummary(
186183
Workbook workbook,
187184
Sheet summarySheet,
188-
String appSheet,
189-
String componentSheet,
190-
String ownerSheet,
191-
String externalSystemSheet,
185+
Sheet appSheet,
186+
Sheet componentSheet,
187+
Sheet ownerSheet,
188+
Sheet externalSystemSheet,
192189
int lineNb
193190
) {
194-
Row row = summarySheet.createRow(lineNb++);
195191
int columnNb = 0;
196-
row.createCell(columnNb++).setCellValue("Application");
197-
Cell cell = row.createCell(columnNb++);
198-
createHyperlink(workbook, appSheet, cell);
199-
200-
row = summarySheet.createRow(lineNb++);
201-
columnNb = 0;
202-
row.createCell(columnNb++).setCellValue("Application Component");
203-
cell = row.createCell(columnNb++);
204-
createHyperlink(workbook, componentSheet, cell);
205-
206-
row = summarySheet.createRow(lineNb++);
207-
columnNb = 0;
208-
row.createCell(columnNb++).setCellValue("Owner");
209-
cell = row.createCell(columnNb++);
210-
createHyperlink(workbook, ownerSheet, cell);
211-
212-
row = summarySheet.createRow(lineNb++);
213-
columnNb = 0;
214-
row.createCell(columnNb++).setCellValue("ExternalSystem");
215-
cell = row.createCell(columnNb++);
216-
createHyperlink(workbook, externalSystemSheet, cell);
192+
if (appSheet != null) {
193+
Row row = summarySheet.createRow(lineNb++);
194+
row.createCell(columnNb++).setCellValue("Application");
195+
Cell cell = row.createCell(columnNb++);
196+
createHyperlink(workbook, appSheet.getSheetName(), cell);
197+
}
198+
199+
if (componentSheet != null) {
200+
Row row = summarySheet.createRow(lineNb++);
201+
columnNb = 0;
202+
row.createCell(columnNb++).setCellValue("Application Component");
203+
Cell cell = row.createCell(columnNb++);
204+
createHyperlink(workbook, componentSheet.getSheetName(), cell);
205+
}
206+
207+
if (ownerSheet != null) {
208+
Row row = summarySheet.createRow(lineNb++);
209+
columnNb = 0;
210+
row.createCell(columnNb++).setCellValue("Owner");
211+
Cell cell = row.createCell(columnNb++);
212+
createHyperlink(workbook, ownerSheet.getSheetName(), cell);
213+
}
214+
215+
if (externalSystemSheet != null) {
216+
Row row = summarySheet.createRow(lineNb++);
217+
columnNb = 0;
218+
row.createCell(columnNb++).setCellValue("ExternalSystem");
219+
Cell cell = row.createCell(columnNb++);
220+
createHyperlink(workbook, externalSystemSheet.getSheetName(), cell);
221+
}
217222
}
218223

219224
private void addSummryFlow(Workbook workbook, Sheet summarySheet, LandscapeView landscape, String flowSheetName, int lineNb) {

src/main/webapp/app/eadesignit/full-export/full-export.component.ts

+3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export default defineComponent({
3030
const capabilitiesMappingWithNoLandscape = ref(true);
3131
const functionalFlowsWhithNoLandscape = ref(true);
3232
const submited = ref(false);
33+
const businessAndDataObjects = ref(true);
3334

3435
onMounted(async () => {
3536
await retrieveAllLandscapeViews();
@@ -93,6 +94,7 @@ export default defineComponent({
9394
checkedCapabilitiesMapping.value.map(l => l.id),
9495
capabilitiesMappingWithNoLandscape.value,
9596
functionalFlowsWhithNoLandscape.value,
97+
businessAndDataObjects.value,
9698
)
9799
.then(
98100
response => {
@@ -137,6 +139,7 @@ export default defineComponent({
137139
selectNoMapping,
138140
checkCapa,
139141
exportExcel,
142+
businessAndDataObjects,
140143
};
141144
},
142145
});

src/main/webapp/app/eadesignit/full-export/full-export.service.ts

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export default class FullExportService {
1414
capabilitiesMapping: number[],
1515
capabilitiesMappingWithNoLandscape: boolean,
1616
functionalFlowsWhithNoLandscape: boolean,
17+
businessAndDataObjects: boolean,
1718
): Promise<any> {
1819
return new Promise<any>((resolve, reject) => {
1920
axios
@@ -29,6 +30,7 @@ export default class FullExportService {
2930
capabilitiesMapping: capabilitiesMapping,
3031
capabilitiesMappingWithNoLandscape: capabilitiesMappingWithNoLandscape,
3132
functionalFlowsWhithNoLandscape: functionalFlowsWhithNoLandscape,
33+
businessAndDataObjects: businessAndDataObjects,
3234
},
3335
})
3436
.then(res => {

src/main/webapp/app/eadesignit/full-export/full-export.vue

+7
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@
4343
<label>Capabilities</label>
4444
</div>
4545
</div>
46+
<h3>Business & Data Objects</h3>
47+
<div class="row m-3">
48+
<div class="col-4">
49+
<input type="checkbox" v-model="businessAndDataObjects" />
50+
<label>Business & Data Objects</label>
51+
</div>
52+
</div>
4653
<div>
4754
<h3>Capabilities In Landscape</h3>
4855
[<a @click="selectAllMapping">Select All</a>] [<a @click="selectNoMapping">Select None</a>]

0 commit comments

Comments
 (0)