cancel
Showing results for 
Search instead for 
Did you mean: 

Guidance on share-custom-config.xml

rw251
Champ in-the-making
Champ in-the-making
I have added the following to my share-custom-config.xml file in order to enable non-minified js for debugging purposes:


<config replace="true">
  <flags>
    <client-debug>true</client-debug>
  </flags>
</config>


This works - however I have discovered that the share admin console (/share/page/console/admin-console/) is now blank.  This happens even if my share-custom-config.xml only contains the opening and closing <blockcode><alfresco-config></blockcode> tags - and no other config settings.

If however I rename the share-custom-config.xml to something else e.g. my-config.xml, and then wire it up with the following in the custom-slingshot-config-custom.xml file then my js is non-minified, but the admin console is now visible again:


<bean id="custommodel.config" class="org.springframework.extensions.config.ConfigBootstrap" init-method="register">
  <property name="configService" ref="web.config"/>
  <property name="configs">
    <list>
      <value>classpath:alfresco/web-extension/my-config.xml</value>
    </list>
  </property>
</bean>


I suspect this is my lack of understanding as to how the share-custom-config.xml file works and would appreciate some guidance.
2 REPLIES 2

jpotts
World-Class Innovator
World-Class Innovator
Try removing the "replace" attribute from your "config" element. With replace set to true, you are telling Share that your element provides everything it needs. If you look at the out-of-the-box config element, you'll see you aren't doing that which is why the admin console (and likely other pages) are broken. With replace set to false you are telling Share that you are only overriding what you are providing.

Jeff

rw251
Champ in-the-making
Champ in-the-making
Hi Jeff,
Thanks for the response.  I had previously tried this but the problem is that without the replace="true" the client-debug setting is not applied and the js files all appear non-minified.  If I copy the entire section from the share-config.xml into my custom one, and keep the replace="true" then it all works, but it doesn't seem ideal as if the share-config.xml changes in future I need to keep my file in synch when all I want to do is change one parameter.
I'm curious to know why my solution (the second bit of code in my first post) works as I'm uncomfortable using it without knowing exactly why it works.
Thanks,
Richard.