loading Wywsiwyg editor

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

loading Wywsiwyg editor

Nick
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









_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: loading Wywsiwyg editor

Nick
Hi,

I've come across some odd behaviour when using the Wysiwyg editor on Pharo when using the Swazoo Adaptor. There are some very strange effects with ajax calls and the Swazoo adaptor which I've yet to characterise. 

So if you try the Wysiwyg editor with Pharo be sure to use the Comanche Adapter rather than the Swazoo Adapter.

Ideally we'd use the Zinc adapter, though I haven't tested with it and I guess we should change the ConfigurationOfSeaside30 to load the Zinc adapter on Pharo 1.3....

There are also various fixes which have been added:
 - fix to file-uploading paths on Windows (thanks to Bart Veenstra)
- improved error reporting for file-upload errors
- moved the registration code (for the filter and configuration instance) to class side of PRFileUploadWysiwygEditorBase. see #initializeWysiwygEditorFileUpload*

Nick

On 24 August 2011 16:24, Nick Ager <[hidden email]> wrote:
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










_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: loading Wywsiwyg editor

Lukas Renggli
> I've come across some odd behaviour when using the Wysiwyg editor on Pharo
> when using the Swazoo Adaptor. There are some very strange effects with ajax
> calls and the Swazoo adaptor which I've yet to characterize.

I think there were some issues reported with Swazoo (or the
Seaside-Swazoo adaptor) that would double encode some URL field. I
guess that could lead to strange effects when using AJAX.

> So if you try the Wysiwyg editor with Pharo be sure to use the Comanche
> Adapter rather than the Swazoo Adapter.
> Ideally we'd use the Zinc adapter, though I haven't tested with it and I
> guess we should change the ConfigurationOfSeaside30 to load the Zinc adapter
> on Pharo 1.3....

Zinc works very well and it is included with Pharo anyway.

Lukas

--
Lukas Renggli
www.lukas-renggli.ch

_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki