Moe <http://source.lukas-renggli.ch/magritteaddons/Moe-jmck.11.mcz>is a
databse persistency framework based which uses Magritte and Roe for
persisting objects to PostgreSQL db's. The one novel thing about it (and I
am sure I can't be the first person to have thought of it) is that, instead
of serializing contained objects to the db column for that object, it
stores the id of any embedded/persisted object in the db column for that
object and rebuilds the object with its embeddded objects on reload. It
works for embedded collections as well writing an integer array to the db
column to represent the collection in the db. Its a relatively simple and
somewhat naive framwork written by a newbie :) I like to think of it as an
Inactive Record Pattern in that Active Record Pattern requires the objects
to (somewhat) model the database, and requires you to implement the database
features (like foreign keys) in the object model. The philosophy of Moe is
to use the db as a mirror of the model objects. Where there is a collection
in the model the db should also have a collection, etc. I don't use any kind
of foreign key relations in my objects so I wht should I bother with them at
all. Best of all, it is all implemented using Magritte meta descriptons.
Along with this the Postgres package has been modified to include integer
array support.
I also needed to implement money columns so I added support for the money
type in postgres and used Avi Bryants Money package from squeaksource to
model money types. Support has been added for reading a string
representation of money replete with Locale defined separators and decimals.
The money implementation required that I write a new Magritte description so
Magritte-Money is now available in the Magritte-Addons project. Again, to
use this you will need to load the Money package.
The following packages will be required to use Moe:
PostgresV2 <http://www.squeaksource.com/PostgresV2.html>
Roe <http://www.squeaksource.com/ROE.html>
Magritte-Roe<http://source.lukas-renggli.ch/magritteaddons/Magritte-Roe-jmck.9.mcz>
and incidentally Money <http://www.squeaksource.com/Money.html> and
Magritte-Money<http://source.lukas-renggli.ch/magritteaddons/Magritte-Money-jmck.1.mcz>
(you can get away with not using Money by using the previous version of
PostgresV2)
Lastly, I have always been dissappointed in the strictly vertical rendering
of Magritte described objects and decided to implement a renderer that would
give them a more horizontal feel.
MARowRenderer<http://source.lukas-renggli.ch/magritteaddons/Magritte-RowRenderer-jmck.1.m…>will
group your descriptions based on their priorities. Priorities 1-9 will
render on one row, 10-19 on the next row, 20-29 on the next row and so on.
Its a little kludgy, and the algorithm needs some work to make it more
efficient, but it works well. Column spans are also calculated so rows do
not have to have the same number of elements to look good. If you've ever
wished you could get the person's Last Name, First Name and Middle Name to
render on one row, and the address fields to render on their own row etc,
this will do the trick. Simply implement descriptionContainer on your object
to return MARowContainer and voila!
I hope the community finds some of this stuff useful.
John McKeon
--
http://jmck.seasidehosting.st
Hi people: I have a problem with css but probably it is because I know very
little about them and I hate them ahaha.
I have a Pier table with |s The thing is that I want to put a particular
css to those tables (the one I create in a page with |s ) but not to ALL
the html tables the Pier render.
If I change in my css table for example, it will affect to all pier tables:
when crating a component, when adding, editing, etc...
I can create another css class (tableForMyTables for example), but then I
should change Pier code so that it renders tables with my css class instead
of the standardone.
Does anyone know how can achieve this? Perhaps adding a div for my tables?
but I don't know what do to then haha.
Thanks for the help!
Mariano
Hi,
I am giving Pier a try, so here is my first question.
How do I change the text: Event location in the main Banner of the web page ?
Regards,
@+Maarten,
If I'm too annoying, just let me know. But I still don't know how solve my
problem, so I'll try once again.
I would like to use existing Poll package (recently updated by Lukas to work
properly in current versions of Pier).
There's POPoll class containing options (as instances of POPollOptions and
described by MAToManyRelationDescription) along with other attributes (like
deadline, uuid --- unique ID used to identify already voted users, ---
etc.). POPolls were supposed to be rendered with special kinds of
PRViewComponents using charts but it's a bit off-topic right now.
Voting itself is supported by POVoteCommand class, which is rendered as a
form described by MASingleOptionDescription with POPollOptons as options. (I
don't fully understand how it works but it obviously does:) *By the way,
despite unvoted POPoll has POVoteCommand as default, it is still rendered as
with View (it's a question for Lukas, maybe?).*
So, *the main question* (still) is: how to join several POPolls in one form
providing choices several choices (of different polls) being posted back to
server by click on one button.
I tried to do it directly (by surrounding by form with submit button), but I
have no information about what was selected by user in callback... And
(better) how to do it by means of Magritte?
--
Dennis Schetinin
I did ask this question before, but still don't know how to solve the
problem.
So, I have Questionnaire (subclass of PRCase) and it's view
QuestionnaireView (PRDefaultView). The latter should render children Polls
of Questionnaire using vote command. I need to embed a Questionnaire into
another page.
I tried to do it implementing #visitQuestionnaire: in #PREmbeddedRender
visitQuestionnaire: aStructure
(aStructure viewComponentClass on: self context) structure: aStructure;
renderContentOn: html
As far as QuestionnaireView renders polls as components, selecting an option
in one of the Polls (posting the form) gives a "WAComponentsNotFoundError"
exception (because #children method of QuestionnaireView is not invoked at
all).
What is the correct way to implement what I want?
--
Dennis Schetinin
Hi,
We are happy to announce the release of Pier 1.2:
http://www.piercms.com/download
What’s new:
- Mature value links (see http://www.piercms.com/doc/syntax for more
details)
- No _s or _k cruft in the url
- Remembered last login
- Smaller javascript code for faster page loading
- Better default CSS (including a style for events)
- Halos for enhanced editing
- Pharo 0.1-10374 inside
Enjoy and let us know what you think.
Cheers,
Lukas and Doru
Hi! I am using Pier 1.2 and lightbox doesn't seems to work. I created a
simple search widget and embed it into a page like this:
++/seach++
The ligthbox is displayed. Then I type a word and give an enter. At that
moment, I get the following walkback:
Seaside WalkbackWAComponentsNotFoundError: Components not found while
processing callbacks: an Array(a PRSearchWidget)
Debug <http://localhost:5555/seaside/pier?_s=BOXmeDNxcV8T5o3T&_k=N3RtmbmB&1>
Full Stack<http://localhost:5555/seaside/pier?_s=BOXmeDNxcV8T5o3T&_k=N3RtmbmB&2>
Possible Causes
- you do not implement #children correctly
- you do not backtrack #children correctly
- you do not implement #states correctly
I am sorry my seaside skill is not yet to good so I don't know what the
problem can be. I checked PRSearchWidget but I think they don't need a
children or states method.
I attach complete SqueakDebug.log
Any help?
Thanks in advance,
Mariano
Hi! I am having a problem with encoding and I am not sure if it is a bug or
if it is correct. I copy Pier and Pharo mailing list.
I am in Linux and when I write a double quote I write something like this:
"Muelle Almirante Storni"
If I write in OpenOffice, when I type the double quote key, OpenOffice
writes something like this: “Muelle Almirante Storni”
Notice that the quotes are these last ones are twisted and the first were
straight.
If I copy paste "Muelle Almirante Storni" in a workspace of Pharo, it is
perfectly understood. But if I paste I get:
?Muelle Almirante Storni?
Now...I am developing a pier application my main problem is that my
"functional information" is in .doc so they that the twisted ones. As they
are put in the image trought Pier and a KomEncoded, there is not
problem....until I try to search on the string. If I evaluate:
' “Muelle Almirante Storni”' findString: 'esquel' startingAt: 1
caseSensitive: false
This has a problem (index out of range) because internaly it tries to ask
the asciiValue and this answers 2881 -> absurd
Now, my solution is everytime I copy paste the text from a .doc to a Pier
page I have to replace those twisted quotes for the straight ones.
Is this a bug? or it is just like this ?
thanks
mariano
Hi,
One of the thing I'm missing with Pier is "clean urls" -- without the
session stuff.
I played with the code a bit, followed advices from
http://onsmalltalk.com/clean-urls-in-seaside to get rid of _s, and
then modifyed the visitInternalLink in PRReferenceRenderer so that
links do not include _k. I simply do something like that:
anchor url: 'http://localhost:8080/seaside/pier', aLink reference
which sets the url fully, and apparently everything seems to work as
hoped -- links indicated in pier are now fully formed and without _s
and _k, while dynamically generated links still work so for example I
can still log in and edit pages as usual... but in "normal viewing
mode" I get clean urls.
My question is, am I breaking something I'm not seeing (as apparently
things works as I want) by doing that ? is that the correct way to do
it ?
thanks,
--
Nicolas Roard
"I love deadlines. I like the whooshing sound
they make as they fly by." -- Douglas Adams
Hi everyone!
Once I install the Gallery add-on, I cannot add pictures into a
gallery (I import a zip-file with pictures inside), the error message
I get is as cryptic as this:
• MessageNotUnderstood: UndefinedObject>>nextPutAll:
• MessageNotUnderstood: UndefinedObject>>close
I do not know how to make a debugger appear to give me a chance to fix
it.
Furthermore, it seems that Pier 1.2 removed the Installer class. Thus,
I recommend changing the documentation of how to install the Gallery
add-on here: http://www.piercms.com/doc/add-ons#248154888, as it
refers to the Installer class.
Cheers,
Niko