Nikolai Pretzell wrote:
Hi Ary,
Hi, im trying to registry two interfaces inside the same .idl file...
I can't give you a workaround (others probably can), but AFAIK, the creators of UNO IDL did explicitely intend, there should only be one IDL type in one IDL file. This is a feature, not a bug. ;-)
That is not quite true. Technically, you can have as many declarations as you like in one UNOIDL file (see Appendix B of the Developer's Guide). But if we ever move from the model of textual include of UNOIDL files within other UNOIDL files and of translating from UNOIDL to a binary rdb to some other model that serves our needs better, there might come a time where each UNOIDL declaration must live in a file of its own. One more reason to stick to the prinicple of one declaration per UNOIDL file.
By the way, the number of declarations per UNOIDL file was a red herring in the original post. What was lacking there, I think, was to have one Java class in the Java UNO component that registers multiple services (if multiple services were indeed intended, I am not very fluent with Calc add-ins).
exactly that is the point. You should create a small registration helper class which does all the registration and instantiation stuff.
In the manifest you would only reference this helper
for example: RegistrationClassName: root.mymodule.CompRegistrationHelper
package root.mymodule; ... public class CompRegistrationHelper {
public static XSingleComponentFactory __getComponentFactory( String sImplementationName ) {
XSingleComponentFactory xFactory = null;
if ( sImplementationName.equals(
NewInterfaceImpl.class.getName() ) )
xFactory = Factory.createComponentFactory(
NewInterfaceImpl.class,
NewInterfaceImpl.getServiceNames( ));
else if ( sImplementationName.equals(
MyInterfaceImpl.class.getName() ) )
xFactory = Factory.createComponentFactory(
MyInterfaceImpl.class,
MyInterfaceImpl.getServiceNames( ));
return xFactory;
}
public static boolean __writeRegistryServiceInfo( XRegistryKey xRegistryKey ) { boolean bReg1 = Factory.writeRegistryServiceInfo( NewInterfaceImpl.class.getName(), NewInterfaceImpl.getServiceNames(), xRegistryKey ); boolean bReg2 = Factory.writeRegistryServiceInfo( MyInterfaceImpl.class.getName(), MyInterfaceImpl.getServiceNames(), xRegistryKey ); return bReg1 && bReg2; } }
-Stephan
Nikolai
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]