diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..0a54d90 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,67 @@ +kind: pipeline +type: docker +name: pipelinefordeveloppement + +trigger: + branch: + - developpement + - master + - upgradeclass + event: + - push + +steps: + - name: build + image: mcr.microsoft.com/dotnet/sdk:7.0 + commands: + - cd notus/ + - dotnet restore notus_without_maui.sln + - dotnet build notus_without_maui.sln -c Release --no-restore /p:AndroidSdkDirectory=$ANDROID_SDK_ROOT -property:Aapt2ToolPath=$ANDROID_SDK_ROOT/build-tools/33.0.0 + - dotnet publish notus_without_maui.sln -c Release --no-restore -o $CI_PROJECT_DIR/build/release + + - name: tests + image: mcr.microsoft.com/dotnet/sdk:7.0 + commands: + - cd notus/ + - dotnet restore notus_without_maui.sln + - dotnet test notus_without_maui.sln --no-restore + depends_on: [build] + + - name: sonar + image: hub.codefirst.iut.uca.fr/marc.chevaldonne/codefirst-dronesonarplugin-dotnet7 + secrets: [ Sonar_Login ] + environment: + sonar_host: https://codefirst.iut.uca.fr/sonar/ + sonar_token: + from_secret: Sonar_Login + project_key: notus_ThMo + coverage_exclusions: "Tests/**/**,Notus_Console/**" + commands: + - cd notus/ + - dotnet restore notus_without_maui.sln + - dotnet sonarscanner begin /k:$${project_key} /d:sonar.host.url=$${sonar_host} /d:sonar.coverageReportPaths="coveragereport/SonarQube.xml" /d:sonar.coverage.exclusions=$${coverage_exclusions} /d:sonar.login=$${sonar_token} + - dotnet build notus_without_maui.sln -c Release --no-restore + - dotnet test notus_without_maui.sln --logger trx --no-restore /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura --collect "XPlat Code Coverage" + - reportgenerator -reports:'**/coverage.cobertura.xml' -reporttypes:SonarQube -targetdir:"coveragereport" -verbosity:Verbose + - dotnet publish notus_without_maui.sln -c Release --no-restore -o CI_PROJECT_DIR/build/release + - dotnet sonarscanner end /d:sonar.login=$${sonar_token} + branch: + - developpement + depends_on: [build,tests] + + - name: generate-and-deploy-docs + image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-docdeployer + failure: ignore + volumes: + - name: docs + path: /docs + commands: + - /entrypoint.sh + when: + branch: + - master +# environment: +# NODOXYGEN: true +volumes: +- name: docs + temp: {} \ No newline at end of file diff --git a/README.md b/README.md index e69de29..9463188 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,12 @@ +[![Build Status](https://codefirst.iut.uca.fr/api/badges/matheo.thierry/notus/status.svg)](https://codefirst.iut.uca.fr/matheo.thierry/notus) +[![Quality Gate Status](https://codefirst.iut.uca.fr/sonar/api/project_badges/measure?project=notus_ThMo&metric=alert_status&token=f49680ff7f8cbaaa0872d836ad12346debbf5164)](https://codefirst.iut.uca.fr/sonar/dashboard?id=notus_ThMo) +[![Coverage](https://codefirst.iut.uca.fr/sonar/api/project_badges/measure?project=notus_ThMo&metric=coverage&token=f49680ff7f8cbaaa0872d836ad12346debbf5164)](https://codefirst.iut.uca.fr/sonar/dashboard?id=notus_ThMo) +[![Lines of Code](https://codefirst.iut.uca.fr/sonar/api/project_badges/measure?project=notus_ThMo&metric=ncloc&token=f49680ff7f8cbaaa0872d836ad12346debbf5164)](https://codefirst.iut.uca.fr/sonar/dashboard?id=notus_ThMo) + +# SAE 2.01 - Développement d'une application + +## Présentation + +Dans le cadre de la SAE, notre mission consiste à développer une application de prise de notes. Cette application sera un outil pratique pour les personnes qui cherchent à organiser leurs idées et leurs pensées. + +Notre application sera facile à utiliser et intuitive, avec une interface simple et épurée qui permettra à l'utilisateur de s'orienter facilement. Elle permettra de partager les notes avec d'autres utilisateurs et de les gérer avec des tags. L’application sera personnalisable grâce à la possibilité de choisir parmi plusieurs thèmes et logos fournis. Les utilisateurs pourront également créer leurs propres thèmes. \ No newline at end of file diff --git a/Uml_NotusApp.mdj b/Uml_NotusApp.mdj index 5c7f1bd..6ca54af 100644 --- a/Uml_NotusApp.mdj +++ b/Uml_NotusApp.mdj @@ -48,8 +48,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": -112, - "top": 768, + "left": -144, + "top": 656, "height": 13 }, { @@ -59,8 +59,8 @@ "$ref": "AAAAAAGHsxATrmDO80A=" }, "font": "Arial;13;1", - "left": 349, - "top": 695, + "left": 333, + "top": 639, "width": 158.93896484375, "height": 13, "text": "BaseData" @@ -73,8 +73,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": -112, - "top": 768, + "left": -144, + "top": 656, "width": 73.67724609375, "height": 13, "text": "(from Model)" @@ -87,15 +87,15 @@ }, "visible": false, "font": "Arial;13;0", - "left": -112, - "top": 768, + "left": -144, + "top": 656, "height": 13, "horizontalAlignment": 1 } ], "font": "Arial;13;0", - "left": 344, - "top": 688, + "left": 328, + "top": 632, "width": 168.93896484375, "height": 25, "stereotypeLabel": { @@ -120,30 +120,11 @@ "model": { "$ref": "AAAAAAGHsxATrWDLbqE=" }, - "subViews": [ - { - "_type": "UMLAttributeView", - "_id": "AAAAAAGHsxDqLGD/gcE=", - "_parent": { - "$ref": "AAAAAAGHsxATrmDTxFE=" - }, - "model": { - "$ref": "AAAAAAGHsxDqJmD8cBs=" - }, - "font": "Arial;13;0", - "left": 349, - "top": 718, - "width": 158.93896484375, - "height": 13, - "text": "-defautLogo: list ", - "horizontalAlignment": 0 - } - ], "font": "Arial;13;0", - "left": 344, - "top": 713, + "left": 328, + "top": 657, "width": 168.93896484375, - "height": 23 + "height": 10 }, { "_type": "UMLOperationCompartmentView", @@ -165,11 +146,11 @@ "$ref": "AAAAAAGHsxHmtmEDQjA=" }, "font": "Arial;13;0", - "left": 349, - "top": 741, + "left": 333, + "top": 672, "width": 158.93896484375, "height": 13, - "text": "+DonnerLienLogo()", + "text": "+RechercherUtilisateur()", "horizontalAlignment": 0 }, { @@ -182,11 +163,11 @@ "$ref": "AAAAAAGHsznnx2NH2gQ=" }, "font": "Arial;13;0", - "left": 349, - "top": 756, + "left": 333, + "top": 687, "width": 158.93896484375, "height": 13, - "text": "+RechercherPseudo()", + "text": "+GetLinkLogo()", "horizontalAlignment": 0 }, { @@ -199,11 +180,11 @@ "$ref": "AAAAAAGHwWwdHu/427c=" }, "font": "Arial;13;0", - "left": 349, - "top": 771, + "left": 333, + "top": 702, "width": 158.93896484375, "height": 13, - "text": "+TrouverMail()", + "text": "+GetUtilisateur()", "horizontalAlignment": 0 }, { @@ -216,8 +197,8 @@ "$ref": "AAAAAAGHwWw++/K3/cw=" }, "font": "Arial;13;0", - "left": 349, - "top": 786, + "left": 333, + "top": 717, "width": 158.93896484375, "height": 13, "text": "+CorrespondPassword()", @@ -233,11 +214,11 @@ "$ref": "AAAAAAGHwWxY5fXure4=" }, "font": "Arial;13;0", - "left": 349, - "top": 801, + "left": 333, + "top": 732, "width": 158.93896484375, "height": 13, - "text": "+AjouterBaseData()", + "text": "+TrouverMail()", "horizontalAlignment": 0 }, { @@ -250,19 +231,121 @@ "$ref": "AAAAAAGHwWx6nf5NEN0=" }, "font": "Arial;13;0", - "left": 349, - "top": 816, + "left": 333, + "top": 747, + "width": 158.93896484375, + "height": 13, + "text": "+AjouterUtilisateur()", + "horizontalAlignment": 0 + }, + { + "_type": "UMLOperationView", + "_id": "AAAAAAGH/LY7PGUgC/M=", + "_parent": { + "$ref": "AAAAAAGHsxATrmDU59E=" + }, + "model": { + "$ref": "AAAAAAGH/LY7M2UdnuU=" + }, + "font": "Arial;13;0", + "left": 333, + "top": 762, + "width": 158.93896484375, + "height": 13, + "text": "+SupUtilisateur()", + "horizontalAlignment": 0 + }, + { + "_type": "UMLOperationView", + "_id": "AAAAAAGH/LZOf2YOhAI=", + "_parent": { + "$ref": "AAAAAAGHsxATrmDU59E=" + }, + "model": { + "$ref": "AAAAAAGH/LZOeGYLzYM=" + }, + "font": "Arial;13;0", + "left": 333, + "top": 777, + "width": 158.93896484375, + "height": 13, + "text": "+AjouterTheme()", + "horizontalAlignment": 0 + }, + { + "_type": "UMLOperationView", + "_id": "AAAAAAGH/LZrNmb8CO8=", + "_parent": { + "$ref": "AAAAAAGHsxATrmDU59E=" + }, + "model": { + "$ref": "AAAAAAGH/LZrM2b5qcY=" + }, + "font": "Arial;13;0", + "left": 333, + "top": 792, + "width": 158.93896484375, + "height": 13, + "text": "+SupTheme()", + "horizontalAlignment": 0 + }, + { + "_type": "UMLOperationView", + "_id": "AAAAAAGH/LaAAWfqCu8=", + "_parent": { + "$ref": "AAAAAAGHsxATrmDU59E=" + }, + "model": { + "$ref": "AAAAAAGH/LZ//Wfn/yw=" + }, + "font": "Arial;13;0", + "left": 333, + "top": 807, + "width": 158.93896484375, + "height": 13, + "text": "+GetTheme()", + "horizontalAlignment": 0 + }, + { + "_type": "UMLOperationView", + "_id": "AAAAAAGH/LaTwmjYkaQ=", + "_parent": { + "$ref": "AAAAAAGHsxATrmDU59E=" + }, + "model": { + "$ref": "AAAAAAGH/LaTv2jVHMA=" + }, + "font": "Arial;13;0", + "left": 333, + "top": 822, + "width": 158.93896484375, + "height": 13, + "text": "+ModifierNomTheme()", + "horizontalAlignment": 0 + }, + { + "_type": "UMLOperationView", + "_id": "AAAAAAGH/LanoGnGr3U=", + "_parent": { + "$ref": "AAAAAAGHsxATrmDU59E=" + }, + "model": { + "$ref": "AAAAAAGH/LannGnD+e4=" + }, + "font": "Arial;13;0", + "left": 333, + "top": 837, "width": 158.93896484375, "height": 13, - "text": "+SupBaseData()", + "text": "+ModifierColorListTheme()", "horizontalAlignment": 0 } ], "font": "Arial;13;0", - "left": 344, - "top": 736, + "left": 328, + "top": 667, "width": 168.93896484375, - "height": 98 + "height": 188 }, { "_type": "UMLReceptionCompartmentView", @@ -275,8 +358,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": -56, - "top": 384, + "left": -72, + "top": 328, "width": 10, "height": 10 }, @@ -291,18 +374,18 @@ }, "visible": false, "font": "Arial;13;0", - "left": -56, - "top": 384, + "left": -72, + "top": 328, "width": 10, "height": 10 } ], "font": "Arial;13;0", "containerChangeable": true, - "left": 344, - "top": 688, + "left": 328, + "top": 632, "width": 168.93896484375, - "height": 146, + "height": 223, "nameCompartment": { "$ref": "AAAAAAGHsxATrmDO80A=" }, @@ -347,8 +430,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": -512, - "top": 64, + "left": -592, + "top": 80, "height": 13 }, { @@ -358,9 +441,9 @@ "$ref": "AAAAAAGHsxLjH2EWA68=" }, "font": "Arial;13;1", - "left": 381, - "top": 271, - "width": 164.0234375, + "left": 341, + "top": 279, + "width": 182.45068359375, "height": 13, "text": "Note" }, @@ -372,8 +455,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": -512, - "top": 64, + "left": -592, + "top": 80, "width": 73.67724609375, "height": 13, "text": "(from Model)" @@ -386,16 +469,16 @@ }, "visible": false, "font": "Arial;13;0", - "left": -512, - "top": 64, + "left": -592, + "top": 80, "height": 13, "horizontalAlignment": 1 } ], "font": "Arial;13;0", - "left": 376, - "top": 264, - "width": 174.0234375, + "left": 336, + "top": 272, + "width": 192.45068359375, "height": 25, "stereotypeLabel": { "$ref": "AAAAAAGHsxLjH2EXG+w=" @@ -430,11 +513,11 @@ "$ref": "AAAAAAGHsxL0HWE9FYU=" }, "font": "Arial;13;0", - "left": 381, - "top": 294, - "width": 164.0234375, + "left": 341, + "top": 302, + "width": 182.45068359375, "height": 13, - "text": "-nom: string", + "text": "-/nom: string", "horizontalAlignment": 0 }, { @@ -447,9 +530,9 @@ "$ref": "AAAAAAGHsxMgtWFET5I=" }, "font": "Arial;13;0", - "left": 381, - "top": 309, - "width": 164.0234375, + "left": 341, + "top": 317, + "width": 182.45068359375, "height": 13, "text": "-logo: string", "horizontalAlignment": 0 @@ -464,9 +547,9 @@ "$ref": "AAAAAAGHsxOyfGFZzxw=" }, "font": "Arial;13;0", - "left": 381, - "top": 324, - "width": 164.0234375, + "left": 341, + "top": 332, + "width": 182.45068359375, "height": 13, "text": "-dateCreation: string", "horizontalAlignment": 0 @@ -481,9 +564,9 @@ "$ref": "AAAAAAGHsxPYlGFgs7M=" }, "font": "Arial;13;0", - "left": 381, - "top": 339, - "width": 164.0234375, + "left": 341, + "top": 347, + "width": 182.45068359375, "height": 13, "text": "-listeImage: list ", "horizontalAlignment": 0 @@ -498,9 +581,9 @@ "$ref": "AAAAAAGHsxQphGFn79c=" }, "font": "Arial;13;0", - "left": 381, - "top": 354, - "width": 164.0234375, + "left": 341, + "top": 362, + "width": 182.45068359375, "height": 13, "text": "-listeLigneTexte: list ", "horizontalAlignment": 0 @@ -515,19 +598,70 @@ "$ref": "AAAAAAGHsxTEpGFu3U4=" }, "font": "Arial;13;0", - "left": 381, - "top": 369, - "width": 164.0234375, + "left": 341, + "top": 377, + "width": 182.45068359375, "height": 13, "text": "-listePosiImage: list ", "horizontalAlignment": 0 + }, + { + "_type": "UMLAttributeView", + "_id": "AAAAAAGH4OGlOd4/fU4=", + "_parent": { + "$ref": "AAAAAAGHsxLjIGEbeoc=" + }, + "model": { + "$ref": "AAAAAAGH4OGlMd48So8=" + }, + "font": "Arial;13;0", + "left": 341, + "top": 392, + "width": 182.45068359375, + "height": 13, + "text": "-Proprietaire: Utilisateur", + "horizontalAlignment": 0 + }, + { + "_type": "UMLAttributeView", + "_id": "AAAAAAGH4OHotd9DLSY=", + "_parent": { + "$ref": "AAAAAAGHsxLjIGEbeoc=" + }, + "model": { + "$ref": "AAAAAAGH4OHosd9AbLE=" + }, + "font": "Arial;13;0", + "left": 341, + "top": 407, + "width": 182.45068359375, + "height": 13, + "text": "-Cooperateurs: list", + "horizontalAlignment": 0 + }, + { + "_type": "UMLAttributeView", + "_id": "AAAAAAGH4OJNhuCGmB0=", + "_parent": { + "$ref": "AAAAAAGHsxLjIGEbeoc=" + }, + "model": { + "$ref": "AAAAAAGH4OJNgeCD2aw=" + }, + "font": "Arial;13;0", + "left": 341, + "top": 422, + "width": 182.45068359375, + "height": 13, + "text": "-Editeurs: list", + "horizontalAlignment": 0 } ], "font": "Arial;13;0", - "left": 376, - "top": 289, - "width": 174.0234375, - "height": 98 + "left": 336, + "top": 297, + "width": 192.45068359375, + "height": 143 }, { "_type": "UMLOperationCompartmentView", @@ -541,146 +675,163 @@ "subViews": [ { "_type": "UMLOperationView", - "_id": "AAAAAAGHsxYIomF4lXs=", + "_id": "AAAAAAGHwWgEJJ81rI0=", "_parent": { "$ref": "AAAAAAGHsxLjIGEcokU=" }, "model": { - "$ref": "AAAAAAGHsxYIk2F1ZpE=" + "$ref": "AAAAAAGHwWgEHp8y24w=" }, "font": "Arial;13;0", - "left": 381, - "top": 392, - "width": 164.0234375, + "left": 341, + "top": 445, + "width": 182.45068359375, "height": 13, - "text": "+SetTexte()", + "text": "+VerifOwner()", "horizontalAlignment": 0 }, { "_type": "UMLOperationView", - "_id": "AAAAAAGHsxZsxGGGwi4=", + "_id": "AAAAAAGHwWg7mKAj0EY=", "_parent": { "$ref": "AAAAAAGHsxLjIGEcokU=" }, "model": { - "$ref": "AAAAAAGHsxZswWGDXAQ=" + "$ref": "AAAAAAGHwWg7laAgGPM=" }, "font": "Arial;13;0", - "left": 381, - "top": 407, - "width": 164.0234375, + "left": 341, + "top": 460, + "width": 182.45068359375, "height": 13, - "text": "+SetNom()", + "text": "+ModifRole()", "horizontalAlignment": 0 }, { "_type": "UMLOperationView", - "_id": "AAAAAAGHsxaW62GNQaM=", + "_id": "AAAAAAGH4NPpL9TC1Ns=", "_parent": { "$ref": "AAAAAAGHsxLjIGEcokU=" }, "model": { - "$ref": "AAAAAAGHsxaW22GKGC8=" + "$ref": "AAAAAAGH4NPpHdS/8Gg=" }, "font": "Arial;13;0", - "left": 381, - "top": 422, - "width": 164.0234375, + "left": 341, + "top": 475, + "width": 182.45068359375, "height": 13, - "text": "+SetLogo()", + "text": "+AjouterImage()", "horizontalAlignment": 0 }, { "_type": "UMLOperationView", - "_id": "AAAAAAGHsziGF2Mf17Q=", + "_id": "AAAAAAGH4OLpg+KbTHU=", "_parent": { "$ref": "AAAAAAGHsxLjIGEcokU=" }, "model": { - "$ref": "AAAAAAGHsziGEGMckj0=" + "$ref": "AAAAAAGH4OLpfuKYzBw=" }, "font": "Arial;13;0", - "left": 381, - "top": 437, - "width": 164.0234375, + "left": 341, + "top": 490, + "width": 182.45068359375, "height": 13, - "text": "+RechercherNote()", + "text": "+SuppImage()", "horizontalAlignment": 0 }, { "_type": "UMLOperationView", - "_id": "AAAAAAGHwWemzZuL01Q=", + "_id": "AAAAAAGH4OSk4+a5A68=", "_parent": { "$ref": "AAAAAAGHsxLjIGEcokU=" }, "model": { - "$ref": "AAAAAAGHwWemx5uIfV8=" + "$ref": "AAAAAAGH4OSk3ea2Vmg=" }, "font": "Arial;13;0", - "left": 381, - "top": 452, - "width": 164.0234375, + "left": 341, + "top": 505, + "width": 182.45068359375, "height": 13, - "text": "+AjouterTag()", + "text": "+VerifPriviledge()", "horizontalAlignment": 0 }, { "_type": "UMLOperationView", - "_id": "AAAAAAGHwWfenp1gf80=", + "_id": "AAAAAAGH/LL0aFmYRH0=", "_parent": { "$ref": "AAAAAAGHsxLjIGEcokU=" }, "model": { - "$ref": "AAAAAAGHwWfelp1durc=" + "$ref": "AAAAAAGH/LL0XFmVxh0=" }, "font": "Arial;13;0", - "left": 381, - "top": 467, - "width": 164.0234375, + "left": 341, + "top": 520, + "width": 182.45068359375, "height": 13, - "text": "+SupTag()", + "text": "+AjouterCoop()", "horizontalAlignment": 0 }, { "_type": "UMLOperationView", - "_id": "AAAAAAGHwWgEJJ81rI0=", + "_id": "AAAAAAGH/LTGbVqGu0s=", "_parent": { "$ref": "AAAAAAGHsxLjIGEcokU=" }, "model": { - "$ref": "AAAAAAGHwWgEHp8y24w=" + "$ref": "AAAAAAGH/LTGZlqDkIg=" }, "font": "Arial;13;0", - "left": 381, - "top": 482, - "width": 164.0234375, + "left": 341, + "top": 535, + "width": 182.45068359375, "height": 13, - "text": "+AjouterImage()", + "text": "+SupCoop()", "horizontalAlignment": 0 }, { "_type": "UMLOperationView", - "_id": "AAAAAAGHwWg7mKAj0EY=", + "_id": "AAAAAAGH/LTpflt0SfI=", "_parent": { "$ref": "AAAAAAGHsxLjIGEcokU=" }, "model": { - "$ref": "AAAAAAGHwWg7laAgGPM=" + "$ref": "AAAAAAGH/LTpeFtxaEQ=" + }, + "font": "Arial;13;0", + "left": 341, + "top": 550, + "width": 182.45068359375, + "height": 13, + "text": "+AjouterEdit()", + "horizontalAlignment": 0 + }, + { + "_type": "UMLOperationView", + "_id": "AAAAAAGH/LUCOVxiOdQ=", + "_parent": { + "$ref": "AAAAAAGHsxLjIGEcokU=" + }, + "model": { + "$ref": "AAAAAAGH/LUCNVxfrq8=" }, "font": "Arial;13;0", - "left": 381, - "top": 497, - "width": 164.0234375, + "left": 341, + "top": 565, + "width": 182.45068359375, "height": 13, - "text": "+SupImage()", + "text": "+SupEdit()", "horizontalAlignment": 0 } ], "font": "Arial;13;0", - "left": 376, - "top": 387, - "width": 174.0234375, - "height": 128 + "left": 336, + "top": 440, + "width": 192.45068359375, + "height": 143 }, { "_type": "UMLReceptionCompartmentView", @@ -693,8 +844,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": -256, - "top": 32, + "left": -296, + "top": 40, "width": 10, "height": 10 }, @@ -709,18 +860,18 @@ }, "visible": false, "font": "Arial;13;0", - "left": -256, - "top": 32, + "left": -296, + "top": 40, "width": 10, "height": 10 } ], "font": "Arial;13;0", "containerChangeable": true, - "left": 376, - "top": 264, - "width": 174.0234375, - "height": 251, + "left": 336, + "top": 272, + "width": 192.45068359375, + "height": 311, "nameCompartment": { "$ref": "AAAAAAGHsxLjH2EWA68=" }, @@ -765,8 +916,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": 1232, - "top": -64, + "left": 1040, + "top": -112, "height": 13 }, { @@ -776,9 +927,9 @@ "$ref": "AAAAAAGHszJKAWG1eoU=" }, "font": "Arial;13;1", - "left": 893, - "top": 503, - "width": 180.26171875, + "left": 797, + "top": 479, + "width": 205.2578125, "height": 13, "text": "Utilisateur" }, @@ -790,8 +941,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": 1232, - "top": -64, + "left": 1040, + "top": -112, "width": 73.67724609375, "height": 13, "text": "(from Model)" @@ -804,16 +955,16 @@ }, "visible": false, "font": "Arial;13;0", - "left": 1232, - "top": -64, + "left": 1040, + "top": -112, "height": 13, "horizontalAlignment": 1 } ], "font": "Arial;13;0", - "left": 888, - "top": 496, - "width": 190.26171875, + "left": 792, + "top": 472, + "width": 215.2578125, "height": 25, "stereotypeLabel": { "$ref": "AAAAAAGHszJKAWG2BVI=" @@ -848,11 +999,11 @@ "$ref": "AAAAAAGHszJzs2HcXu4=" }, "font": "Arial;13;0", - "left": 893, - "top": 526, - "width": 180.26171875, + "left": 797, + "top": 502, + "width": 205.2578125, "height": 13, - "text": "-pseudo: string", + "text": "-/pseudo: string", "horizontalAlignment": 0 }, { @@ -865,11 +1016,11 @@ "$ref": "AAAAAAGHszKhY2Hk848=" }, "font": "Arial;13;0", - "left": 893, - "top": 541, - "width": 180.26171875, + "left": 797, + "top": 517, + "width": 205.2578125, "height": 13, - "text": "-mail: string", + "text": "-/mail: string", "horizontalAlignment": 0 }, { @@ -882,11 +1033,11 @@ "$ref": "AAAAAAGHszLWWGHtWvc=" }, "font": "Arial;13;0", - "left": 893, - "top": 556, - "width": 180.26171875, + "left": 797, + "top": 532, + "width": 205.2578125, "height": 13, - "text": "-password: string", + "text": "-/password: string", "horizontalAlignment": 0 }, { @@ -899,19 +1050,36 @@ "$ref": "AAAAAAGHwX5qfj58iuE=" }, "font": "Arial;13;0", - "left": 893, - "top": 571, - "width": 180.26171875, + "left": 797, + "top": 547, + "width": 205.2578125, "height": 13, "text": "-connecter: bool", "horizontalAlignment": 0 + }, + { + "_type": "UMLAttributeView", + "_id": "AAAAAAGH5ZuqkuEJHqY=", + "_parent": { + "$ref": "AAAAAAGHszJKAWG6OO4=" + }, + "model": { + "$ref": "AAAAAAGH5Zuqf+EGwEY=" + }, + "font": "Arial;13;0", + "left": 797, + "top": 562, + "width": 205.2578125, + "height": 13, + "text": "-notetaged: map>", + "horizontalAlignment": 0 } ], "font": "Arial;13;0", - "left": 888, - "top": 521, - "width": 190.26171875, - "height": 68 + "left": 792, + "top": 497, + "width": 215.2578125, + "height": 83 }, { "_type": "UMLOperationCompartmentView", @@ -925,129 +1093,231 @@ "subViews": [ { "_type": "UMLOperationView", - "_id": "AAAAAAGHszOJ+mIQ0PQ=", + "_id": "AAAAAAGHszOmxGIcpC4=", "_parent": { "$ref": "AAAAAAGHszJKAmG7KV0=" }, "model": { - "$ref": "AAAAAAGHszOJ8mIN0vE=" + "$ref": "AAAAAAGHszOmwWIZbnQ=" }, "font": "Arial;13;0", - "left": 893, - "top": 594, - "width": 180.26171875, + "left": 797, + "top": 585, + "width": 205.2578125, "height": 13, - "text": "+SetPseudo()", + "text": "+RechercherNote()", "horizontalAlignment": 0 }, { "_type": "UMLOperationView", - "_id": "AAAAAAGHszOlUmIWsQs=", + "_id": "AAAAAAGHwWZXe5PNb7Y=", "_parent": { "$ref": "AAAAAAGHszJKAmG7KV0=" }, "model": { - "$ref": "AAAAAAGHszOlSmITA04=" + "$ref": "AAAAAAGHwWZXdpPKlxs=" }, "font": "Arial;13;0", - "left": 893, - "top": 609, - "width": 180.26171875, + "left": 797, + "top": 600, + "width": 205.2578125, "height": 13, - "text": "+SetMail()", + "text": "+RechercherNoteFav()", "horizontalAlignment": 0 }, { "_type": "UMLOperationView", - "_id": "AAAAAAGHszOmxGIcpC4=", + "_id": "AAAAAAGHwWbQIZXNNR4=", "_parent": { "$ref": "AAAAAAGHszJKAmG7KV0=" }, "model": { - "$ref": "AAAAAAGHszOmwWIZbnQ=" + "$ref": "AAAAAAGHwWbQHpXKwHw=" }, "font": "Arial;13;0", - "left": 893, - "top": 624, - "width": 180.26171875, + "left": 797, + "top": 615, + "width": 205.2578125, "height": 13, - "text": "+SetPassword()", + "text": "+RechercherTags()", "horizontalAlignment": 0 }, { "_type": "UMLOperationView", - "_id": "AAAAAAGHwWZXe5PNb7Y=", + "_id": "AAAAAAGHwWcDa5eiGRw=", "_parent": { "$ref": "AAAAAAGHszJKAmG7KV0=" }, "model": { - "$ref": "AAAAAAGHwWZXdpPKlxs=" + "$ref": "AAAAAAGHwWcDZpefm/w=" }, "font": "Arial;13;0", - "left": 893, - "top": 639, - "width": 180.26171875, + "left": 797, + "top": 630, + "width": 205.2578125, "height": 13, "text": "+AjouterFav()", "horizontalAlignment": 0 }, { "_type": "UMLOperationView", - "_id": "AAAAAAGHwWbQIZXNNR4=", + "_id": "AAAAAAGHwWc4T5l3iME=", "_parent": { "$ref": "AAAAAAGHszJKAmG7KV0=" }, "model": { - "$ref": "AAAAAAGHwWbQHpXKwHw=" + "$ref": "AAAAAAGHwWc4R5l0Qos=" }, "font": "Arial;13;0", - "left": 893, - "top": 654, - "width": 180.26171875, + "left": 797, + "top": 645, + "width": 205.2578125, "height": 13, - "text": "+SupFav()", + "text": "+SuppFav()", "horizontalAlignment": 0 }, { "_type": "UMLOperationView", - "_id": "AAAAAAGHwWcDa5eiGRw=", + "_id": "AAAAAAGH5Z2Iuea6vDk=", "_parent": { "$ref": "AAAAAAGHszJKAmG7KV0=" }, "model": { - "$ref": "AAAAAAGHwWcDZpefm/w=" + "$ref": "AAAAAAGH5Z2Ir+a3+4U=" }, "font": "Arial;13;0", - "left": 893, - "top": 669, - "width": 180.26171875, + "left": 797, + "top": 660, + "width": 205.2578125, "height": 13, "text": "+AjouterNote()", "horizontalAlignment": 0 }, { "_type": "UMLOperationView", - "_id": "AAAAAAGHwWc4T5l3iME=", + "_id": "AAAAAAGH5Z23ReeTalo=", "_parent": { "$ref": "AAAAAAGHszJKAmG7KV0=" }, "model": { - "$ref": "AAAAAAGHwWc4R5l0Qos=" + "$ref": "AAAAAAGH5Z23P+eQnoI=" + }, + "font": "Arial;13;0", + "left": 797, + "top": 675, + "width": 205.2578125, + "height": 13, + "text": "+SuppNote()", + "horizontalAlignment": 0 + }, + { + "_type": "UMLOperationView", + "_id": "AAAAAAGH7Y/7u6/9e4g=", + "_parent": { + "$ref": "AAAAAAGHszJKAmG7KV0=" + }, + "model": { + "$ref": "AAAAAAGH7Y/7sa/62wM=" + }, + "font": "Arial;13;0", + "left": 797, + "top": 690, + "width": 205.2578125, + "height": 13, + "text": "+createTag()", + "horizontalAlignment": 0 + }, + { + "_type": "UMLOperationView", + "_id": "AAAAAAGH7ZACirDAG+Q=", + "_parent": { + "$ref": "AAAAAAGHszJKAmG7KV0=" + }, + "model": { + "$ref": "AAAAAAGH7ZAChbC9p+o=" + }, + "font": "Arial;13;0", + "left": 797, + "top": 705, + "width": 205.2578125, + "height": 13, + "text": "+deleteTag()", + "horizontalAlignment": 0 + }, + { + "_type": "UMLOperationView", + "_id": "AAAAAAGH/KxPwUUTIEE=", + "_parent": { + "$ref": "AAAAAAGHszJKAmG7KV0=" + }, + "model": { + "$ref": "AAAAAAGH/KxPskUQQZ4=" + }, + "font": "Arial;13;0", + "left": 797, + "top": 720, + "width": 205.2578125, + "height": 13, + "text": "+AddOneTagToNoteList()", + "horizontalAlignment": 0 + }, + { + "_type": "UMLOperationView", + "_id": "AAAAAAGH/KxhfUYBFQE=", + "_parent": { + "$ref": "AAAAAAGHszJKAmG7KV0=" + }, + "model": { + "$ref": "AAAAAAGH/KxhdkX+V8s=" + }, + "font": "Arial;13;0", + "left": 797, + "top": 735, + "width": 205.2578125, + "height": 13, + "text": "+SupOneTagToNoteList()", + "horizontalAlignment": 0 + }, + { + "_type": "UMLOperationView", + "_id": "AAAAAAGH/KyCJ0bv5Dc=", + "_parent": { + "$ref": "AAAAAAGHszJKAmG7KV0=" + }, + "model": { + "$ref": "AAAAAAGH/KyCIkbsdWw=" + }, + "font": "Arial;13;0", + "left": 797, + "top": 750, + "width": 205.2578125, + "height": 13, + "text": "+AddTagToNoteList()", + "horizontalAlignment": 0 + }, + { + "_type": "UMLOperationView", + "_id": "AAAAAAGH/KyTS0fdez8=", + "_parent": { + "$ref": "AAAAAAGHszJKAmG7KV0=" + }, + "model": { + "$ref": "AAAAAAGH/KyTR0faUc4=" }, "font": "Arial;13;0", - "left": 893, - "top": 684, - "width": 180.26171875, + "left": 797, + "top": 765, + "width": 205.2578125, "height": 13, - "text": "+SupNote()", + "text": "+SupTagToNoteList()", "horizontalAlignment": 0 } ], "font": "Arial;13;0", - "left": 888, - "top": 589, - "width": 190.26171875, - "height": 113 + "left": 792, + "top": 580, + "width": 215.2578125, + "height": 203 }, { "_type": "UMLReceptionCompartmentView", @@ -1060,8 +1330,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": 608, - "top": -40, + "left": 504, + "top": -72, "width": 10, "height": 10 }, @@ -1076,18 +1346,18 @@ }, "visible": false, "font": "Arial;13;0", - "left": 938.5927734375, - "top": 488, + "left": 834.5927734375, + "top": 456, "width": 130.6689453125, "height": 10 } ], "font": "Arial;13;0", "containerChangeable": true, - "left": 888, - "top": 496, - "width": 190.26171875, - "height": 221, + "left": 792, + "top": 472, + "width": 215.2578125, + "height": 311, "nameCompartment": { "$ref": "AAAAAAGHszJKAWG1eoU=" }, @@ -1132,7 +1402,7 @@ }, "visible": false, "font": "Arial;13;0", - "left": 384, + "left": -304, "top": 160, "height": 13 }, @@ -1143,7 +1413,7 @@ "$ref": "AAAAAAGHszUGkWJWMlk=" }, "font": "Arial;13;1", - "left": 1189, + "left": 845, "top": 327, "width": 111.642578125, "height": 13, @@ -1157,7 +1427,7 @@ }, "visible": false, "font": "Arial;13;0", - "left": 384, + "left": -304, "top": 160, "width": 73.67724609375, "height": 13, @@ -1171,14 +1441,14 @@ }, "visible": false, "font": "Arial;13;0", - "left": 384, + "left": -304, "top": 160, "height": 13, "horizontalAlignment": 1 } ], "font": "Arial;13;0", - "left": 1184, + "left": 840, "top": 320, "width": 121.642578125, "height": 25, @@ -1215,11 +1485,11 @@ "$ref": "AAAAAAGHszUk6GJ9jMQ=" }, "font": "Arial;13;0", - "left": 1189, + "left": 845, "top": 350, "width": 111.642578125, "height": 13, - "text": "-nom: string", + "text": "-/nom: string", "horizontalAlignment": 0 }, { @@ -1232,16 +1502,16 @@ "$ref": "AAAAAAGHszUrAGKDQzw=" }, "font": "Arial;13;0", - "left": 1189, + "left": 845, "top": 365, "width": 111.642578125, "height": 13, - "text": "-couleur: string", + "text": "-/couleur: string", "horizontalAlignment": 0 } ], "font": "Arial;13;0", - "left": 1184, + "left": 840, "top": 345, "width": 121.642578125, "height": 38 @@ -1255,64 +1525,11 @@ "model": { "$ref": "AAAAAAGHszUGkGJTukc=" }, - "subViews": [ - { - "_type": "UMLOperationView", - "_id": "AAAAAAGHszUusWKMZko=", - "_parent": { - "$ref": "AAAAAAGHszUGkmJcy48=" - }, - "model": { - "$ref": "AAAAAAGHszUuqmKJmq4=" - }, - "font": "Arial;13;0", - "left": 1189, - "top": 388, - "width": 111.642578125, - "height": 13, - "text": "+ChangerNom()", - "horizontalAlignment": 0 - }, - { - "_type": "UMLOperationView", - "_id": "AAAAAAGHszUwsGKStvY=", - "_parent": { - "$ref": "AAAAAAGHszUGkmJcy48=" - }, - "model": { - "$ref": "AAAAAAGHszUwqWKPirU=" - }, - "font": "Arial;13;0", - "left": 1189, - "top": 403, - "width": 111.642578125, - "height": 13, - "text": "+ChangerCouleur()", - "horizontalAlignment": 0 - }, - { - "_type": "UMLOperationView", - "_id": "AAAAAAGHszjNOmMt6Rw=", - "_parent": { - "$ref": "AAAAAAGHszUGkmJcy48=" - }, - "model": { - "$ref": "AAAAAAGHszjNNmMq9wI=" - }, - "font": "Arial;13;0", - "left": 1189, - "top": 418, - "width": 111.642578125, - "height": 13, - "text": "+RechercherTag()", - "horizontalAlignment": 0 - } - ], "font": "Arial;13;0", - "left": 1184, + "left": 840, "top": 383, "width": 121.642578125, - "height": 53 + "height": 10 }, { "_type": "UMLReceptionCompartmentView", @@ -1325,7 +1542,7 @@ }, "visible": false, "font": "Arial;13;0", - "left": 192, + "left": -152, "top": 80, "width": 10, "height": 10 @@ -1341,7 +1558,7 @@ }, "visible": false, "font": "Arial;13;0", - "left": 192, + "left": -152, "top": 80, "width": 10, "height": 10 @@ -1349,10 +1566,10 @@ ], "font": "Arial;13;0", "containerChangeable": true, - "left": 1184, + "left": 840, "top": 320, "width": 121.642578125, - "height": 116, + "height": 73, "nameCompartment": { "$ref": "AAAAAAGHszUGkWJWMlk=" }, @@ -1369,182 +1586,6 @@ "$ref": "AAAAAAGHszUGkmJeE1Y=" } }, - { - "_type": "UMLClassView", - "_id": "AAAAAAGHs1tJIWWFFvw=", - "_parent": { - "$ref": "AAAAAAFF+qBtyKM79qY=" - }, - "model": { - "$ref": "AAAAAAGHs1tJIWWDEBQ=" - }, - "subViews": [ - { - "_type": "UMLNameCompartmentView", - "_id": "AAAAAAGHs1tJIWWGGNU=", - "_parent": { - "$ref": "AAAAAAGHs1tJIWWFFvw=" - }, - "model": { - "$ref": "AAAAAAGHs1tJIWWDEBQ=" - }, - "subViews": [ - { - "_type": "LabelView", - "_id": "AAAAAAGHs1tJIWWHR+I=", - "_parent": { - "$ref": "AAAAAAGHs1tJIWWGGNU=" - }, - "visible": false, - "font": "Arial;13;0", - "left": 784, - "top": 192, - "height": 13 - }, - { - "_type": "LabelView", - "_id": "AAAAAAGHs1tJIWWIG8o=", - "_parent": { - "$ref": "AAAAAAGHs1tJIWWGGNU=" - }, - "font": "Arial;13;1", - "left": 901, - "top": 791, - "width": 153.537109375, - "height": 13, - "text": "SetTheme" - }, - { - "_type": "LabelView", - "_id": "AAAAAAGHs1tJIWWJptc=", - "_parent": { - "$ref": "AAAAAAGHs1tJIWWGGNU=" - }, - "visible": false, - "font": "Arial;13;0", - "left": 784, - "top": 192, - "width": 73.67724609375, - "height": 13, - "text": "(from Model)" - }, - { - "_type": "LabelView", - "_id": "AAAAAAGHs1tJIWWKk58=", - "_parent": { - "$ref": "AAAAAAGHs1tJIWWGGNU=" - }, - "visible": false, - "font": "Arial;13;0", - "left": 784, - "top": 192, - "height": 13, - "horizontalAlignment": 1 - } - ], - "font": "Arial;13;0", - "left": 896, - "top": 784, - "width": 163.537109375, - "height": 25, - "stereotypeLabel": { - "$ref": "AAAAAAGHs1tJIWWHR+I=" - }, - "nameLabel": { - "$ref": "AAAAAAGHs1tJIWWIG8o=" - }, - "namespaceLabel": { - "$ref": "AAAAAAGHs1tJIWWJptc=" - }, - "propertyLabel": { - "$ref": "AAAAAAGHs1tJIWWKk58=" - } - }, - { - "_type": "UMLAttributeCompartmentView", - "_id": "AAAAAAGHs1tJIWWLFZc=", - "_parent": { - "$ref": "AAAAAAGHs1tJIWWFFvw=" - }, - "model": { - "$ref": "AAAAAAGHs1tJIWWDEBQ=" - }, - "font": "Arial;13;0", - "left": 896, - "top": 809, - "width": 163.537109375, - "height": 10 - }, - { - "_type": "UMLOperationCompartmentView", - "_id": "AAAAAAGHs1tJIWWMSO8=", - "_parent": { - "$ref": "AAAAAAGHs1tJIWWFFvw=" - }, - "model": { - "$ref": "AAAAAAGHs1tJIWWDEBQ=" - }, - "font": "Arial;13;0", - "left": 896, - "top": 819, - "width": 163.537109375, - "height": 10 - }, - { - "_type": "UMLReceptionCompartmentView", - "_id": "AAAAAAGHs1tJIWWN4/0=", - "_parent": { - "$ref": "AAAAAAGHs1tJIWWFFvw=" - }, - "model": { - "$ref": "AAAAAAGHs1tJIWWDEBQ=" - }, - "visible": false, - "font": "Arial;13;0", - "left": 392, - "top": 96, - "width": 10, - "height": 10 - }, - { - "_type": "UMLTemplateParameterCompartmentView", - "_id": "AAAAAAGHs1tJIWWOOTo=", - "_parent": { - "$ref": "AAAAAAGHs1tJIWWFFvw=" - }, - "model": { - "$ref": "AAAAAAGHs1tJIWWDEBQ=" - }, - "visible": false, - "font": "Arial;13;0", - "left": 392, - "top": 96, - "width": 10, - "height": 10 - } - ], - "font": "Arial;13;0", - "containerChangeable": true, - "left": 896, - "top": 784, - "width": 163.537109375, - "height": 105, - "nameCompartment": { - "$ref": "AAAAAAGHs1tJIWWGGNU=" - }, - "attributeCompartment": { - "$ref": "AAAAAAGHs1tJIWWLFZc=" - }, - "operationCompartment": { - "$ref": "AAAAAAGHs1tJIWWMSO8=" - }, - "receptionCompartment": { - "$ref": "AAAAAAGHs1tJIWWN4/0=" - }, - "templateParameterCompartment": { - "$ref": "AAAAAAGHs1tJIWWOOTo=" - } - }, { "_type": "UMLClassView", "_id": "AAAAAAGHs2HK42c8byg=", @@ -1573,8 +1614,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": 1440, - "top": 400, + "left": 464, + "top": 448, "height": 13 }, { @@ -1584,8 +1625,8 @@ "$ref": "AAAAAAGHs2HK42c9P1Y=" }, "font": "Arial;13;1", - "left": 1253, - "top": 791, + "left": 765, + "top": 815, "width": 160.4052734375, "height": 13, "text": "Theme" @@ -1598,8 +1639,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": 1440, - "top": 400, + "left": 464, + "top": 448, "width": 73.67724609375, "height": 13, "text": "(from Model)" @@ -1612,15 +1653,15 @@ }, "visible": false, "font": "Arial;13;0", - "left": 1440, - "top": 400, + "left": 464, + "top": 448, "height": 13, "horizontalAlignment": 1 } ], "font": "Arial;13;0", - "left": 1248, - "top": 784, + "left": 760, + "top": 808, "width": 170.4052734375, "height": 25, "stereotypeLabel": { @@ -1646,6 +1687,23 @@ "$ref": "AAAAAAGHs2HK4mc6StU=" }, "subViews": [ + { + "_type": "UMLAttributeView", + "_id": "AAAAAAGH5ZSDQ8GNXOk=", + "_parent": { + "$ref": "AAAAAAGHs2HK42dCx5A=" + }, + "model": { + "$ref": "AAAAAAGH5ZSDMsGKSBM=" + }, + "font": "Arial;13;0", + "left": 765, + "top": 838, + "width": 160.4052734375, + "height": 13, + "text": "-/nom: string", + "horizontalAlignment": 0 + }, { "_type": "UMLAttributeView", "_id": "AAAAAAGHs2HpiWdnChE=", @@ -1656,8 +1714,8 @@ "$ref": "AAAAAAGHs2HpZ2dkozw=" }, "font": "Arial;13;0", - "left": 1253, - "top": 814, + "left": 765, + "top": 853, "width": 160.4052734375, "height": 13, "text": "-listeCouleur: list ", @@ -1665,10 +1723,10 @@ } ], "font": "Arial;13;0", - "left": 1248, - "top": 809, + "left": 760, + "top": 833, "width": 170.4052734375, - "height": 23 + "height": 38 }, { "_type": "UMLOperationCompartmentView", @@ -1679,11 +1737,47 @@ "model": { "$ref": "AAAAAAGHs2HK4mc6StU=" }, + "subViews": [ + { + "_type": "UMLOperationView", + "_id": "AAAAAAGH7UFM65jZvww=", + "_parent": { + "$ref": "AAAAAAGHs2HK42dDsQM=" + }, + "model": { + "$ref": "AAAAAAGH7UFM3ZjWsn8=" + }, + "font": "Arial;13;0", + "left": 765, + "top": 876, + "width": 160.4052734375, + "height": 13, + "text": "+GetColorList()", + "horizontalAlignment": 0 + }, + { + "_type": "UMLOperationView", + "_id": "AAAAAAGH6+RfvRFVmfE=", + "_parent": { + "$ref": "AAAAAAGHs2HK42dDsQM=" + }, + "model": { + "$ref": "AAAAAAGH6+RfrBFS0Bc=" + }, + "font": "Arial;13;0", + "left": 765, + "top": 891, + "width": 160.4052734375, + "height": 13, + "text": "+ChangeColor()", + "horizontalAlignment": 0 + } + ], "font": "Arial;13;0", - "left": 1248, - "top": 832, + "left": 760, + "top": 871, "width": 170.4052734375, - "height": 10 + "height": 38 }, { "_type": "UMLReceptionCompartmentView", @@ -1696,8 +1790,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": 720, - "top": 200, + "left": 232, + "top": 224, "width": 10, "height": 10 }, @@ -1712,18 +1806,18 @@ }, "visible": false, "font": "Arial;13;0", - "left": 720, - "top": 200, + "left": 232, + "top": 224, "width": 10, "height": 10 } ], "font": "Arial;13;0", "containerChangeable": true, - "left": 1248, - "top": 784, + "left": 760, + "top": 808, "width": 170.4052734375, - "height": 105, + "height": 101, "nameCompartment": { "$ref": "AAAAAAGHs2HK42c9P1Y=" }, @@ -1761,8 +1855,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": 993, - "top": 744, + "left": 647, + "top": 696, "height": 13, "alpha": 1.5707963267948966, "distance": 15, @@ -1782,8 +1876,8 @@ }, "visible": null, "font": "Arial;13;0", - "left": 1008, - "top": 744, + "left": 650, + "top": 711, "height": 13, "alpha": 1.5707963267948966, "distance": 30, @@ -1803,8 +1897,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": 964, - "top": 743, + "left": 640, + "top": 667, "height": 13, "alpha": -1.5707963267948966, "distance": 15, @@ -1824,8 +1918,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": 994, - "top": 737, + "left": 769, + "top": 667, "height": 13, "alpha": 0.5235987755982988, "distance": 30, @@ -1845,8 +1939,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": 1007, - "top": 740, + "left": 770, + "top": 681, "height": 13, "alpha": 0.7853981633974483, "distance": 40, @@ -1866,8 +1960,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": 966, - "top": 732, + "left": 767, + "top": 639, "height": 13, "alpha": -0.5235987755982988, "distance": 25, @@ -1886,12 +1980,12 @@ "$ref": "AAAAAAGHwVHBhV+9K5M=" }, "font": "Arial;13;0", - "left": 984, - "top": 760, + "left": 519, + "top": 692, "width": 48.0517578125, "height": 13, - "alpha": -1.0552473341080453, - "distance": 34.48187929913333, + "alpha": 0.2432285905158279, + "distance": 52.839379254491625, "hostEdge": { "$ref": "AAAAAAGHwVHBhl+/C6c=" }, @@ -1908,8 +2002,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": 1007, - "top": 749, + "left": 531, + "top": 737, "height": 13, "alpha": -0.7853981633974483, "distance": 40, @@ -1927,8 +2021,8 @@ "$ref": "AAAAAAGHwVHBhV+9K5M=" }, "font": "Arial;13;0", - "left": 945, - "top": 759, + "left": 498, + "top": 690, "width": 21.68359375, "height": 13, "alpha": -5.348897275791532, @@ -1973,13 +2067,13 @@ ], "font": "Arial;13;0", "head": { - "$ref": "AAAAAAGHs1tJIWWFFvw=" + "$ref": "AAAAAAGHsxATrmDNnOM=" }, "tail": { "$ref": "AAAAAAGHszJKAGG0NQ0=" }, "lineStyle": 1, - "points": "980:717;978:783", + "points": "791:653;497:723", "showVisibility": true, "nameLabel": { "$ref": "AAAAAAGHwVHBhl/Apoc=" @@ -2036,8 +2130,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": 1120, - "top": 458, + "left": 885, + "top": 425, "height": 13, "alpha": 1.5707963267948966, "distance": 15, @@ -2057,8 +2151,8 @@ }, "visible": null, "font": "Arial;13;0", - "left": 1110, - "top": 447, + "left": 870, + "top": 425, "height": 13, "alpha": 1.5707963267948966, "distance": 30, @@ -2078,8 +2172,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": 1139, - "top": 481, + "left": 914, + "top": 426, "height": 13, "alpha": -1.5707963267948966, "distance": 15, @@ -2099,8 +2193,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": 1087, - "top": 487, + "left": 885, + "top": 439, "height": 13, "alpha": 0.5235987755982988, "distance": 30, @@ -2120,8 +2214,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": 1080, - "top": 476, + "left": 871, + "top": 436, "height": 13, "alpha": 0.7853981633974483, "distance": 40, @@ -2141,8 +2235,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": 1102, - "top": 511, + "left": 912, + "top": 443, "height": 13, "alpha": -0.5235987755982988, "distance": 25, @@ -2161,8 +2255,8 @@ "$ref": "AAAAAAGHwVctm4UK/yI=" }, "font": "Arial;13;0", - "left": 1111, - "top": 428, + "left": 847, + "top": 425, "width": 50.93994140625, "height": 13, "alpha": -0.6300750331437177, @@ -2183,8 +2277,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": 1143, - "top": 421, + "left": 871, + "top": 415, "height": 13, "alpha": -0.7853981633974483, "distance": 40, @@ -2202,8 +2296,8 @@ "$ref": "AAAAAAGHwVctm4UK/yI=" }, "font": "Arial;13;0", - "left": 1171, - "top": 451, + "left": 912, + "top": 411, "width": 6.5, "height": 13, "alpha": 0.5552277465295183, @@ -2254,7 +2348,7 @@ "$ref": "AAAAAAGHszJKAGG0NQ0=" }, "lineStyle": 1, - "points": "1078:522;1183:430", + "points": "900:471;900:393", "showVisibility": true, "nameLabel": { "$ref": "AAAAAAGHwVctnIUNaCs=" @@ -2311,8 +2405,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": 801, - "top": 430, + "left": 804, + "top": 434, "height": 13, "alpha": 1.5707963267948966, "distance": 15, @@ -2332,8 +2426,8 @@ }, "visible": null, "font": "Arial;13;0", - "left": 811, - "top": 418, + "left": 817, + "top": 426, "height": 13, "alpha": 1.5707963267948966, "distance": 30, @@ -2353,8 +2447,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": 782, - "top": 453, + "left": 779, + "top": 449, "height": 13, "alpha": -1.5707963267948966, "distance": 15, @@ -2372,7 +2466,7 @@ "$ref": "AAAAAAGHsxLjH2EVAzI=" }, "lineStyle": 3, - "points": "550:405;792:448;887:527", + "points": "528:433;792:448;806:471", "showVisibility": true, "nameLabel": { "$ref": "AAAAAAGHwV2zBOCQoPw=" @@ -2405,8 +2499,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": 668, - "top": 636, + "left": 639, + "top": 590, "height": 13, "alpha": 1.5707963267948966, "distance": 15, @@ -2426,8 +2520,8 @@ }, "visible": null, "font": "Arial;13;0", - "left": 657, - "top": 646, + "left": 630, + "top": 602, "height": 13, "alpha": 1.5707963267948966, "distance": 30, @@ -2447,8 +2541,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": 691, - "top": 615, + "left": 656, + "top": 565, "height": 13, "alpha": -1.5707963267948966, "distance": 15, @@ -2468,8 +2562,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": 862, - "top": 625, + "left": 762, + "top": 612, "height": 13, "alpha": 0.5235987755982988, "distance": 30, @@ -2489,8 +2583,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": 861, - "top": 638, + "left": 758, + "top": 625, "height": 13, "alpha": 0.7853981633974483, "distance": 40, @@ -2510,8 +2604,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": 864, - "top": 597, + "left": 771, + "top": 586, "height": 13, "alpha": -0.5235987755982988, "distance": 25, @@ -2530,12 +2624,12 @@ "$ref": "AAAAAAGHwV3a5OQzkxk=" }, "font": "Arial;13;0", - "left": 543, - "top": 527, + "left": 535, + "top": 509, "width": 58.169921875, "height": 13, - "alpha": -0.2931152672219888, - "distance": 51.894122981316485, + "alpha": 0.17368804935160154, + "distance": 40.70626487409524, "hostEdge": { "$ref": "AAAAAAGHwV3a5OQ1/RQ=" }, @@ -2552,8 +2646,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": 547, - "top": 520, + "left": 534, + "top": 531, "height": 13, "alpha": -0.7853981633974483, "distance": 40, @@ -2571,8 +2665,8 @@ "$ref": "AAAAAAGHwV3a5OQzkxk=" }, "font": "Arial;13;0", - "left": 575, - "top": 495, + "left": 555, + "top": 500, "width": 6.5, "height": 13, "alpha": 0.3480805540781273, @@ -2623,7 +2717,7 @@ "$ref": "AAAAAAGHszJKAGG0NQ0=" }, "lineStyle": 3, - "points": "887:614;680:632;550:487", + "points": "791:608;648:584;528:498", "showVisibility": true, "nameLabel": { "$ref": "AAAAAAGHwV3a5OQ2Hy0=" @@ -2660,400 +2754,125 @@ } }, { - "_type": "UMLAssociationView", - "_id": "AAAAAAGHwV8k+hY+LDY=", + "_type": "UMLDependencyView", + "_id": "AAAAAAGHwWj+HLR7e4Q=", "_parent": { "$ref": "AAAAAAFF+qBtyKM79qY=" }, "model": { - "$ref": "AAAAAAGHwV8k+BY69+0=" + "$ref": "AAAAAAGHwWj+G7R5mto=" }, "subViews": [ { "_type": "EdgeLabelView", - "_id": "AAAAAAGHwV8k+hY/yCc=", + "_id": "AAAAAAGHwWj+HLR8LT4=", "_parent": { - "$ref": "AAAAAAGHwV8k+hY+LDY=" + "$ref": "AAAAAAGHwWj+HLR7e4Q=" }, "model": { - "$ref": "AAAAAAGHwV8k+BY69+0=" + "$ref": "AAAAAAGHwWj+G7R5mto=" }, "visible": false, "font": "Arial;13;0", - "left": 865, - "top": 362, + "left": 433, + "top": 601, "height": 13, "alpha": 1.5707963267948966, "distance": 15, "hostEdge": { - "$ref": "AAAAAAGHwV8k+hY+LDY=" + "$ref": "AAAAAAGHwWj+HLR7e4Q=" }, "edgePosition": 1 }, { "_type": "EdgeLabelView", - "_id": "AAAAAAGHwV8k+hZAroA=", + "_id": "AAAAAAGHwWj+HLR9/0U=", "_parent": { - "$ref": "AAAAAAGHwV8k+hY+LDY=" + "$ref": "AAAAAAGHwWj+HLR7e4Q=" }, "model": { - "$ref": "AAAAAAGHwV8k+BY69+0=" + "$ref": "AAAAAAGHwWj+G7R5mto=" }, "visible": null, "font": "Arial;13;0", - "left": 865, - "top": 347, + "left": 448, + "top": 602, "height": 13, "alpha": 1.5707963267948966, "distance": 30, "hostEdge": { - "$ref": "AAAAAAGHwV8k+hY+LDY=" + "$ref": "AAAAAAGHwWj+HLR7e4Q=" }, "edgePosition": 1 }, { "_type": "EdgeLabelView", - "_id": "AAAAAAGHwV8k+hZBBHk=", + "_id": "AAAAAAGHwWj+HLR+qjI=", "_parent": { - "$ref": "AAAAAAGHwV8k+hY+LDY=" + "$ref": "AAAAAAGHwWj+HLR7e4Q=" }, "model": { - "$ref": "AAAAAAGHwV8k+BY69+0=" + "$ref": "AAAAAAGHwWj+G7R5mto=" }, "visible": false, "font": "Arial;13;0", - "left": 866, - "top": 391, + "left": 404, + "top": 600, "height": 13, "alpha": -1.5707963267948966, "distance": 15, "hostEdge": { - "$ref": "AAAAAAGHwV8k+hY+LDY=" + "$ref": "AAAAAAGHwWj+HLR7e4Q=" }, "edgePosition": 1 - }, + } + ], + "font": "Arial;13;0", + "head": { + "$ref": "AAAAAAGHsxATrmDNnOM=" + }, + "tail": { + "$ref": "AAAAAAGHsxLjH2EVAzI=" + }, + "lineStyle": 1, + "points": "421:583;418:631", + "showVisibility": true, + "nameLabel": { + "$ref": "AAAAAAGHwWj+HLR8LT4=" + }, + "stereotypeLabel": { + "$ref": "AAAAAAGHwWj+HLR9/0U=" + }, + "propertyLabel": { + "$ref": "AAAAAAGHwWj+HLR+qjI=" + } + }, + { + "_type": "UMLAssociationView", + "_id": "AAAAAAGHwWkglLcu+/w=", + "_parent": { + "$ref": "AAAAAAFF+qBtyKM79qY=" + }, + "model": { + "$ref": "AAAAAAGHwWkglLcqb8o=" + }, + "subViews": [ { "_type": "EdgeLabelView", - "_id": "AAAAAAGHwV8k+hZCtQc=", + "_id": "AAAAAAGHwWkglLcvzPg=", "_parent": { - "$ref": "AAAAAAGHwV8k+hY+LDY=" + "$ref": "AAAAAAGHwWkglLcu+/w=" }, "model": { - "$ref": "AAAAAAGHwV8k+BY7m7c=" + "$ref": "AAAAAAGHwWkglLcqb8o=" }, "visible": false, "font": "Arial;13;0", - "left": 575, - "top": 366, + "left": 679, + "top": 741, "height": 13, - "alpha": 0.5235987755982988, - "distance": 30, - "hostEdge": { - "$ref": "AAAAAAGHwV8k+hY+LDY=" - }, - "edgePosition": 2 - }, - { - "_type": "EdgeLabelView", - "_id": "AAAAAAGHwV8k+hZDhTw=", - "_parent": { - "$ref": "AAAAAAGHwV8k+hY+LDY=" - }, - "model": { - "$ref": "AAAAAAGHwV8k+BY7m7c=" - }, - "visible": false, - "font": "Arial;13;0", - "left": 577, - "top": 353, - "height": 13, - "alpha": 0.7853981633974483, - "distance": 40, - "hostEdge": { - "$ref": "AAAAAAGHwV8k+hY+LDY=" - }, - "edgePosition": 2 - }, - { - "_type": "EdgeLabelView", - "_id": "AAAAAAGHwV8k+hZE+vQ=", - "_parent": { - "$ref": "AAAAAAGHwV8k+hY+LDY=" - }, - "model": { - "$ref": "AAAAAAGHwV8k+BY7m7c=" - }, - "visible": false, - "font": "Arial;13;0", - "left": 571, - "top": 394, - "height": 13, - "alpha": -0.5235987755982988, - "distance": 25, - "hostEdge": { - "$ref": "AAAAAAGHwV8k+hY+LDY=" - }, - "edgePosition": 2 - }, - { - "_type": "EdgeLabelView", - "_id": "AAAAAAGHwV8k+hZFeho=", - "_parent": { - "$ref": "AAAAAAGHwV8k+hY+LDY=" - }, - "model": { - "$ref": "AAAAAAGHwV8k+BY8GjY=" - }, - "font": "Arial;13;0", - "left": 1086, - "top": 359, - "width": 85.642578125, - "height": 13, - "alpha": -0.23361556914686998, - "distance": 55.65968020030299, - "hostEdge": { - "$ref": "AAAAAAGHwV8k+hY+LDY=" - }, - "text": "-atributionTags" - }, - { - "_type": "EdgeLabelView", - "_id": "AAAAAAGHwV8k+hZGKEc=", - "_parent": { - "$ref": "AAAAAAGHwV8k+hY+LDY=" - }, - "model": { - "$ref": "AAAAAAGHwV8k+BY8GjY=" - }, - "visible": false, - "font": "Arial;13;0", - "left": 1154, - "top": 344, - "height": 13, - "alpha": -0.7853981633974483, - "distance": 40, - "hostEdge": { - "$ref": "AAAAAAGHwV8k+hY+LDY=" - } - }, - { - "_type": "EdgeLabelView", - "_id": "AAAAAAGHwV8k+hZHfLg=", - "_parent": { - "$ref": "AAAAAAGHwV8k+hY+LDY=" - }, - "model": { - "$ref": "AAAAAAGHwV8k+BY8GjY=" - }, - "font": "Arial;13;0", - "left": 1158, - "top": 384, - "width": 6.5, - "height": 13, - "alpha": 0.5235987755982988, - "distance": 25, - "hostEdge": { - "$ref": "AAAAAAGHwV8k+hY+LDY=" - }, - "text": "*" - }, - { - "_type": "UMLQualifierCompartmentView", - "_id": "AAAAAAGHwV8k+hZI5ac=", - "_parent": { - "$ref": "AAAAAAGHwV8k+hY+LDY=" - }, - "model": { - "$ref": "AAAAAAGHwV8k+BY7m7c=" - }, - "visible": false, - "font": "Arial;13;0", - "left": 80, - "top": 64, - "width": 10, - "height": 10 - }, - { - "_type": "UMLQualifierCompartmentView", - "_id": "AAAAAAGHwV8k+xZJ5J4=", - "_parent": { - "$ref": "AAAAAAGHwV8k+hY+LDY=" - }, - "model": { - "$ref": "AAAAAAGHwV8k+BY8GjY=" - }, - "visible": false, - "font": "Arial;13;0", - "left": 80, - "top": 64, - "width": 10, - "height": 10 - } - ], - "font": "Arial;13;0", - "head": { - "$ref": "AAAAAAGHszUGkWJVNws=" - }, - "tail": { - "$ref": "AAAAAAGHsxLjH2EVAzI=" - }, - "lineStyle": 1, - "points": "550:388;1183:378", - "showVisibility": true, - "nameLabel": { - "$ref": "AAAAAAGHwV8k+hY/yCc=" - }, - "stereotypeLabel": { - "$ref": "AAAAAAGHwV8k+hZAroA=" - }, - "propertyLabel": { - "$ref": "AAAAAAGHwV8k+hZBBHk=" - }, - "tailRoleNameLabel": { - "$ref": "AAAAAAGHwV8k+hZCtQc=" - }, - "tailPropertyLabel": { - "$ref": "AAAAAAGHwV8k+hZDhTw=" - }, - "tailMultiplicityLabel": { - "$ref": "AAAAAAGHwV8k+hZE+vQ=" - }, - "headRoleNameLabel": { - "$ref": "AAAAAAGHwV8k+hZFeho=" - }, - "headPropertyLabel": { - "$ref": "AAAAAAGHwV8k+hZGKEc=" - }, - "headMultiplicityLabel": { - "$ref": "AAAAAAGHwV8k+hZHfLg=" - }, - "tailQualifiersCompartment": { - "$ref": "AAAAAAGHwV8k+hZI5ac=" - }, - "headQualifiersCompartment": { - "$ref": "AAAAAAGHwV8k+xZJ5J4=" - } - }, - { - "_type": "UMLDependencyView", - "_id": "AAAAAAGHwWj+HLR7e4Q=", - "_parent": { - "$ref": "AAAAAAFF+qBtyKM79qY=" - }, - "model": { - "$ref": "AAAAAAGHwWj+G7R5mto=" - }, - "subViews": [ - { - "_type": "EdgeLabelView", - "_id": "AAAAAAGHwWj+HLR8LT4=", - "_parent": { - "$ref": "AAAAAAGHwWj+HLR7e4Q=" - }, - "model": { - "$ref": "AAAAAAGHwWj+G7R5mto=" - }, - "visible": false, - "font": "Arial;13;0", - "left": 456, - "top": 596, - "height": 13, - "alpha": 1.5707963267948966, - "distance": 15, - "hostEdge": { - "$ref": "AAAAAAGHwWj+HLR7e4Q=" - }, - "edgePosition": 1 - }, - { - "_type": "EdgeLabelView", - "_id": "AAAAAAGHwWj+HLR9/0U=", - "_parent": { - "$ref": "AAAAAAGHwWj+HLR7e4Q=" - }, - "model": { - "$ref": "AAAAAAGHwWj+G7R5mto=" - }, - "visible": null, - "font": "Arial;13;0", - "left": 471, - "top": 597, - "height": 13, - "alpha": 1.5707963267948966, - "distance": 30, - "hostEdge": { - "$ref": "AAAAAAGHwWj+HLR7e4Q=" - }, - "edgePosition": 1 - }, - { - "_type": "EdgeLabelView", - "_id": "AAAAAAGHwWj+HLR+qjI=", - "_parent": { - "$ref": "AAAAAAGHwWj+HLR7e4Q=" - }, - "model": { - "$ref": "AAAAAAGHwWj+G7R5mto=" - }, - "visible": false, - "font": "Arial;13;0", - "left": 427, - "top": 593, - "height": 13, - "alpha": -1.5707963267948966, - "distance": 15, - "hostEdge": { - "$ref": "AAAAAAGHwWj+HLR7e4Q=" - }, - "edgePosition": 1 - } - ], - "font": "Arial;13;0", - "head": { - "$ref": "AAAAAAGHsxATrmDNnOM=" - }, - "tail": { - "$ref": "AAAAAAGHsxLjH2EVAzI=" - }, - "lineStyle": 1, - "points": "450:515;434:687", - "showVisibility": true, - "nameLabel": { - "$ref": "AAAAAAGHwWj+HLR8LT4=" - }, - "stereotypeLabel": { - "$ref": "AAAAAAGHwWj+HLR9/0U=" - }, - "propertyLabel": { - "$ref": "AAAAAAGHwWj+HLR+qjI=" - } - }, - { - "_type": "UMLAssociationView", - "_id": "AAAAAAGHwWkglLcu+/w=", - "_parent": { - "$ref": "AAAAAAFF+qBtyKM79qY=" - }, - "model": { - "$ref": "AAAAAAGHwWkglLcqb8o=" - }, - "subViews": [ - { - "_type": "EdgeLabelView", - "_id": "AAAAAAGHwWkglLcvzPg=", - "_parent": { - "$ref": "AAAAAAGHwWkglLcu+/w=" - }, - "model": { - "$ref": "AAAAAAGHwWkglLcqb8o=" - }, - "visible": false, - "font": "Arial;13;0", - "left": 720, - "top": 732, - "height": 13, - "alpha": 1.5707963267948966, - "distance": 15, + "alpha": 1.5707963267948966, + "distance": 15, "hostEdge": { "$ref": "AAAAAAGHwWkglLcu+/w=" }, @@ -3070,8 +2889,8 @@ }, "visible": null, "font": "Arial;13;0", - "left": 713, - "top": 719, + "left": 671, + "top": 728, "height": 13, "alpha": 1.5707963267948966, "distance": 30, @@ -3091,8 +2910,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": 735, - "top": 759, + "left": 696, + "top": 766, "height": 13, "alpha": -1.5707963267948966, "distance": 15, @@ -3112,8 +2931,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": 538, - "top": 736, + "left": 523, + "top": 728, "height": 13, "alpha": 0.5235987755982988, "distance": 30, @@ -3133,8 +2952,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": 540, - "top": 722, + "left": 527, + "top": 715, "height": 13, "alpha": 0.7853981633974483, "distance": 40, @@ -3154,8 +2973,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": 534, - "top": 763, + "left": 517, + "top": 755, "height": 13, "alpha": -0.5235987755982988, "distance": 25, @@ -3174,8 +2993,8 @@ "$ref": "AAAAAAGHwWkglLcsxtM=" }, "font": "Arial;13;0", - "left": 782, - "top": 664, + "left": 687, + "top": 701, "width": 88.50537109375, "height": 13, "alpha": -0.3566504292668551, @@ -3196,8 +3015,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": 848, - "top": 644, + "left": 751, + "top": 680, "height": 13, "alpha": -0.7853981633974483, "distance": 40, @@ -3215,8 +3034,8 @@ "$ref": "AAAAAAGHwWkglLcsxtM=" }, "font": "Arial;13;0", - "left": 871, - "top": 676, + "left": 776, + "top": 711, "width": 6.5, "height": 13, "alpha": 0.5235987755982988, @@ -3267,7 +3086,7 @@ "$ref": "AAAAAAGHsxATrmDNnOM=" }, "lineStyle": 3, - "points": "513:758;728:752;887:661", + "points": "497:748;688:760;791:695", "showVisibility": true, "nameLabel": { "$ref": "AAAAAAGHwWkglLcvzPg=" @@ -3324,8 +3143,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": 712, - "top": 503, + "left": 653, + "top": 532, "height": 13, "alpha": 1.5707963267948966, "distance": 15, @@ -3345,8 +3164,8 @@ }, "visible": null, "font": "Arial;13;0", - "left": 706, - "top": 517, + "left": 647, + "top": 546, "height": 13, "alpha": 1.5707963267948966, "distance": 30, @@ -3366,8 +3185,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": 723, - "top": 476, + "left": 664, + "top": 505, "height": 13, "alpha": -1.5707963267948966, "distance": 15, @@ -3387,8 +3206,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": 857, - "top": 563, + "left": 761, + "top": 578, "height": 13, "alpha": 0.5235987755982988, "distance": 30, @@ -3408,8 +3227,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": 850, - "top": 575, + "left": 753, + "top": 589, "height": 13, "alpha": 0.7853981633974483, "distance": 40, @@ -3429,8 +3248,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": 871, - "top": 540, + "left": 775, + "top": 555, "height": 13, "alpha": -0.5235987755982988, "distance": 25, @@ -3449,12 +3268,12 @@ "$ref": "AAAAAAGHwW45PFitVg4=" }, "font": "Arial;13;0", - "left": 543, - "top": 454, + "left": 549, + "top": 486, "width": 68.9990234375, "height": 13, - "alpha": -0.5199840652869545, - "distance": 44.204072210600685, + "alpha": 0.002433128081675673, + "distance": 60.40695324215582, "hostEdge": { "$ref": "AAAAAAGHwW45PVivcZ0=" }, @@ -3471,8 +3290,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": 565, - "top": 456, + "left": 542, + "top": 500, "height": 13, "alpha": -0.7853981633974483, "distance": 40, @@ -3490,8 +3309,8 @@ "$ref": "AAAAAAGHwW45PFitVg4=" }, "font": "Arial;13;0", - "left": 559, - "top": 439, + "left": 536, + "top": 483, "width": 6.5, "height": 13, "alpha": -0.6366393122007756, @@ -3540,7 +3359,7 @@ "$ref": "AAAAAAGHszJKAGG0NQ0=" }, "lineStyle": 1, - "points": "887:566;550:426", + "points": "791:581;528:469", "showVisibility": true, "nameLabel": { "$ref": "AAAAAAGHwW45PViwqGs=" @@ -3597,8 +3416,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": 1153, - "top": 815, + "left": 631, + "top": 779, "height": 13, "alpha": 1.5707963267948966, "distance": 15, @@ -3618,8 +3437,8 @@ }, "visible": null, "font": "Arial;13;0", - "left": 1153, - "top": 800, + "left": 635, + "top": 765, "height": 13, "alpha": 1.5707963267948966, "distance": 30, @@ -3639,8 +3458,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": 1153, - "top": 845, + "left": 624, + "top": 808, "height": 13, "alpha": -1.5707963267948966, "distance": 15, @@ -3660,8 +3479,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": 1085, - "top": 815, + "left": 525, + "top": 752, "height": 13, "alpha": 0.5235987755982988, "distance": 30, @@ -3681,8 +3500,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": 1088, - "top": 801, + "left": 531, + "top": 739, "height": 13, "alpha": 0.7853981633974483, "distance": 40, @@ -3702,8 +3521,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": 1081, - "top": 842, + "left": 514, + "top": 777, "height": 13, "alpha": -0.5235987755982988, "distance": 25, @@ -3722,8 +3541,8 @@ "$ref": "AAAAAAGHwXrkljsW6h4=" }, "font": "Arial;13;0", - "left": 1168, - "top": 815, + "left": 685, + "top": 804, "width": 71.169921875, "height": 13, "alpha": -0.30805284668983113, @@ -3744,8 +3563,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": 1218, - "top": 801, + "left": 738, + "top": 794, "height": 13, "alpha": -0.7853981633974483, "distance": 40, @@ -3763,9 +3582,9 @@ "$ref": "AAAAAAGHwXrkljsW6h4=" }, "font": "Arial;13;0", - "left": 1223, - "top": 842, - "width": 5.05908203125, + "left": 731, + "top": 835, + "width": 6.5, "height": 13, "alpha": 0.5235987755982988, "distance": 25, @@ -3808,10 +3627,10 @@ "$ref": "AAAAAAGHs2HK42c8byg=" }, "tail": { - "$ref": "AAAAAAGHs1tJIWWFFvw=" + "$ref": "AAAAAAGHsxATrmDNnOM=" }, "lineStyle": 1, - "points": "1060:836;1247:836", + "points": "497:766;759:835", "showVisibility": true, "nameLabel": { "$ref": "AAAAAAGHwXrkljsZ58k=" @@ -3829,22 +3648,505 @@ "$ref": "AAAAAAGHwXrkljsdk2M=" }, "tailMultiplicityLabel": { - "$ref": "AAAAAAGHwXrkljseXO0=" + "$ref": "AAAAAAGHwXrkljseXO0=" + }, + "headRoleNameLabel": { + "$ref": "AAAAAAGHwXrkljsf1/A=" + }, + "headPropertyLabel": { + "$ref": "AAAAAAGHwXrkljsgrHc=" + }, + "headMultiplicityLabel": { + "$ref": "AAAAAAGHwXrkljshZKo=" + }, + "tailQualifiersCompartment": { + "$ref": "AAAAAAGHwXrkljsiZSs=" + }, + "headQualifiersCompartment": { + "$ref": "AAAAAAGHwXrkljsjGDQ=" + } + }, + { + "_type": "UMLClassView", + "_id": "AAAAAAGH5ZTmwMXEOZg=", + "_parent": { + "$ref": "AAAAAAFF+qBtyKM79qY=" + }, + "model": { + "$ref": "AAAAAAGH5ZTmwMXCGIo=" + }, + "subViews": [ + { + "_type": "UMLNameCompartmentView", + "_id": "AAAAAAGH5ZTmwMXFnWw=", + "_parent": { + "$ref": "AAAAAAGH5ZTmwMXEOZg=" + }, + "model": { + "$ref": "AAAAAAGH5ZTmwMXCGIo=" + }, + "subViews": [ + { + "_type": "LabelView", + "_id": "AAAAAAGH5ZTmwMXG39k=", + "_parent": { + "$ref": "AAAAAAGH5ZTmwMXFnWw=" + }, + "visible": false, + "font": "Arial;13;0", + "left": 192, + "top": -256, + "height": 13 + }, + { + "_type": "LabelView", + "_id": "AAAAAAGH5ZTmwcXHh+g=", + "_parent": { + "$ref": "AAAAAAGH5ZTmwMXFnWw=" + }, + "font": "Arial;13;1", + "left": 573, + "top": 839, + "width": 95.3798828125, + "height": 13, + "text": "Logo" + }, + { + "_type": "LabelView", + "_id": "AAAAAAGH5ZTmwcXIs/c=", + "_parent": { + "$ref": "AAAAAAGH5ZTmwMXFnWw=" + }, + "visible": false, + "font": "Arial;13;0", + "left": 192, + "top": -256, + "width": 73.67724609375, + "height": 13, + "text": "(from Model)" + }, + { + "_type": "LabelView", + "_id": "AAAAAAGH5ZTmwcXJjY8=", + "_parent": { + "$ref": "AAAAAAGH5ZTmwMXFnWw=" + }, + "visible": false, + "font": "Arial;13;0", + "left": 192, + "top": -256, + "height": 13, + "horizontalAlignment": 1 + } + ], + "font": "Arial;13;0", + "left": 568, + "top": 832, + "width": 105.3798828125, + "height": 25, + "stereotypeLabel": { + "$ref": "AAAAAAGH5ZTmwMXG39k=" + }, + "nameLabel": { + "$ref": "AAAAAAGH5ZTmwcXHh+g=" + }, + "namespaceLabel": { + "$ref": "AAAAAAGH5ZTmwcXIs/c=" + }, + "propertyLabel": { + "$ref": "AAAAAAGH5ZTmwcXJjY8=" + } + }, + { + "_type": "UMLAttributeCompartmentView", + "_id": "AAAAAAGH5ZTmwcXKYRI=", + "_parent": { + "$ref": "AAAAAAGH5ZTmwMXEOZg=" + }, + "model": { + "$ref": "AAAAAAGH5ZTmwMXCGIo=" + }, + "subViews": [ + { + "_type": "UMLAttributeView", + "_id": "AAAAAAGH5ZT8oMaXNAE=", + "_parent": { + "$ref": "AAAAAAGH5ZTmwcXKYRI=" + }, + "model": { + "$ref": "AAAAAAGH5ZT8lsZ/BSw=" + }, + "font": "Arial;13;0", + "left": 573, + "top": 862, + "width": 95.3798828125, + "height": 13, + "text": "-/nom: string", + "horizontalAlignment": 0 + }, + { + "_type": "UMLAttributeView", + "_id": "AAAAAAGH5ZUsG8dcRNU=", + "_parent": { + "$ref": "AAAAAAGH5ZTmwcXKYRI=" + }, + "model": { + "$ref": "AAAAAAGH5ZUsEsdE3fg=" + }, + "font": "Arial;13;0", + "left": 573, + "top": 877, + "width": 95.3798828125, + "height": 13, + "text": "-/linkLogo: string", + "horizontalAlignment": 0 + } + ], + "font": "Arial;13;0", + "left": 568, + "top": 857, + "width": 105.3798828125, + "height": 38 + }, + { + "_type": "UMLOperationCompartmentView", + "_id": "AAAAAAGH5ZTmwcXLIOY=", + "_parent": { + "$ref": "AAAAAAGH5ZTmwMXEOZg=" + }, + "model": { + "$ref": "AAAAAAGH5ZTmwMXCGIo=" + }, + "font": "Arial;13;0", + "left": 568, + "top": 895, + "width": 105.3798828125, + "height": 10 + }, + { + "_type": "UMLReceptionCompartmentView", + "_id": "AAAAAAGH5ZTmwcXMftg=", + "_parent": { + "$ref": "AAAAAAGH5ZTmwMXEOZg=" + }, + "model": { + "$ref": "AAAAAAGH5ZTmwMXCGIo=" + }, + "visible": false, + "font": "Arial;13;0", + "left": 96, + "top": -128, + "width": 10, + "height": 10 + }, + { + "_type": "UMLTemplateParameterCompartmentView", + "_id": "AAAAAAGH5ZTmwcXN29c=", + "_parent": { + "$ref": "AAAAAAGH5ZTmwMXEOZg=" + }, + "model": { + "$ref": "AAAAAAGH5ZTmwMXCGIo=" + }, + "visible": false, + "font": "Arial;13;0", + "left": 96, + "top": -128, + "width": 10, + "height": 10 + } + ], + "font": "Arial;13;0", + "containerChangeable": true, + "left": 568, + "top": 832, + "width": 105.3798828125, + "height": 73, + "nameCompartment": { + "$ref": "AAAAAAGH5ZTmwMXFnWw=" + }, + "attributeCompartment": { + "$ref": "AAAAAAGH5ZTmwcXKYRI=" + }, + "operationCompartment": { + "$ref": "AAAAAAGH5ZTmwcXLIOY=" + }, + "receptionCompartment": { + "$ref": "AAAAAAGH5ZTmwcXMftg=" + }, + "templateParameterCompartment": { + "$ref": "AAAAAAGH5ZTmwcXN29c=" + } + }, + { + "_type": "UMLAssociationView", + "_id": "AAAAAAGH5ZaYJM5hLPU=", + "_parent": { + "$ref": "AAAAAAFF+qBtyKM79qY=" + }, + "model": { + "$ref": "AAAAAAGH5ZaYJM5dUQg=" + }, + "subViews": [ + { + "_type": "EdgeLabelView", + "_id": "AAAAAAGH5ZaYJM5iscE=", + "_parent": { + "$ref": "AAAAAAGH5ZaYJM5hLPU=" + }, + "model": { + "$ref": "AAAAAAGH5ZaYJM5dUQg=" + }, + "visible": false, + "font": "Arial;13;0", + "left": 539, + "top": 796, + "height": 13, + "alpha": 1.5707963267948966, + "distance": 15, + "hostEdge": { + "$ref": "AAAAAAGH5ZaYJM5hLPU=" + }, + "edgePosition": 1 + }, + { + "_type": "EdgeLabelView", + "_id": "AAAAAAGH5ZaYJM5jYZg=", + "_parent": { + "$ref": "AAAAAAGH5ZaYJM5hLPU=" + }, + "model": { + "$ref": "AAAAAAGH5ZaYJM5dUQg=" + }, + "visible": null, + "font": "Arial;13;0", + "left": 547, + "top": 783, + "height": 13, + "alpha": 1.5707963267948966, + "distance": 30, + "hostEdge": { + "$ref": "AAAAAAGH5ZaYJM5hLPU=" + }, + "edgePosition": 1 + }, + { + "_type": "EdgeLabelView", + "_id": "AAAAAAGH5ZaYJc5kQ74=", + "_parent": { + "$ref": "AAAAAAGH5ZaYJM5hLPU=" + }, + "model": { + "$ref": "AAAAAAGH5ZaYJM5dUQg=" + }, + "visible": false, + "font": "Arial;13;0", + "left": 524, + "top": 821, + "height": 13, + "alpha": -1.5707963267948966, + "distance": 15, + "hostEdge": { + "$ref": "AAAAAAGH5ZaYJM5hLPU=" + }, + "edgePosition": 1 + }, + { + "_type": "EdgeLabelView", + "_id": "AAAAAAGH5ZaYJc5l+wc=", + "_parent": { + "$ref": "AAAAAAGH5ZaYJM5hLPU=" + }, + "model": { + "$ref": "AAAAAAGH5ZaYJM5ekSI=" + }, + "visible": false, + "font": "Arial;13;0", + "left": 526, + "top": 788, + "height": 13, + "alpha": 0.5235987755982988, + "distance": 30, + "hostEdge": { + "$ref": "AAAAAAGH5ZaYJM5hLPU=" + }, + "edgePosition": 2 + }, + { + "_type": "EdgeLabelView", + "_id": "AAAAAAGH5ZaYJc5mpjQ=", + "_parent": { + "$ref": "AAAAAAGH5ZaYJM5hLPU=" + }, + "model": { + "$ref": "AAAAAAGH5ZaYJM5ekSI=" + }, + "visible": false, + "font": "Arial;13;0", + "left": 535, + "top": 778, + "height": 13, + "alpha": 0.7853981633974483, + "distance": 40, + "hostEdge": { + "$ref": "AAAAAAGH5ZaYJM5hLPU=" + }, + "edgePosition": 2 + }, + { + "_type": "EdgeLabelView", + "_id": "AAAAAAGH5ZaYJc5nWeY=", + "_parent": { + "$ref": "AAAAAAGH5ZaYJM5hLPU=" + }, + "model": { + "$ref": "AAAAAAGH5ZaYJM5ekSI=" + }, + "visible": false, + "font": "Arial;13;0", + "left": 509, + "top": 809, + "height": 13, + "alpha": -0.5235987755982988, + "distance": 25, + "hostEdge": { + "$ref": "AAAAAAGH5ZaYJM5hLPU=" + }, + "edgePosition": 2 + }, + { + "_type": "EdgeLabelView", + "_id": "AAAAAAGH5ZaYJc5oNu0=", + "_parent": { + "$ref": "AAAAAAGH5ZaYJM5hLPU=" + }, + "model": { + "$ref": "AAAAAAGH5ZaYJM5fb2g=" + }, + "font": "Arial;13;0", + "left": 514, + "top": 814, + "width": 72.6552734375, + "height": 13, + "alpha": -0.2021279491877861, + "distance": 22.67156809750927, + "hostEdge": { + "$ref": "AAAAAAGH5ZaYJM5hLPU=" + }, + "text": "-defautLogo" + }, + { + "_type": "EdgeLabelView", + "_id": "AAAAAAGH5ZaYJc5psF4=", + "_parent": { + "$ref": "AAAAAAGH5ZaYJM5hLPU=" + }, + "model": { + "$ref": "AAAAAAGH5ZaYJM5fb2g=" + }, + "visible": false, + "font": "Arial;13;0", + "left": 557, + "top": 791, + "height": 13, + "alpha": -0.7853981633974483, + "distance": 40, + "hostEdge": { + "$ref": "AAAAAAGH5ZaYJM5hLPU=" + } + }, + { + "_type": "EdgeLabelView", + "_id": "AAAAAAGH5ZaYJc5qKxc=", + "_parent": { + "$ref": "AAAAAAGH5ZaYJM5hLPU=" + }, + "model": { + "$ref": "AAAAAAGH5ZaYJM5fb2g=" + }, + "font": "Arial;13;0", + "left": 539, + "top": 829, + "width": 6.5, + "height": 13, + "alpha": 0.5235987755982988, + "distance": 25, + "hostEdge": { + "$ref": "AAAAAAGH5ZaYJM5hLPU=" + }, + "text": "*" + }, + { + "_type": "UMLQualifierCompartmentView", + "_id": "AAAAAAGH5ZaYJc5rgHM=", + "_parent": { + "$ref": "AAAAAAGH5ZaYJM5hLPU=" + }, + "model": { + "$ref": "AAAAAAGH5ZaYJM5ekSI=" + }, + "visible": false, + "font": "Arial;13;0", + "width": 10, + "height": 10 + }, + { + "_type": "UMLQualifierCompartmentView", + "_id": "AAAAAAGH5ZaYJc5sIZw=", + "_parent": { + "$ref": "AAAAAAGH5ZaYJM5hLPU=" + }, + "model": { + "$ref": "AAAAAAGH5ZaYJM5fb2g=" + }, + "visible": false, + "font": "Arial;13;0", + "width": 10, + "height": 10 + } + ], + "font": "Arial;13;0", + "head": { + "$ref": "AAAAAAGH5ZTmwMXEOZg=" + }, + "tail": { + "$ref": "AAAAAAGHsxATrmDNnOM=" + }, + "lineStyle": 1, + "points": "497:794;567:836", + "showVisibility": true, + "nameLabel": { + "$ref": "AAAAAAGH5ZaYJM5iscE=" + }, + "stereotypeLabel": { + "$ref": "AAAAAAGH5ZaYJM5jYZg=" + }, + "propertyLabel": { + "$ref": "AAAAAAGH5ZaYJc5kQ74=" + }, + "tailRoleNameLabel": { + "$ref": "AAAAAAGH5ZaYJc5l+wc=" + }, + "tailPropertyLabel": { + "$ref": "AAAAAAGH5ZaYJc5mpjQ=" + }, + "tailMultiplicityLabel": { + "$ref": "AAAAAAGH5ZaYJc5nWeY=" }, "headRoleNameLabel": { - "$ref": "AAAAAAGHwXrkljsf1/A=" + "$ref": "AAAAAAGH5ZaYJc5oNu0=" }, "headPropertyLabel": { - "$ref": "AAAAAAGHwXrkljsgrHc=" + "$ref": "AAAAAAGH5ZaYJc5psF4=" }, "headMultiplicityLabel": { - "$ref": "AAAAAAGHwXrkljshZKo=" + "$ref": "AAAAAAGH5ZaYJc5qKxc=" }, "tailQualifiersCompartment": { - "$ref": "AAAAAAGHwXrkljsiZSs=" + "$ref": "AAAAAAGH5ZaYJc5rgHM=" }, "headQualifiersCompartment": { - "$ref": "AAAAAAGHwXrkljsjGDQ=" + "$ref": "AAAAAAGH5ZaYJc5sIZw=" } } ] @@ -3871,8 +4173,7 @@ }, "reference": { "$ref": "AAAAAAGHsxATrWDLbqE=" - }, - "navigable": false + } }, "end2": { "_type": "UMLAssociationEnd", @@ -3887,18 +4188,36 @@ "visibility": "private", "multiplicity": "*" } - } - ], - "attributes": [ + }, { - "_type": "UMLAttribute", - "_id": "AAAAAAGHsxDqJmD8cBs=", + "_type": "UMLAssociation", + "_id": "AAAAAAGH5ZaYJM5dUQg=", "_parent": { "$ref": "AAAAAAGHsxATrWDLbqE=" }, - "name": "defautLogo", - "visibility": "private", - "type": "list " + "end1": { + "_type": "UMLAssociationEnd", + "_id": "AAAAAAGH5ZaYJM5ekSI=", + "_parent": { + "$ref": "AAAAAAGH5ZaYJM5dUQg=" + }, + "reference": { + "$ref": "AAAAAAGHsxATrWDLbqE=" + } + }, + "end2": { + "_type": "UMLAssociationEnd", + "_id": "AAAAAAGH5ZaYJM5fb2g=", + "_parent": { + "$ref": "AAAAAAGH5ZaYJM5dUQg=" + }, + "name": "defautLogo", + "reference": { + "$ref": "AAAAAAGH5ZTmwMXCGIo=" + }, + "visibility": "private", + "multiplicity": "*" + } } ], "operations": [ @@ -3908,7 +4227,7 @@ "_parent": { "$ref": "AAAAAAGHsxATrWDLbqE=" }, - "name": "DonnerLienLogo" + "name": "RechercherUtilisateur" }, { "_type": "UMLOperation", @@ -3916,7 +4235,7 @@ "_parent": { "$ref": "AAAAAAGHsxATrWDLbqE=" }, - "name": "RechercherPseudo" + "name": "GetLinkLogo" }, { "_type": "UMLOperation", @@ -3924,7 +4243,7 @@ "_parent": { "$ref": "AAAAAAGHsxATrWDLbqE=" }, - "name": "TrouverMail" + "name": "GetUtilisateur" }, { "_type": "UMLOperation", @@ -3940,7 +4259,7 @@ "_parent": { "$ref": "AAAAAAGHsxATrWDLbqE=" }, - "name": "AjouterBaseData" + "name": "TrouverMail" }, { "_type": "UMLOperation", @@ -3948,7 +4267,55 @@ "_parent": { "$ref": "AAAAAAGHsxATrWDLbqE=" }, - "name": "SupBaseData" + "name": "AjouterUtilisateur" + }, + { + "_type": "UMLOperation", + "_id": "AAAAAAGH/LY7M2UdnuU=", + "_parent": { + "$ref": "AAAAAAGHsxATrWDLbqE=" + }, + "name": "SupUtilisateur" + }, + { + "_type": "UMLOperation", + "_id": "AAAAAAGH/LZOeGYLzYM=", + "_parent": { + "$ref": "AAAAAAGHsxATrWDLbqE=" + }, + "name": "AjouterTheme" + }, + { + "_type": "UMLOperation", + "_id": "AAAAAAGH/LZrM2b5qcY=", + "_parent": { + "$ref": "AAAAAAGHsxATrWDLbqE=" + }, + "name": "SupTheme" + }, + { + "_type": "UMLOperation", + "_id": "AAAAAAGH/LZ//Wfn/yw=", + "_parent": { + "$ref": "AAAAAAGHsxATrWDLbqE=" + }, + "name": "GetTheme" + }, + { + "_type": "UMLOperation", + "_id": "AAAAAAGH/LaTv2jVHMA=", + "_parent": { + "$ref": "AAAAAAGHsxATrWDLbqE=" + }, + "name": "ModifierNomTheme" + }, + { + "_type": "UMLOperation", + "_id": "AAAAAAGH/LannGnD+e4=", + "_parent": { + "$ref": "AAAAAAGHsxATrWDLbqE=" + }, + "name": "ModifierColorListTheme" } ] }, @@ -4067,8 +4434,7 @@ }, "reference": { "$ref": "AAAAAAGHsxLjHmETJHw=" - }, - "navigable": false + } }, "end2": { "_type": "UMLAssociationEnd", @@ -4106,7 +4472,7 @@ "_parent": { "$ref": "AAAAAAGHsxLjHmETJHw=" }, - "name": "nom", + "name": "/nom", "visibility": "private", "type": "string" }, @@ -4159,72 +4525,112 @@ "name": "listePosiImage", "visibility": "private", "type": "list " + }, + { + "_type": "UMLAttribute", + "_id": "AAAAAAGH4OGlMd48So8=", + "_parent": { + "$ref": "AAAAAAGHsxLjHmETJHw=" + }, + "name": "Proprietaire", + "visibility": "private", + "type": { + "$ref": "AAAAAAGHszJKAGGyqQg=" + } + }, + { + "_type": "UMLAttribute", + "_id": "AAAAAAGH4OHosd9AbLE=", + "_parent": { + "$ref": "AAAAAAGHsxLjHmETJHw=" + }, + "name": "Cooperateurs", + "visibility": "private", + "type": "list" + }, + { + "_type": "UMLAttribute", + "_id": "AAAAAAGH4OJNgeCD2aw=", + "_parent": { + "$ref": "AAAAAAGHsxLjHmETJHw=" + }, + "name": "Editeurs", + "visibility": "private", + "type": "list" } ], "operations": [ { "_type": "UMLOperation", - "_id": "AAAAAAGHsxYIk2F1ZpE=", + "_id": "AAAAAAGHwWgEHp8y24w=", "_parent": { "$ref": "AAAAAAGHsxLjHmETJHw=" }, - "name": "SetTexte" + "name": "VerifOwner" }, { "_type": "UMLOperation", - "_id": "AAAAAAGHsxZswWGDXAQ=", + "_id": "AAAAAAGHwWg7laAgGPM=", "_parent": { "$ref": "AAAAAAGHsxLjHmETJHw=" }, - "name": "SetNom" + "name": "ModifRole" }, { "_type": "UMLOperation", - "_id": "AAAAAAGHsxaW22GKGC8=", + "_id": "AAAAAAGH4NPpHdS/8Gg=", "_parent": { "$ref": "AAAAAAGHsxLjHmETJHw=" }, - "name": "SetLogo" + "name": "AjouterImage" }, { "_type": "UMLOperation", - "_id": "AAAAAAGHsziGEGMckj0=", + "_id": "AAAAAAGH4OLpfuKYzBw=", "_parent": { "$ref": "AAAAAAGHsxLjHmETJHw=" }, - "name": "RechercherNote" + "name": "SuppImage" }, { "_type": "UMLOperation", - "_id": "AAAAAAGHwWemx5uIfV8=", + "_id": "AAAAAAGH4OSk3ea2Vmg=", "_parent": { "$ref": "AAAAAAGHsxLjHmETJHw=" }, - "name": "AjouterTag" + "name": "VerifPriviledge" }, { "_type": "UMLOperation", - "_id": "AAAAAAGHwWfelp1durc=", + "_id": "AAAAAAGH/LL0XFmVxh0=", "_parent": { "$ref": "AAAAAAGHsxLjHmETJHw=" }, - "name": "SupTag" + "name": "AjouterCoop" }, { "_type": "UMLOperation", - "_id": "AAAAAAGHwWgEHp8y24w=", + "_id": "AAAAAAGH/LTGZlqDkIg=", "_parent": { "$ref": "AAAAAAGHsxLjHmETJHw=" }, - "name": "AjouterImage" + "name": "SupCoop" }, { "_type": "UMLOperation", - "_id": "AAAAAAGHwWg7laAgGPM=", + "_id": "AAAAAAGH/LTpeFtxaEQ=", "_parent": { "$ref": "AAAAAAGHsxLjHmETJHw=" }, - "name": "SupImage" + "name": "AjouterEdit" + }, + { + "_type": "UMLOperation", + "_id": "AAAAAAGH/LUCNVxfrq8=", + "_parent": { + "$ref": "AAAAAAGHsxLjHmETJHw=" + }, + "name": "SupEdit" } ] }, @@ -4278,8 +4684,7 @@ }, "reference": { "$ref": "AAAAAAGHszJKAGGyqQg=" - }, - "navigable": false + } }, "end2": { "_type": "UMLAssociationEnd", @@ -4289,7 +4694,7 @@ }, "name": "Theme", "reference": { - "$ref": "AAAAAAGHs1tJIWWDEBQ=" + "$ref": "AAAAAAGHsxATrWDLbqE=" }, "visibility": "private", "navigable": "navigable", @@ -4310,8 +4715,7 @@ }, "reference": { "$ref": "AAAAAAGHszJKAGGyqQg=" - }, - "navigable": false + } }, "end2": { "_type": "UMLAssociationEnd", @@ -4342,8 +4746,7 @@ }, "reference": { "$ref": "AAAAAAGHszJKAGGyqQg=" - }, - "navigable": false + } }, "end2": { "_type": "UMLAssociationEnd", @@ -4383,8 +4786,7 @@ }, "reference": { "$ref": "AAAAAAGHszJKAGGyqQg=" - }, - "navigable": false + } }, "end2": { "_type": "UMLAssociationEnd", @@ -4409,7 +4811,7 @@ "_parent": { "$ref": "AAAAAAGHszJKAGGyqQg=" }, - "name": "pseudo", + "name": "/pseudo", "visibility": "private", "type": "string" }, @@ -4419,7 +4821,7 @@ "_parent": { "$ref": "AAAAAAGHszJKAGGyqQg=" }, - "name": "mail", + "name": "/mail", "visibility": "private", "type": "string" }, @@ -4429,7 +4831,7 @@ "_parent": { "$ref": "AAAAAAGHszJKAGGyqQg=" }, - "name": "password", + "name": "/password", "visibility": "private", "type": "string" }, @@ -4442,36 +4844,46 @@ "name": "connecter", "visibility": "private", "type": "bool" + }, + { + "_type": "UMLAttribute", + "_id": "AAAAAAGH5Zuqf+EGwEY=", + "_parent": { + "$ref": "AAAAAAGHszJKAGGyqQg=" + }, + "name": "notetaged", + "visibility": "private", + "type": "map>" } ], "operations": [ { "_type": "UMLOperation", - "_id": "AAAAAAGHszOJ8mIN0vE=", + "_id": "AAAAAAGHszOmwWIZbnQ=", "_parent": { "$ref": "AAAAAAGHszJKAGGyqQg=" }, - "name": "SetPseudo" + "name": "RechercherNote" }, { "_type": "UMLOperation", - "_id": "AAAAAAGHszOlSmITA04=", + "_id": "AAAAAAGHwWZXdpPKlxs=", "_parent": { "$ref": "AAAAAAGHszJKAGGyqQg=" }, - "name": "SetMail" + "name": "RechercherNoteFav" }, { "_type": "UMLOperation", - "_id": "AAAAAAGHszOmwWIZbnQ=", + "_id": "AAAAAAGHwWbQHpXKwHw=", "_parent": { "$ref": "AAAAAAGHszJKAGGyqQg=" }, - "name": "SetPassword" + "name": "RechercherTags" }, { "_type": "UMLOperation", - "_id": "AAAAAAGHwWZXdpPKlxs=", + "_id": "AAAAAAGHwWcDZpefm/w=", "_parent": { "$ref": "AAAAAAGHszJKAGGyqQg=" }, @@ -4479,15 +4891,15 @@ }, { "_type": "UMLOperation", - "_id": "AAAAAAGHwWbQHpXKwHw=", + "_id": "AAAAAAGHwWc4R5l0Qos=", "_parent": { "$ref": "AAAAAAGHszJKAGGyqQg=" }, - "name": "SupFav" + "name": "SuppFav" }, { "_type": "UMLOperation", - "_id": "AAAAAAGHwWcDZpefm/w=", + "_id": "AAAAAAGH5Z2Ir+a3+4U=", "_parent": { "$ref": "AAAAAAGHszJKAGGyqQg=" }, @@ -4495,11 +4907,59 @@ }, { "_type": "UMLOperation", - "_id": "AAAAAAGHwWc4R5l0Qos=", + "_id": "AAAAAAGH5Z23P+eQnoI=", + "_parent": { + "$ref": "AAAAAAGHszJKAGGyqQg=" + }, + "name": "SuppNote" + }, + { + "_type": "UMLOperation", + "_id": "AAAAAAGH7Y/7sa/62wM=", + "_parent": { + "$ref": "AAAAAAGHszJKAGGyqQg=" + }, + "name": "createTag" + }, + { + "_type": "UMLOperation", + "_id": "AAAAAAGH7ZAChbC9p+o=", + "_parent": { + "$ref": "AAAAAAGHszJKAGGyqQg=" + }, + "name": "deleteTag" + }, + { + "_type": "UMLOperation", + "_id": "AAAAAAGH/KxPskUQQZ4=", + "_parent": { + "$ref": "AAAAAAGHszJKAGGyqQg=" + }, + "name": "AddOneTagToNoteList" + }, + { + "_type": "UMLOperation", + "_id": "AAAAAAGH/KxhdkX+V8s=", + "_parent": { + "$ref": "AAAAAAGHszJKAGGyqQg=" + }, + "name": "SupOneTagToNoteList" + }, + { + "_type": "UMLOperation", + "_id": "AAAAAAGH/KyCIkbsdWw=", "_parent": { "$ref": "AAAAAAGHszJKAGGyqQg=" }, - "name": "SupNote" + "name": "AddTagToNoteList" + }, + { + "_type": "UMLOperation", + "_id": "AAAAAAGH/KyTR0faUc4=", + "_parent": { + "$ref": "AAAAAAGHszJKAGGyqQg=" + }, + "name": "SupTagToNoteList" } ] }, @@ -4517,7 +4977,7 @@ "_parent": { "$ref": "AAAAAAGHszUGkGJTukc=" }, - "name": "nom", + "name": "/nom", "visibility": "private", "type": "string" }, @@ -4527,36 +4987,10 @@ "_parent": { "$ref": "AAAAAAGHszUGkGJTukc=" }, - "name": "couleur", + "name": "/couleur", "visibility": "private", "type": "string" } - ], - "operations": [ - { - "_type": "UMLOperation", - "_id": "AAAAAAGHszUuqmKJmq4=", - "_parent": { - "$ref": "AAAAAAGHszUGkGJTukc=" - }, - "name": "ChangerNom" - }, - { - "_type": "UMLOperation", - "_id": "AAAAAAGHszUwqWKPirU=", - "_parent": { - "$ref": "AAAAAAGHszUGkGJTukc=" - }, - "name": "ChangerCouleur" - }, - { - "_type": "UMLOperation", - "_id": "AAAAAAGHszjNNmMq9wI=", - "_parent": { - "$ref": "AAAAAAGHszUGkGJTukc=" - }, - "name": "RechercherTag" - } ] }, { @@ -4738,9 +5172,8 @@ "$ref": "AAAAAAGHwXrkljsUu9c=" }, "reference": { - "$ref": "AAAAAAGHs1tJIWWDEBQ=" - }, - "navigable": false + "$ref": "AAAAAAGHsxATrWDLbqE=" + } }, "end2": { "_type": "UMLAssociationEnd", @@ -4830,6 +5263,16 @@ }, "name": "Theme", "attributes": [ + { + "_type": "UMLAttribute", + "_id": "AAAAAAGH5ZSDMsGKSBM=", + "_parent": { + "$ref": "AAAAAAGHs2HK4mc6StU=" + }, + "name": "/nom", + "visibility": "private", + "type": "string" + }, { "_type": "UMLAttribute", "_id": "AAAAAAGHs2HpZ2dkozw=", @@ -4840,6 +5283,24 @@ "visibility": "private", "type": "list " } + ], + "operations": [ + { + "_type": "UMLOperation", + "_id": "AAAAAAGH7UFM3ZjWsn8=", + "_parent": { + "$ref": "AAAAAAGHs2HK4mc6StU=" + }, + "name": "GetColorList" + }, + { + "_type": "UMLOperation", + "_id": "AAAAAAGH6+RfrBFS0Bc=", + "_parent": { + "$ref": "AAAAAAGHs2HK4mc6StU=" + }, + "name": "ChangeColor" + } ] }, { @@ -4869,6 +5330,55 @@ "$ref": "AAAAAAFF+qBWK6M3Z8Y=" }, "name": "EnleverImage" + }, + { + "_type": "UMLClass", + "_id": "AAAAAAGH5ZTmwMXCGIo=", + "_parent": { + "$ref": "AAAAAAFF+qBWK6M3Z8Y=" + }, + "name": "Logo", + "attributes": [ + { + "_type": "UMLAttribute", + "_id": "AAAAAAGH5ZT8lsZ/BSw=", + "_parent": { + "$ref": "AAAAAAGH5ZTmwMXCGIo=" + }, + "name": "/nom", + "visibility": "private", + "type": "string" + }, + { + "_type": "UMLAttribute", + "_id": "AAAAAAGH5ZUsEsdE3fg=", + "_parent": { + "$ref": "AAAAAAGH5ZTmwMXCGIo=" + }, + "name": "/linkLogo", + "visibility": "private", + "type": "string" + } + ] + }, + { + "_type": "UMLClass", + "_id": "AAAAAAGH5Zjg9NvBVJQ=", + "_parent": { + "$ref": "AAAAAAFF+qBWK6M3Z8Y=" + }, + "name": "TagedNote", + "attributes": [ + { + "_type": "UMLAttribute", + "_id": "AAAAAAGH5ZkVmdyTM14=", + "_parent": { + "$ref": "AAAAAAGH5Zjg9NvBVJQ=" + }, + "name": "tagnote", + "type": "map>" + } + ] } ] } diff --git a/notus/Biblioteque_de_Class/Biblioteque_de_Class.csproj b/notus/Biblioteque_de_Class/Biblioteque_de_Class.csproj index 4658cbf..469e6eb 100644 --- a/notus/Biblioteque_de_Class/Biblioteque_de_Class.csproj +++ b/notus/Biblioteque_de_Class/Biblioteque_de_Class.csproj @@ -6,4 +6,8 @@ enable + + + + diff --git a/notus/Biblioteque_de_Class/Biblioteque_de_Class.sln b/notus/Biblioteque_de_Class/Biblioteque_de_Class.sln new file mode 100644 index 0000000..524fca0 --- /dev/null +++ b/notus/Biblioteque_de_Class/Biblioteque_de_Class.sln @@ -0,0 +1,34 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.33424.131 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Biblioteque_de_Class", "Biblioteque_de_Class.csproj", "{CC2FF847-9D3A-44F7-8672-C70A4FE87C5B}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Notus_Console", "..\Notus_Console\Notus_Console.csproj", "{F48CF8AB-163E-4D63-B210-BDA22BE5251D}" + ProjectSection(ProjectDependencies) = postProject + {CC2FF847-9D3A-44F7-8672-C70A4FE87C5B} = {CC2FF847-9D3A-44F7-8672-C70A4FE87C5B} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {CC2FF847-9D3A-44F7-8672-C70A4FE87C5B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CC2FF847-9D3A-44F7-8672-C70A4FE87C5B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CC2FF847-9D3A-44F7-8672-C70A4FE87C5B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CC2FF847-9D3A-44F7-8672-C70A4FE87C5B}.Release|Any CPU.Build.0 = Release|Any CPU + {F48CF8AB-163E-4D63-B210-BDA22BE5251D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F48CF8AB-163E-4D63-B210-BDA22BE5251D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F48CF8AB-163E-4D63-B210-BDA22BE5251D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F48CF8AB-163E-4D63-B210-BDA22BE5251D}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {0AA9469C-FA7B-4AF1-9C90-056193DA2415} + EndGlobalSection +EndGlobal diff --git a/notus/Biblioteque_de_Class/Category.cs b/notus/Biblioteque_de_Class/Category.cs deleted file mode 100644 index 6466376..0000000 --- a/notus/Biblioteque_de_Class/Category.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Biblioteque_de_Class -{ - internal class Category - { - public string nom { get; set; } - } -} diff --git a/notus/Biblioteque_de_Class/Database.cs b/notus/Biblioteque_de_Class/Database.cs new file mode 100644 index 0000000..2013dce --- /dev/null +++ b/notus/Biblioteque_de_Class/Database.cs @@ -0,0 +1,206 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.Design; +using System.Data; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +using System.Threading.Tasks; +using System.Web; + +namespace Biblioteque_de_Class +{ + [DataContract] + public class Database + { + [DataMember] + public List DefaultLogoList { get; private set; } + [DataMember] + public List ThemeList { get; private set; } + [DataMember] + public List Users; + public List UserList + { + get => Users; private set + { + Users = value; + } + } + + public Database() + { + DefaultLogoList = new List(); + ThemeList = new List(); + UserList = new List(); + } + + public void SetDefaultLogoList(List defaultLogoList) { DefaultLogoList = defaultLogoList; } + public void SetDefaultThemeList(List defaultThemeList) { ThemeList = defaultThemeList; } + public void SetUserList(List userList) { UserList = userList; } + + /// + /// recherche un utilisateur dans la liste d'utilisateur + /// + public User SearchUser(string name) + { + foreach(User user in UserList) + { + if (user.Username == name) + { + return user; + } + } + throw new NotFoundException("No user found with this username."); + } + + /// + /// récupérer le lien d'un logo + /// + public string? GetLogoLink(string name) + { + foreach (Logo logo in DefaultLogoList) + { + if (logo.Name == name) { return logo.LogoLink; } + } + throw new NotFoundException("No logo link found."); + } + + /// + /// récupérer un utilisateur + /// + public User GetUser(string name) + { + foreach (User user in UserList) + { + if (user.Username == name) + { + return user; + } + } + throw new AlreadyUsedException("No user found with this username."); + } + + /// + /// comparer le mot de passe entré avec celui de l'utilisateur + /// + public static bool ComparePassword(User user, string? password) => user.Password == password; + + /// + /// rechercher un mail dans la liste d'utilisateur + /// + public bool FindEmail(string email) + { + foreach (User user in UserList) + { + if (string.Equals(user.Email, email)) + { + return true; + } + } + return false; + } + + /// + /// ajouter un utilisateur dans la liste d'utilisateur + /// + public void AddUser(User user) + { + foreach (User existingUser in UserList) + { + if (existingUser.Username == user.Username) + { + throw new AlreadyUsedException("Username already used."); + } + else if (existingUser.Email == user.Email) + { + throw new AlreadyUsedException("Email already used."); + } + } + UserList.Add(user); + } + + /// + /// supprimer un utilisateur dans la liste d'utilisateur + /// + public void RemoveUser(User user) + { + if (UserList.Contains(user)) + { + UserList.Remove(user); + } + else + { + throw new NotFoundException("User not found."); + } + } + + /// + /// ajouter un theme dans la liste de theme + /// + public void AddTheme(Theme theme) + { + foreach (Theme existingTheme in ThemeList) + { + if (existingTheme.Name == theme.Name) + { + throw new AlreadyExistException("Theme already Existing."); + } + } + ThemeList.Add(theme); + } + + /// + /// récupérer un theme + /// + /// + /// + /// + public Theme GetTheme(string name) + { + foreach (Theme theme in ThemeList) + { + if (theme.Name == name) + { + return theme; + } + } + throw new NotFoundException("Theme not found."); + } + + /// + /// changer le pseudo d'un utilisateur + /// + /// + /// + /// + public void ChangeUsername(User user, string newUsername) + { + foreach(User existingUser in UserList) + { + if(existingUser.Username == newUsername) + { + throw new AlreadyUsedException("this username is already used."); + } + } + user.Username = newUsername; + } + + /// + /// vérifier si le nom du theme n'est pas déjà pris + /// + /// + /// + public bool VerifThemeNameNotTaken(string name) + { + foreach (Theme theme in ThemeList) + { + if (theme.Name == name) + { + return false; + } + } + return true; + } + } +} \ No newline at end of file diff --git a/notus/Biblioteque_de_Class/Exception.cs b/notus/Biblioteque_de_Class/Exception.cs new file mode 100644 index 0000000..bc3de91 --- /dev/null +++ b/notus/Biblioteque_de_Class/Exception.cs @@ -0,0 +1,63 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +using System.Threading.Tasks; + +namespace Biblioteque_de_Class +{ + [Serializable, ExcludeFromCodeCoverage] + public class NotAllowedException : Exception + { + public NotAllowedException(string message) : base(message) + { + } + protected NotAllowedException(SerializationInfo info, StreamingContext context) : base(info, context) + { + } + } + [Serializable, ExcludeFromCodeCoverage] + public class AlreadyUsedException : Exception + { + public AlreadyUsedException(string message) : base(message) + { + } + protected AlreadyUsedException(SerializationInfo info, StreamingContext context) : base(info, context) + { + } + } + [Serializable, ExcludeFromCodeCoverage] + public class NotFoundException : Exception + { + public NotFoundException(string message) : base(message) + { + } + protected NotFoundException(SerializationInfo info, StreamingContext context) : base(info, context) + { + } + } + [Serializable, ExcludeFromCodeCoverage] + public class AlreadyExistException : Exception + { + public AlreadyExistException(string message) : base(message) + { + } + protected AlreadyExistException(SerializationInfo info, StreamingContext context) : base(info, context) + { + } + } + + [Serializable, ExcludeFromCodeCoverage] + public class FileException : Exception + { + public FileException(string message) : base(message) + { + } + protected FileException(SerializationInfo info, StreamingContext context) : base(info, context) + { + + } + } +} diff --git a/notus/Biblioteque_de_Class/HashCodeModel.cs b/notus/Biblioteque_de_Class/HashCodeModel.cs new file mode 100644 index 0000000..7bfbaeb --- /dev/null +++ b/notus/Biblioteque_de_Class/HashCodeModel.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Security.Cryptography; +using System.Text; +using System.Threading.Tasks; + +namespace Biblioteque_de_Class +{ + public class HashCodeModel + { + public static string GetSHA256Hash(string input) + { + using (SHA256 sha256Hash = SHA256.Create()) + { + byte[] bytes = sha256Hash.ComputeHash(Encoding.UTF8.GetBytes(input)); + + StringBuilder builder = new StringBuilder(); + for (int i = 0; i < bytes.Length; i++) + { + builder.Append(bytes[i].ToString("x2")); + } + + return builder.ToString(); + } + } + } +} diff --git a/notus/Biblioteque_de_Class/IManager.cs b/notus/Biblioteque_de_Class/IManager.cs new file mode 100644 index 0000000..a88aac1 --- /dev/null +++ b/notus/Biblioteque_de_Class/IManager.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Biblioteque_de_Class +{ + public interface IManager + { + public void SaveDatabaseData(List UserList); + public void SaveDefaultData(List DefaultThemeList, List DefaultLogoList); + public List LoadDatabaseData(); + public List LoadDefaultTheme(); + public List LoadDefaultLogo(); + } +} diff --git a/notus/Biblioteque_de_Class/Logo.cs b/notus/Biblioteque_de_Class/Logo.cs new file mode 100644 index 0000000..f96fc27 --- /dev/null +++ b/notus/Biblioteque_de_Class/Logo.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +using System.Threading.Tasks; + +namespace Biblioteque_de_Class +{ + [DataContract] + public class Logo + { + [DataMember] + public string Name { get; set; } + [DataMember] + public string LogoLink { get; set; } + + public Logo(string name, string logoLink) + { + Name = name; + LogoLink = logoLink; + } + + public override string ToString() => $"Logo -> Name: {Name}\nLink: {LogoLink}"; + } +} diff --git a/notus/Biblioteque_de_Class/Note.cs b/notus/Biblioteque_de_Class/Note.cs index 3530a5c..02f205b 100644 --- a/notus/Biblioteque_de_Class/Note.cs +++ b/notus/Biblioteque_de_Class/Note.cs @@ -1,43 +1,177 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Runtime.Serialization; using System.Text; using System.Threading.Tasks; namespace Biblioteque_de_Class { - internal class Note + [DataContract(IsReference = true)] + public class Note { - public string Nom { - get { return Nom; } - set { if (value==null) { Nom = "Note sans nom"; } else { Nom = value; } } + [DataMember] + public int id { get; init; } + [DataMember] + private string name; + [DataMember] + public string Name + { + get { return name; } + set { if (value == null) { name = "Unnamed Note"; } else { name = value; } } + } + + [DataMember] + public string Text { get; private set; } = ""; + + [DataMember] + private string logoPath; + [DataMember] + public string LogoPath + { + get { return logoPath; } + private set { if (value == null) { logoPath = "PATH TO DEFAULT LOGO"; } else { logoPath = value; } } + } + + [DataMember] + public DateOnly CreationDate { get; init; } + [DataMember] + public DateOnly ModificationDate { get; private set; } + [DataMember] + public List ImageList { get; private set; } + [DataMember] + public List Collaborators { get; private set; } + [DataMember] + public List Editors { get; private set; } + [DataMember] + public User Owner { get; private set; } + + public Note(int initId,string name, string logoPath, User owner) + { + id = initId; + Name = name; + LogoPath = logoPath; + CreationDate = DateOnly.FromDateTime(DateTime.Now); + ModificationDate = DateOnly.FromDateTime(DateTime.Now); + ImageList = new List(); + Collaborators = new List(); + Editors = new List() { owner }; + Owner = owner; } - public string LogoPATH { - get { return LogoPATH; } - set { if (value == null) { LogoPATH = "PATH TO DEFAULT LOGO"; } else { LogoPATH = value; } } + + public override string ToString() => $"Note -> Name: {Name}\nLogoPath: {LogoPath}"; + + /// + /// vérifier si l'utilisateur est le propriétaire de la note + /// + public bool VerifyOwner(User user) + { + if (user == Owner) { return true; } + else { throw new NotAllowedException("User is not the owner"); } } - public List atributionTag; - public List listeImage; - public List listeLigneTexte; - public List listePosiImage; - public Note(string nom, string logoPATH) + /// + /// ajouter une image à la note + /// + /// + /// + public void AddImage(string imageLink, List position) { - Nom = nom; - LogoPATH = logoPATH; + string newname = (ImageList.Count + 1).ToString(); + ImageList.Add(new NoteImage(newname, imageLink, position)); } - public Note RechercherNote(List listeNote, string nom) + /// + /// supprimer une image de la note + /// + /// + /// + public void RemoveImage(string name) { - foreach (Note note in listeNote) + foreach (NoteImage image in ImageList) { - if (note.Nom == nom) + if (image.Name == name) { - return note; + ImageList.Remove(image); + return; } } - return null; + throw new NotFoundException("Image not found"); + } + + /// + /// ajouter du texte à la note + /// + /// + public void AddText( User user, string text) + { + if (user == Owner || Editors.Contains(user)) { ModificationDate = DateOnly.FromDateTime(DateTime.Now); } + else { throw new NotAllowedException("User is not the owner or an editor"); } + Text = Text + "\n" + text; + } + + /// + /// vérifier si l'utilisateur est un éditeur de la note + /// + public bool VerifyPrivilege(User user) + { + return Editors.Contains(user); } + /// + /// ajouter un utilisateur en tant que coopérateur + /// + public void AddCollaborator(User owner, User user) + { + if (VerifyOwner(owner)) { Collaborators.Add(user); } + user.NoteList.Add(this); + } + + /// + /// supprimer un utilisateur en tant que coopérateur + /// + public void RemoveCollaborator(User owner, User user) + { + if (VerifyOwner(owner)) { Collaborators.Remove(user); } + user.NoteList.Remove(this); + } + + /// + /// passer un coopérateur en tant qu'éditeur + /// + public void AddEditor(User owner, User user) + { + if (Editors.Contains(user)) { throw new AlreadyExistException("user already in editors."); } + if (VerifyOwner(owner)) { Editors.Add(user); } + } + + /// + /// supprimer un coopérateur de la liste des éditeurs + /// + public void RemoveEditor(User owner, User user) + { + if (!Editors.Contains(user)) { throw new NotFoundException("user not found in editors."); } + if (VerifyOwner(owner)) { Editors.Remove(user); } + } + + /// + /// changer le nom de la note + /// + /// + /// + public void ChangeName(User user, string newName) + { + if (VerifyOwner(user)) { Name = newName; } + } + + /// + /// changer le logo de la note + /// + /// + /// + public void ChangeLogo(User user, string newLogoPath) + { + if (VerifyOwner(user)) { LogoPath = newLogoPath; } + } } } diff --git a/notus/Biblioteque_de_Class/NoteImage.cs b/notus/Biblioteque_de_Class/NoteImage.cs new file mode 100644 index 0000000..e0a4fa7 --- /dev/null +++ b/notus/Biblioteque_de_Class/NoteImage.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +using System.Threading.Tasks; + +namespace Biblioteque_de_Class +{ + [DataContract] + public class NoteImage + { + [DataMember] + public string Name { get; set; } + [DataMember] + public string ImageLink { get; set; } + [DataMember] + public List Position { get; set; } + + public NoteImage(string name, string imageLink, List position) + { + Name = name; + ImageLink = imageLink; + Position = position; + } + + public override string ToString() => $"image -> name: {Name}\nlink: {ImageLink}"; + } +} diff --git a/notus/Biblioteque_de_Class/PersistenceManager.cs b/notus/Biblioteque_de_Class/PersistenceManager.cs new file mode 100644 index 0000000..4d06776 --- /dev/null +++ b/notus/Biblioteque_de_Class/PersistenceManager.cs @@ -0,0 +1,52 @@ +using Microsoft.VisualBasic; + +namespace Biblioteque_de_Class +{ + public class PersistenceManager + { + private Database db = new Database(); + + private readonly IManager persistence; + + public PersistenceManager(IManager pers) + { + persistence = pers; + } + + public void SaveDatabaseData(Database database) + { + persistence.SaveDatabaseData(database.UserList); + } + + public void SaveDefaultData(Database database) + { + persistence.SaveDefaultData(database.ThemeList, database.DefaultLogoList); + } + + public Database LoadDatabaseData() + { + db.SetUserList(persistence.LoadDatabaseData()); + db.SetDefaultThemeList(persistence.LoadDefaultTheme()); + db.SetDefaultLogoList(persistence.LoadDefaultLogo()); + return db; + } + + public Database GetOnlyDatabaseUser() + { + db.SetUserList(persistence.LoadDatabaseData()); + return db; + } + + public Database GetOnlyDatabaseDefaultTheme() + { + db.SetDefaultThemeList(persistence.LoadDefaultTheme()); + return db; + } + + public Database GetOnlyDatabaseDefaultLogo() + { + db.SetDefaultLogoList(persistence.LoadDefaultLogo()); + return db; + } + } +} diff --git a/notus/Biblioteque_de_Class/Tags.cs b/notus/Biblioteque_de_Class/Tags.cs new file mode 100644 index 0000000..f5d046b --- /dev/null +++ b/notus/Biblioteque_de_Class/Tags.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +using System.Threading.Tasks; + +namespace Biblioteque_de_Class +{ + [DataContract] + public class Tags + { + [DataMember] + public string Name { get; set; } + [DataMember] + public string Color { get; set; } + + public Tags(string name, string color) + { + Name = name; + Color = color; + } + + public override string ToString() => $"tag -> name: {Name}\ncolor: {Color}"; + } +} diff --git a/notus/Biblioteque_de_Class/Theme.cs b/notus/Biblioteque_de_Class/Theme.cs new file mode 100644 index 0000000..b08d299 --- /dev/null +++ b/notus/Biblioteque_de_Class/Theme.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +using System.Threading.Tasks; + +namespace Biblioteque_de_Class +{ + [DataContract] + public class Theme + { + [DataMember] + public string Name { get; set; } + [DataMember] + public List ColorList { get; private set; } + + public Theme(string name, List colorList) + { + Name = name; + ColorList = colorList; + } + + public override string ToString() => $"name: {Name}\ncolor 1: {ColorList[0]}\ncolor 2: {ColorList[1]}\ncolor 3: {ColorList[2]}\n"; + + /// + /// Change a specific color of the theme. + /// + public void ChangeColor(string color, string newColor) + { + for (int i = 0; i < ColorList.Count; i++) + { + if (ColorList[i] == color) + { + ColorList[i] = newColor; + } + } + } + } +} diff --git a/notus/Biblioteque_de_Class/User.cs b/notus/Biblioteque_de_Class/User.cs new file mode 100644 index 0000000..dad2a6c --- /dev/null +++ b/notus/Biblioteque_de_Class/User.cs @@ -0,0 +1,493 @@ +using Microsoft.VisualBasic.FileIO; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations.Schema; +using System.Runtime.Serialization; + +namespace Biblioteque_de_Class +{ + [DataContract] + public class User + { + [DataMember] + public string Username { get; set; } + [DataMember] + public string Email { get; private set; } + [DataMember] + public string Password { get; private set; } + [DataMember] + public string Picture { get; private set; } + [DataMember] + public Theme UseTheme { get; set; } + [DataMember] + public List NoteList { get; set; } + [DataMember] + public List TagList { get; private set; } + [DataMember] + public List FavList { get; private set; } + [DataMember(EmitDefaultValue = false)] + public bool IsConnected { get; set; } + [DataMember] + public Dictionary> NoteTagged { get; set; } + public List AddedTheme { get; set; } + + public User(string username, string email, string password) + { + Username = username; + Email = email; + Password = password; + Picture = "defaultpicture.png"; + UseTheme = new("", ",,".Split(',').ToList()); + NoteList = new List(); + TagList = new List(); + FavList = new List(); + NoteTagged = new Dictionary>(); + AddedTheme = new List(); + } + public override string ToString() => $"username: {Username}\nemail: {Email}\npassword: {Password}\nOwned notes: {NoteList.Count}"; + + /// + /// rechercher une note dans la liste de note de l'utilisateur et la liste de note favoris de l'utilisateur + /// + public List SearchNoteByName(List toResearchIntoList, string name) + { + List searchedNotes = new List(); + string search = name.ToLower(); + foreach (Note note in toResearchIntoList) + { + if (note.Name.ToLower().Contains(search)) + { + searchedNotes.Add(note); + } + } + return searchedNotes; + } + + public List SearchNoteByTag(List toResearchIntoList, string name) + { + List searchedNotes = new(); + Tags tagtoresearchby = GetTagByName(name); + foreach(Note note in toResearchIntoList) + { + if (NoteTagged[note].Contains(tagtoresearchby)) + { + searchedNotes.Add(note); + } + } + return searchedNotes; + } + + /// + /// rechercher un tag dans la liste de tag de l'utilisateur + /// + public List SearchTagByName(List ToResearchIntoList, string name) + { + List searchedTags = new List(); + string search = name.ToLower(); + foreach (Tags tag in ToResearchIntoList) + { + if (tag.Name.ToLower().Contains(search)) + { + searchedTags.Add(tag); + } + } + return searchedTags; + } + + /// + /// rechercher par date de création ou de modification + /// + /// + /// + /// + /// + /// + public List SearchNoteByDate(List ToResearchIntoList, string name, DateOnly FirstDate, DateOnly SecondeDate) + { + List searchedNotes = new List(); + string search = name.ToLower(); + foreach (Note note in ToResearchIntoList) + { + if (note.Name.ToLower().Contains(search) && note.CreationDate >= FirstDate && note.CreationDate <= SecondeDate || note.Name.ToLower().Contains(search) && note.ModificationDate >= FirstDate && note.ModificationDate <= SecondeDate) + { + searchedNotes.Add(note); + } + } + return searchedNotes; + } + + /// + /// rechercher par nom de la note + /// + /// + /// + /// + public Note GetNoteByName(string name) + { + foreach (Note note in NoteList) + { + if (note.Name == name) + { + return note; + } + } + throw new NotFoundException("Note not found"); + } + + /// + /// rechercher par nom du tag + /// + /// + /// + /// + public Tags GetTagByName(string name) + { + foreach (Tags tag in TagList) + { + if (tag.Name == name) + { + return tag; + } + } + throw new NotFoundException("Tag not found"); + } + + /// + /// ajouter une note dans la liste de note favorite de l'utilisateur + /// + public void AddFavorite(Note note) + { + if (FavList.Contains(note)) + { + throw new AlreadyExistException("Note already in favorites"); + } + FavList.Add(note); + } + + /// + /// supprimer une note dans la liste de note favorite de l'utilisateur + /// + public void RemoveFavorite(Note note) + { + if (FavList.Contains(note)) + { + FavList.Remove(note); + } + else + { + throw new NotFoundException("Note not found"); + } + } + + /// + ///creer une note + /// + public Note CreateNote(string name, string imagePath) + { + foreach (Note existingNote in NoteList) + { + if (existingNote.Name == name) + { + throw new AlreadyExistException("Note already exists"); + } + } + Note note; + if (NoteList.Count == 0) { note = new Note(0, name, imagePath, this); } + else { note = new Note(NoteList[NoteList.Count - 1].id + 1, name, imagePath, this); } + NoteList.Add(note); + NoteTagged.Add(note, new List()); + return note; + } + + /// + /// supprimer une note + /// + public void DeleteNote(Note note) + { + note.VerifyOwner(this); + foreach (Note existingNote in NoteList) + { + if (existingNote == note) + { + NoteList.Remove(existingNote); + NoteTagged.Remove(existingNote); + return; + } + } + throw new NotFoundException("Note not found"); + } + + /// + /// creer un tag + /// + public void CreateTag(string name, string color) + { + foreach (Tags tag in TagList) + { + if (tag.Name == name) + { + throw new AlreadyExistException("Tag already exists"); + } + } + TagList.Add(new Tags(name, color)); + } + + /// + /// supprimer un tag + /// + public void DeleteTag(Tags tagtodelete) + { + foreach (Tags tag in TagList) + { + if (tag == tagtodelete) + { + TagList.Remove(tag); + return; + } + } + throw new NotFoundException("Tag not found"); + } + + public void EditTagName(Tags tag, string newName) + { + if (!TagList.Contains(tag)) + { + throw new NotFoundException("Tag not found"); + } + else + { + foreach (Tags existingTag in TagList) + { + if (existingTag.Name == newName) + { + throw new AlreadyExistException("Tag already exists"); + } + } + } + tag.Name = newName; + } + + public void EditTagColor(Tags tag, string newColor) + { + if (!TagList.Contains(tag)) + { + throw new NotFoundException("Tag not found"); + } + tag.Color = newColor; + } + + /// + /// ajouter un tag a une note + /// + public void AddTagFromNoteList(Note note, Tags tagToAdd) + { + if (!TagList.Contains(tagToAdd)) + { + throw new NotFoundException("Tag not found"); + } + if (!NoteList.Contains(note)) + { + throw new NotFoundException("Note not found"); + } + NoteTagged[note].Add(tagToAdd); + } + + /// + /// supprimer un tag a une note + /// + public void RemoveTagFromNoteList(Note note, Tags tagToRemove) + { + if (!TagList.Contains(tagToRemove)) + { + throw new NotFoundException("Tag not found"); + } + if (!NoteList.Contains(note)) + { + throw new NotFoundException("Note not found"); + } + NoteTagged[note].Remove(tagToRemove); + } + + /// + /// modifier le nom d'une note + /// + /// + /// + /// + public void SetNoteName(Note note, string newname) + { + if (!NoteList.Contains(note)) + { + throw new NotFoundException("Note not found"); + } + foreach(Note n in NoteList) + { + if(n.Name == newname) + { + throw new AlreadyUsedException("This name is already used"); + } + } + note.Name = newname; + } + + /// + /// modifier le mot de passe de l'utilisateur + /// + /// + /// + /// + public void ChangePassword(string newPassword) + { + if (newPassword.Length < 8) { throw new NotAllowedException("this password is too short."); } + if (Password == HashCodeModel.GetSHA256Hash(newPassword).ToString()) + { + throw new AlreadyUsedException("this password is already used."); + } + else + { + Password = HashCodeModel.GetSHA256Hash(newPassword).ToString(); + } + } + + /// + /// modifier le theme de l'utilisateur + /// + /// + /// + public void ChangeTheme(Theme theme) + { + if (UseTheme.Name == theme.Name) + { + throw new AlreadyExistException("this theme is already selected."); + } + UseTheme = theme; + } + + public void ChangeThemeName(Theme theme, string newName) + { + foreach (Theme existingTheme in AddedTheme) + { + if (existingTheme.Name == newName) + { + throw new AlreadyExistException("this theme is already existing."); + } + } + if (theme.Name == newName) + { + throw new AlreadyExistException("this theme is already selected."); + } + theme.Name = newName; + } + + public void ChangeThemeColors(Theme theme, List newColor) + { + int compteurSameColor = 0; + for(int i = 0; i < theme.ColorList.Count; i++) + { + if (theme.ColorList[i] == newColor[i]) + { + compteurSameColor++; + } + } + if (compteurSameColor == theme.ColorList.Count) + { + throw new AlreadyExistException("this theme those colors"); + } + if (theme.ColorList.Count != newColor.Count) + { + throw new NotFoundException("this theme doesn't have the same number of colors"); + } + for (int i = 0; i < theme.ColorList.Count; i++) + { + theme.ChangeColor(theme.ColorList[i], newColor[i]); + } + } + + /// + /// ajouter un theme dans la liste de theme + /// + public void AddTheme(Theme theme) + { + foreach (Theme existingTheme in AddedTheme) + { + if (existingTheme.Name == theme.Name) + { + throw new AlreadyExistException("Theme already used."); + } + } + AddedTheme.Add(theme); + } + + /// + /// supprimer un theme dans la liste de theme + /// + public void RemoveTheme(Theme theme) + { + if (AddedTheme.Contains(theme)) + { + AddedTheme.Remove(theme); + } + else + { + throw new NotFoundException("Theme not found."); + } + } + + /// + /// recuperer un theme dans la liste de theme ajouté par l'utilisateur + /// + /// + /// + /// + public Theme GetTheme(string name) + { + foreach (Theme theme in AddedTheme) + { + if (theme.Name == name) + { + return theme; + } + } + throw new NotFoundException("Theme not found."); + } + + /// + /// modifier l'email de l'utilisateur + /// + /// + /// + public void ChangeEmail(string newEmail) + { + if (newEmail.Length < 3 ) { throw new NotAllowedException("this is not a mail address."); } + if (Email == newEmail) { throw new AlreadyUsedException("this email is the same."); } + Email = newEmail; + } + + /// + /// changer la photo de profil de l'utilisateur + /// + /// + public void ChangeProfilePicture(string path) + { + if (path.Length < 3) + { + Picture = "default.png"; + } + else + { + List picture = new(); + picture = path.Split('.').ToList(); + string extension = picture.Last(); + if (extension != "png" && extension != "jpg" && extension != "jpeg") + { + throw new NotFoundException("this extension is not allowed."); + } + Picture = path; + } + } + + public void SetDefaultTheme(Theme theme) + { + UseTheme = theme; + } + } +} \ No newline at end of file diff --git a/notus/Biblioteque_de_Class/Utilisateur.cs b/notus/Biblioteque_de_Class/Utilisateur.cs deleted file mode 100644 index 1aa6cea..0000000 --- a/notus/Biblioteque_de_Class/Utilisateur.cs +++ /dev/null @@ -1,24 +0,0 @@ -namespace Biblioteque_de_Class -{ - public class Utilisateur - { - private string Psd { get; set; } - private string Mail { get; set; } - private string Mdp { get; set; } - private List NoteList; - - public Utilisateur(string Upseudo, string Umail, string Upassword) - { - Psd = Upseudo; - Mail=Umail; - Mdp = Upassword; - NoteList = new List(); - } - - public override string ToString() - { - return $"pseudo : {Psd}\nmail : {Mail}\npassword : {Mdp}\nNote possédé : { NoteList.Count}"; - } - - } -} \ No newline at end of file diff --git a/notus/Notus_Console/Notus_Console.csproj b/notus/Notus_Console/Notus_Console.csproj index d439800..047b5cb 100644 --- a/notus/Notus_Console/Notus_Console.csproj +++ b/notus/Notus_Console/Notus_Console.csproj @@ -7,4 +7,9 @@ enable + + + + + diff --git a/notus/Notus_Console/Program.cs b/notus/Notus_Console/Program.cs index 83fa4f4..d021b66 100644 --- a/notus/Notus_Console/Program.cs +++ b/notus/Notus_Console/Program.cs @@ -1,2 +1,1146 @@ -// See https://aka.ms/new-console-template for more information -Console.WriteLine("Hello, World!"); +using Biblioteque_de_Class; +using Notus_Persistance; +using System.ComponentModel.DataAnnotations; +using System; +using System.Collections; +using System.Security.Cryptography; +using System.Text; + +// load database +PersistenceManager manager = new PersistenceManager(new Stub()); +Database db = manager.LoadDatabaseData(); + +//save database +PersistenceManager managerSave = new(new ToXML()); + +// initialization zone============================================================================== + +bool arreter = true; +bool continuerboucle = false; +bool menu = true, connection = false, inscription = false; +bool note=false, tags=false, para=false, paraCompte=false, theme=false; + +// déclaration d'un user qui sera utiliser pour servir de personne connecté dans l'app +User u = new("", "", ""); +User uvide = new("", "", "") { IsConnected = false }; + +// déclaration d'une note qui sera utiliser pour servir de note selectionnée +Note n = new(uvide.NoteList.Count,"","",uvide); + +List researchlist = new(); + +/* + * starting menu: + * connection + * inscription + * + * menu principal: + * note (créer, modifier, supprimer, partager, rechercher) + * tags (créer, modifier, supprimer) + * parametre (compte (modifier, supprimer), theme ( créer, modifier, supprimer)) + * se déconnecter + */ + + +// factorisation zone ================================================================================ + +// pour faire un choix par defaut non +bool Choix_DefaultNon() +{ + continuerboucle = false; + while (!continuerboucle) + { + Console.WriteLine("\nContinuer ? (o/N)"); + switch (Console.ReadLine()) + { + case "O": + return true; + case null: + return false; + case "o": + return true; + case "n": + return false; + default: + Console.WriteLine("\nEntrez un choix valide.\n"); + continuerboucle = true; + break; + } + } + return false; +} + +// pour selectionner une note dans le menu note +bool Choix_Note() +{ + foreach (Note notetodisplay in u.NoteList) + { + Console.WriteLine("- " + notetodisplay.Name); + } + continuerboucle = true; + while (continuerboucle) + { + Console.WriteLine("Quel note voulez vous selectionner ? (entrez le nom de la note complet)"); + string? nom = Console.ReadLine(); + if (nom == null) { continue; } + foreach (Note note in u.NoteList) + { + if (note.Name == nom) + { + n = note; + return true; + } + } + Console.WriteLine("\nEntrez un choix valide.\n"); + Console.WriteLine("Voulez vous reessayer ? (o/N)"); + continuerboucle = Choix_DefaultNon(); + } + return false; +} + +bool CouleurValide(string couleur) +{ + int correct = 0; + if (couleur[0] == '#' && couleur.Length == 7) + { + for (int i = 1; i < 7-1; i++) + { + if (couleur[i] >= '0' && couleur[i] <= '9' || couleur[i] >= 'A' && couleur[i] <= 'F' || couleur[i] >= 'a' && couleur[i] <= 'f') + { + correct++; + } + } + if (correct == 6) + { + return true; + } + } + return false; +} + +bool IsValidEmail(string email) +{ + return new EmailAddressAttribute().IsValid(email); +} + +List Choix_CouleursToTheme() +{ + Console.WriteLine("Choisez les couleurs respetivement fond, text, boutton en hexa (ex: #FFFFFF) séparé par des epaces"); + List listcouleurs = new(); + string? couleur = Console.ReadLine(); + if (couleur == null) { return new List(); } + listcouleurs = couleur.Split(' ').ToList(); + foreach (string coul in listcouleurs) + { + if (!CouleurValide(coul)) + { + Console.WriteLine("\nEntrez un choix valide. pour "+ coul +"\n"); + return new List(); + } + } + return listcouleurs; +} + +// program zone ===================================================================================== +while (arreter) +{ + //starting menu + while (menu) + { + Console.WriteLine("\n|--------------------------------------|"); + Console.WriteLine("| |"); + Console.WriteLine("| starting menu |"); + Console.WriteLine("| |"); + Console.WriteLine("|--------------------------------------|--------|"); + Console.WriteLine("| |"); + Console.WriteLine("| 1 / - connection - |"); + Console.WriteLine("| 2 / - inscription - |"); + Console.WriteLine("| 3 / - arreter le program - |"); + Console.WriteLine("| |"); + Console.WriteLine("|-----------------------------------------------|\n"); + Console.WriteLine("rentrez votre choix."); + switch (Console.ReadLine()) + { + case "1": ///Connexion + connection = true; break; + + case "2":///Creer un compte + inscription = true; break; + case "3":///Arreter le program + arreter = false; + menu = false; + break; + default: + Console.WriteLine("\nEntrez un choix valide.\n"); + break; + } + + //connection + while (connection) + { + connection = false; + Console.WriteLine("\nEntrez un nom : "); + string? nom = Console.ReadLine(); + if (nom == null) { continue; } + Console.WriteLine("\nEntrez un password :"); + string? password = Console.ReadLine(); + if (password == null) { continue; } + + //test si l'utilisateur existe et si le password est bon + try + { + u = db.GetUser(nom); + } + catch (AlreadyUsedException ex) + { + Console.WriteLine(ex.Message); + connection = true; + } + if (!connection) + { + + if (Database.ComparePassword(u, HashCodeModel.GetSHA256Hash(password).ToString())) + { + u.IsConnected = true; + Console.WriteLine("\nConnection réussie !\n"); + menu = false; + break; + } + else + { + Console.WriteLine("\nWrong PassWord !\n"); + connection = true; + continuerboucle = true; + u = uvide; + } + } + + // demander si il veut continuer de ce connecter + connection = Choix_DefaultNon(); + } + + + + //inscription + while (inscription) + { + Console.WriteLine("\nEntrez un nom :"); + string? nom = Console.ReadLine(); + if (nom == null) { continue; } + Console.WriteLine("\nEntrez un password :"); + string? password = Console.ReadLine(); + + //test si l'utilisateur n'est pas déjà dans la base de donnée et ajout dans la base de donnée + if (password == null) { continue; } + try + { + u = db.GetUser(nom); + } + catch (AlreadyUsedException) + { + u = new User(nom, "", HashCodeModel.GetSHA256Hash(password).ToString()); + db.AddUser(u); + db.GetUser(nom).IsConnected = true; + Console.WriteLine("\nConnection réussie !\n"); + menu = false; + break; + } + Console.WriteLine("\nNom d'utilisateur déjà utilisé. \n"); + + // demander si il veut continuer de ce connecter + inscription = Choix_DefaultNon(); + + } + } + + //menu principal + while (u.IsConnected) + { + Console.WriteLine("\n|--------------------------------------|"); + Console.WriteLine("| |"); + Console.WriteLine("| menu |"); + Console.WriteLine("| |"); + Console.WriteLine("|--------------------------------------|--------|"); + Console.WriteLine("| |"); + Console.WriteLine("| 1/ - note - |"); + Console.WriteLine("| 2/ - tags - |"); + Console.WriteLine("| 3/ - paramêtres - |"); + Console.WriteLine("| 4/ - se déconnecter - |"); + Console.WriteLine("| |"); + Console.WriteLine("|-----------------------------------------------|\n"); + Console.WriteLine("rentrez votre choix."); + switch (Console.ReadLine()) + { + case "1": + note = true; + foreach (Note notetodisplay in u.NoteList) + { + Console.WriteLine("- " + notetodisplay.Name); + } + break; + case "2": + tags = true; + break; + case "3": + para = true; + break; + case "4": + menu = true; + Console.WriteLine("\ndéconnecté! \n"); + u.IsConnected = false; + u = uvide; + break; + default: + Console.WriteLine("\nEntrez un choix valide.\n"); + break; + } + + while (note) + { + Console.WriteLine("\n|--------------------------------------|"); + Console.WriteLine("| |"); + Console.WriteLine("| menu - note |"); + Console.WriteLine("| |"); + Console.WriteLine("|--------------------------------------|--------|"); + Console.WriteLine("| |"); + Console.WriteLine("| 1/ - créer une note - |"); + Console.WriteLine("| 2/ - modifier une note - |"); + Console.WriteLine("| 3/ - supprimer une note - |"); + Console.WriteLine("| 4/ - écrire dans une note - |"); + Console.WriteLine("| 5/ - ajouter une image - |"); + Console.WriteLine("| 6/ - supprimer une image - |"); + Console.WriteLine("| 7/ - partager note - |"); + Console.WriteLine("| 8/ - supprimer collaborateur - |"); + Console.WriteLine("| 9/ - ajouter un éditeur - |"); + Console.WriteLine("| 10/ - supprimer un éditeur - |"); + Console.WriteLine("| 11/ - ajouter tag - |"); + Console.WriteLine("| 12/ - enelver tag - |"); + Console.WriteLine("| 13/ - rechercher une note - |"); + Console.WriteLine("| 14/ - retour - |"); + Console.WriteLine("| |"); + Console.WriteLine("|-----------------------------------------------|\n"); + Console.WriteLine("note actuelle : " + n.Name); + Console.WriteLine("rentrez votre choix."); + switch (Console.ReadLine()) + { + case "1": + Console.WriteLine("\nEntrez le nom de la note :"); + string? wantedNameNote = Console.ReadLine(); + if (wantedNameNote == null) { continue; } + try + { + n = u.CreateNote(wantedNameNote, ""); + }catch(AlreadyUsedException ex) + { + Console.WriteLine(ex.Message); + break; + } + Console.WriteLine("\nNote créée !\n"); + break; + case "2": + if (!Choix_Note()) { break; } + Console.WriteLine("Voulez vous modifier le nom de la note ? (o/N)"); + if (Choix_DefaultNon()) + { + Console.WriteLine("\nEntrez le nouveau nom de la note :"); + string? wantedNameNote2 = Console.ReadLine(); + if (wantedNameNote2 == null) { continue; } + try + { + n.ChangeName(u, wantedNameNote2); + } + catch (NotAllowedException ex) + { + Console.WriteLine(ex.Message); + break; + } + Console.WriteLine("\nNom modifié !\n"); + } + break; + case "3": + if (!Choix_Note()) { break; } + Console.WriteLine("Voulez vous vraiment supprimer la note ? (o/N)"); + if (Choix_DefaultNon()) + { + try + { + u.DeleteNote(n); + } + catch (NotAllowedException ex) + { + Console.WriteLine(ex.Message); + break; + } + catch (NotFoundException ex) + { + Console.WriteLine(ex.Message); + break; + } + Console.WriteLine("\nNote supprimée !\n"); + } + break; + case "4": + if (!Choix_Note()) { break; } + Console.WriteLine(n.Text); // affiche le texte de la note + if (!n.VerifyPrivilege(u)) { break; } + Console.WriteLine("\nEntrez le texte à ajouter"); + string? wantedTextNote = Console.ReadLine(); + if (wantedTextNote == null) { continue; } + try + { + n.AddText(u, wantedTextNote); + } + catch(NotAllowedException ex) + { + Console.WriteLine(ex.Message); + break; + } + break; + case "5": + if (!Choix_Note()) { break; } + if (!n.VerifyPrivilege(u)) { break; } + Console.WriteLine("Entrer le chemin de l'image :"); + string? wantedimage = Console.ReadLine(); + if (wantedimage == null) { continue; } + n.AddImage(wantedimage, new() { 0, 0 }); + break; + case "6": + if (!Choix_Note()) { break; } + if(!n.VerifyPrivilege(u)) { break; } + foreach (NoteImage image in n.ImageList) + { + Console.WriteLine(image.Name + " -> " + image.ImageLink + "\n"); + } + Console.WriteLine("entrez le numéro de l'image à supprimer :"); + string? wantedimagetodelete = Console.ReadLine(); + if(wantedimagetodelete == null) { continue; } + try + { + n.RemoveImage(wantedimagetodelete); + } + catch(NotFoundException ex) + { + Console.WriteLine(ex.Message); + break; + } + break; + case "7": + if (!Choix_Note()) { break; } + if (!n.VerifyOwner(u)) { continue; } + User wantedUser; + Console.WriteLine("\nEntrez le nom de l'utilisateur à qui partager la note :"); + string? wantedNameUser = Console.ReadLine(); + if (wantedNameUser == null) { continue; } + try + { + wantedUser = db.SearchUser(wantedNameUser); + } + catch (NotFoundException ex) + { + Console.WriteLine(ex.Message); + break; + } + try + { + n.AddCollaborator(u, wantedUser); + } + catch (NotAllowedException ex) + { + Console.WriteLine(ex.Message); + break; + } + break; + case "8": //supp collab + User wantedUser2; + if (!Choix_Note()) { break; } + if (!n.VerifyOwner(u)) { continue; } + Console.WriteLine("\n Entrez le nom de l'utilisateur qui doit etre supprimer : "); + string? wantedNameUser2 = Console.ReadLine(); + if (wantedNameUser2 == null) { continue; } + try + { + wantedUser2 = db.SearchUser(wantedNameUser2); + } + catch(NotFoundException ex) + { + Console.WriteLine(ex.Message); + break; + } + try + { + n.RemoveCollaborator(u, wantedUser2); + } + catch(NotAllowedException ex) + { + Console.WriteLine(ex.Message); + break; + } + break; + case "9":// add edit + if (!Choix_Note()) { break; } + if (!n.VerifyOwner(u)) { continue; } + foreach (User user in n.Collaborators) + { + if( n.Editors.Contains(user)) { continue; } + Console.WriteLine( " - " + user.Username ); + } + User UserToAddEdit; + Console.WriteLine("Entrer le pseudo de l'utilisateur voulu"); + string? wantedNameUser3 = Console.ReadLine(); + if (wantedNameUser3 == null) { continue; } + try + { + UserToAddEdit = db.SearchUser(wantedNameUser3); + }catch(NotFoundException ex) + { + Console.WriteLine(ex.Message); + break; + } + try + { + n.AddEditor(u, UserToAddEdit); + } + catch(AlreadyExistException ex) + { + Console.WriteLine(ex.Message); + break; + } + break; + case "10":// supp edit + if (!Choix_Note()) { break; } + if (!n.VerifyOwner(u)) { continue; } + User UserToDeleteEdit; + Console.WriteLine("Entrer le pseudo de l'utilisateur voulu"); + string? wantedNameUser4 = Console.ReadLine(); + if (wantedNameUser4 == null) { continue; } + try + { + UserToDeleteEdit = db.SearchUser(wantedNameUser4); + } + catch (NotFoundException ex) + { + Console.WriteLine(ex.Message); + break; + } + try + { + n.RemoveEditor(u, UserToDeleteEdit); + } + catch (NotFoundException ex) + { + Console.WriteLine(ex.Message); + break; + } + break; + case "11": + Tags tagtoadd; + if (!Choix_Note()) { break; } + Console.WriteLine("\nEntrez le nom du tag à ajouter :"); + string? wantedNameTag2 = Console.ReadLine(); + if (wantedNameTag2 == null) { continue; } + try + { + tagtoadd = u.GetTagByName(wantedNameTag2); + } + catch (NotFoundException ex) + { + Console.WriteLine(ex.Message); + break; + } + try + { + u.AddTagFromNoteList(n, tagtoadd); + } + catch (NotAllowedException ex) + { + Console.WriteLine(ex.Message); + break; + } + break; + case "12":// enelver tag + if (!Choix_Note()) { break; } + Console.WriteLine("\n Entrez le nom du tag à supprimer"); + string? wantedNameTag3 = Console.ReadLine(); + if (wantedNameTag3 == null) { continue; } + try + { + tagtoadd = u.GetTagByName(wantedNameTag3); + } + catch (NotFoundException ex) + { + Console.WriteLine(ex.Message); + break; + } + try + { + u.RemoveTagFromNoteList(n, tagtoadd); + } + catch (NotAllowedException ex) + { + Console.WriteLine(ex.Message); + break; + } + break; + case "13": + List wantedNotes = new List(); + + Console.WriteLine("\nEntrez le nom de la note à rechercher :"); + string? wantedNameNote3 = Console.ReadLine(); + if (wantedNameNote3 == null) { continue; } + Console.WriteLine("Voulez vous faire une recherche avancé ? (o/N)"); + if (Choix_DefaultNon()) + { + Console.WriteLine("Voulez vous chercher dans les favoris ? (o/N)"); + if (Choix_DefaultNon()) + { + wantedNotes = u.FavList; + } + else + { + wantedNotes = u.NoteList; + } + Console.WriteLine("Voulez vous chercher par date seul '1' ou par fourchette de date '2' ? autre pour continuer"); + switch (Console.ReadLine()) + { + case "1": + Console.WriteLine("Entrez la date de la note à rechercher :"); + string? line = Console.ReadLine(); + if (line == null) { continue; } + DateOnly date1; + while (!DateOnly.TryParseExact(line, "dd/MM/yyyy", null, System.Globalization.DateTimeStyles.None, out date1)) + { + Console.WriteLine("Invalid date, please retry"); + line = Console.ReadLine(); + } + wantedNotes = u.SearchNoteByDate(wantedNotes, wantedNameNote3, date1, date1); + if (wantedNotes == null) { Console.WriteLine("Aucun resultat !"); break; } + foreach (Note notetodisplay in wantedNotes) + { + Console.WriteLine(" - " + notetodisplay.Name); + } + break; + + case "2": + Console.WriteLine("Entrez la date de début de la fourchette de date de la note à rechercher :"); + string? line2 = Console.ReadLine(); + if (line2 == null) { continue; } + DateOnly date2; + while (!DateOnly.TryParseExact(line2, "dd/MM/yyyy", null, System.Globalization.DateTimeStyles.None, out date2)) + { + Console.WriteLine("Invalid date, please retry"); + line2 = Console.ReadLine(); + } + Console.WriteLine("Entrez la date de début de la fourchette de date de la note à rechercher :"); + string? line3 = Console.ReadLine(); + if (line3 == null) { continue; } + DateOnly date3; + while (!DateOnly.TryParseExact(line3, "dd/MM/yyyy", null, System.Globalization.DateTimeStyles.None, out date3)) + { + Console.WriteLine("Invalid date, please retry"); + line3 = Console.ReadLine(); + } + wantedNotes = u.SearchNoteByDate(wantedNotes, wantedNameNote3, date2, date3); + if (wantedNotes == null) { Console.WriteLine("Aucun resultat !"); break; } + foreach (Note notetodisplay in wantedNotes) + { + Console.WriteLine(" - " + notetodisplay.Name); + } + break; + default: + break; + } + Console.WriteLine("\n Voulez vous rechercher par tag (o/N) ? autre pour continuer"); + if (Choix_DefaultNon()) + { + Console.WriteLine("Plusieurs tags ? (o/N)"); + if (Choix_DefaultNon()) + { + Console.WriteLine("choisissez les tags à rechercher séparé par un espace :"); + string? tagstoresearch = Console.ReadLine(); + if (tagstoresearch == null) { continue; } + List listoftagtoresearch = tagstoresearch.Split(' ').ToList(); + } + else + { + Console.WriteLine("choisissez le tags à rechercher"); + string? tagstoresearch = Console.ReadLine(); + if (tagstoresearch == null) { continue; } + if (wantedNotes == null) { Console.WriteLine("Aucun resultat !"); break; } + try + { + wantedNotes = u.SearchNoteByTag(wantedNotes, tagstoresearch); + } + catch (Exception ex) { Console.WriteLine(ex.Message); break; } + } + if (wantedNotes == null) { Console.WriteLine("Aucun resultat !"); break; } + foreach (Note notetodisplay in wantedNotes) + { + Console.WriteLine(" - " + notetodisplay.Name); + } + } + } + else + { + wantedNotes = u.SearchNoteByName(wantedNotes, wantedNameNote3); + if (wantedNotes == null) { Console.WriteLine("Aucun resultat !"); break; } + foreach (Note notetodisplay in wantedNotes) + { + Console.WriteLine(" - " + notetodisplay.Name); + } + } + break; + case "14": + note = false; + break; + default: + Console.WriteLine("\nEntrez un choix valide.\n"); + break; + } + } + + while (tags) + { + Console.WriteLine("\n|--------------------------------------|"); + Console.WriteLine("| |"); + Console.WriteLine("| menu - tags |"); + Console.WriteLine("| |"); + Console.WriteLine("|--------------------------------------|--------|"); + Console.WriteLine("| |"); + Console.WriteLine("| 1/ - créer tag - |"); + Console.WriteLine("| 2/ - modifier un tag - |"); + Console.WriteLine("| 3/ - supprimer tag - |"); + Console.WriteLine("| 4/ - retour - |"); + Console.WriteLine("| |"); + Console.WriteLine("|-----------------------------------------------|\n"); + Console.WriteLine("rentrez votre choix."); + switch (Console.ReadLine()) + { + case "1": + Console.WriteLine("\nEntrez le nom du tag à créer :"); + string? wantedNameTag = Console.ReadLine(); + if (wantedNameTag == null) { continue; } + Console.WriteLine("\nEntrez la couleur du tag à créer :"); + string? wantedColorTag = Console.ReadLine(); + if (wantedColorTag == null) { continue; } + if (!CouleurValide(wantedColorTag)) + { + Console.WriteLine("\nEntrez une couleur valide.\n"); + break; + } + try + { + u.CreateTag(wantedNameTag ,wantedColorTag); + } + catch (NotAllowedException ex) + { + Console.WriteLine(ex.Message); + break; + } + break; + case "2": + Tags tagtoedit; + Console.WriteLine("\nEntrez le nom du tag à modifier :"); + string? wantedNameTag2 = Console.ReadLine(); + if (wantedNameTag2 == null) { continue; } + try + { + tagtoedit = u.GetTagByName(wantedNameTag2); + } + catch (NotFoundException ex) + { + Console.WriteLine(ex.Message); + break; + } + Console.WriteLine("Voulez vous modifier le nom du tag ? (o/N)"); + if (Choix_DefaultNon()) + { + Console.WriteLine("\nEntrez le nouveau nom du tag :"); + string? wantedNewNameTag = Console.ReadLine(); + if (wantedNewNameTag == null) { continue; } + try + { + u.EditTagName(tagtoedit, wantedNewNameTag); + } + catch (NotFoundException ex) + { + Console.WriteLine(ex.Message); + break; + } + catch(AlreadyUsedException ex) + { + Console.WriteLine(ex.Message); + break; + } + Console.WriteLine("Le nom du tag a été modifié avec succès."); + } + Console.WriteLine("Voulez vous modifier la couleur du tag ? (o/N)"); + if (Choix_DefaultNon()) + { + Console.WriteLine("\nEntrez la nouvelle couleur du tag :"); + string? wantedNewColorTag = Console.ReadLine(); + if (wantedNewColorTag == null) { continue; } + if (!CouleurValide(wantedNewColorTag)) + { + Console.WriteLine("\nEntrez une couleur valide.\n"); + break; + } + try + { + u.EditTagColor(tagtoedit, wantedNewColorTag); + } + catch (NotFoundException ex) + { + Console.WriteLine(ex.Message); + break; + } + Console.WriteLine("La couleur du tag a été modifiée avec succès."); + } + break; + case "3": + Tags tagToDelete; + Console.WriteLine("\nEntrez le nom du tag à supprimer :"); + string? wantedNameTag3 = Console.ReadLine(); + if (wantedNameTag3 == null) { continue; } + try + { + tagToDelete = u.GetTagByName(wantedNameTag3); + } + catch (NotFoundException ex) + { + Console.WriteLine(ex.Message); + break; + } + try + { + u.DeleteTag(tagToDelete); + } + catch (NotFoundException ex) + { + Console.WriteLine(ex.Message); + break; + } + break; + case "4": + tags = false; + break; + default: + Console.WriteLine("\nEntrez un choix valide.\n"); + break; + } + } + + while (para) + { + Console.WriteLine("\n|--------------------------------------|"); + Console.WriteLine("| |"); + Console.WriteLine("| menu - paramêtre |"); + Console.WriteLine("| |"); + Console.WriteLine("|--------------------------------------|--------|"); + Console.WriteLine("| |"); + Console.WriteLine("| 1/ - modifier compte - |"); + Console.WriteLine("| 2/ - thèmes - |"); + Console.WriteLine("| 3/ - retour - |"); + Console.WriteLine("| |"); + Console.WriteLine("|-----------------------------------------------|\n"); + Console.WriteLine("rentrez votre choix."); + switch (Console.ReadLine()) + { + case "1": + paraCompte = true; + break; + case "2": + theme = true; + break; + case "3": + para = false; + break; + default: + Console.WriteLine("\nEntrez un choix valide.\n"); + break; + } + while (paraCompte) + { + Console.WriteLine("\n|--------------------------------------|"); + Console.WriteLine("| |"); + Console.WriteLine("| paramêtre - compte |"); + Console.WriteLine("| |"); + Console.WriteLine("|--------------------------------------|--------|"); + Console.WriteLine("| |"); + Console.WriteLine("| 1/ - modifier pseudo - |"); + Console.WriteLine("| 2/ - modifier mot de passe - |"); + Console.WriteLine("| 3/ - modifier l'email |"); + Console.WriteLine("| 4/ - modifier l'image de profil |"); + Console.WriteLine("| 5/ - supprimer le compte - |"); + Console.WriteLine("| 6/ - retour - |"); + Console.WriteLine("| |"); + Console.WriteLine("|-----------------------------------------------|\n"); + Console.WriteLine("rentrez votre choix."); + switch (Console.ReadLine()) + { + case "1": + Console.WriteLine("\nEntrez votre nouveau pseudo :"); + string? wantedNewPseudo = Console.ReadLine(); + if (wantedNewPseudo == null) { continue; } + try + { + db.ChangeUsername(u,wantedNewPseudo); + } + catch (AlreadyUsedException ex) + { + Console.WriteLine(ex.Message); + break; + } + Console.WriteLine("Votre pseudo a été modifié avec succès."); + break; + case "2": + Console.WriteLine("\nEntrez votre nouveau mot de passe :"); + string? wantedNewPassword = Console.ReadLine(); + if (wantedNewPassword == null) { continue; } + try + { + u.ChangePassword(wantedNewPassword); + } + catch(NotAllowedException ex) + { + Console.WriteLine(ex.Message); + break; + } + Console.WriteLine("Votre mot de passe a été modifié avec succès."); + break; + case "3": + Console.WriteLine("\nEntrez votre nouvelle adresse email :"); + string? wantedNewEmail = Console.ReadLine(); + if (wantedNewEmail == null) { continue; } + if (!IsValidEmail(wantedNewEmail)) + { + Console.WriteLine("\nEntrez une adresse email valide.\n"); + break; + } + try + { + u.ChangeEmail(wantedNewEmail); + } + catch (AlreadyUsedException ex) + { + Console.WriteLine(ex.Message); + break; + } + break; + case "4": + Console.WriteLine("\nEntrez le chemin de votre nouvelle image de profil :"); + string? wantedNewProfilePicture = Console.ReadLine(); + if (wantedNewProfilePicture == null) { continue; } + if (!File.Exists(wantedNewProfilePicture)) + { + Console.WriteLine("\nEntrez un chemin valide.\n"); + break; + } + try + { + u.ChangeProfilePicture(wantedNewProfilePicture); + } + catch (NotFoundException ex) + { + Console.WriteLine(ex.Message); + break; + } + catch(AlreadyExistException ex) + { + Console.WriteLine(ex.Message); + break; + } + break; + case "5": + Console.WriteLine("\nÊtes-vous sûr de vouloir supprimer votre compte ? (o/N)"); + if (Choix_DefaultNon()) + { + try + { + db.RemoveUser(u); + } + catch (NotFoundException ex) + { + Console.WriteLine(ex.Message); + break; + } + Console.WriteLine("Votre compte a été supprimé avec succès."); + paraCompte = false; + para = false; + u = uvide; + } + + break; + case "6": + paraCompte = false; + break; + default: + Console.WriteLine("\nEntrez un choix valide.\n"); + break; + } + } + while (theme) + { + Console.WriteLine("\n|--------------------------------------|"); + Console.WriteLine("| |"); + Console.WriteLine("| paramêtre - thèmes |"); + Console.WriteLine("| |"); + Console.WriteLine("|--------------------------------------|--------|"); + Console.WriteLine("| |"); + Console.WriteLine("| 1/ - choisir un thème - |"); + Console.WriteLine("| 2/ - créer un thème - |"); + Console.WriteLine("| 3/ - supprimer un thème - |"); + Console.WriteLine("| 4/ - modifier un thème - |"); + Console.WriteLine("| 5/ - retour - |"); + Console.WriteLine("| |"); + Console.WriteLine("|-----------------------------------------------|\n"); + Console.WriteLine("rentrez votre choix."); + switch (Console.ReadLine()) + { + case "1": + Theme ThemetoSelect; + Console.WriteLine("\nEntrez le nom du thème :"); + string? wantedTheme = Console.ReadLine(); + if (wantedTheme == null) { continue; } + try + { + ThemetoSelect = db.GetTheme(wantedTheme); + } + catch (NotFoundException) + { + try + { + ThemetoSelect = u.GetTheme(wantedTheme); + } + catch (NotFoundException ex2) + { + Console.WriteLine(ex2.Message); + break; + } + } + try + { + u.ChangeTheme(ThemetoSelect); + } + catch (AlreadyExistException ex) + { + Console.WriteLine(ex.Message); + break; + } + break; + case "2": + List couleurs; + Console.WriteLine("\nEntrez le nom du thème :"); + string? wantedNewTheme = Console.ReadLine(); + if (wantedNewTheme == null) { continue; } + if (!db.VerifThemeNameNotTaken(wantedNewTheme)) + { + Console.WriteLine("\nCe nom de thème est déjà pris.\n"); + break; + } + else + { + couleurs = Choix_CouleursToTheme(); + } + try + { + u.AddTheme(new Theme(wantedNewTheme, couleurs)); + }catch(AlreadyExistException ex) + { + Console.WriteLine(ex.Message); + break; + } + break; + case "3": + Theme ThemeToDelete; + Console.WriteLine("\nEntrez le nom du thème :"); + string? wantedThemeToDelete = Console.ReadLine(); + if (wantedThemeToDelete == null) { continue; } + try + { + ThemeToDelete = u.GetTheme(wantedThemeToDelete); + } + catch (NotFoundException ex) + { + Console.WriteLine(ex.Message); + break; + } + try + { + u.RemoveTheme(ThemeToDelete); + } + catch (NotFoundException ex) + { + Console.WriteLine(ex.Message); + break; + } + break; + case "4": + Theme ThemeToModify; + Console.WriteLine("\nEntrez le nom du thème :"); + string? wantedThemeToModify = Console.ReadLine(); + if (wantedThemeToModify == null) { continue; } + try + { + ThemeToModify = u.GetTheme(wantedThemeToModify); + } + catch (NotFoundException ex) + { + Console.WriteLine(ex.Message); + break; + } + Console.WriteLine("\nVoules Vous changer le nom du theme : (o/N)"); + if (Choix_DefaultNon()) + { + Console.WriteLine("\nEntrez le nouveau nom du thème :"); + string? wantedNewThemeName = Console.ReadLine(); + if (wantedNewThemeName == null) { continue; } + if(!db.VerifThemeNameNotTaken(wantedNewThemeName)) + { + Console.WriteLine("\nCe nom de thème est déjà pris.\n"); + break; + } + try + { + u.ChangeThemeName(ThemeToModify, wantedNewThemeName); + } + catch(AlreadyExistException ex) + { + Console.WriteLine(ex.Message); + break; + } + } + Console.WriteLine("\nVoules Vous changer les couleurs du theme : (o/N)"); + if (Choix_DefaultNon()) + { + List couleursToChange; + couleursToChange = Choix_CouleursToTheme(); + try + { + u.ChangeThemeColors(ThemeToModify, couleursToChange); + } + catch (NotFoundException ex) + { + Console.WriteLine(ex.Message); + break; + } + catch (AlreadyExistException ex) + { + Console.WriteLine(ex.Message); + break; + } + } + break; + case "5": + theme = false; + break; + default: + Console.WriteLine("\nEntrez un choix valide.\n"); + break; + } + } + } + } +} + +managerSave.SaveDatabaseData(db); +managerSave.SaveDefaultData(db); diff --git a/notus/Notus_Persistence/Notus_Persistance.csproj b/notus/Notus_Persistence/Notus_Persistance.csproj new file mode 100644 index 0000000..bec8016 --- /dev/null +++ b/notus/Notus_Persistence/Notus_Persistance.csproj @@ -0,0 +1,13 @@ + + + + net7.0 + enable + enable + + + + + + + diff --git a/notus/Notus_Persistence/Stub.cs b/notus/Notus_Persistence/Stub.cs new file mode 100644 index 0000000..1970b85 --- /dev/null +++ b/notus/Notus_Persistence/Stub.cs @@ -0,0 +1,82 @@ +using Biblioteque_de_Class; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.Serialization.Json; +using System.Text; +using System.Security.Cryptography; +using System.Threading.Tasks; + + +namespace Notus_Persistance +{ + public class Stub : IManager + { + public void SaveDatabaseData(List UserList) + { + throw new NotImplementedException(); + } + + public void SaveDefaultData(List DefaultThemeList, List DefaultLogoList) + { + throw new NotImplementedException() ; + } + + //Loaders + List IManager.LoadDatabaseData() + { + List userList = new List(); + Note nselect; + User uselect; + + // add some users + userList.Add(new User("Nicolas", "leHeros@gmail.com", "FeurFeur")); + userList.Add(new User("Benjamin", "labsent@gmail.com", "Moto2005")); + userList.Add(new User("Liam", "liammonchanin@gmail.com", "Baguette")); + userList.Add(new User("Brigitte", "Macroutte@gmail.com", "4949Trois")); + + // add some notes and tags to go faster + + for (int i = 0; i < userList.Count; i++) + { + userList[i].CreateNote($"Note {i}", "DefaultLogo.png"); + userList[i].CreateTag($"Tag {i}", "#5555FF"); + } + + // add note to user for sharing note test mixed with tag + + uselect = userList[0]; + nselect = uselect.NoteList[0]; + nselect.AddCollaborator(uselect, userList[1]); + nselect.AddCollaborator(uselect, userList[2]); + uselect.AddTagFromNoteList(nselect, uselect.TagList[0]); + nselect.AddEditor(uselect, userList[2]); + + // add some default logos and themes + foreach (User user in userList) + { + user.ChangePassword(user.Password); + } + + return userList; + } + + public List LoadDefaultTheme() + { + List DefaultThemeList = new List(); + DefaultThemeList.Add(new("blacktheme", "#000000,#FF00FF,#OOFFOO".Split(',').ToList())); + DefaultThemeList.Add(new("whitetheme", "#FFFFFF,#FF00FF,#OOFFOO".Split(',').ToList())); + return DefaultThemeList; + } + public List LoadDefaultLogo() + { + List DefaultLogoList = new List(); + DefaultLogoList.Add(new("default","DefaultLogo.png")); + DefaultLogoList.Add(new("1", "Logo1.png")); + DefaultLogoList.Add(new("2", "Logo2.png")); + return DefaultLogoList; + } + + } +} + diff --git a/notus/Notus_Persistence/ToXML.cs b/notus/Notus_Persistence/ToXML.cs new file mode 100644 index 0000000..a177846 --- /dev/null +++ b/notus/Notus_Persistence/ToXML.cs @@ -0,0 +1,107 @@ +using Biblioteque_de_Class; +using System.Runtime.Serialization; +using System.Xml; +using System.IO; +using System.Diagnostics.CodeAnalysis; + +namespace Notus_Persistance +{ + [ExcludeFromCodeCoverage] + public class ToXML : IManager + { + // /../../../.. + private string DataFilePath { get; set; } = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "NotusData"); + private const string DataFileName = "/Userdata.xml"; + private const string DefaultThemeName = "/defaultTheme.xml"; + private const string DefaultLogoName = "/defaultLogo.xml"; + private static readonly DataContractSerializer DatabaseXmlSerializer = new(typeof(Database), GetKnownTypes()); + + public void SaveDatabaseData(List UserList) + { + if (!Directory.Exists(DataFilePath)) + { + Directory.CreateDirectory(DataFilePath); + } + XmlWriterSettings settings = new() { Indent = true }; + using TextWriter tw = File.CreateText(Path.Combine(DataFilePath + DataFileName)); + using XmlWriter writer = XmlWriter.Create(tw, settings); + DatabaseXmlSerializer.WriteObject(writer, UserList); + } + + public void SaveDefaultData(List DefaultThemeList, List DefaultLogoList) + { + if (!Directory.Exists(DataFilePath)) + { Directory.CreateDirectory(DataFilePath); } + XmlWriterSettings settings = new() { Indent = true }; + using TextWriter tw = File.CreateText(Path.Combine(DataFilePath + DefaultThemeName)); + using XmlWriter writer = XmlWriter.Create(tw, settings); + DatabaseXmlSerializer.WriteObject(writer, DefaultThemeList); + + using TextWriter tw2 = File.CreateText(Path.Combine(DataFilePath + DefaultLogoName)); + using XmlWriter writer2 = XmlWriter.Create(tw2, settings); + DatabaseXmlSerializer.WriteObject(writer2, DefaultLogoList); + } + + private static IEnumerable GetKnownTypes() + { + yield return typeof(User); + yield return typeof(List); + yield return typeof(Theme); + yield return typeof(List); + yield return typeof(Logo); + yield return typeof(List); + } + + public List LoadDatabaseData() + { + if (File.Exists(Path.Combine(DataFilePath + DataFileName))) + { + using (FileStream fileStream = File.OpenRead(Path.Combine(DataFilePath + DataFileName))) + { + return DatabaseXmlSerializer.ReadObject(fileStream) is not List user + ? throw new FileException("Failed to load Database. The loaded object is null.") + : user; + } + } + else + { + throw new FileException("No data file found."); + } + } + + public List LoadDefaultTheme() + { + if (File.Exists(Path.Combine(DataFilePath + DefaultThemeName))) + { + using (FileStream fileStream = File.OpenRead(Path.Combine(DataFilePath + DefaultThemeName))) + { + return DatabaseXmlSerializer.ReadObject(fileStream) is not List DefaultThemeList + ? throw new FileException("Failed to load Default Theme. The loaded object is null.") + : DefaultThemeList; + } + } + else + { + throw new FileException("No data file found."); + } + } + + public List LoadDefaultLogo() + { + if (File.Exists(Path.Combine(DataFilePath + DefaultLogoName))) + { + using (FileStream fileStream = File.OpenRead(Path.Combine(DataFilePath + DefaultLogoName))) + { + return DatabaseXmlSerializer.ReadObject(fileStream) is not List DefaultLogoList + ? throw new FileException("Failed to load Default Logo. The loaded object is null.") + : DefaultLogoList; + } + } + else + { + throw new FileException("No data file found."); + } + } + + } +} diff --git a/notus/Tests/UnitTests_Model/Database_Tests.cs b/notus/Tests/UnitTests_Model/Database_Tests.cs new file mode 100644 index 0000000..1698b23 --- /dev/null +++ b/notus/Tests/UnitTests_Model/Database_Tests.cs @@ -0,0 +1,223 @@ +using Biblioteque_de_Class; +namespace UnitTests_Model +{ + [TestFixture] + public class Database_Tests + { + private Database database; + + [SetUp] + public void Setup() + { + database = new Database(); + database.UserList.Add(new User("John", "john@example.com", "password123")); + database.UserList.Add(new User("Jane", "jane@example.com", "choco")); + database.UserList.Add(new User("Alice", "alice@example.com", "choco")); + database.DefaultLogoList.Add(new Logo("Logo1", "link1")); + database.DefaultLogoList.Add(new Logo("Logo2", "link2")); + database.DefaultLogoList.Add(new Logo("Logo3", "link3")); + } + + // SearchUser tests + + [Test] + public void SearchUser_UserDoesNotExist_ThrowsException() + { + string searchName = "Bob"; + Assert.Throws(() => database.SearchUser(searchName)); + } + + [Test] + public void SearchUser_CaseInsensitiveSearch_ReturnsMatchingUsers() + { + string searchName = "Alice"; + User searchedUser = database.SearchUser(searchName); + Assert.That(searchedUser.Username, Is.EqualTo("Alice")); + } + + // GetLogoLink tests + [Test] + public void GetLogoLink_LogoExists_ReturnsLogoLink() + { + Assert.That(database.GetLogoLink("Logo2"), Is.EqualTo("link2")); + } + + [Test] + public void GetLogoLink_LogoDoesNotExist_ThrowsException() + { + string logoName = "Logo4"; + Assert.Throws(() => database.GetLogoLink(logoName)); + } + + // GetUser tests + [Test] + public void GetUser_UserExists_ReturnsUser() + { + string userName = "Alice"; + User user = database.GetUser(userName); + Assert.IsNotNull(user); + Assert.That(user.Username, Is.EqualTo(userName)); + } + + [Test] + public void GetUser_UserDoesNotExist_ThrowsException() + { + string userName = "Eve"; + Assert.Throws(() => database.GetUser(userName)); + } + + // ComparePassword tests + [Test] + public void ComparePassword_CorrectPassword_ReturnsTrue() + { + User user = database.UserList[0]; + string password = "password123"; + bool result = Database.ComparePassword(user, password); + Assert.That(result, Is.True); + } + + [Test] + public void ComparePassword_IncorrectPassword_ReturnsFalse() + { + User user = database.UserList[0]; + string password = "incorrectPassword"; + bool result = Database.ComparePassword(user, password); + Assert.That(result, Is.False); + } + + // FindEmail tests + [Test] + public void FindEmail_ExistingEmail_ReturnsTrue() + { + string email = "john@example.com"; + bool result = database.FindEmail(email); + Assert.IsTrue(result); + } + + [Test] + public void FindEmail_NonExistingEmail_ReturnsFalse() + { + string email = "olivedecarglass@example.com"; + bool result = database.FindEmail(email); + Assert.IsFalse(result); + } + + // AddUser tests + [Test] + public void AddUser_ValidUser_AddsUserToList() + { + User user = new User("Bob", "bob@example.com", "password123"); + database.AddUser(user); + Assert.That(database.UserList, Contains.Item(user)); + } + + [Test] + public void AddUser_DuplicateUserName_ThrowsException() + { + User user = new User("John", "johnDae@example.com", "password123"); + Assert.Throws(() => database.AddUser(user)); + } + + [Test] + public void AddUser_DuplicateUserEmail_ThrowsException() + { + User user = new User("Bob", "john@example.com", "password123"); + Assert.Throws(() => database.AddUser(user)); + } + + // removeUser tests + [Test] + public void RemoveUser_ExistingUser_RemovesUserFromList() + { + User user = database.UserList[0]; + database.RemoveUser(user); + Assert.That(database.UserList, !Contains.Item(user)); + } + + [Test] + public void RemoveUser_NotExistingUser_ThrowsException() + { + User user = new User("Bob", "bob@example.com", "password123"); + Assert.Throws(() => database.RemoveUser(user)); + } + + // AddTheme tests + [Test] + public void AddTheme_ValidTheme_AddsThemeToList() + { + Theme theme = new Theme("Theme1", ",,,".Split().ToList()); + database.AddTheme(theme); + Assert.That(database.ThemeList, Contains.Item(theme)); + } + + [Test] + public void AddTheme_DuplicateTheme_ThrowsException() + { + Theme theme = new Theme("Theme1", ",,,".Split().ToList()); + database.ThemeList.Add(theme); + Assert.Throws(() => database.AddTheme(theme)); + } + + // GetTheme tests + [Test] + public void GetTheme_ExistingTheme_ReturnsTheme() + { + Theme expectedTheme = new Theme("Theme1", ",,,".Split().ToList()); + database.ThemeList.Add(expectedTheme); + + Theme theme = database.GetTheme("Theme1"); + Assert.IsNotNull(theme); + Assert.That(theme, Is.EqualTo(expectedTheme)); + } + + [Test] + public void GetTheme_NonExistingTheme_ReturnsNull() + { + Theme expectedTheme = new Theme("Theme1", ",,,".Split().ToList()); + database.ThemeList.Add(expectedTheme); + Assert.Throws(() => database.GetTheme("NonExistingTheme")); + } + + // ChangeUsername tests + [Test] + public void ChangeUsername_CorrectReplaceName_ChangesUsername() + { + User userSelected = database.UserList[0]; + string newUsername = "duberlute"; + + database.ChangeUsername(userSelected, newUsername); + + User updatedUser = database.UserList.Where(u => u.Username == newUsername).First(); + Assert.IsNotNull(updatedUser); + Assert.That(updatedUser.Username, Is.EqualTo(newUsername)); + } + + [Test] + public void ChangeUsername_UsernameAlreadyUsed_ThrowsException() + { + User userNotSelected = database.UserList[2]; + string newUsername = "Jane"; + + Assert.Throws(() => database.ChangeUsername(userNotSelected, newUsername)); + } + + // VerifThemeNameNotTaken tests + [Test] + public void VerifThemeNameNotTaken_NameNotTaken_ReturnsTrue() + { + string themeName = "NewTheme"; + bool result = database.VerifThemeNameNotTaken(themeName); + Assert.IsTrue(result); + } + + [Test] + public void VerifThemeNameNotTaken_NameAlreadyTaken_ReturnsFalse() + { + Theme expectedTheme = new Theme("Theme1", ",,,".Split().ToList()); + database.ThemeList.Add(expectedTheme); + string themeName = "Theme1"; + bool result = database.VerifThemeNameNotTaken(themeName); + Assert.IsFalse(result); + } + } +} diff --git a/notus/Tests/UnitTests_Model/Note_Tests.cs b/notus/Tests/UnitTests_Model/Note_Tests.cs new file mode 100644 index 0000000..29a9902 --- /dev/null +++ b/notus/Tests/UnitTests_Model/Note_Tests.cs @@ -0,0 +1,265 @@ +using Biblioteque_de_Class; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace UnitTests_Model +{ + [TestFixture] + public class Note_Tests + { + private User owner; + private Note note; + + [SetUp] + public void Setup() + { + owner = new User("John", "john@example.com", "password123"); + note = new Note(1, "Note 1", "logoPath", owner); + } + + [Test] + public void Note_Constructor_InitializesProperties() + { + Assert.That(note.id, Is.EqualTo(1)); + Assert.That(note.Name, Is.EqualTo("Note 1")); + Assert.That(note.LogoPath, Is.EqualTo("logoPath")); + Assert.That(note.Owner, Is.EqualTo(owner)); + Assert.That(note.ImageList.Count, Is.EqualTo(0)); + Assert.That(note.Collaborators.Count, Is.EqualTo(0)); + Assert.That(note.Editors.Count, Is.EqualTo(1)); + Assert.That(note.Editors[0], Is.EqualTo(owner)); + } + + [Test] + public void Note_VerifyOwner_UserIsOwner_ReturnsTrue() + { + bool result = note.VerifyOwner(owner); + Assert.IsTrue(result); + } + + [Test] + public void Note_VerifyOwner_UserIsNotOwner_ThrowsNotAllowedException() + { + User otherUser = new User("Jane", "jane@example.com", "password123"); + + Assert.Throws(() => note.VerifyOwner(otherUser)); + } + + [Test] + public void Note_AddImage_ValidData_AddsImage() + { + string imageLink = "imageLink"; + List position = new List { 1, 2, 3 }; + + note.AddImage(imageLink, position); + + Assert.That(note.ImageList.Count, Is.EqualTo(1)); + Assert.That(note.ImageList[0].Name, Is.EqualTo("1")); + Assert.That(note.ImageList[0].ImageLink, Is.EqualTo(imageLink)); + Assert.That(note.ImageList[0].Position, Is.EqualTo(position)); + } + + [Test] + public void Note_RemoveImage_ExistingImage_RemovesImage() + { + string imageLink = "imageLink"; + List position = new List { 1, 2, 3 }; + note.AddImage(imageLink, position); + + note.RemoveImage("1"); + + Assert.That(note.ImageList.Count, Is.EqualTo(0)); + } + + [Test] + public void Note_RemoveImage_NonExistingImage_ThrowsNotFoundException() + { + string imageLink = "imageLink"; + List position = new List { 1, 2, 3 }; + note.AddImage(imageLink, position); + + Assert.Throws(() => note.RemoveImage("2")); + } + + [Test] + public void Note_AddText_UserIsOwner_AddsText() + { + User user = owner; + string text = "Some text"; + + note.AddText(user, text); + + Assert.That(note.Text, Is.EqualTo("\n" + text)); + Assert.That(note.ModificationDate, Is.EqualTo(DateOnly.FromDateTime(DateTime.Now))); + } + + [Test] + public void Note_AddText_UserIsEditor_AddsText() + { + User user = new User("Editor", "editor@example.com", "password123"); + note.AddEditor(owner, user); + string text = "Some text"; + + note.AddText(user, text); + + Assert.That(note.Text, Is.EqualTo("\n"+text)); + Assert.That(note.ModificationDate, Is.EqualTo(DateOnly.FromDateTime(DateTime.Now))); + } + + [Test] + public void Note_AddText_UserIsNotOwnerOrEditor_ThrowsNotAllowedException() + { + User user = new User("Jane", "jane@example.com", "password123"); + string text = "Some text"; + + Assert.Throws(() => note.AddText(user, text)); + } + + [Test] + public void Note_VerifyPrivilege_UserIsEditor_ReturnsTrue() + { + User editor = new User("Editor", "editor@example.com", "password123"); + note.AddEditor(owner, editor); + + bool result = note.VerifyPrivilege(editor); + + Assert.IsTrue(result); + } + + [Test] + public void Note_VerifyPrivilege_UserIsNotEditor_ReturnsFalse() + { + User user = new User("User", "user@example.com", "password123"); + + bool result = note.VerifyPrivilege(user); + + Assert.IsFalse(result); + } + + [Test] + public void Note_AddCollaborator_UserIsOwner_AddsCollaborator() + { + User collaborator = new User("Collaborator", "collaborator@example.com", "password123"); + + note.AddCollaborator(owner, collaborator); + + Assert.That(note.Collaborators.Count, Is.EqualTo(1)); + Assert.That(note.Collaborators[0], Is.EqualTo(collaborator)); + Assert.IsTrue(collaborator.NoteList.Contains(note)); + } + + [Test] + public void Note_AddCollaborator_UserIsNotOwner_ThrowsNotAllowedException() + { + User otherUser = new User("OtherUser", "otheruser@example.com", "password123"); + User collaborator = new User("Collaborator", "collaborator@example.com", "password123"); + + Assert.Throws(() => note.AddCollaborator(otherUser, collaborator)); + } + + [Test] + public void Note_RemoveCollaborator_UserIsOwner_RemovesCollaborator() + { + User collaborator = new User("Collaborator", "collaborator@example.com", "password123"); + note.AddCollaborator(owner, collaborator); + + note.RemoveCollaborator(owner, collaborator); + + Assert.That(note.Collaborators.Count, Is.EqualTo(0)); + Assert.IsFalse(collaborator.NoteList.Contains(note)); + } + + [Test] + public void Note_RemoveCollaborator_UserIsNotOwner_ThrowsNotAllowedException() + { + User otherUser = new User("OtherUser", "otheruser@example.com", "password123"); + User collaborator = new User("Collaborator", "collaborator@example.com", "password123"); + note.AddCollaborator(owner, collaborator); + + Assert.Throws(() => note.RemoveCollaborator(otherUser, collaborator)); + } + + [Test] + public void Note_AddEditor_UserAlreadyEditor_ThrowsAlreadyExistException() + { + User editor = new User("Editor", "editor@example.com", "password123"); + note.AddEditor(owner, editor); + + Assert.Throws(() => note.AddEditor(owner, editor)); + } + + [Test] + public void Note_AddEditor_UserIsOwner_AddsEditor() + { + User editor = new User("Editor", "editor@example.com", "password123"); + + note.AddEditor(owner, editor); + + Assert.That(note.Editors.Count, Is.EqualTo(2)); + Assert.That(note.Editors[1], Is.EqualTo(editor)); + } + + [Test] + public void Note_RemoveEditor_UserNotEditor_ThrowsNotFoundException() + { + User user = new User("User", "user@example.com", "password123"); + + Assert.Throws(() => note.RemoveEditor(owner, user)); + } + + [Test] + public void Note_RemoveEditor_UserIsOwner_RemovesEditor() + { + User editor = new User("Editor", "editor@example.com", "password123"); + note.AddEditor(owner, editor); + + note.RemoveEditor(owner, editor); + + Assert.That(note.Editors.Count, Is.EqualTo(1)); + Assert.IsFalse(note.Editors.Contains(editor)); + } + + [Test] + public void Note_ChangeName_UserIsOwner_ChangesName() + { + User user = owner; + string newName = "New Note Name"; + + note.ChangeName(user, newName); + + Assert.That(note.Name, Is.EqualTo(newName)); + } + + [Test] + public void Note_ChangeName_UserIsNotOwner_NameNotChanged() + { + User user = new User("OtherUser", "otheruser@example.com", "password123"); + string newName = "New Note Name"; + + Assert.Throws(() => note.ChangeName(user, newName)); + } + + [Test] + public void Note_ChangeLogo_UserIsOwner_ChangesLogo() + { + User user = owner; + string newLogoPath = "newLogoPath"; + + note.ChangeLogo(user, newLogoPath); + + Assert.That(note.LogoPath, Is.EqualTo(newLogoPath)); + } + + [Test] + public void Note_ChangeLogo_UserIsNotOwner_LogoNotChanged() + { + User user = new User("OtherUser", "otheruser@example.com", "password123"); + string newLogoPath = "newLogoPath"; + + Assert.Throws(() => note.ChangeLogo(user, newLogoPath)); + } + } +} diff --git a/notus/Tests/UnitTests_Model/UnitTests_Model.csproj b/notus/Tests/UnitTests_Model/UnitTests_Model.csproj new file mode 100644 index 0000000..3f9f74f --- /dev/null +++ b/notus/Tests/UnitTests_Model/UnitTests_Model.csproj @@ -0,0 +1,24 @@ + + + + net7.0 + enable + enable + + false + true + + + + + + + + + + + + + + + diff --git a/notus/Tests/UnitTests_Model/User_Tests.cs b/notus/Tests/UnitTests_Model/User_Tests.cs new file mode 100644 index 0000000..75a504c --- /dev/null +++ b/notus/Tests/UnitTests_Model/User_Tests.cs @@ -0,0 +1,481 @@ +using Biblioteque_de_Class; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace UnitTests_Model +{ + public class User_Tests + { + private User user; + + [SetUp] + public void Setup() + { + user = new User("John", "john@example.com", "password123"); + user.CreateTag("tag1","#FF0000"); + user.CreateTag("tag2", "#00FF00"); + user.CreateNote("note1", "default.png"); + user.AddTagFromNoteList(user.NoteList[0], user.TagList[0]); + user.CreateNote("note2", "default.png"); + user.AddTheme(new Theme("white","#FFAAAA,#000000,#999999".Split(',').ToList())); + } + + //test searchnoteByName + [Test] + public void User_SearchNoteByName_ValidData_ReturnsNote() + { + Note note = user.SearchNoteByName(user.NoteList,"note1").First(); + Assert.That(note.Name, Is.EqualTo("note1")); + } + [Test] + public void User_SearchNoteByName_InvalidData_ReturnsNull() + { + Assert.That(user.SearchNoteByName(user.NoteList, "note3"), Is.Empty); + } + + //test seachNoteBytag + [Test] + public void User_SearchNoteByTag_ValidData_ReturnsNote() + { + Note note = user.SearchNoteByTag(user.NoteList, "tag1").First(); + Assert.That(note.Name, Is.EqualTo("note1")); + } + [Test] + public void User_SearchNoteByTag_InvalidData_ReturnsNull() + { + Assert.Throws(() => user.SearchNoteByTag(user.NoteList, "tag3")); + } + + //test SearchNoteByDate + [Test] + public void User_SearchNoteByDate_ValidData_ReturnsNote() + { + Note note = user.SearchNoteByDate(user.NoteList, "note1", DateOnly.FromDateTime(DateTime.Now), DateOnly.FromDateTime(DateTime.Now)).First(); + Assert.That(note.Name, Is.EqualTo("note1")); + } + + [Test] + public void User_SearchNoteByDate_InvalidData_ReturnsNull() + { + Assert.That(user.SearchNoteByDate(user.NoteList, "note3", DateOnly.FromDateTime(DateTime.Now), DateOnly.FromDateTime(DateTime.Now)), Is.Empty); + } + + //test GetNoteByName + [Test] + public void User_GetNoteByName_ValidData_ReturnsNote() + { + Note note = user.GetNoteByName("note1"); + Assert.That(note.Name, Is.EqualTo("note1")); + } + + [Test] + public void User_GetNoteByName_InvalidData_ReturnsNull() + { + Assert.Throws(() => user.GetNoteByName("note3")); + } + + //test searchTagByName + [Test] + public void User_SearchTagByName_ValidData_ReturnsTag() + { + Tags tag = user.SearchTagByName(user.TagList, "tag1").First(); + Assert.That(tag.Name, Is.EqualTo("tag1")); + } + [Test] + public void User_SearchTagByName_InvalidData_ReturnsNull() + { + Assert.That(user.SearchTagByName(user.TagList, "tag3"), Is.Empty); + } + + //test AddFavorite + [Test] + public void User_AddFavorite_ValidData_AddNote() + { + user.AddFavorite(user.NoteList[0]); + Assert.That(user.FavList.Count, Is.EqualTo(1)); + } + [Test] + public void User_AddFavorite_InvalidData_ThrowException() + { + user.AddFavorite(user.NoteList[0]); + Assert.Throws(() => user.AddFavorite(user.NoteList[0])); + } + + //test RemoveFavorite + + [Test] + public void User_RemoveFavorite_ValidData_RemoveNote() + { + user.AddFavorite(user.NoteList[0]); + user.RemoveFavorite(user.NoteList[0]); + Assert.That(user.FavList, Is.Empty); + } + [Test] + public void User_RemoveFavorite_InvalidData_ThrowException() + { + Assert.Throws(() => user.RemoveFavorite(user.NoteList[0])); + } + + //test createNote + [Test] + public void User_CreateNote_ValidData_AddNote() + { + user.CreateNote("note3", "default.png"); + Assert.That(user.NoteList.Count, Is.EqualTo(3)); + } + + [Test] + public void User_CreateNote_InvalidData_ThrowException() + { + user.CreateNote("note3", "default.png"); + Assert.Throws(() => user.CreateNote("note3", "default.png")); + } + [Test] + public void User_CreateNote_ValidData_secondNote_AddNote() + { + User user2 = new User("John", "rien", "choco"); + user2.CreateNote("note3", "default.png"); + user2.CreateNote("note4", "default.png"); + Assert.That(user2.NoteList.Count, Is.EqualTo(2)); + Assert.That(user2.NoteList[1].id, Is.EqualTo(1)); + } + + //test DeleteNote + [Test] + public void User_DeleteNote_ValidData_RemoveNote() + { + Note note = user.NoteList[0]; + user.DeleteNote(note); + Assert.That(user.NoteList.Count, Is.EqualTo(1)); + } + + [Test] + public void User_DeleteNote_InvalidData_ThrowException() + { + Note note = user.NoteList[0]; + user.DeleteNote(note); + Assert.Throws(() => user.DeleteNote(note)); + } + + //test CreateTag + [Test] + public void User_CreateTag_ValidData_AddTag() + { + user.CreateTag("tag3", "#FF0000"); + Assert.That(user.TagList.Count, Is.EqualTo(3)); + } + + [Test] + public void User_CreateTag_InvalidData_ThrowException() + { + user.CreateTag("tag3", "#FF0000"); + Assert.Throws(() => user.CreateTag("tag2", "#FF0000")); + } + + //test DeleteTag + [Test] + public void User_DeleteTag_ValidData_RemoveTag() + { + Tags tag = user.TagList[0]; + user.DeleteTag(tag); + Assert.That(user.TagList.Count, Is.EqualTo(1)); + } + + [Test] + public void User_DeleteTag_InvalidData_ThrowException() + { + Tags tag = user.TagList[0]; + user.DeleteTag(tag); + Assert.Throws(() => user.DeleteTag(tag)); + } + + //test EditTagName + [Test] + public void User_EditTagName_ValidData_EditTag() + { + user.EditTagName(user.TagList[0], "tag3"); + Assert.That(user.TagList[0].Name, Is.EqualTo("tag3")); + } + + [Test] + public void User_EditTagName_InvalidData_ThrowException() + { + Tags tags = new Tags("tag2", "#FF0000"); + Assert.Throws(() => user.EditTagName(tags, "tag1")); + } + + [Test] + public void User_EditTagName_InvalidData2_ThrowException() + { + Assert.Throws(() => user.EditTagName(user.TagList[0], "tag1")); + } + + //test EditTagColor + [Test] + public void User_EditTagColor_ValidData_EditTag() + { + user.EditTagColor(user.TagList[0], "#FF0000"); + Assert.That(user.TagList[0].Color, Is.EqualTo("#FF0000")); + } + + [Test] + public void User_EditTagColor_InvalidData_ThrowException() + { + Tags tags = new Tags("tag2", "#FF0000"); + Assert.Throws(() => user.EditTagColor(tags, "#000000")); + } + + //Test AddTagFromNoteList + [Test] + public void User_AddTagFromNoteList_ValidData_AddTag() + { + user.AddTagFromNoteList(user.NoteList[0], user.TagList[1]); + Assert.That(user.NoteTagged[user.NoteList[0]].Count, Is.EqualTo(2)); + } + + [Test] + public void User_AddTagFromNoteList_InvalidData_ThrowException() + { + Tags tags = new Tags("tag2", "#FF0000"); + Assert.Throws(() => user.AddTagFromNoteList(user.NoteList[0], tags)); + } + + + [Test] + public void User_AddTagFromNoteList_InvalidData2_ThrowException() + { + User uvide = new User("", "", ""); + Note note = new Note(4,"rien", "default.png", uvide); + Assert.Throws(() => user.AddTagFromNoteList(note, user.TagList[0])); + } + + //Test RemoveTagFromNoteList + [Test] + public void User_RemoveTagFromNoteList_ValidData_RemoveTag() + { + user.RemoveTagFromNoteList(user.NoteList[0], user.TagList[0]); + Assert.That(user.NoteTagged[user.NoteList[0]], Is.Empty); + } + + [Test] + public void User_RemoveTagFromNoteList_InvalidData_ThrowException() + { + Tags tags = new Tags("tag2", "#FF0000"); + Assert.Throws(() => user.RemoveTagFromNoteList(user.NoteList[0], tags)); + } + + [Test] + public void User_RemoveTagFromNoteList_InvalidData2_ThrowException() + { + User uvide = new User("", "", ""); + Note note = new Note(4, "rien", "default.png", uvide); + Assert.Throws(() => user.RemoveTagFromNoteList(note, user.TagList[0])); + } + + //test SetNoteName + [Test] + public void User_SetNoteName_ValidData_EditNote() + { + user.SetNoteName(user.NoteList[0], "note3"); + Assert.That(user.NoteList[0].Name, Is.EqualTo("note3")); + } + + [Test] + public void User_SetNoteName_InvalidData_ThrowException() + { + User uvide = new User("", "", ""); + Note note = new Note(4, "rien", "default.png", uvide); + Assert.Throws(() => user.SetNoteName(note, "note2")); + } + + [Test] + public void User_SetNoteName_InvalidData2_ThrowException() + { + Assert.Throws(() => user.SetNoteName(user.NoteList[0], "note1")); + } + + //test ChangePassword + [Test] + public void User_ChangePassword_ValidData_ChangePassword() + { + user.ChangePassword("chocoChoco"); + Assert.That(user.Password, Is.EqualTo(HashCodeModel.GetSHA256Hash("chocoChoco").ToString())); + } + + [Test] + public void User_ChangePassword_InvalidData_ThrowException() + { + user.ChangePassword("chocoChoco"); + Assert.Throws(() => user.ChangePassword("chocoChoco")); + } + + [Test] + public void User_ChangePassword_InvalidData1_ThrowException() + { + Assert.Throws(() => user.ChangePassword("choco")); + } + + [Test] + public void User_ChangePassword_InvalidData2_ThrowException() + { + Assert.Throws(() => user.ChangePassword("")); + } + + //test ChangeTheme + [Test] + public void User_ChangeTheme_ValidData_ChangeTheme() + { + user.ChangeTheme(new Theme("dark", "#0000FF,#FF00FF,#FFFFFF".Split(',').ToList())); + Assert.That(user.UseTheme.Name, Is.EqualTo("dark")); + } + + [Test] + public void User_ChangeTheme_InvalidData_ThrowException() + { + user.ChangeTheme(new Theme("dark", "#0000FF,#FF00FF,#FFFFFF".Split(',').ToList())); + Assert.Throws(() => user.ChangeTheme(new Theme("dark", "#0000FF,#FF00FF,#FFFFFF".Split(',').ToList()))); + } + + //test ChangeThemeName + [Test] + public void User_ChangeThemeName_ValidData_ChangeThemeName() + { + user.ChangeThemeName(user.AddedTheme[0], "dark"); + Assert.That(user.AddedTheme[0].Name, Is.EqualTo("dark")); + } + + [Test] + public void User_ChangeThemeName_InvalidData_ThrowException() + { + user.AddTheme(new Theme("dark", "#0000FF,#FF00FF,#FFFFFF".Split(',').ToList())); + Assert.Throws(() => user.ChangeThemeName(user.AddedTheme[0], "dark")); + } + + [Test] + public void User_ChangeThemeName_InvalidData2_ThrowException() + { + Assert.Throws(() => user.ChangeThemeName(user.AddedTheme[0], "white")); + } + + //test ChangeThemeColors + [Test] + public void User_ChangeThemeColors_ValidData_ChangeThemeColors() + { + // Arrange + var theme = new Theme("blacktheme", new List { "#000000", "#FF00FF", "#OOFFOO" }); + var newColors = new List { "#111111", "#222222", "#333333" }; + + // Act + user.ChangeThemeColors(theme, newColors); + + // Assert + Assert.That(theme.ColorList[0], Is.EqualTo(newColors[0])); + Assert.That(theme.ColorList[1], Is.EqualTo(newColors[1])); + Assert.That(theme.ColorList[2], Is.EqualTo(newColors[2])); + } + + [Test] + public void User_ChangeThemeColors_InvalidData_ThrowException() + { + // Arrange + var theme = new Theme("blacktheme", new List { "#000000", "#FF00FF", "#OOFFOO" }); + var sameColors = new List { "#000000", "#FF00FF", "#OOFFOO" }; + + // Act & Assert + Assert.Throws(() => user.ChangeThemeColors(theme, sameColors)); + } + + [Test] + public void User_ChangeThemeColors_InvalidData1_ThrowException() + { + // Arrange + var theme = new Theme("blacktheme", new List { "#000000", "#FF00FF", "#OOFFOO" }); + var differentColors = new List { "#111111", "#222222", "#333333", "#444444" }; + + // Act & Assert + Assert.Throws(() => user.ChangeThemeColors(theme, differentColors)); + } + + //test AddTheme + [Test] + public void User_AddTheme_ValidData_AddTheme() + { + user.AddTheme(new Theme("dark", "#0000FF,#FF00FF,#FFFFFF".Split(',').ToList())); + Assert.That(user.AddedTheme[1].Name, Is.EqualTo("dark")); + } + + [Test] + public void User_AddTheme_InvalidData_ThrowException() + { + user.AddTheme(new Theme("dark", "#0000FF,#FF00FF,#FFFFFF".Split(',').ToList())); + Assert.Throws(() => user.AddTheme(new Theme("dark", "#0000FF,#FF00FF,#FFFFFF".Split(',').ToList()))); + } + + //test RemoveTheme + [Test] + public void User_RemoveTheme_ValidData_RemoveTheme() + { + user.AddTheme(new Theme("dark", "#0000FF,#FF00FF,#FFFFFF".Split(',').ToList())); + user.RemoveTheme(user.AddedTheme[1]); + Assert.That(user.AddedTheme.Count, Is.EqualTo(1)); + } + + [Test] + public void User_RemoveTheme_InvalidData_ThrowException() + { + Assert.Throws(() => user.RemoveTheme(new Theme("dark", "#0000FF,#FF00FF,#FFFFFF".Split(',').ToList()))); + } + + //test GetTheme + [Test] + public void User_GetTheme_ValidData_GetTheme() + { + user.AddTheme(new Theme("dark", "#0000FF,#FF00FF,#FFFFFF".Split(',').ToList())); + Assert.That(user.GetTheme("dark").Name, Is.EqualTo("dark")); + } + + [Test] + public void User_GetTheme_InvalidData_ThrowException() + { + Assert.Throws(() => user.GetTheme("dark")); + } + + //test ChangeEmail + [Test] + public void User_ChangeEmail_ValidData_ChangeEmail() + { + user.ChangeEmail("nouvelleEmail@gmail.com"); + Assert.That(user.Email, Is.EqualTo("nouvelleEmail@gmail.com")); + } + + [Test] + public void User_ChangeEmail_InvalidData_ThrowException() + { + Assert.Throws(() => user.ChangeEmail("")); + } + + //test ChangeProfilePicture + [Test] + public void User_ChangeProfilePicture_ValidData_ChangeProfilePicture() + { + user.ChangeProfilePicture("nouvellePhoto.png"); + Assert.That(user.Picture, Is.EqualTo("nouvellePhoto.png")); + } + + [Test] + public void User_ChangeProfilePicture_InvalidData_ThrowException() + { + Assert.Throws(() => user.ChangeProfilePicture("photosansextesion")); + } + + [Test] + public void User_ChangeProfilePicture_InvalidData2_ThrowException() + { + user.ChangeProfilePicture(""); + Assert.That(user.Picture, Is.EqualTo("default.png")); + } + } +} diff --git a/notus/Tests/UnitTests_Model/Usings.cs b/notus/Tests/UnitTests_Model/Usings.cs new file mode 100644 index 0000000..cefced4 --- /dev/null +++ b/notus/Tests/UnitTests_Model/Usings.cs @@ -0,0 +1 @@ +global using NUnit.Framework; \ No newline at end of file diff --git a/notus/Tests/UnitTests_Persistance/Stub_Tests.cs b/notus/Tests/UnitTests_Persistance/Stub_Tests.cs new file mode 100644 index 0000000..76e5c56 --- /dev/null +++ b/notus/Tests/UnitTests_Persistance/Stub_Tests.cs @@ -0,0 +1,76 @@ +using Biblioteque_de_Class; +using Notus_Persistance; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace UnitTests_Persistance +{ + public class Stub_Tests + { + PersistenceManager manager; + Database result; + + [SetUp] + public void Setup() + { + manager = new PersistenceManager(new Stub()); + result = new Database(); + } + + [Test] + public void SaveDatabaseData_Test() + { + Assert.Throws(() => manager.SaveDatabaseData(result)); + } + + [Test] + public void LoadDatabaseData_Test() + { + result = manager.GetOnlyDatabaseUser(); + + Assert.NotNull(result); + Assert.NotNull(result.UserList); + Assert.That(result.UserList.Count, Is.EqualTo(4)); + User user1 = result.UserList[0]; + Assert.That(user1.Username, Is.EqualTo("Nicolas")); + Assert.That(user1.Email, Is.EqualTo("leHeros@gmail.com")); + Assert.That(user1.Password, Is.EqualTo(HashCodeModel.GetSHA256Hash("FeurFeur"))); + Note user1Note = user1.NoteList[0]; + Tags user1Tag = user1.TagList[0]; + Assert.That(user1Note.Name, Is.EqualTo("Note 0")); + Assert.That(user1Note.LogoPath, Is.EqualTo("DefaultLogo.png")); + Assert.That(user1Tag.Name, Is.EqualTo("Tag 0")); + Assert.That(user1Tag.Color, Is.EqualTo("#5555FF")); + } + + [Test] + public void LoadDefaultTheme_Test() + { + result = manager.GetOnlyDatabaseDefaultTheme(); + + Assert.NotNull(result); + Assert.That(result.ThemeList.Count, Is.EqualTo(2)); + Theme theme1 = result.ThemeList[0]; + Assert.That(theme1.Name, Is.EqualTo("blacktheme")); + Assert.That(theme1.ColorList[0], Is.EqualTo("#000000")); + Assert.That(theme1.ColorList[1], Is.EqualTo("#FF00FF")); + Assert.That(theme1.ColorList[2], Is.EqualTo("#OOFFOO")); + } + + [Test] + public void LoadDefaultLogo_Test() + { + result = manager.GetOnlyDatabaseDefaultLogo(); + + Assert.NotNull(result); + Assert.That(result.DefaultLogoList.Count, Is.EqualTo(3)); + Logo logo1 = result.DefaultLogoList[0]; + Assert.That(logo1.Name, Is.EqualTo("default")); + Assert.That(logo1.LogoLink, Is.EqualTo("DefaultLogo.png")); + } + + } +} diff --git a/notus/Tests/UnitTests_Persistance/ToXML_Tests.cs b/notus/Tests/UnitTests_Persistance/ToXML_Tests.cs new file mode 100644 index 0000000..854f3de --- /dev/null +++ b/notus/Tests/UnitTests_Persistance/ToXML_Tests.cs @@ -0,0 +1,115 @@ +using Biblioteque_de_Class; +using Notus_Persistance; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace UnitTests_Persistance +{ + public class ToXML_Tests + { + PersistenceManager manager; + Database result; + + [SetUp] + public void Setup() + { + manager = new PersistenceManager(new Stub()); + result = new Database(); + } + + [Test] + public void SaveDatabaseData_Test() + { + PersistenceManager manager2 = new PersistenceManager(new ToXML()); + Database result2 = manager.LoadDatabaseData(); + + manager2.SaveDatabaseData(result2); + + Database result3 = manager2.GetOnlyDatabaseUser(); + Assert.NotNull(result3); + + Assert.That(result2.UserList.Count, Is.EqualTo(result3.UserList.Count)); + Assert.That(result2.UserList[0].Username, Is.EqualTo(result3.UserList[0].Username)); + Assert.That(result2.UserList[0].Email, Is.EqualTo(result3.UserList[0].Email)); + Assert.That(result2.UserList[0].Password, Is.EqualTo(result3.UserList[0].Password)); + } + + [Test] + public void LoadDefaultData_Test() + { + PersistenceManager manager2 = new PersistenceManager(new ToXML()); + Database result2 = new(); + result2.SetDefaultThemeList(manager.GetOnlyDatabaseDefaultTheme().ThemeList); + result2.SetDefaultLogoList(manager.GetOnlyDatabaseDefaultLogo().DefaultLogoList); + + manager2.SaveDefaultData(result2); + + Database result3 = new(); + result3.SetDefaultThemeList(manager2.GetOnlyDatabaseDefaultTheme().ThemeList); + result3.SetDefaultLogoList(manager2.GetOnlyDatabaseDefaultLogo().DefaultLogoList); + Assert.NotNull(result3); + + Assert.That(result2.ThemeList.Count, Is.EqualTo(result3.ThemeList.Count)); + Assert.That(result2.DefaultLogoList.Count, Is.EqualTo(result3.DefaultLogoList.Count)); + + Assert.That(result2.ThemeList[0].Name, Is.EqualTo(result3.ThemeList[0].Name)); + Assert.That(result2.ThemeList[0].ColorList[0], Is.EqualTo(result3.ThemeList[0].ColorList[0])); + Assert.That(result2.ThemeList[0].ColorList[1], Is.EqualTo(result3.ThemeList[0].ColorList[1])); + Assert.That(result2.ThemeList[0].ColorList[2], Is.EqualTo(result3.ThemeList[0].ColorList[2])); + + Assert.That(result2.DefaultLogoList[0].Name, Is.EqualTo(result3.DefaultLogoList[0].Name)); + Assert.That(result2.DefaultLogoList[0].LogoLink, Is.EqualTo(result3.DefaultLogoList[0].LogoLink)); + + } + + [Test] + public void LoadDatabaseData_Test() + { + result = manager.GetOnlyDatabaseUser(); + + Assert.NotNull(result); + Assert.NotNull(result.UserList); + Assert.That(result.UserList.Count, Is.EqualTo(4)); + User user1 = result.UserList[0]; + Assert.That(user1.Username, Is.EqualTo("Nicolas")); + Assert.That(user1.Email, Is.EqualTo("leHeros@gmail.com")); + Assert.That(user1.Password, Is.EqualTo(HashCodeModel.GetSHA256Hash("FeurFeur"))); + Note user1Note = user1.NoteList[0]; + Tags user1Tag = user1.TagList[0]; + Assert.That(user1Note.Name, Is.EqualTo("Note 0")); + Assert.That(user1Note.LogoPath, Is.EqualTo("DefaultLogo.png")); + Assert.That(user1Tag.Name, Is.EqualTo("Tag 0")); + Assert.That(user1Tag.Color, Is.EqualTo("#5555FF")); + } + + [Test] + public void LoadDefaultTheme_Test() + { + result = manager.GetOnlyDatabaseDefaultTheme(); + + Assert.NotNull(result); + Assert.That(result.ThemeList.Count, Is.EqualTo(2)); + Theme theme1 = result.ThemeList[0]; + Assert.That(theme1.Name, Is.EqualTo("blacktheme")); + Assert.That(theme1.ColorList[0], Is.EqualTo("#000000")); + Assert.That(theme1.ColorList[1], Is.EqualTo("#FF00FF")); + Assert.That(theme1.ColorList[2], Is.EqualTo("#OOFFOO")); + } + + [Test] + public void LoadDefaultLogo_Test() + { + result = manager.GetOnlyDatabaseDefaultLogo(); + + Assert.NotNull(result); + Assert.That(result.DefaultLogoList.Count, Is.EqualTo(3)); + Logo logo1 = result.DefaultLogoList[0]; + Assert.That(logo1.Name, Is.EqualTo("default")); + Assert.That(logo1.LogoLink, Is.EqualTo("DefaultLogo.png")); + } + } +} + diff --git a/notus/Tests/UnitTests_Persistance/UnitTests_Persistance.csproj b/notus/Tests/UnitTests_Persistance/UnitTests_Persistance.csproj new file mode 100644 index 0000000..44f0282 --- /dev/null +++ b/notus/Tests/UnitTests_Persistance/UnitTests_Persistance.csproj @@ -0,0 +1,25 @@ + + + + net7.0 + enable + enable + + false + true + + + + + + + + + + + + + + + + diff --git a/notus/Tests/UnitTests_Persistance/Usings.cs b/notus/Tests/UnitTests_Persistance/Usings.cs new file mode 100644 index 0000000..cefced4 --- /dev/null +++ b/notus/Tests/UnitTests_Persistance/Usings.cs @@ -0,0 +1 @@ +global using NUnit.Framework; \ No newline at end of file diff --git a/notus/notus.sln b/notus/notus.sln index 3abb435..6fa0582 100644 --- a/notus/notus.sln +++ b/notus/notus.sln @@ -3,11 +3,24 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.0.31611.283 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "notus", "notus\notus.csproj", "{561264A1-4611-40FB-A662-3EF65550CA71}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Notus_Vue", "notus_vue\Notus_Vue.csproj", "{561264A1-4611-40FB-A662-3EF65550CA71}" + ProjectSection(ProjectDependencies) = postProject + {184478A9-E14F-42E0-B963-B3A4474C9C1C} = {184478A9-E14F-42E0-B963-B3A4474C9C1C} + {7B7F1062-9498-44E5-AC77-84BC90A3B730} = {7B7F1062-9498-44E5-AC77-84BC90A3B730} + {92DD50C5-EEAD-44ED-AEFF-E21935725477} = {92DD50C5-EEAD-44ED-AEFF-E21935725477} + {AFCEAA99-3A25-4E9E-B498-72DD76A6B7FF} = {AFCEAA99-3A25-4E9E-B498-72DD76A6B7FF} + {EE443C17-B31D-4AD0-9141-920876E7DF79} = {EE443C17-B31D-4AD0-9141-920876E7DF79} + EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Biblioteque_de_Class", "Biblioteque_de_Class\Biblioteque_de_Class.csproj", "{92DD50C5-EEAD-44ED-AEFF-E21935725477}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Biblioteque_de_Class", "Biblioteque_de_Class\Biblioteque_de_Class.csproj", "{92DD50C5-EEAD-44ED-AEFF-E21935725477}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Notus_Console", "Notus_Console\Notus_Console.csproj", "{0A5E5F33-6B39-42BF-A46D-0752EDB666FB}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Notus_Console", "Notus_Console\Notus_Console.csproj", "{0A5E5F33-6B39-42BF-A46D-0752EDB666FB}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Notus_Persistance", "Notus_Persistence\Notus_Persistance.csproj", "{184478A9-E14F-42E0-B963-B3A4474C9C1C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnitTests_Model", "Tests\UnitTests_Model\UnitTests_Model.csproj", "{CB4664CE-F451-401D-862F-4A74A80B8161}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTests_Persistance", "Tests\UnitTests_Persistance\UnitTests_Persistance.csproj", "{E2BCA278-8741-4116-B0E0-B20849D66739}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -29,6 +42,18 @@ Global {0A5E5F33-6B39-42BF-A46D-0752EDB666FB}.Debug|Any CPU.Build.0 = Debug|Any CPU {0A5E5F33-6B39-42BF-A46D-0752EDB666FB}.Release|Any CPU.ActiveCfg = Release|Any CPU {0A5E5F33-6B39-42BF-A46D-0752EDB666FB}.Release|Any CPU.Build.0 = Release|Any CPU + {184478A9-E14F-42E0-B963-B3A4474C9C1C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {184478A9-E14F-42E0-B963-B3A4474C9C1C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {184478A9-E14F-42E0-B963-B3A4474C9C1C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {184478A9-E14F-42E0-B963-B3A4474C9C1C}.Release|Any CPU.Build.0 = Release|Any CPU + {CB4664CE-F451-401D-862F-4A74A80B8161}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CB4664CE-F451-401D-862F-4A74A80B8161}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CB4664CE-F451-401D-862F-4A74A80B8161}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CB4664CE-F451-401D-862F-4A74A80B8161}.Release|Any CPU.Build.0 = Release|Any CPU + {E2BCA278-8741-4116-B0E0-B20849D66739}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E2BCA278-8741-4116-B0E0-B20849D66739}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E2BCA278-8741-4116-B0E0-B20849D66739}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E2BCA278-8741-4116-B0E0-B20849D66739}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/notus/notus/App.xaml.cs b/notus/notus/App.xaml.cs deleted file mode 100644 index 2ab16d6..0000000 --- a/notus/notus/App.xaml.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace notus; - -public partial class App : Application -{ - public App() - { - InitializeComponent(); - - MainPage = new AppShell(); - } -} diff --git a/notus/notus/ConnecPage.xaml.cs b/notus/notus/ConnecPage.xaml.cs deleted file mode 100644 index e000990..0000000 --- a/notus/notus/ConnecPage.xaml.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace notus; - -public partial class ConnecPage : ContentPage -{ - public ConnecPage() - { - InitializeComponent(); - } -} \ No newline at end of file diff --git a/notus/notus/MainPage.xaml.cs b/notus/notus/MainPage.xaml.cs deleted file mode 100644 index 95b6e7e..0000000 --- a/notus/notus/MainPage.xaml.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace notus; - -public partial class MainPage : ContentPage{ - public MainPage(){ - InitializeComponent(); - } -} - diff --git a/notus/notus/RecherPage.xaml b/notus/notus/RecherPage.xaml deleted file mode 100644 index 22399e7..0000000 --- a/notus/notus/RecherPage.xaml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/notus/notus/RecherPage.xaml.cs b/notus/notus/RecherPage.xaml.cs deleted file mode 100644 index d0a1e3d..0000000 --- a/notus/notus/RecherPage.xaml.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace notus; - -public partial class RecherPage : ContentPage -{ - public RecherPage() - { - InitializeComponent(); - } -} \ No newline at end of file diff --git a/notus/notus/App.xaml b/notus/notus_vue/App.xaml similarity index 97% rename from notus/notus/App.xaml rename to notus/notus_vue/App.xaml index 34273cc..0c897b2 100644 --- a/notus/notus/App.xaml +++ b/notus/notus_vue/App.xaml @@ -1,14 +1,14 @@ - - - - - - - - - - - + + + + + + + + + + + diff --git a/notus/notus_vue/App.xaml.cs b/notus/notus_vue/App.xaml.cs new file mode 100644 index 0000000..f6bc467 --- /dev/null +++ b/notus/notus_vue/App.xaml.cs @@ -0,0 +1,20 @@ + +using Biblioteque_de_Class; +using Notus_Persistance; + +namespace notus; + +public partial class App : Application +{ + public PersistenceManager manager = new PersistenceManager(new Stub()); + public Database db = new Database(); + + public App() + { + InitializeComponent(); + db = manager.LoadDatabaseData(); + MainPage = new AppShell(); + } + + +} diff --git a/notus/notus/AppShell.xaml b/notus/notus_vue/AppShell.xaml similarity index 67% rename from notus/notus/AppShell.xaml rename to notus/notus_vue/AppShell.xaml index 6933251..15947ae 100644 --- a/notus/notus/AppShell.xaml +++ b/notus/notus_vue/AppShell.xaml @@ -1,27 +1,37 @@ - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/notus/notus/AppShell.xaml.cs b/notus/notus_vue/AppShell.xaml.cs similarity index 94% rename from notus/notus/AppShell.xaml.cs rename to notus/notus_vue/AppShell.xaml.cs index b315a68..4c4e7f2 100644 --- a/notus/notus/AppShell.xaml.cs +++ b/notus/notus_vue/AppShell.xaml.cs @@ -1,7 +1,7 @@ -namespace notus; - -public partial class AppShell : Shell{ - public AppShell(){ - InitializeComponent(); - } -} +namespace notus; + +public partial class AppShell : Shell{ + public AppShell(){ + InitializeComponent(); + } +} diff --git a/notus/notus/ConnecPage.xaml b/notus/notus_vue/ConnecPage.xaml similarity index 62% rename from notus/notus/ConnecPage.xaml rename to notus/notus_vue/ConnecPage.xaml index 2060959..8e5a0aa 100644 --- a/notus/notus/ConnecPage.xaml +++ b/notus/notus_vue/ConnecPage.xaml @@ -1,69 +1,86 @@ - - - - - - - - - - - - - - - - - - - - - - - -