Hello,
I am attempting to implement the example for Adaptive Forms in Lukas'
thesis in Chapter 3 on Pier. 3.6.3 Adaptive Forms
I created a Category, MyPier-Tutorial with the Classes, MyForm and
EditMyFormCommand attempting to implement the example as written with
the exception of it being PRCommand and PRStructure.
When I add a page to Pier with 'MyForm' and save it. Then I click on the
command 'Edit MyForm' I get this stack trace which I truncated somewhat.
I do not understand why I am getting this message. I have the class
method in EditMyFormCommand.
label
^ 'Edit MyForm'
Any help in understanding, greatly appreciated. If I did not include
enough of the stack trace, let me know.
Also included is a fileout of my attempt.
Are there any small Pier tutorials or applications which can be filed in
for educational purposes?
I get lost in all the Pier, Magritte, framework code attempting to find
examples.
Where in the code can I find where the Pier frontpage is implemented? I
tried to find it for an example. But am overlooking it somewhere. Or
else I am still lacking understanding somewhere.
Thanks for any help.
Jimmie Houchin
MessageNotUnderstood: EditMyFormCommand>>label
Debug Proceed
Possible Causes
* you sent a message this type of object doesn't understand
Stack Trace
1.
thisContext
EditMyFormCommand(Object)>>doesNotUnderstand: #label
self
an EditMyFormCommand
aMessage
label
2.
thisContext
MASelectorAccessor>>read:
self
(MASelectorAccessor read: #label write: #label:)
aModel
an EditMyFormCommand
3.
thisContext
EditMyFormCommand(Object)>>readUsing:
self
an EditMyFormCommand
aDescription
a MAStringDescription label: 'Label' comment: nil
4.
thisContext
[] in MACheckedMemento(MAMemento)>>pullRaw {[:each | result
at: each put: (self model readUsing:...etc...
self
a MACheckedMemento model: an EditMyFormCommand
result
a Dictionary(a MAStringDescription label: 'Kind' comment:
nil->'Edit MyForm' )
each
a MAStringDescription label: 'Label' comment: nil
5.
thisContext
SortedCollection(OrderedCollection)>>do:
self
a SortedCollection(a MAStringDescription label: 'Kind'
comment: nil a MAStringDescription label: 'La...etc...
aBlock
[] in MACheckedMemento(MAMemento)>>pullRaw {[:each | result
at: each put: (self model readUsing:...etc...
index
4
6.
thisContext
MAPriorityContainer(MAContainer)>>do:
self
a MAPriorityContainer label: 'Container' comment: nil
aBlock
PRCommand subclass: #EditMyFormCommand
instanceVariableNames: 'metamodel'
classVariableNames: ''
poolDictionaries: ''
category: 'MyPier-Tutorial'!
!EditMyFormCommand methodsFor: 'as yet unclassified' stamp: 'jlh 9/1/2007 09:29'!
description
^ self metamodel description! !
!EditMyFormCommand methodsFor: 'as yet unclassified' stamp: 'jlh 9/1/2007 09:30'!
doExecute
super doExecute.
self structure metamodel: self metamodel! !
!EditMyFormCommand methodsFor: 'as yet unclassified' stamp: 'jlh 9/1/2007 09:27'!
metamodel
"Answer the meta-model of the command, fetch it from the current structure if it is not initialized."
^ metamodel ifNil: [ metamodel := self structure metamodel ]! !
!EditMyFormCommand methodsFor: 'as yet unclassified' stamp: 'jlh 9/1/2007 09:28'!
metamodel: aDescription
" the meta-model of the command, fetch it from the current structure if it is not initialized."
metamodel := aDescription! !
"-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!
EditMyFormCommand class
instanceVariableNames: ''!
!EditMyFormCommand class methodsFor: 'as yet unclassified' stamp: 'jlh 9/1/2007 09:26'!
isAbstract
^ false! !
!EditMyFormCommand class methodsFor: 'as yet unclassified' stamp: 'jlh 9/1/2007 09:25'!
label
^ 'Edit MyForm'! !
!EditMyFormCommand class methodsFor: 'as yet unclassified' stamp: 'jlh 9/1/2007 09:25'!
structureClass
^ MyForm! !
PRStructure subclass: #MyForm
instanceVariableNames: 'model metamodel'
classVariableNames: ''
poolDictionaries: ''
category: 'MyPier-Tutorial'!
!MyForm methodsFor: 'as yet unclassified' stamp: 'jlh 9/1/2007 08:55'!
description
^ (MAContainer withAll: super description),
(self metamodel do: [ :each | each beEditable ])! !
!MyForm methodsFor: 'as yet unclassified' stamp: 'jlh 9/1/2007 09:07'!
document
^ PRDocument new
add: ( PRUnorderedList new
add: ( self metamodel children collect: [ :desc |
PRListItem
with: (Text with: '<b>' , desc label , '</b>');
with: (Text with: (desc
toString: ( self readUsing: desc)));
yourself]);
yourself);
yourself! !
!MyForm methodsFor: 'as yet unclassified' stamp: 'jlh 9/1/2007 08:52'!
initialize
super initialize.
self model: Dictionary new.
self metamodel: MAContainer new! !
!MyForm methodsFor: 'as yet unclassified' stamp: 'jlh 9/1/2007 08:49'!
metamodel
"Anser a Magritte container with the description of the receiver."
^ metamodel! !
!MyForm methodsFor: 'as yet unclassified' stamp: 'jlh 9/1/2007 08:50'!
metamodel: aDescription
" a Magritte container with the description of the receiver."
metamodel := aDescription
! !
!MyForm methodsFor: 'as yet unclassified' stamp: 'jlh 9/1/2007 08:50'!
model
"Answer a dictionary mapping the descriptions of the receiver to actual values."
^ model! !
!MyForm methodsFor: 'as yet unclassified' stamp: 'jlh 9/1/2007 08:51'!
model: aDictionary
" a dictionary mapping the descriptions of the receiver to actual values."
model := aDictionary! !
!MyForm methodsFor: 'as yet unclassified' stamp: 'jlh 9/1/2007 08:53'!
postCopy
super postCopy.
self model: self model copy! !
!MyForm methodsFor: 'as yet unclassified' stamp: 'jlh 9/1/2007 08:58'!
readUsing: aDescription
"Answer the actual value described by aDescription. If our meta-model includes aDescription return the associated value from the dictionary, else use the super implementation."
^(self metamodel includes: aDescription )
ifTrue: [
self model
at: aDescription
ifAbsent: [ aDescription default ]]
ifFalse: [ super readUsing: aDescription ]! !
!MyForm methodsFor: 'as yet unclassified' stamp: 'jlh 9/1/2007 09:01'!
write: anObject using: aDescription
"Set the value described by aDescription to be anObject. If our meta-model includes aDescription put anObject into the dictionary, else use the super implementation."
(self metamodel includes: aDescription )
ifTrue: [ self model at: aDescription put: anObject ]
ifFalse: [ super write: anObject using: aDescription ]! !
"-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!
MyForm class
instanceVariableNames: ''!
!MyForm class methodsFor: 'as yet unclassified' stamp: 'jlh 9/1/2007 08:48'!
isAbstract
^ false! !
yeh thats a good point, it would be great if we could use the thesis as a foundation to create an up to date versioned Magritte/Pier documentation > Date: Fri, 24 Aug 2007 07:47:12 -0500> From: j.squeak(a)cyberhaus.us> To: smallwiki(a)iam.unibe.ch> Subject: Re: Magritte book> > i p wrote:> > > > "Magritte – Meta-Described Web Application> > Development" is not a book. but its Lukas's Masters degree thesis work. > > The thesis documents the the design and overall architecture of > > magritte, the benefits of magritte and what problems it solves, this is > > not going to be updated (i dont think ) as it is not inteded to be a > > book for magritte, but this document will give you a good understanding > > of the overall architecture and design decisions made in designing > > magritte .> > The wiki would be a good place to have up to date information and > > current documentation, up to date class names etc> [snip original message]> > Yes, you are technically correct. It is not a book technically. I > thought it was his thesis, but missed inside where it said so.> > Nevertheless. It can provide an excellent foundation for such a book. It > is being provided as documentation for Magritte. It would still be nice > if this documentation was current. If Lukas wishes for this be to be > left alone and remain a thesis and a historic artifact it can be so and > with great respect to him for the work he put into his thesis and the > value it currently provides. But over time it will diminish as > documentation. In any living system if the documentation isn't also > changing, then the documentation will at some point become a historic > artifact of the program at a point in time.> > So the question still remains on whether this thesis can form the > foundation of a documentation book or booklet which can and will remain > current documentation of Magritte, Pier, etc? Or do we from the > knowledge gained from all of the materials start from scratch to create > such a work?> > His thesis will always be his thesis. That is a historical and > documented fact. But if it is made available as the beginning of some > versioned Magritte/Pier documentation then that document can be kept > current with the state of Squeak, Seaside, Magritte, Pier.> By versioned I mean it can have a version number which states the > versions of Squeak, Seaside, Magritte, Pier that are used in its pages.> > Stale documentation always frustrates and hinders beginners and people > exploring new technology. We need to enable the adoption of these tools. > Not provide another excuse for passing them by and instead using > "industry standard" and accepted tools which in many ways are less > productive than the Squeak toolset.> > Any way just some thoughts.> > Jimmie> > > > _______________________________________________> SmallWiki, Magritte, Pier and Related Tools ...> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
_________________________________________________________________
Discover the new Windows Vista
http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE
"Magritte – Meta-Described Web ApplicationDevelopment" is not a book. but its Lukas's Masters degree thesis work. The thesis documents the the design and overall architecture of magritte, the benefits of magritte and what problems it solves, this is not going to be updated (i dont think ) as it is not inteded to be a book for magritte, but this document will give you a good understanding of the overall architecture and design decisions made in designing magritte .
The wiki would be a good place to have up to date information and current documentation, up to date class names etc
Date: Fri, 24 Aug 2007 10:41:58 +0200From: matthias.berth(a)googlemail.comTo: smallwiki(a)iam.unibe.chSubject: Re: Magritte bookI think that an "errata" or "comments" page is an excellent idea. How about a wiki page on http://smallwiki.unibe.ch/smallwiki/pier/ and a hint on http://smallwiki.unibe.ch/smallwiki/pier/pierfaq/ ? You can use anonymous/xopu to login.Cheers Matthias
On 8/24/07, Jimmie Houchin <j.squeak(a)cyberhaus.us> wrote:
I am reading Lukas book Magritte – Meta-Described Web ApplicationDevelopment.I have tried to type in the code and run it.But it doesn't run. :(DateDescription selector: #birthday label: 'Birthday') between: (Date year: 1900) and: Date today; yourself.This is in the latest squeak-dev image.It complains that DateDescription doesn't exist and offersMADateDescription instead. Okay. But then #year: isn't a method in Date either. :(It would be nice if Pier/Magritte/Seaside had current documentation.Would it be possible, reasonable to put up an OO.org doc or some such ofthe original book so that it could be kept up to date by the community?I know this is asking a lot. But I also hate to ask Lukas to do all ofthe work by himself.I don't know exactly what would be the best process for community stewardship over material like this. But it would be nice if we had anexcellent place to start. And I think this book is. It would be nice ifit was current with the current favored images.If this isn't doable for whatever reason, I certainly respect Lukas' wishes concerning his material and authorship. Next best thing until adifferent book or such material came out would be an excellent erratapage for this book.Lets make choosing Squeak/Seaside/Pier as easy as possible. Any way, some thoughts for consideration.Thanks.Jimmie_______________________________________________SmallWiki, Magritte, Pier and Related Tools ...https://www.iam.unibe.ch/mailman/listinfo/smallwiki
_________________________________________________________________
Discover the new Windows Vista
http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE
Hello,
I want to add a condition to a Magritte-described object that checks the
whole object for consistency (and not just a single attribute). Is that
possible?
Example: Think about creating a workgroup from some of the users of your
site. The workgroup has a manager. The condition is that the manager must be
one of the members of the workgroup.
I've tried to do this. I have two descriptions on the workgroup class side:
one for the manager (saying that it can be any of the site's users) and one
for the users (saying that this is a subset of all users). I can add a
method #description to modify the standard description that is assembled
from the description* methods on the class side. So I tried:
Workgroup>>description
^super description
addCondition: [:workgroup | workgroup users includes: workgroup
manager]
labelled: 'Manager must be a member of the workgroup';
yourself
Alas, trying to edit an existing workgroup, I learned that the argument of
the condition block is a MACheckedMemento, so I can't ask it for users.
What would be the best way to have this check everytime the work group is
edited? Or should I just write the #manager: method such that the condition
will be satisfied automatically?
Cheers
Matthias
PS: I want to say a big thank you, especially to Lukas, for the great
answers on this list. I have learned something every time, and I was
impressed when my questions on how to do something were answered with a
patch.
PPS: No, this email is not a request for a patch :-)
I wrote this because I want my data model classes to have one set of
#description's to model their data structure and another set of
#settings to model the view/filter settings that are available for each
class.
I dont know what the best way to achieve this with magritte would be,
but I figured being able to have multiple sets of descriptions for
different unrelated purposes could be very useful.
As an implementation detail, it might be useful if the
MADescriptionBuilder 'Cache' was a class instance var rather than a
classVar.
best regards
Keith
p.s. Lukas, I want to thank you for all of the great help you have
provided, especially in the past few days.
In http://mc.lukas-renggli.ch/pieraddons
Name: Magritte-CustomBuilder-kph.1
Author: kph
Time: 18 August 2007, 2:53:47 am
UUID: dc2d465c-4d2d-11dc-b626-000a95edb42a
Ancestors:
- Variant of MADescriptionBuilder that is not tied to #description as a
prefix.
usage: (MCCustomDescriptionBuilder prefix: #settings) for: anObject
Notes: Includes a performance enhancement to double speed of description
building. (selectors of Object are ignored)
before:
[ 1000 timesRepeat: [MADescriptionBuilder default build: (ProductData) ]
] timeToRun. 21622
after:
[ 1000 timesRepeat: [(MACustomDescriptionBuilder prefix: #description)
build: (ProductData) ] ] timeToRun. 11075
thanks lukas
i found that when i click on 'Groups' or 'superuser' column sort on the users. i get the following error. if i click on groups i get "MessageNotUnderstood: OrderedCollection>><="
and if i click on 'superUsers' column i get messageNotUnderstood: True>> <=.
is it just a matter of adding <= to Boolean so it can respond to the binary message <= , for orderedcollection not sure
any ideas ?> From: renggli(a)iam.unibe.ch> Subject: Re: Error in PUUsersWidget> Date: Fri, 17 Aug 2007 18:36:37 +0200> To: smallwiki(a)iam.unibe.ch> > The problem is fixed in:> > Name: Pier-All-lr.230> Author: lr> Time: 17 August 2007, 6:35:49 pm> UUID: 49baa1a6-da58-4dfb-8c98-ec9d1c2a521e> Ancestors: Pier-All-lr.229> Dependencies: Pier-Model-lr.162, Pier-Tests-lr.73, Pier-Seaside-lr. > 194, Pier-Security-lr.87, Pier-Blog-lr.58> > - fixes: "when i added a system users component to a page, when i > click on any thing on the component which invokes a callback. i get > the following error 'Components not found while processing callbacks: > an Array(a PUUsersWidget)'. " (thanks to isaiah)> > > I see the same problem, I have two images, the older one where it> > works, and the newer one with the problem:> >> > Working:> > Pier-Security-lr.85> > Pier-Seaside-lr.185> > Pier-Model-lr.158> >> > Not working:> > Pier-Security-lr.86> > Pier-Seaside-lr.192> > Pier-Model-lr.161> >> > I've had a look at the changes in Pier-Security, but I have no idea> > what could cause this problem.> >> > Cheers> >> > Matthias> >> >> > On 8/17/07, isaiah <cappadonza(a)hotmail.com> wrote:> >>> >> hey i got the latest version of pier, when i added a system users > >> component> >> to a page, when i click on any thing on the component which invokes a> >> callback. i get the following error> >> "WAComponentsNotFoundError: Components not found while processing > >> callbacks:> >> an Array(a PUUsersWidget)" .> >> any ideas how to resolve this> >> --> >> View this message in context: http://www.nabble.com/Error-in- > >> PUUsersWidget-tf4286525.html#a12202036> >> Sent from the SmallWiki mailing list archive at Nabble.com.> >>> >>> >> _______________________________________________> >> SmallWiki, Magritte, Pier and Related Tools ...> >> https://www.iam.unibe.ch/mailman/listinfo/smallwiki> >>> >> > _______________________________________________> > SmallWiki, Magritte, Pier and Related Tools ...> > https://www.iam.unibe.ch/mailman/listinfo/smallwiki> > -- > Lukas Renggli> http://www.lukas-renggli.ch>
_________________________________________________________________
Explore the seven wonders of the world
http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&form=QBRE
hey i got the latest version of pier, when i added a system users component
to a page, when i click on any thing on the component which invokes a
callback. i get the following error
"WAComponentsNotFoundError: Components not found while processing callbacks:
an Array(a PUUsersWidget)" .
any ideas how to resolve this
--
View this message in context: http://www.nabble.com/Error-in-PUUsersWidget-tf4286525.html#a12202036
Sent from the SmallWiki mailing list archive at Nabble.com.
Hello,
I want to give pier users additional attributes (first name, last
name, email, etc). So far I was creating a subclass of PUUser. Would
it be better to just extend PUUser by a few Magritte descriptions on
the class side?
When I load new versions of Pier-Unix-Security from Monticello, I
guess my additional description methods would be deleted again? And if
I put them into my own category *my-customizations (with a star in the
name), monticello would leave them alone?
And, on a related note, what if I want to change a method in Pier's
core (like PULogin class>>isValidIn:), how do I avoid that the next
load from monticello gives me that old version again?
Cheers
Matthias
A small framework to enable external validation plugins to be added and
configured for Pier Login.
I am using this with a plugin (not included yet) which validates the
user/pass against a MYSQL query, then it logs in this user using an
internally defined pier-user (or as I call it a "role") as a template.
Finally I perform a second query to obtain a UserData record, and a
potential invalidation is performed on "any other criteria", such as an
account expiry date.
You add your plugin by subclassing PUExternalValidationPlugin, and
select the plugin to use in the application configuration.
Finally your plugin gets the opportunity to customize the Login Dialog's
descriptions. This enables you to customize the presentation of the
dialog if you add Magritte-ComponentDecoration 's. You should also be
able to add extra fields, though I leave this as an exercise for the reader.
enjoy
Keith
Hello,
I'd like to collect some snippets of documentation about Pier. Would
http://smallwiki.unibe.ch/smallwiki/pier/
be the right place to do so? I was not able to figure out a login to
that wiki :-(
Matthias