Limiting Site Studio WYSIWYG Object Dialogs

I recently got a question from someone that asked if it was possible to modify the WYSIWYG element form to limit the options available to contributors when adding tables. Specifically, they wanted the ability to take away cellpadding, cellspacing, border size, etc... so that they could control all of this through their own CSS.

In looking into it, there's no real OOTB way to do this. But I dug a little bit deeper and found out how this can be done. Basically, you'll need to edit the FCK editor's primary dialog files to make the changes. Now there is the quick & dirty way to do this...and there is the right way to do this.

The files that the editor uses are within the weblayout\resoureces\wcm\sitestudio directory. But you don't want to modify those because they are re-published from the Site Studio component every time the server is restarted. So if you want to do the quick & dirty method, you would go to the file:

[ucm home dir]\custom\SiteStudio\publish\resources\wcm\sitestudio\elements\shared\fck_table.html

and edit it there. When done, you would go to Administration -> Actions -> Publish Static Layout Files. Now the one in the weblayout directory would be replaced with the modified one.

The caveat with this method and why it's not the right way is because if you install a patch or updated version of Site Studio, it's going to wipe out your changes. So the proper way is to create a separate component that contains that modified file and gets published instead. Here are the basic steps to do so:


  1. Create a component and include a Static Table resource.

  2. Here is what the code in the table should look like:

    code.png


  3. Create a publish path in your component that will mirror the weblayout path (\publish\resources\wcm\sitestudio\elements\shared)

    folder.png


  4. Copy the fck_table.html file from the Site Studio component and place it in the directory.

  5. Modify the HTML file with the changes needed.

  6. Enable the component and restart. The updated file should be published

  7. (Optional) If you plan on packaging up the component, be sure to include the publish directory as a ComponentExtra.

As for the best way to modify the file to remove those options, I found that actually removing the fields from the code resulted in JavaScript errors by the FCK editor. Rather then mess with the JavaScript, I found it easier to simply style the objects with a display: none; property.

Comments:

Hi Kyle We are trying to override the FCK editor file under weblayout/resources/wcm/sitestudio/elements/shared I followed the instructions to create a custom component but it is not overriding the SiteStudio base files. Does the component hda file needs to define a MergeRule . I tried this in my hda based on an example on customizing 10g interface but it is still not overwriting the weblayout or the SiteStudio component files. @ResultSet MergeRules 4 fromTable toTable column loadOrder EJSiteStudioEditorOverride PublishedStaticFiles null 10 @end

Posted by Sid Mulpuru on February 23, 2010 at 02:15 AM CST #

Hello Sid, Yes, it sounds like you took the right approach, so I'm not sure why that did not work for you. Here is a copy of my SiteStudioEditorOverride.zip component that I built for this example. In this example, I'm hiding the 'Caption' and 'Summary' dialogs from the Table properties.

Posted by kyle.hatlestad on February 24, 2010 at 01:55 AM CST #

Hi Kyle, I too have a problem with overwriting SiteStudio files in the weblayout/resources/wcm/sitestudio folders. I downloaded your sample component, but UCM (version 10.1.3.5.1) is failing to start with this error in the debug.log: Startup timeout occurred. Error occurred in startup. Terminating mutex lock thread. Terminated thread. Forcibly terminating the process. Line 1390: TerminateProcess() failed. Error 183: Cannot create a file when that file already exists. If I remove the MergeRules bit from the .hda file UCM does boot, but the files haven't been overwritten. FYI: I'm trying to overwrite the wcm\custom\sitestudio\elements\fckwysiwyg.js and wcm\custom\sitestudio\linkwizard\linkwizard.js file. I'm hiding some section related options in the link wizard as we're using SSXA and I'm overwriting the WCM.ContentServerPopup.prototype.FixupUrl method to include options.params in the URL, so that it's possible to use a profile with the flash browse popup. Regards, Stijn

Posted by Stijn R on November 07, 2010 at 07:09 PM CST #

Oh, btw: my weblayout folder is on a network path. Stijn

Posted by Stijn R on November 07, 2010 at 07:11 PM CST #

Hi Kyle, Thanks for the quick reply. I already found the two SR you mentioned, but they're not really helpful for me. The database is fine, and there's no problem with memory or something like that. If I put the MergeRules back in, I am getting the error again. I already opened a SR (3-2317851121), but since a custom component is causing this issue, I'm having a bit of trouble getting support. I suspect that the error has to do with the weblayout being on the NAS (and the permissions of the service user on the NAS). The strange thing is that the CS runs just fine otherwise. Stijn

Posted by Stijn R on November 08, 2010 at 01:35 AM CST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Kyle Hatlestad is a Solution Architect in the WebCenter Architecture group (A-Team) who works with WebCenter Content and other products in the WebCenter & Fusion Middleware portfolios. The WebCenter A-Team blog can be found at: https://blogs.oracle.com/ ateam_webcenter/

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today