Hi,
I've been working on the ConfigurationOfxxx to load the Wysiwyg editor and think I've finally made it.
Starting with a clean Pharo1.3 image, I found I first needed to load a recent version of Seaside:
Gofer new
squeaksource: 'Seaside30';
package: 'ConfigurationOfSeaside30';
load.
ConfigurationOfSeaside30 loadLatestVersion.
I've added the editor configuration to ConfigurationOfPierAddOns2, so the next step is to load the configuration:
Gofer new
renggli: 'pier2addons';
package: 'ConfigurationOfPierAddOns2';
load.
If you want to test the editor in a minimal configuration, then execute:
((Smalltalk at: #ConfigurationOfPierAddOns2) project version: '2.0.9') load: #('Pier-FileUpload-Wysiwyg').
Or if you want the editor loaded into a more complete "standard" pier installation execute:
((Smalltalk at: #ConfigurationOfPierAddOns2) project version: '2.0.9') load: #('Pier-Setup' 'Pier-FileUpload-Wysiwyg').
The Wysiwyg editor insert image/file upload, functionality requires a filter and configuration to be installed. The magic to do this is in ConfigurationOfPierAddOns2>>#initializeWysiwygEditorFileUpload:
ConfigurationOfPierAddOns2>>#initializeWysiwygEditorFileUpload
| pierApp |
pierApp := WADispatcher default handlers at: 'pier' ifAbsent: [
| distribution |
distribution := Smalltalk at: #PRDistribution ifAbsent: [ nil ].
distribution isNil
ifTrue: [
(PRPierFrame registerAsApplication: 'pier' kernel: (PRKernel named: 'defaultKernel')) ]
ifFalse: [
PRPierFrame registerAsApplication: 'pier' kernel: PRDistribution new kernel ] ].
pierApp filters detect: [ :aFilter | aFilter class name = #NAFileUploadRequestHandler ] ifNone: [ pierApp addFilterFirst: NAFileUploadRequestHandler new ].
pierApp configuration addParent: NAFileUploadConfigurator instance
The installation will install the required filter and configuration provided your Pier application is installed at '/pier'
Editing a page should now display the Wysiwyg editor. The editor's links dialog should include a Pier site map, allowing you to easily select a link within the site. The insert image, should include a "choose file" button which will upload a file and by default store it in folder based on the location of the page within the pier site-map, by default within a folder - 'uploadedFiles' - in the image folder. The uploaded images folder can be configured within /config in the "File Upload" section.
Hope this all makes sense
Nick