jamiejackson
02/13/2025, 4:50 PMjamiejackson
02/13/2025, 4:51 PMjamiejackson
02/13/2025, 5:23 PMjamiejackson
02/13/2025, 5:30 PM/cfconfig-services
Is that the expected name of the git working copy directory? It naturally is cfconfig.bdw429s
02/13/2025, 5:57 PMbdw429s
02/13/2025, 5:57 PMbdw429s
02/13/2025, 5:57 PMbdw429s
02/13/2025, 5:59 PMcommandbox-cfconfig and config-services repos
• run box install from the root of the services one (but NOT the commandbox one)
• package link them both (just run that command from the root)
• You can now test import/export commands from the CLI using your checked out repos. Use reload (r) to pick up changes to the files between testsbdw429s
02/13/2025, 5:59 PMjamiejackson
02/13/2025, 6:05 PMbdw429s
02/13/2025, 6:08 PMbdw429s
02/13/2025, 6:09 PMbdw429s
02/13/2025, 6:09 PMbdw429s
02/13/2025, 6:09 PMjamiejackson
02/13/2025, 6:12 PMbdw429s
02/13/2025, 6:18 PMjamiejackson
02/14/2025, 3:14 PMjamiejackson
02/28/2025, 6:26 PMschmaused = "flarp"
without a spec, i'm stuck. i don't think the spec can be adequately gleaned from function signatures (optional argument lists) because that seems to be a bit of a kitchen sink, at the moment.
a developer approaching a fresh project should, IMO, be able to write, say, an engine-agnostic scheduled task definition from scratch in config.json from docs (as opposed to reverse-engineering from an engine admin output and then relying on whatever engine quirks that the cfconfig export yields).
defining (or partially reverse-engineering) a spec is a tough thing to do as a contributor. it's a common issue i've had with open source project which have hindered contributions before. (i've had to bail out on contributions to other open source projects for the same reason.) ortus has great documentation, in general, but this particular gap is getting me.bdw429s
02/28/2025, 8:44 PMcfconfig show and you'll instantly see what it looks like. I'd happily accept pulls that try to flesh out more examples-- especially for things like mail servers, datasources, or schedule tasks, but trying to cover every possible variation could require hundreds of pages of examples, which to be honest, no one is going to read. What I did spend more time documenting was the CLI for adding specific complex types such as datasources or scheduled tasks. Each of those docs contain copy/paste examples which should create the necessary JSON for you.
Ex: https://cfconfig.ortusbooks.com/using-the-cli/command-overview/manage-scheduled-tasks
cfconfig task save myTask <http://www.google.com> Once 4/13/2018 "5:00 PM"
cfconfig task save task=myTask url=<http://www.google.com> interval=Once startDate=4/13/2018 startTime="5:00 PM" to=serverName
cfconfig task save task=myTask url=<http://www.google.com> interval=Once startDate=4/13/2018 startTime="5:00 PM" to=/path/to/server/home
Just point one of those commands to your JSON file and it will write the config there. The CLI help for these commands also lists out all the parameters
cfconfig task save ?
It had seemed easier to document the API of the CLI commands than the underlying JSON format, which is generally created for you.bdw429s
02/28/2025, 8:45 PMaddXXX() method documents what the nested structs may look likebdw429s
02/28/2025, 8:46 PMaddScheduledTask() we have a method signature of
/**
* Add a single Scheduled Task to the config
* @task The name of the task
* @url The full URL to hit
* @group The group for the task (Adobe only)
* @chained Is this task chained? (Adobe only)
* @clustered Is this task clustered? (Adobe only)
* @crontime Schedule in Cron format (Adobe only)
* @endDate Date when task will end as 1/1/2000
* @endTime Time when task will end as 9:57:00 AM
* @eventhandler Specify a dot-delimited CFC path under webroot, for example a.b.server (without the CFC extension). The CFC should implement CFIDE.scheduler.ITaskEventHandler. (Adobe only)
* @exclude Comma-separated list of dates or date range for exclusion in the schedule period. (Adobe only)
* @file Save output of task to this file
* @httpPort The port for the main task URL
* @httpProxyPort The port for the proxy server
* @interval The type of schedule. Once, Weekly, Daily, Monthly, an integer containing the number of seconds between runs
* @misfire What to do in case of a misfire. Ignore, FireNow, invokeHander (Adobe only)
* @oncomplete Comma-separated list of chained tasks to be run after the completion of the current task (task1:group1,task2:group2...) (Adobe only)
* @onexception Specify what to do if a task results in error. Ignore, Pause, ReFire, InvokeHandler (Adobe only)
* @overwrite Overwrite the log file? (Adobe only)
* @password Basic auth password to use when hitting URL
* @priority An integer that indicates the priority of the task. (Adobe only)
* @proxyPassword Proxy server password
* @proxyServer Name of the proxy server to use
* @proxyUser Proxy server username
* @saveOutputToFile Save output to a file?
* @repeat -1 to repeat forever, otherwise integer.
* @requestTimeOut Number of seconds to timeout the request. Empty string for none.
* @resolveurl When saving output of task to file, Resolve internal URLs so that links remain intact.
* @retrycount The number of reattempts if the task results in an error. (Adobe only)
* @startDate The date to start executing the task
* @startTime The date to end excuting the task
* @status The current status of the task. Running, Paused
* @username Basic auth username to use when hitting URL
* @autoDelete (Lucee only)
* @hidden Do not show in admin UI (Lucee only)
* @unique If set run the task only once at time. Every time a task is started, it will check if still a task from previous round is running, if so no new test is started. (Lucee only)
*/
function addScheduledTask(
required string task,
string url,
string group,
boolean chained,
boolean clustered,
string crontime,
string endDate,
string endTime,
string eventhandler,
string exclude,
string file,
string httpPort,
string httpProxyPort,
string interval,
string misfire,
string oncomplete,
string onexception,
string overwrite,
string password,
string priority,
string proxyPassword,
string proxyServer,
string proxyUser,
boolean saveOutputToFile,
string repeat,
string requestTimeOut,
boolean resolveurl,
string retryCount,
string startDate,
string startTime,
string status,
string username,
string autoDelete,
string hidden,
string unique
) {
so any of those params can be a key in a sched task struct, of the type specified, and matching the description specifiedbdw429s
02/28/2025, 8:47 PMbdw429s
02/28/2025, 8:49 PMjamiejackson
02/28/2025, 8:53 PMcfconfig import to a plain directory versus what happens when i am in the "box" cli context and do a cfconfig import there? i had it generating json that looked good in the first case but after doing the import into the running server, then doing a cfconfig show , it was missing scheduled task subkeys that i had been writing.bdw429s
02/28/2025, 8:55 PMto param is omitted, the CLI will look for a CommandBox sever defined in the current folder, and point itself as the server home of that server (and detect the engine name and version)
If the to param points directly to a folder on disk, then the XML/JSON/properties files will be written out for the CF engine/version (whether explicitly provided in the toFormat or detect based on the contents of the file system)bdw429s
02/28/2025, 8:55 PMfrom and fromFormat follow the same rules, just applied to reading instead of writingbdw429s
02/28/2025, 8:56 PMto or from is a file path pointing to a JSON file, then the config is read or written as CFConfig's JSON format (no CF engine)bdw429s
02/28/2025, 8:57 PMi had it generating json that looked good in the first case but after doing the import into the running server, then doing aPresumably, that key was not being written to Lucee's cfconfig.json in the server home, and wasn't there to read back out, you'd have to import and then look to see what got written., it was missing scheduled task subkeys that i had been writing.cfconfig show
jamiejackson
02/28/2025, 9:07 PMjamiejackson
02/28/2025, 9:09 PM