Last active
July 26, 2022 16:50
-
-
Save Bwilliamson55/cc07e64387ec725e7f152ee0ae60a198 to your computer and use it in GitHub Desktop.
PlantUML class and activity diagram for Custom Magento 2 Export Model
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@startuml | |
'*********** | |
'play around with this via https://www.planttext.com/ | |
'*********** | |
!theme reddress-darkgreen | |
skinparam pageMargin 0 | |
package CustomModule { | |
class CustomExportModel { | |
-attributeCollectionProvider | |
+getAttributeCollection() | |
+export() | |
} | |
object KeyClasses #Grey { | |
AttributeCollectionProvider | |
-- | |
EntityCollectionFactory | |
} | |
package Filters {} | |
package etc { | |
class di_xml { | |
FilterProcessorAggregator_Arguments | |
Optional Preference to modify the core export model | |
} | |
class export_xml { | |
Declare entity model | |
Declare fileFormats | |
} | |
} | |
} | |
package Exporter_Module { | |
class CoreExportModel_Override { | |
+export() | |
} | |
note bottom of CoreExportModel_Override | |
To drive our logic for custom 'FileFormats' | |
Such as json being sent to a restClient | |
end note | |
package Service { | |
Class RestService | |
} | |
package Model\Export { | |
Class CronExport | |
package Adapter { | |
class json { | |
#_jsonData | |
+writeRow() | |
+getContentType() | |
+getFileExtension() | |
+setHeaderCols() | |
+getContents() | |
} | |
} | |
json <--> CustomExportModel #text:blue : FileFormat $_writer \n aka adapter | |
} | |
CronExport -> CoreExportModel_Override | |
RestService <--> CoreExportModel_Override | |
} | |
package Magento_framework_Filesystem { | |
namespace Driver { | |
Class Driver.File{} | |
Class Http{} | |
Class Https{} | |
Class Zlib{} | |
} | |
namespace Io { | |
Class File{} | |
Class Ftp{} | |
Class Sftp{} | |
} | |
} | |
package Magento_ImportExport { | |
namespace Controllers { | |
class GetFilter { | |
} | |
class Export { | |
#publish() | |
} | |
} | |
package Models { | |
class Consumer { | |
#writeFile() | |
} | |
class ExportManagement { | |
} | |
class CoreExportModel { | |
+export() | |
} | |
} | |
package Adminhtml { | |
class export_form_before_phtml { | |
+JSajax() | |
} | |
class ExportGui { | |
+AttributeGrid | |
+Continue_Submit_Button | |
} | |
} | |
} | |
package Magento_ScheduledImportExport { | |
class ExportModel { | |
+runSchedule() | |
} | |
} | |
Package RabbitMQ <<Database>> { | |
class async_all | |
} | |
'Directives | |
'------------------- | |
hide empty members | |
' Activities | |
'--------------------------------------------------------------------------------- | |
ExportModel::runSchedule --> CoreExportModel_Override::export | |
export_form_before_phtml::JSajax <--> Controllers.GetFilter | |
Controllers.GetFilter <--> CustomExportModel::getAttributeCollection | |
ExportGui::Continue_Submit_Button -> Controllers.Export : <($attributeCollection, $_params) | |
export_form_before_phtml -> ExportGui::AttributeGrid | |
note top of export_form_before_phtml | |
Custom attribute collection fetched | |
creates the attributeGrid and thus | |
the filters form for export | |
end note | |
Controllers.Export --> RabbitMQ | |
RabbitMQ -> Consumer | |
note on link | |
queue consumer name is | |
<b>exportProcessor</b> | |
end note | |
Consumer <-> ExportManagement | |
ExportManagement <-> CoreExportModel_Override | |
CoreExportModel_Override <-> CustomExportModel::export | |
Consumer::writeFile -> Io | |
Io -- Driver | |
@enduml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment