Hi Carsten,

> I don't exactly know what you want to do. Do you want to pass arguments
> to a command that you want to dispatch?

I wrote a little UNO component that should be able to print the
document. I registered this component. Then I added a transient menu
item to the menu. If I click on this item, my component is called. I
would like to give my component the name of the printer, it should print on.

> Sequence< beans::PropertyValue > aArguments(1);
> com::sun::star::util::URL aURL;
> aURL.Complete = ".uno:Open"
> 
> xURLTransformer->parseStrict( aURL );
> 
> aArgs[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FileName" );
> aArgs[0].Value = uno::makeAny( rtl::OUString(
> RTL_CONSTASCII_USTRINGPARAM( "file:///home/test/test.odt" )) );
> 
> xDispatch->dispatch( aURL, aArgs )
> 
> There is also a way to pass simple types via the URL. Keep in mind that
> you have to escape certain characters (e.g. ?,&,' ',...) if you use them
> in your arguments.
> 
> command?arg1:type1=value2&arg2:type2=value2
> 
> ".uno:Open?FileName:string=file:///home/test/test.odt"

All of this seems to be very interesting and might solve my problem. But
I don't understand all :-). By the way, I use Java.

As far as I understand, there is one possiblity I can use when I create
the menu item. I just add a PropertyValue like this:
-----%<-----
menuItemProperties[3] = new PropertyValue();
menuItemProperties[3].Name = "Printer";
menuItemProperties[3].Value = new String("LaserJet1100");
-----%<-----
If this is correct, how can I access the properties in my Component.

Second solution: I can extend the CommandURL:
-----%<-----
menuItemProperties[0] = new PropertyValue();
menuItemProperties[0].Name = "CommandURL";
menuItemProperties[0].Value = ".Judas:PrintTrays?Printer:string=LJ1100";
-----%<-----
Is this correct? But how can I access the values?

Do I have to change my ProtocolHandler.xcu?

Thank you.

Greetings, Tobias

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to