cancel
Showing results for 
Search instead for 
Did you mean: 

Scoped configuration error

ungawunga
Champ in-the-making
Champ in-the-making
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?
2 REPLIES 2

afaust
Legendary Innovator
Legendary Innovator
Hello,

there is AFAIK no limitation on the number of config sections you can have in your config file, either global or scoped.
This is an interesting error. Which Alfresco version are you running? Are you by any chance assigning any value to the config variable (by mistake)? Is there some code in your script that does a <blockcode>delete config</blockcode>?

Regards
Axel

ungawunga
Champ in-the-making
Champ in-the-making
I don't modify or delete the configuration. Using Enterprise 4.1.3. Thanks