diff --git a/ContactBook.package/.filetree b/ContactBook.package/.filetree new file mode 100644 index 0000000..8998102 --- /dev/null +++ b/ContactBook.package/.filetree @@ -0,0 +1,4 @@ +{ + "noMethodMetaData" : true, + "separateMethodMetaAndSource" : false, + "useCypressPropertiesFile" : true } diff --git a/ContactBook.package/Contact.class/README.md b/ContactBook.package/Contact.class/README.md new file mode 100644 index 0000000..8d9cbef --- /dev/null +++ b/ContactBook.package/Contact.class/README.md @@ -0,0 +1,17 @@ +I represent a contact. + +I know about my name and email. + +Collaborators: +- Veit Heller ' \ No newline at end of file diff --git a/ContactBook.package/Contact.class/properties.json b/ContactBook.package/Contact.class/properties.json new file mode 100644 index 0000000..84005a0 --- /dev/null +++ b/ContactBook.package/Contact.class/properties.json @@ -0,0 +1,15 @@ +{ + "category" : "ContactBook", + "classinstvars" : [ + ], + "classvars" : [ + ], + "commentStamp" : "VeitHeller 5/12/2018 14:05", + "instvars" : [ + "fullname", + "email" ], + "name" : "Contact", + "pools" : [ + ], + "super" : "Object", + "type" : "normal" } diff --git a/ContactBook.package/ContactBook.class/README.md b/ContactBook.package/ContactBook.class/README.md new file mode 100644 index 0000000..105710a --- /dev/null +++ b/ContactBook.package/ContactBook.class/README.md @@ -0,0 +1,9 @@ +I represent a contact book. + +I have contacts. + +Collaborators: +- Veit Heller + + Instance Variables + contacts: a List of Contacts diff --git a/ContactBook.package/ContactBook.class/class/createDefault.st b/ContactBook.package/ContactBook.class/class/createDefault.st new file mode 100644 index 0000000..e186e61 --- /dev/null +++ b/ContactBook.package/ContactBook.class/class/createDefault.st @@ -0,0 +1,16 @@ +instance creation +createDefault + ^ self new + addContact: (Contact + newNamed: 'Damien Cassou' + email: 'damien@cassou.me'); + addContact: (Contact + newNamed: 'Marcus Denker' + email: 'marcus.denker@inria.fr'); + addContact: (Contact + newNamed: 'Tudor Girba' + email: 'tudor@tudorgirba.com'); + addContact: (Contact + newNamed: 'Clara Allende' + email: 'clari.allende@gmail.com'); + yourself \ No newline at end of file diff --git a/ContactBook.package/ContactBook.class/instance/addContact..st b/ContactBook.package/ContactBook.class/instance/addContact..st new file mode 100644 index 0000000..19bc6ac --- /dev/null +++ b/ContactBook.package/ContactBook.class/instance/addContact..st @@ -0,0 +1,3 @@ +accessing +addContact: aContact + contacts add: aContact \ No newline at end of file diff --git a/ContactBook.package/ContactBook.class/instance/contacts.st b/ContactBook.package/ContactBook.class/instance/contacts.st new file mode 100644 index 0000000..df14b73 --- /dev/null +++ b/ContactBook.package/ContactBook.class/instance/contacts.st @@ -0,0 +1,3 @@ +accessing +contacts + ^ contacts \ No newline at end of file diff --git a/ContactBook.package/ContactBook.class/instance/initialize.st b/ContactBook.package/ContactBook.class/instance/initialize.st new file mode 100644 index 0000000..185fc60 --- /dev/null +++ b/ContactBook.package/ContactBook.class/instance/initialize.st @@ -0,0 +1,3 @@ +initialization +initialize + contacts := OrderedCollection new. \ No newline at end of file diff --git a/ContactBook.package/ContactBook.class/instance/removeContact..st b/ContactBook.package/ContactBook.class/instance/removeContact..st new file mode 100644 index 0000000..436bc99 --- /dev/null +++ b/ContactBook.package/ContactBook.class/instance/removeContact..st @@ -0,0 +1,3 @@ +accessing +removeContact: aContact + contacts remove: aContact \ No newline at end of file diff --git a/ContactBook.package/ContactBook.class/properties.json b/ContactBook.package/ContactBook.class/properties.json new file mode 100644 index 0000000..fd2e058 --- /dev/null +++ b/ContactBook.package/ContactBook.class/properties.json @@ -0,0 +1,14 @@ +{ + "category" : "ContactBook", + "classinstvars" : [ + ], + "classvars" : [ + ], + "commentStamp" : "VeitHeller 5/12/2018 14:19", + "instvars" : [ + "contacts" ], + "name" : "ContactBook", + "pools" : [ + ], + "super" : "Object", + "type" : "normal" } diff --git a/ContactBook.package/ContactBookTest.class/README.md b/ContactBook.package/ContactBookTest.class/README.md new file mode 100644 index 0000000..e69de29 diff --git a/ContactBook.package/ContactBookTest.class/instance/testContactManagement.st b/ContactBook.package/ContactBookTest.class/instance/testContactManagement.st new file mode 100644 index 0000000..892e322 --- /dev/null +++ b/ContactBook.package/ContactBookTest.class/instance/testContactManagement.st @@ -0,0 +1,10 @@ +testing +testContactManagement + | book contact | + book := ContactBook new. + contact := Contact newNamed: 'Veit Heller' email: 'veit@veitheller.de'. + book addContact: contact. + self assert: book contacts size equals: 1. + book removeContact: contact. + self assert: book contacts size equals: 0. + \ No newline at end of file diff --git a/ContactBook.package/ContactBookTest.class/instance/testCreation.st b/ContactBook.package/ContactBookTest.class/instance/testCreation.st new file mode 100644 index 0000000..11d8b4c --- /dev/null +++ b/ContactBook.package/ContactBookTest.class/instance/testCreation.st @@ -0,0 +1,5 @@ +testing +testCreation + | book | + book := ContactBook new. + self assert: book contacts size equals: 0. \ No newline at end of file diff --git a/ContactBook.package/ContactBookTest.class/properties.json b/ContactBook.package/ContactBookTest.class/properties.json new file mode 100644 index 0000000..fac8c87 --- /dev/null +++ b/ContactBook.package/ContactBookTest.class/properties.json @@ -0,0 +1,14 @@ +{ + "category" : "ContactBook", + "classinstvars" : [ + ], + "classvars" : [ + ], + "commentStamp" : "", + "instvars" : [ + ], + "name" : "ContactBookTest", + "pools" : [ + ], + "super" : "TestCase", + "type" : "normal" } diff --git a/ContactBook.package/ContactTest.class/README.md b/ContactBook.package/ContactTest.class/README.md new file mode 100644 index 0000000..e69de29 diff --git a/ContactBook.package/ContactTest.class/instance/testInstanceCreation.st b/ContactBook.package/ContactTest.class/instance/testInstanceCreation.st new file mode 100644 index 0000000..ed35d01 --- /dev/null +++ b/ContactBook.package/ContactTest.class/instance/testInstanceCreation.st @@ -0,0 +1,6 @@ +testing +testInstanceCreation + | contact | + contact := Contact newNamed: 'Marcus Denker' email: 'marcus.denker@inria.fr'. + self assert: contact fullname equals: 'Marcus Denker'. + self assert: contact email equals: 'marcus.denker@inria.fr'. \ No newline at end of file diff --git a/ContactBook.package/ContactTest.class/instance/testNameTrimmed.st b/ContactBook.package/ContactTest.class/instance/testNameTrimmed.st new file mode 100644 index 0000000..fc85989 --- /dev/null +++ b/ContactBook.package/ContactTest.class/instance/testNameTrimmed.st @@ -0,0 +1,5 @@ +testing +testNameTrimmed + | contact | + contact := Contact newNamed: ' Veit Heller ' email: 'veit@veitheller.de'. + self assert: contact fullname equals: 'Veit Heller'. \ No newline at end of file diff --git a/ContactBook.package/ContactTest.class/instance/testString.st b/ContactBook.package/ContactTest.class/instance/testString.st new file mode 100644 index 0000000..6080abb --- /dev/null +++ b/ContactBook.package/ContactTest.class/instance/testString.st @@ -0,0 +1,5 @@ +testing +testString + | contact | + contact := Contact newNamed: ' Veit Heller ' email: 'veit@veitheller.de'. + self assert: contact asString equals: 'Veit Heller '. \ No newline at end of file diff --git a/ContactBook.package/ContactTest.class/properties.json b/ContactBook.package/ContactTest.class/properties.json new file mode 100644 index 0000000..651a15a --- /dev/null +++ b/ContactBook.package/ContactTest.class/properties.json @@ -0,0 +1,14 @@ +{ + "category" : "ContactBook", + "classinstvars" : [ + ], + "classvars" : [ + ], + "commentStamp" : "", + "instvars" : [ + ], + "name" : "ContactTest", + "pools" : [ + ], + "super" : "TestCase", + "type" : "normal" } diff --git a/ContactBook.package/WAContact.class/README.md b/ContactBook.package/WAContact.class/README.md new file mode 100644 index 0000000..e69de29 diff --git a/ContactBook.package/WAContact.class/class/editContact..st b/ContactBook.package/WAContact.class/class/editContact..st new file mode 100644 index 0000000..24acaba --- /dev/null +++ b/ContactBook.package/WAContact.class/class/editContact..st @@ -0,0 +1,5 @@ +operations +editContact: aContact + ^ self new + setContact: aContact; + yourself \ No newline at end of file diff --git a/ContactBook.package/WAContact.class/instance/contact.st b/ContactBook.package/WAContact.class/instance/contact.st new file mode 100644 index 0000000..c92577c --- /dev/null +++ b/ContactBook.package/WAContact.class/instance/contact.st @@ -0,0 +1,3 @@ +accessing +contact + ^ contact \ No newline at end of file diff --git a/ContactBook.package/WAContact.class/instance/initialize.st b/ContactBook.package/WAContact.class/instance/initialize.st new file mode 100644 index 0000000..c76269b --- /dev/null +++ b/ContactBook.package/WAContact.class/instance/initialize.st @@ -0,0 +1,4 @@ +initialize +initialize + super initialize. + contact := Contact new. \ No newline at end of file diff --git a/ContactBook.package/WAContact.class/instance/renderButtonsOn..st b/ContactBook.package/WAContact.class/instance/renderButtonsOn..st new file mode 100644 index 0000000..d41d695 --- /dev/null +++ b/ContactBook.package/WAContact.class/instance/renderButtonsOn..st @@ -0,0 +1,9 @@ +rendering +renderButtonsOn: html + html tbsFormGroup: [ + html tbsButtonGroup: [ + self + renderSubmitButtonOn: html; + renderCancelButtonOn: html + ] + ] \ No newline at end of file diff --git a/ContactBook.package/WAContact.class/instance/renderCancelButtonOn..st b/ContactBook.package/WAContact.class/instance/renderCancelButtonOn..st new file mode 100644 index 0000000..9036f4c --- /dev/null +++ b/ContactBook.package/WAContact.class/instance/renderCancelButtonOn..st @@ -0,0 +1,6 @@ +rendering +renderCancelButtonOn: html + html tbsButton + beDanger; + cancelCallback: [ self answer: nil ]; + with: 'Cancel' \ No newline at end of file diff --git a/ContactBook.package/WAContact.class/instance/renderContentOn..st b/ContactBook.package/WAContact.class/instance/renderContentOn..st new file mode 100644 index 0000000..7930f79 --- /dev/null +++ b/ContactBook.package/WAContact.class/instance/renderContentOn..st @@ -0,0 +1,9 @@ +rendering +renderContentOn: html + html tbsContainer: [ + html heading with: 'Contact Editing'. + html tbsForm with: [ + self renderFieldsOn: html. + self renderButtonsOn: html + ] + ] \ No newline at end of file diff --git a/ContactBook.package/WAContact.class/instance/renderEmailFieldOn..st b/ContactBook.package/WAContact.class/instance/renderEmailFieldOn..st new file mode 100644 index 0000000..994a59a --- /dev/null +++ b/ContactBook.package/WAContact.class/instance/renderEmailFieldOn..st @@ -0,0 +1,10 @@ +rendering +renderEmailFieldOn: html + html tbsFormGroup: [ + html label: 'Email'. + html emailInput + tbsFormControl; + placeholder: 'your@email.eu'; + callback: [ :email | self contact email: email address ]; + value: (self contact email ifNil: '') + ] \ No newline at end of file diff --git a/ContactBook.package/WAContact.class/instance/renderFieldsOn..st b/ContactBook.package/WAContact.class/instance/renderFieldsOn..st new file mode 100644 index 0000000..e92ae46 --- /dev/null +++ b/ContactBook.package/WAContact.class/instance/renderFieldsOn..st @@ -0,0 +1,4 @@ +rendering +renderFieldsOn: html + self renderFullnameFieldOn: html. + self renderEmailFieldOn: html \ No newline at end of file diff --git a/ContactBook.package/WAContact.class/instance/renderFullnameFieldOn..st b/ContactBook.package/WAContact.class/instance/renderFullnameFieldOn..st new file mode 100644 index 0000000..6bdf33a --- /dev/null +++ b/ContactBook.package/WAContact.class/instance/renderFullnameFieldOn..st @@ -0,0 +1,10 @@ +rendering +renderFullnameFieldOn: html + html tbsFormGroup: [ + html label: 'Fullname'. + html textInput + tbsFormControl; + placeholder: 'fullname'; + callback: [ :value | self contact fullname: value ]; + value: (self contact fullname ifNil: '') + ] \ No newline at end of file diff --git a/ContactBook.package/WAContact.class/instance/renderSubmitButtonOn..st b/ContactBook.package/WAContact.class/instance/renderSubmitButtonOn..st new file mode 100644 index 0000000..bacfcea --- /dev/null +++ b/ContactBook.package/WAContact.class/instance/renderSubmitButtonOn..st @@ -0,0 +1,7 @@ +rendering +renderSubmitButtonOn: html + html tbsSubmitButton + beSuccess; + bePrimary; + callback: [ self answer: self contact ]; + with: 'Save' \ No newline at end of file diff --git a/ContactBook.package/WAContact.class/instance/setContact..st b/ContactBook.package/WAContact.class/instance/setContact..st new file mode 100644 index 0000000..002fcce --- /dev/null +++ b/ContactBook.package/WAContact.class/instance/setContact..st @@ -0,0 +1,3 @@ +accessing +setContact: aContact + contact := aContact \ No newline at end of file diff --git a/ContactBook.package/WAContact.class/properties.json b/ContactBook.package/WAContact.class/properties.json new file mode 100644 index 0000000..8660191 --- /dev/null +++ b/ContactBook.package/WAContact.class/properties.json @@ -0,0 +1,14 @@ +{ + "category" : "ContactBook", + "classinstvars" : [ + ], + "classvars" : [ + ], + "commentStamp" : "", + "instvars" : [ + "contact" ], + "name" : "WAContact", + "pools" : [ + ], + "super" : "WAComponent", + "type" : "normal" } diff --git a/ContactBook.package/WAContactBook.class/README.md b/ContactBook.package/WAContactBook.class/README.md new file mode 100644 index 0000000..a8898a2 --- /dev/null +++ b/ContactBook.package/WAContactBook.class/README.md @@ -0,0 +1,14 @@ +I represent a contact book web application. + +I render a contact book to HTML using Seaside. + +Collaborators: +Veit Heller + +Internal Representation and Key Implementation Points. + + Instance Variables + contactBook: a Contactbook + + + Implementation Points \ No newline at end of file diff --git a/ContactBook.package/WAContactBook.class/class/initialize.st b/ContactBook.package/WAContactBook.class/class/initialize.st new file mode 100644 index 0000000..3c6a723 --- /dev/null +++ b/ContactBook.package/WAContactBook.class/class/initialize.st @@ -0,0 +1,5 @@ +initialization +initialize + (WAAdmin register: self asApplicationAt: 'contacts') + addLibrary: JQDeploymentLibrary; + addLibrary: TBSDeploymentLibrary \ No newline at end of file diff --git a/ContactBook.package/WAContactBook.class/instance/addContact.st b/ContactBook.package/WAContactBook.class/instance/addContact.st new file mode 100644 index 0000000..1855a6a --- /dev/null +++ b/ContactBook.package/WAContactBook.class/instance/addContact.st @@ -0,0 +1,4 @@ +rendering +addContact + (self call: WAContact new) + ifNotNil: [ :contact | contactBook addContact: contact ] \ No newline at end of file diff --git a/ContactBook.package/WAContactBook.class/instance/contacts.st b/ContactBook.package/WAContactBook.class/instance/contacts.st new file mode 100644 index 0000000..fd0549b --- /dev/null +++ b/ContactBook.package/WAContactBook.class/instance/contacts.st @@ -0,0 +1,3 @@ +accessing +contacts + ^ contactBook contacts \ No newline at end of file diff --git a/ContactBook.package/WAContactBook.class/instance/contactsDo..st b/ContactBook.package/WAContactBook.class/instance/contactsDo..st new file mode 100644 index 0000000..16c7fdd --- /dev/null +++ b/ContactBook.package/WAContactBook.class/instance/contactsDo..st @@ -0,0 +1,3 @@ +operations +contactsDo: aBlock + self contacts do: aBlock \ No newline at end of file diff --git a/ContactBook.package/WAContactBook.class/instance/initialize.st b/ContactBook.package/WAContactBook.class/instance/initialize.st new file mode 100644 index 0000000..d1ffe34 --- /dev/null +++ b/ContactBook.package/WAContactBook.class/instance/initialize.st @@ -0,0 +1,4 @@ +initialization +initialize + super initialize. + contactBook := ContactBook createDefault \ No newline at end of file diff --git a/ContactBook.package/WAContactBook.class/instance/renderButtonsForContact.on..st b/ContactBook.package/WAContactBook.class/instance/renderButtonsForContact.on..st new file mode 100644 index 0000000..13dfef4 --- /dev/null +++ b/ContactBook.package/WAContactBook.class/instance/renderButtonsForContact.on..st @@ -0,0 +1,7 @@ +rendering +renderButtonsForContact: aContact on: html + html tbsButtonGroup: [ + self + renderEditButtonForContact: aContact on: html; + renderRemoveButtonForContact: aContact on: html + ] \ No newline at end of file diff --git a/ContactBook.package/WAContactBook.class/instance/renderContact.on..st b/ContactBook.package/WAContactBook.class/instance/renderContact.on..st new file mode 100644 index 0000000..c433865 --- /dev/null +++ b/ContactBook.package/WAContactBook.class/instance/renderContact.on..st @@ -0,0 +1,9 @@ +rendering +renderContact: aContact on: html + html tableRow: [ + html + tableData: [ self renderPhotoOf: aContact on: html ]; + tableData: aContact fullname; + tableData: aContact email; + tableData: [ self renderButtonsForContact: aContact on: html ] + ] \ No newline at end of file diff --git a/ContactBook.package/WAContactBook.class/instance/renderContactsOn..st b/ContactBook.package/WAContactBook.class/instance/renderContactsOn..st new file mode 100644 index 0000000..25ff918 --- /dev/null +++ b/ContactBook.package/WAContactBook.class/instance/renderContactsOn..st @@ -0,0 +1,12 @@ +rendering +renderContactsOn: html + html tbsTable: [ + html tableHead: [ + html + tableHeading: 'Photo'; + tableHeading: 'Name'; + tableHeading: 'Email'; + tableHeading: 'Actions' + ]. + self contactsDo: [ :contact | self renderContact: contact on: html ] + ] \ No newline at end of file diff --git a/ContactBook.package/WAContactBook.class/instance/renderContentOn..st b/ContactBook.package/WAContactBook.class/instance/renderContentOn..st new file mode 100644 index 0000000..51ce653 --- /dev/null +++ b/ContactBook.package/WAContactBook.class/instance/renderContentOn..st @@ -0,0 +1,11 @@ +rendering +renderContentOn: html + html tbsContainer: [ + html heading + level: 1; + with: 'My Contact Book'. + html tbsForm: [ + self renderContactsOn: html. + self renderGlobalButtonsOn: html + ] + ] \ No newline at end of file diff --git a/ContactBook.package/WAContactBook.class/instance/renderEditButtonForContact.on..st b/ContactBook.package/WAContactBook.class/instance/renderEditButtonForContact.on..st new file mode 100644 index 0000000..0b1dab7 --- /dev/null +++ b/ContactBook.package/WAContactBook.class/instance/renderEditButtonForContact.on..st @@ -0,0 +1,6 @@ +updating +renderEditButtonForContact: aContact on: html + html tbsButton + beSuccess; + callback: [ self call: (WAContact editContact: aContact) ]; + with: 'Edit' \ No newline at end of file diff --git a/ContactBook.package/WAContactBook.class/instance/renderGlobalButtonsOn..st b/ContactBook.package/WAContactBook.class/instance/renderGlobalButtonsOn..st new file mode 100644 index 0000000..ed4c3c3 --- /dev/null +++ b/ContactBook.package/WAContactBook.class/instance/renderGlobalButtonsOn..st @@ -0,0 +1,8 @@ +rendering +renderGlobalButtonsOn: html + html tbsButtonGroup: [ + html tbsButton + beSuccess; + callback: [ self addContact ]; + with: 'New contact' + ] \ No newline at end of file diff --git a/ContactBook.package/WAContactBook.class/instance/renderPhotoOf.on..st b/ContactBook.package/WAContactBook.class/instance/renderPhotoOf.on..st new file mode 100644 index 0000000..b13e8c0 --- /dev/null +++ b/ContactBook.package/WAContactBook.class/instance/renderPhotoOf.on..st @@ -0,0 +1,3 @@ +rendering +renderPhotoOf: aContact on: html + html image url: aContact gravatarUrl \ No newline at end of file diff --git a/ContactBook.package/WAContactBook.class/instance/renderRemoveButtonForContact.on..st b/ContactBook.package/WAContactBook.class/instance/renderRemoveButtonForContact.on..st new file mode 100644 index 0000000..c1c8a7a --- /dev/null +++ b/ContactBook.package/WAContactBook.class/instance/renderRemoveButtonForContact.on..st @@ -0,0 +1,6 @@ +rendering +renderRemoveButtonForContact: aContact on: html + html tbsButton + beDanger; + callback: [ self contactBook removeContact: aContact ]; + with: 'Remove' \ No newline at end of file diff --git a/ContactBook.package/WAContactBook.class/instance/updateRoot..st b/ContactBook.package/WAContactBook.class/instance/updateRoot..st new file mode 100644 index 0000000..496345b --- /dev/null +++ b/ContactBook.package/WAContactBook.class/instance/updateRoot..st @@ -0,0 +1,4 @@ +updating +updateRoot: anHtmlRoot + super updateRoot: anHtmlRoot. + anHtmlRoot title: 'Contact Book' \ No newline at end of file diff --git a/ContactBook.package/WAContactBook.class/properties.json b/ContactBook.package/WAContactBook.class/properties.json new file mode 100644 index 0000000..92b6f55 --- /dev/null +++ b/ContactBook.package/WAContactBook.class/properties.json @@ -0,0 +1,14 @@ +{ + "category" : "ContactBook", + "classinstvars" : [ + ], + "classvars" : [ + ], + "commentStamp" : "VeitHeller 5/12/2018 14:29", + "instvars" : [ + "contactBook" ], + "name" : "WAContactBook", + "pools" : [ + ], + "super" : "WAComponent", + "type" : "normal" } diff --git a/ContactBook.package/monticello.meta/categories.st b/ContactBook.package/monticello.meta/categories.st new file mode 100644 index 0000000..a7f7cb7 --- /dev/null +++ b/ContactBook.package/monticello.meta/categories.st @@ -0,0 +1 @@ +SystemOrganization addCategory: #ContactBook! diff --git a/ContactBook.package/monticello.meta/initializers.st b/ContactBook.package/monticello.meta/initializers.st new file mode 100644 index 0000000..e69de29 diff --git a/ContactBook.package/monticello.meta/package b/ContactBook.package/monticello.meta/package new file mode 100644 index 0000000..b0d2b21 --- /dev/null +++ b/ContactBook.package/monticello.meta/package @@ -0,0 +1 @@ +(name 'ContactBook') \ No newline at end of file diff --git a/ContactBook.package/properties.json b/ContactBook.package/properties.json new file mode 100644 index 0000000..f037444 --- /dev/null +++ b/ContactBook.package/properties.json @@ -0,0 +1,2 @@ +{ + }