cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Customization: Publish multiple files at once?

SOLVED
Highlighted
Newbie

Customization: Publish multiple files at once?

I would like to write custom Java code which executes menu the functionality File > Publish > HTML File... on multiple files at once.

To do so I need to find the Arbortext code which is called when File > Publish > HTML File... is triggered by a user. In other words, I need to know the function name, argument names, and valid argument values so that I can write custom code which will call this function on multiple files.

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Customization: Publish multiple files at once?

To find out what gets called by menu items in an edit window, you'll need to look in <editor_install_path>/lib/editmenu.cf. You'll find a set of lines that looks like this:

Menu "File.Publish" \

active "main::activeFileComposeMenu() == 1"

{

Somewhere between that opening brace and the corresponding closing brace should be what you're looking for. Sure enough, a few lines down is this:

"HTML &File..." \

cmd "ComposeHTMLFile" active "main::activeComposeHtmlFile() == 1"

So this tells you the command or alias associated with your menu item is ComposeHTMLFile. You can also use a good text editor to search through the <editor_install_path>/packages directory tree looking for a particular string in ACL files. Doing that for the string "alias ComposeHTMLFile" shows that the commands.acl file defines the alias as pointing to the function compose_htmlfile(). Sometimes searching through the same directory for that function name will show how it's defined in ACL. In this case, compose_htmlfile() isn't defined where we have access to it, but if you look it up in Help Center you'll find the description for it.

3 REPLIES 3

Re: Customization: Publish multiple files at once?

To find out what gets called by menu items in an edit window, you'll need to look in <editor_install_path>/lib/editmenu.cf. You'll find a set of lines that looks like this:

Menu "File.Publish" \

active "main::activeFileComposeMenu() == 1"

{

Somewhere between that opening brace and the corresponding closing brace should be what you're looking for. Sure enough, a few lines down is this:

"HTML &File..." \

cmd "ComposeHTMLFile" active "main::activeComposeHtmlFile() == 1"

So this tells you the command or alias associated with your menu item is ComposeHTMLFile. You can also use a good text editor to search through the <editor_install_path>/packages directory tree looking for a particular string in ACL files. Doing that for the string "alias ComposeHTMLFile" shows that the commands.acl file defines the alias as pointing to the function compose_htmlfile(). Sometimes searching through the same directory for that function name will show how it's defined in ACL. In this case, compose_htmlfile() isn't defined where we have access to it, but if you look it up in Help Center you'll find the description for it.

Re: Customization: Publish multiple files at once?

That is a very clear and thorough answer - thank you very much!

Re: Customization: Publish multiple files at once?

The arguments obtained from the dialog aren't passed into the function. The description in Help Center states that it's an interactive function, which means the dialog gets displayed as part of what happens inside the function. In other words, we don't have access to it. What you want might be the compose_for_htmlfile() function, which you'll see further down that same page in Help Center. Looks like you'll need to also look at the help for get_composer() to see what parameters you'll need to set for the array argument of compose_for_htmlfile().