AnsweredAssumed Answered

Scoped configuration error

Question asked by ungawunga on May 2, 2013
Latest reply on May 3, 2013 by ungawunga
I'm finding that I can get my scoped configuration properties once per webscript call. If there's a second attempt at using the "config" root scoped javascript object, an exception is thrown stating the reference is undefined.

Snippet of the configuration file that sits in \META-INF\spring-webscripts-config-custom.xml


<alfresco-config>
   <config evaluator="string-compare" condition="AppSettings">
      <appSettings>
         <setting id="skipRecord">352</setting>
      </appSettings>
   </config>
   <config evaluator="string-compare" condition="MetadataErrors">
      <metadataErrors>
         <error id="0" level="0">OK</error>
         <error id="1" level="0">INTERNAL DEFAULT ERROR CODE</error>



I get the error values once:

var my = config.scoped[ "MetadataErrors" ][ "metadataErrors" ].getChildren( "error" );


That works. I try again, in the same method…


var settings = config.scoped[ "AppSettings" ][ "appSettings" ].getChildren( "setting" );


and I get the following exception. Makes no sense to me. Anyone else run into this bug?

ReferenceError: "config" is not defined.


Are we not allowed to have more than one scoped config section in our config file?

Outcomes