cancel
Showing results for 
Search instead for 
Did you mean: 

TinyMCE..how do you override the web-client-config-wcm.xml ?

tvaughan77
Champ in-the-making
Champ in-the-making
Hi,

Short of editing the exploded-war tomcat/webapps/alfresco/WEB-INF/classes/alfresco/web-client-config-wcm.xml, where do I stick the customizations I make to the TinyMCE widgets?

I tried putting a "web-client-config-wcm.xml" in tomcat/shared/classes/alfresco (and the extension subdirectory, and the web-extensions subdirectoy).  I also tried calling the file "web-client-config-wcm-custom.xml . . . nothing seems to get "picked up"

Here's the contents of my XML file:

<alfresco-config>

   <config>

      <wcm>
         <xforms>
           <widget xforms-type="xf:textarea"
                   appearance="custom"
                   javascript-class-name="alfresco.xforms.RichTextEditor">
             <param name="theme_advanced_buttons1">bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,bullist,numlist,separator,undo,redo</param>
             <param name="height">100</param>
             <param name="cleanup_on_startup">true</param>
             <param name="convert_newlines_to_brs">true</param>
             <param name="force_p_newlines">false</param>
             <param name="apply_source_formatting">true</param>
           </widget>
           <widget xforms-type="xf:textarea"
                   appearance="custom-minimal"
                   javascript-class-name="alfresco.xforms.RichTextEditor">
             <param name="height">100</param>
             <param name="convert_newlines_to_brs">true</param>
             <param name="force_p_newlines">false</param>
             <param name="apply_source_formatting">true</param>
           </widget>

         </xforms>
      </wcm>

   </config>

</alfresco-config>

8 REPLIES 8

tvaughan77
Champ in-the-making
Champ in-the-making
This is pretty annoying that overriding defaults isn't more obvious.  I tried the following and it still doesn't seem to work.  I'm pretty sure this *should* so I'm gonna log a Jira ticket on this and hope it's just me being dumb…

1) Note that tomcat/webapps/alfresco/WEB-INF/classes/alfresco/web-client-application-context.xml contains this block of config code:

<bean id="webClientConfigSource" parent="repoUrlConfigSource">
      <constructor-arg>
         <list>
            <value>classpath:alfresco/web-client-config.xml</value>
            ….snip……..
            <value>classpath:alfresco/extension/web-client-config-custom.xml</value>

2) That means a classpath file under alfresco/extension/web-client-config-custom.xml should be picked up and integrated with the configuration for the web client

3) So I created a tomcat/shared/classes/alfresco/extension/web-client-config-custom.xml file with this block of configuration in it:

<alfresco-config>
    <wcm>
      <xforms>
        <widget xforms-type="xf:textarea"
                   appearance="custom"
                   javascript-class-name="alfresco.xforms.RichTextEditor">
          <param name="theme_advanced_buttons1">bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,bullist,numlist,separator,undo,redo</param>
          <param name="height">100</param>
          <param name="cleanup_on_startup">true</param>
          <param name="convert_newlines_to_brs">true</param>
          <param name="force_p_newlines">false</param>
          <param name="apply_source_formatting">true</param>  <!– indent html code –>
        </widget>
        <widget xforms-type="xf:textarea"
                  appearance="custom-minimal"
                  javascript-class-name="alfresco.xforms.RichTextEditor">
          <param name="height">100</param>
          <param name="convert_newlines_to_brs">true</param>
          <param name="force_p_newlines">false</param>
          <param name="apply_source_formatting">true</param>  <!– indent html code –>
        </widget>
      </xforms>
    </wcm>
  </config>
  <config>
    <actions>
      <action id="tip_mgmt">
        <label>Manage Tips</label>
        <href>http://localhost:8080/tipmgmt</href>
        <image>/images/icons/website.gif</image>
        <target>new</target>
      </action>
    </actions>

    <!– Actions Menu for More Actions in Web Project screen –>
    <action-group id="browse_website_menu">
      <action idref="details_space" />
      <action idref="create_webapp" />
      <action idref="edit_website" />
      <action idref="invite_website_users" />
      <action idref="delete_all_deploy_reports" />
      <action idref="delete_space" />
      <action idref="tip_mgmt" />
    </action-group>
</alfresco-config>


4) Restart the app -> no effect; everything in the "out of the box" configurations is loaded.

rsulliv1
Champ in-the-making
Champ in-the-making
Have you any update on this?

The JIRA ticket that's noted in the Potts book (https://issues.alfresco.com/jira/browse/ETWOTWO-119) appears to be pretty much abandoned. A major version has come out and this considerably serious (as noted by the ticket) bug doesn't appear to be going anywhere.

There's nothing but status requests for the last 18 months….

nvsreeram
Champ in-the-making
Champ in-the-making
Hi,

I am not sure if you guys got it working or not, but for those who still have the problem, there is a solution (may not be very standard, but works fine).

Copy the content of tomcat/webapps/alfresco/WEB-INF/classes/alfresco/web-client-config-wcm.xml
and paste it in
tomcat/shared/classes/alfresco/extension/web-client-config-custom.xml along with your TinyMCE configuration and other config data (if you have any).
Note:
<config> copied from web-client-config-wcm.xml should put as <config replace="true">

That's it, your TinyMCE customizations would get picked up.

The bug https://issues.alfresco.com/jira/browse/ETWOTWO-119 is still valid and Alfresco should fix it.
But for now, this work-around solution (of not tampering/editing the standard config file directly) works fine.

sgt_pepper
Champ in-the-making
Champ in-the-making
I did exactly as you indicated, but it does not work for me.
I restarted Tomcat after the modification.
I'm running Alfresco Community Edition 3.0-2 under Windows 2008 Server R2 64-bit.

Any hints?
Sgt.Pepper

marutiprasad
Champ in-the-making
Champ in-the-making
Hi all,

you need to mention the same in the xsd ur using for the content def .

ex:
<xs:element name="content_body" type="xs:string">
                    <xs:annotation>
                        <xs:appinfo>
                            <alf:appearance>custom</alf:appearance>
                        </xs:appinfo>
                    </xs:annotation>
                </xs:element>

nvsreeram
Champ in-the-making
Champ in-the-making
Yeah that's true, you need to mention the "custom appearance" (as described by marutiprasad) in the XSD for the customizations to get picked up.

sgt_pepper
Champ in-the-making
Champ in-the-making
What file would that be?
I'm trying to override the TinyMCE editor layout in the Alfresco Share blog.
I'm new to Alfresco and willing to learn, so please cut me a little slack here.
What kind of file am I looking for?

Thanks,
Sgt.Pepper

willson
Champ in-the-making
Champ in-the-making
For me it started with going to
http://example.com/alfresco/faces/jsp/admin/webclientconfig-console.jsp
and doing a reload command.  This told me all the spots where WCM was loading configs from and had a line saying that
workspace://SpacesStore/app:company_home/app:dictionary/app:webclient_extension/cm:web-client-config-custom.xml

was not found.

So I figured out, finally, that the data dictionary is also being read for a config file.  Wonderful news.
I'm running under GlassFish which is a difficult configuration and the Alfresco (Community) documentation is difficult to navigate/understand so this was a great discovery after many frustrating hours.  Yes, I had/have read the How to Configure document and that just gave me headaches.

I succeeded by putting the configuration file in the WCM repository.  Data Dictionary - Web Client Extension section.

I Created Content  named web-client-config-custom.xml as Plain Text. With content of

<xforms>
  <widget xforms-type="xf:textarea"
     appearance="my_custom"
     javascript-class-name="alfresco.xforms.RichTextEditor">
     <param name="theme_advanced_buttons1">
        bold,italic,underline,strikethrough,separator,fontselect,fontsizeselect
     </param>
     <param name="theme_advanced_buttons2">
        link,unlink,image,separator,justifyleft,justifycenter,justifyright,justifyfull,
   separator,bullist,numlist,separator,undo,redo,separator,forecolor,backcolor
     </param>
     <param name="height">600</param>
     <param name="plugins">fullscreen,table</param>
     <param name="theme_advanced_buttons3">tablecontrols,fullscreen</param>
</widget>
</xforms>

Then went and ran the webclientconfig-console's reload command again.  Worked a charm.