Question re the uno-skeletonmaker'-t' CLI qualifier
dlochrin at aussiebb.com.au
Wed Jan 25 04:14:58 UTC 2023
I think we're getting somewhere...!
On 24/1/23 18:03, Stephan Bergmann wrote:
> I don't know much about skeletonmaker or Calc add-ins, but
> <https://wiki.documentfoundation.org/Documentation/DevGuide/Spreadsheet_Documents#Spreadsheet_Add-Ins> <<https://wiki.documentfoundation.org/Documentation/DevGuide/Spreadsheet_Documents#Spreadsheet_Add-Ins>> says "The functions that the add-in component exports to the spreadsheet application have to be defined in a new interface." So I would assume that -t must specify that interface type. And one or more -l will be needed to make available that interface type and all the other UNOIDL entities recursively referenced from it. So if you have your own type com.example.XMyAddIn in your own local mytypes.rdb, you'd probably need something like
>> -t com.example.XMyAddIn -l "$OFFICE_HOME"/program/types.rdb -l "$OFFICE_HOME"/program/types/offapi.rdb -l mytypes.rdb
Using the three '-l' options shown above and in the following test command with *no**'-t' option* results in a skeletonmaker error, presumably because '-t' and '-n' are mandatory in the 'calc-add-in' command (BUG: the '-t' is displayed in upper case, which can be misleading given case-sensitivity):
david at anon:~> "$OFFICE_HOME"/sdk/bin/uno-skeletonmaker calc-add-in --java5 -l "$OFFICE_PROGRAM_PATH"/types.rdb -l "$OFFICE_HOME"/program/types/offapi.rdb -l /home/david/<...path...>/XCalcDL1.rdb -n org.openoffice.adl.util.CalcDL1
Error: no type is specified, use the -T option at least once
Changing the last '-l' to '-t' results in:
ERROR: Unknown entity '/home/david/<...path...>/XCalcDL1.rdb'
However treating the '-t' option as a service rather than an interface, as follows, works. An <org/openoffice/adl/util> directory tree is created in the directory where the skeletonmaker CLI command was run, and a very plausible skeleton CalcDL1.java file was created in <util> though I haven't been through it in detail.
david at anon:~> "$OFFICE_HOME"/sdk/bin/uno-skeletonmaker calc-add-in --java5 -l "$OFFICE_PROGRAM_PATH"/types.rdb -l "$OFFICE_HOME"/program/types/offapi.rdb -l /home/david/<...path...>/XCalcDL1.rdb -n org.openoffice.adl.util.CalcDL1 -t org.openoffice.adl.util.CalcDL1
david at anon:~>
Your comment "[...] So I would assume that -t must specify that interface type." is what I'd expect too. That's reinforced by the HELP text which states: "-t <name> specifies a UNOIDL type name, e.g. com.sun.star.text.XText (can be used more than once". Not much doubt there...
There's evidently a discrepancy between the LibreOffice Developer's Guide, the skeletonmaker HELP text, introductory comments in the skeletonmaker source code, all other API guides which repeat the HELP text, and what actually works.
Most of the initial command & option validation seems to be done by 'skeletonmaker.cxx' which calls generatePackage() in 'javacompskeleton.cxx' to do the work. But as I mentioned in an earlier email, I've come across a suggestion somewhere that '-t' defines a service, not an interface; maybe a change was made which hasn't been reflected in the Developer's Guide?
I don't have the time and expertise in C to untangle the source code and in any case the sources I've looked at are completely devoid of comments (without which ongoing maintenance is far more difficult and unreliable!) apart from the introduction to skeletonmaker.cxx. Should I post another bug report in Bugzilla? - the first was marked NOTABUG.
Thanks for your help, Stephan.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the LibreOffice