Quantcast
Channel: Alfresco Forums - Other APIs
Viewing all articles
Browse latest Browse all 74

Default missing parameters in context

$
0
0

I have a timed job that sets its quarrtz cron string using a parameter like this

<property name="cronExpression"><value>${myservice.cron}</value></property>

I would like to be able to default the service cron should someone not set the parameter myservice.cron in alfresco-global.properties and I cannot find out how to do this.

At first I thought this was Freemarker but

${(myservice.cron)!'0 0/1 * * * ?'}

did not work.

Then I found an article saying Freemaker directives must be escaped so I tried

\$\{(myservice.cron)!'0 0/1 * * * ?'\}

but that didn't work either.

More ferreting around on the internet suggests that Alfresco "works out" how to process a parameter based on regex & an array of processors but I cannot fathom out how that works.

Grepping the entire context xml files in Alfresco did not yield any suggestions as to how this can be done

Any kind soul want to explain to me how I set a parameter string that says Use this value if the property exists and if not us "0 0/1 * * * ?"?

Many thanks

Good luck

Bob Johnson

P.S. If this was useful, please mark it as such - it might help someone else to.


Viewing all articles
Browse latest Browse all 74

Trending Articles