elstar IT

Fullstack | Java | Tech Speaker | Tech Coach | Frank van der Linden

  • About me
  • Blog license
  • My Open source projects

From the archive: How to customize theXPages CKEditor toolbar with a Java bean

20-10-2015 no responses flinden68 development

I was reading the blog post from Marky Roden about ‘How to easily hide an XPages CKEditor toolbar‘. I was thinking back at e-office I wrote also a blog about customising the Toolbar of the CKEditor. I found it in the way back machine, because the took the domino-weblog down after I left. Here is a link to the way back machine entries of that blog.

Below is a copy of the original blog

 

How it started
I have build a Social Intranet Framework powered by XPages, included integration with IBM Connection.
When I was at a customer to implement the framework on their Domino server, the content manager was wondering if it was possible to paste HTML code inside the richtext fields. Which is based on CKEditor.
So after some research I found the toolbar was build up by several plugins.

So a quick fix was made to the code to load the Source button and the content was able to add some weather information HTML in the widget.

My solution
I was thinking about a more solid solution. Why not give the intranet admin the opportunity to decide which plugin should be available for the content managers.
At the website of the CKEditor I found a list of possible toolbar options.

In the faces-config.xml I defined the toolbar managed bean
Image:How to customize theXPages CKEditor toolbar with a Java bean
I created a XPages with the most common options for the toolbar, with the possibility to check an item if the option should be loaded.
Image:How to customize theXPages CKEditor toolbar with a Java bean
On the save of the XPage, the managed bean will be updated with the latest choices.
Image:How to customize theXPages CKEditor toolbar with a Java bean

On a content page where a Richtext field is used I added a ‘toolbar’ Dojo attribute to the field. The toolbar attribute will get the options from the Managed Bean which should be loaded.
Image:How to customize theXPages CKEditor toolbar with a Java bean

The  toolbarBean.composeToolbar calls the method in the bean to get all the needed options and produce the output in the correct syntax
Image:How to customize theXPages CKEditor toolbar with a Java bean

I also made a small video to see the the toolbar configuration in action by checking and unchecking options and see the result in a richtextitem after a save.

Tags: development, java, xpages

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

  • « Jackson JSON wrapper plugin
  • My slides of SNoUG 2015: Let’s serve your data »

Contact me

My name is Frank van der Linden and I am an independent software developer based in the Netherlands. The last 2 years I was awarded as IBM Champion. Also I am on the board of OpenNTF. My specialisations are Java, Web development and Domino.


If you want to hire me, please fill in the Contact form


IBM Champion web badge
Apache Logo

All the code on this blog are under the Apache License 2.0. For more details, see Apache License 2.0

Most recent posts

  • NL Portal, a open source project
  • 10th anniversary as a freelancer and more…
  • Engage 2020: Hello are you listening, There is stream for everything
  • Spring Cloud Function on Azure run locally
  • Deploy Spring Cloud Function to IBM Cloud

Latest reactions

  • Spring Cloud Function on Azure run locally - elstar IT on Deploy Spring Cloud Function to IBM Cloud
  • flinden68 on Quick XPages tip: add Fullcalendar plugin to your application
  • Rajesh samal on Quick tip: Swagger support for Spring Webflux
  • dsieyx on Quick XPages tip: add Fullcalendar plugin to your application
  • John on Named as IBM Champion 2019

Archive

  • November 2024
  • April 2024
  • March 2020
  • February 2020
  • January 2020
  • October 2019
  • September 2019
  • June 2019
  • May 2019
  • April 2019
  • March 2019
  • January 2019
  • December 2018
  • October 2018
  • September 2018
  • May 2018
  • April 2018
  • March 2018
  • February 2018
  • January 2018
  • December 2017
  • November 2017
  • October 2017
  • July 2017
  • June 2017
  • May 2017
  • April 2017
  • March 2017
  • February 2017
  • January 2017
  • December 2016
  • November 2016
  • October 2016
  • September 2016
  • August 2016
  • June 2016
  • May 2016
  • April 2016
  • March 2016
  • February 2016
  • December 2015
  • November 2015
  • October 2015
  • September 2015
  • August 2015
  • July 2015
  • June 2015
  • May 2015
  • April 2015
  • March 2015
  • February 2015
  • December 2014
  • October 2014
  • September 2014
  • August 2014
  • July 2014
  • June 2014
  • May 2014
  • April 2014
  • March 2014
  • February 2014

Category

  • bluemix
  • business
  • cloudant
  • community
  • development
  • hrassistant
  • openntf
  • running
  • salesforce
  • Springboot
  • Tesla
  • trailrunning
  • Uncategorized
  • watson
  • OpenNTF
  • Collaboration Today
  • XSnippets
  • Stackoverflow
  • IBM Collaboration Solutions
  • Social Business Toolkit
  • About me
  • Dutch curriculum vitae
  • English curriculum vitae
  • Google+
  • LinkedIn profile
  • Twitter
  • Slideshare
  • Blog license
  • My open source projects