From 1e699ea3343dad04bc9709b32040fbab28657422 Mon Sep 17 00:00:00 2001 From: OffrayLuna Date: Tue, 20 Dec 2016 11:36:13 +0000 Subject: [PATCH] First backup, just before starting to develop in a new image (this one became slow). --- src/Etico/EtiAction.class.st | 12 ++++++++ src/Etico/EtiAgent.class.st | 58 ++++++++++++++++++++++++++++++++++++ src/Etico/EtiEvent.class.st | 43 ++++++++++++++++++++++++++ src/Etico/EtiSector.class.st | 13 ++++++++ src/Etico/EtiWeb.class.st | 28 +++++++++++++++++ src/Etico/package.st | 1 + 6 files changed, 155 insertions(+) create mode 100644 src/Etico/EtiAction.class.st create mode 100644 src/Etico/EtiAgent.class.st create mode 100644 src/Etico/EtiEvent.class.st create mode 100644 src/Etico/EtiSector.class.st create mode 100644 src/Etico/EtiWeb.class.st create mode 100644 src/Etico/package.st diff --git a/src/Etico/EtiAction.class.st b/src/Etico/EtiAction.class.st new file mode 100644 index 0000000..41ca56a --- /dev/null +++ b/src/Etico/EtiAction.class.st @@ -0,0 +1,12 @@ +" +I model several actions that can be taken regarding ethical or unethical events, like +public acknowledge for the first ones or law actions for the second ones. +" +Class { + #name : #EtiAction, + #superclass : #Object, + #instVars : [ + 'description' + ], + #category : #'Etico-Model' +} diff --git a/src/Etico/EtiAgent.class.st b/src/Etico/EtiAgent.class.st new file mode 100644 index 0000000..70219b2 --- /dev/null +++ b/src/Etico/EtiAgent.class.st @@ -0,0 +1,58 @@ +" +I model the agents for the Etico web site, which tries to map ethical behavior of agents +in the private and public sectors. +For more information (in Spanish) look at: + +http://mutabit.com/repos.fossil/etico/ +" +Class { + #name : #EtiAgent, + #superclass : #Object, + #instVars : [ + 'name', + 'sector', + 'type', + 'events' + ], + #category : #'Etico-Model' +} + +{ #category : #accessing } +EtiAgent >> events [ + ^ events ifNil: [ ^ OrderedCollection new ] +] + +{ #category : #accessing } +EtiAgent >> events: anObject [ + events := anObject +] + +{ #category : #accessing } +EtiAgent >> name [ + ^ name +] + +{ #category : #accessing } +EtiAgent >> name: anObject [ + name := anObject +] + +{ #category : #accessing } +EtiAgent >> sector [ + ^ sector +] + +{ #category : #accessing } +EtiAgent >> sector: anObject [ + sector := anObject +] + +{ #category : #accessing } +EtiAgent >> type [ + ^ type +] + +{ #category : #accessing } +EtiAgent >> type: anObject [ + type := anObject +] diff --git a/src/Etico/EtiEvent.class.st b/src/Etico/EtiEvent.class.st new file mode 100644 index 0000000..8c55983 --- /dev/null +++ b/src/Etico/EtiEvent.class.st @@ -0,0 +1,43 @@ +" +I model the ethical an unethical events that an EtiAgent can do. +" +Class { + #name : #EtiEvent, + #superclass : #Object, + #instVars : [ + 'overview', + 'details', + 'actions' + ], + #category : #'Etico-Model' +} + +{ #category : #accessing } +EtiEvent >> actions [ + ^ actions ifNil: [ ^OrderedCollection new ] +] + +{ #category : #accessing } +EtiEvent >> actions: anObject [ + actions := anObject +] + +{ #category : #accessing } +EtiEvent >> details [ + ^ details +] + +{ #category : #accessing } +EtiEvent >> details: anObject [ + details := anObject +] + +{ #category : #accessing } +EtiEvent >> overview [ + ^ overview +] + +{ #category : #accessing } +EtiEvent >> overview: anObject [ + overview := anObject +] diff --git a/src/Etico/EtiSector.class.st b/src/Etico/EtiSector.class.st new file mode 100644 index 0000000..3bb9620 --- /dev/null +++ b/src/Etico/EtiSector.class.st @@ -0,0 +1,13 @@ +" +I model the sectors where an Agent can belong to. +" +Class { + #name : #EtiSector, + #superclass : #Object, + #category : #'Etico-Model' +} + +{ #category : #initializing } +EtiSector class >> list [ + ^ #('privado' 'publico' 'fundaciones / ONG') +] diff --git a/src/Etico/EtiWeb.class.st b/src/Etico/EtiWeb.class.st new file mode 100644 index 0000000..4b4195f --- /dev/null +++ b/src/Etico/EtiWeb.class.st @@ -0,0 +1,28 @@ +" +I provide functionality to add data to some instances of the Etico package. +" +Class { + #name : #EtiWeb, + #superclass : #Object, + #category : #'Etico-WebSite' +} + +{ #category : #'as yet unclassified' } +EtiWeb class >> addAgentForm: request [ + + | input page | + input := request uri queryAt: #input ifAbsent: [ 'Entrada' ]. + page := ZnHtmlOutputStream streamContents: [ :html | + html page: 'Entrada sencilla' do: [ + html + tag: #form + attributes: #(#action 'form-test-1' 'accept-charset' 'utf-8' method GET) + do: [ + html + str: 'Entrada'; space; + tag: #input attributes: { #type. #input. #name. #input. #value. input }; space; + tag: #input attributes: #(type submit); + str: 'La entrada fue:'; space; tag: #em with: input] + ] + ] +] diff --git a/src/Etico/package.st b/src/Etico/package.st new file mode 100644 index 0000000..0134d75 --- /dev/null +++ b/src/Etico/package.st @@ -0,0 +1 @@ +Package { #name : #Etico }