diff --git a/lib/Service/ArchiMateExportService.php b/lib/Service/ArchiMateExportService.php index 16c4ba94..c3018814 100644 --- a/lib/Service/ArchiMateExportService.php +++ b/lib/Service/ArchiMateExportService.php @@ -244,12 +244,14 @@ public function addRelationshipsToXml(\SimpleXMLElement $xml, array $relationshi */ public function addViewsToXml(\SimpleXMLElement $xml, array $views): void { - echo "ADDVIEWSTOXML CALLED WITH " . count($views) . " VIEWS\n"; - var_dump(array_keys($views)); + $this->logger->debug('Adding views to XML', [ + 'view_count' => count($views), + 'view_keys' => array_keys($views) + ]); if (empty($views)) { - echo "NO VIEWS TO PROCESS\n"; - die(); + $this->logger->warning('No views to process'); + return; } $folder = $xml->addChild('folder'); @@ -281,25 +283,25 @@ private function addViewToFolder(\SimpleXMLElement $folder, array $view): void $viewData = $this->extractViewData($view); if (!$viewData) { - echo "NO VALID VIEW DATA FOUND\n"; - var_dump(['view_keys' => array_keys($view), 'view' => $view]); - die(); + $this->logger->warning('No valid view data found', [ + 'view_keys' => array_keys($view), + 'view_structure' => $view + ]); + return; } // DEBUG: Check if this is our target view with nodes if (isset($viewData['_identifier']) && $viewData['_identifier'] === 'id-1c197dc3-71e5-40dc-8f5d-a96e983b41af') { - echo "FOUND TARGET VIEW WITH ID: id-1c197dc3-71e5-40dc-8f5d-a96e983b41af\n"; - echo "Raw view input:\n"; - var_dump($view); - echo "\nExtracted viewData:\n"; - var_dump($viewData); - echo "\nNode data check:\n"; - var_dump([ - 'has_node' => isset($viewData['node']), - 'node_count' => is_array($viewData['node'] ?? null) ? count($viewData['node']) : 0, - 'node_sample' => isset($viewData['node'][0]) ? $viewData['node'][0] : 'NO FIRST NODE' + $this->logger->debug('Found target view with specific ID', [ + 'identifier' => $viewData['_identifier'], + 'raw_view' => $view, + 'extracted_view_data' => $viewData, + 'node_analysis' => [ + 'has_node' => isset($viewData['node']), + 'node_count' => is_array($viewData['node'] ?? null) ? count($viewData['node']) : 0, + 'node_sample' => isset($viewData['node'][0]) ? $viewData['node'][0] : 'NO FIRST NODE' + ] ]); - die(); } $this->logger->debug('Processing view with custom logic', [ diff --git a/lib/Service/ArchiMateService.php b/lib/Service/ArchiMateService.php index 718c9f07..1b727e0b 100644 --- a/lib/Service/ArchiMateService.php +++ b/lib/Service/ArchiMateService.php @@ -1538,11 +1538,10 @@ private function cleanupMemory(): void { if (function_exists('gc_collect_cycles')) { $cycles = gc_collect_cycles(); - if ($this->logger->isDebug()) { - $this->logger->debug('Garbage collection completed', [ - 'cycles_collected' => $cycles - ]); - } + // Use PSR-3 standard logging instead of isDebug() check + $this->logger->debug('Garbage collection completed', [ + 'cycles_collected' => $cycles + ]); } } diff --git a/lib/Service/OrganisatieService.php b/lib/Service/OrganisatieService.php index c283f133..eeed4dd7 100644 --- a/lib/Service/OrganisatieService.php +++ b/lib/Service/OrganisatieService.php @@ -315,7 +315,11 @@ public function addUsersToOrganization(string $organizationUuid, array $username 'organizationUuid' => $organizationUuid, 'error' => $e->getMessage() ]); - var_dump($e->getMessage(), $e->getTraceAsString()); + // Log detailed error information using PSR-3 logger + $this->logger->error('OrganisatieService: Exception details', [ + 'message' => $e->getMessage(), + 'trace' => $e->getTraceAsString() + ]); return false; } } @@ -328,7 +332,7 @@ public function addUsersToOrganization(string $organizationUuid, array $username public function getAdminGroupUsernames(): array { try { - $groupManager = \OC::$server->get('OCP\IGroupManager'); + $groupManager = $this->container->get('OCP\IGroupManager'); $adminGroup = $groupManager->get('admin'); if ($adminGroup) { diff --git a/src/views/settings/sections/OpenRegisterIntegration.vue b/src/views/settings/sections/OpenRegisterIntegration.vue index 8d12cc3f..e1eaf5ad 100644 --- a/src/views/settings/sections/OpenRegisterIntegration.vue +++ b/src/views/settings/sections/OpenRegisterIntegration.vue @@ -60,8 +60,8 @@ @@ -121,6 +121,26 @@ + + +
+
+ + + {{ saving ? 'Saving...' : 'Save Voorzieningen Configuration' }} + +

+ Save your Voorzieningen schema configuration to enable organization and contact management. +

+
+
+
@@ -236,6 +256,26 @@
+ + +
+
+ + + {{ saving ? 'Saving...' : 'Save AMEF Configuration' }} + +

+ Save your AMEF schema configuration to enable ArchiMate import/export functionality. +

+
+
+
@@ -386,7 +426,16 @@ export default { * @return {boolean} True if configuration is valid and can be saved */ canSave() { - return this.voorzieningenRegister || this.amefRegister + // Check if any register is selected + const hasRegisters = this.voorzieningenRegister || this.amefRegister + + // Check if AMEF configuration has been modified + const amefConfigModified = this.hasAmefConfigChanges() + + // Check if Voorzieningen configuration has been modified + const voorzieningenConfigModified = this.hasVoorzieningenConfigChanges() + + return hasRegisters && (amefConfigModified || voorzieningenConfigModified) }, }, @@ -423,6 +472,67 @@ export default { this.store.validateConfiguration() }, + /** + * Check if AMEF configuration has been modified + * Compares current configuration with original values + * + * @return {boolean} True if AMEF configuration has changed + */ + hasAmefConfigChanges() { + if (!this.amefRegister) return false + + const amefKeys = [ + 'amef_elements', + 'amef_organization', + 'amef_relationships', + 'amef_views', + 'amef_models', + 'amef_properties', + 'amef_property_definitions', + ] + + return amefKeys.some(key => { + const config = this.configuration[key] + return config && config.schema && config.schema.value !== undefined + }) + }, + + /** + * Check if Voorzieningen configuration has been modified + * Compares current configuration with original values + * + * @return {boolean} True if Voorzieningen configuration has changed + */ + hasVoorzieningenConfigChanges() { + if (!this.voorzieningenRegister) return false + + const voorzieningenKeys = [ + 'voorzieningen_organisatie', + 'voorzieningen_contactpersoon', + 'voorzieningen_voorziening', + 'voorzieningen_voorziening_aanbod', + 'voorzieningen_voorziening_versie', + 'voorzieningen_kwetsbaarheid', + 'voorzieningen_contract', + 'voorzieningen_standaard', + 'voorzieningen_review', + 'voorzieningen_koppeling', + 'voorzieningen_beoordeeling', + 'voorzieningen_voorziening_module', + 'voorzieningen_verklaring', + 'voorzieningen_koppeling_gebruik', + 'voorzieningen_compliancy', + 'voorzieningen_module_gebruik', + 'voorzieningen_module_versie', + 'voorzieningen_sector', + ] + + return voorzieningenKeys.some(key => { + const config = this.configuration[key] + return config && config.schema && config.schema.value !== undefined + }) + }, + /** * Save configuration * Saves the current configuration to the backend @@ -527,6 +637,25 @@ export default { border-top: 1px solid var(--color-border); } +.amef-save-section { + margin-top: 24px; + padding: 20px; + border: 1px solid var(--color-border); + border-radius: var(--border-radius); + background-color: var(--color-background-hover); +} + +.save-button-container { + text-align: center; +} + +.save-help-text { + margin: 12px 0 0 0; + font-size: 14px; + color: var(--color-text-maxcontrast); + text-align: center; +} + .section-title-with-buttons { display: flex; align-items: center;