Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
PRStructure
Last updated at 9:58 am UTC on 17 October 2008
PRStructure is a superclass of PRPage in the Pier wiki system.

The environment method gives back the Environment associated with the PRStructure object. If no environment exists, a default environment is contructed.

PRStructure>>newEnvironment

calls

PRStructure>>deaultEnvironment

The following code illustrates how Components (the model, e.g. PRPage or PRComponent objects) and wiki syntax (the view, the quoted text after 'content:') are composed in the Pier wiki.

defaultEnvironment
	^ (PRPage named: 'environment')
		addChild: ((PRPage named: 'title')
			contents: '!*/*';
			yourself);
		addChild: ((PRComponent named: 'search')
			componentClass: PRAjaxSearchWidget;
			yourself);
		addChild: ((PRComponent named: 'children')
			componentClass: PRChildrenWidget;
			write: 1 using: PRChildrenWidget descriptionLevel;
			write: true using: PRChildrenWidget descriptionHighlightPath;
			yourself);
		addChild: ((PRPage named: 'sidebar')
			addChild: ((PRComponent named: 'navigation')
				componentClass: PRChildrenWidget;
				write: 2 using: PRChildrenWidget descriptionLevel;
				write: true using: PRChildrenWidget descriptionExpand;
				yourself);
			addChild: ((PRComponent named: 'views')
				componentClass: PRViewsWidget;
				yourself);
			addChild: ((PRComponent named: 'commands')
				componentClass: PRCommandsWidget;
				yourself);
			contents: '+navigation+
+views+
+commands+';
			yourself);
		addChild: ((PRComponent named: 'contents')
			componentClass: PRContentsWidget;
			write: '%c' using: PRContentsWidget descriptionHeading;
			yourself);
		addChild: ((PRPage named: 'footer')
			contents: 'Powered by *Squeak>http://www.squeak.org*, *Seaside>http://www.seaside.st*, *Magritte>http://www.lukas-renggli.ch/smalltalk/magritte*
		and *Pier>http://www.lukas-renggli.ch/smalltalk/pier*.';
			yourself);
		contents: '<div class="container">
	<div class="header column span-24">
		<div class="title column span-20">+title+</div>
		<div class="search column span-4 last">+search+</div>
		<div class="children column span-24 last">+children+</div>
	</div>
	<div class="body column span-24">
		<div class="sidebar column span-4">+sidebar+</div>
		<div class="contents column span-20 last">+contents+</div>
	</div>
	<div class="footer column span-24">+footer+</div>
</div>';
	yourself


hjh