On Thu, Jun 13, 2013 at 11:01:50AM +0530, Rajath Shashidhara wrote:
> Hello Ariel,
> 
> I changed:
> registration.classname=org.apache.aoo.ucp.cmisucp.ucp.CMISContentProvider
> central.registration.class=org.apache.aoo.ucp.cmisucp.ucp.CentralRegistrationClass
> 
> 
> I created the .oxt. Reinstalled. Still have the same problem.!

Are you getting the error when installing, or you can install it but it
does not work?

If the later, you also need to change the implementation name in the
configuration file to reflect the changes in the package name, as long
as

private static final String m_implementationName = 
CMISContentProvider.class.getName();

the implementation name of your component is bound to the package name
of the class implementing it.


> Also, I did not understand what you mean by component factory
> implementation. I have not implemented any component factory! Please
> clarify.

In CMISContentProvider you have


public static XSingleComponentFactory __getComponentFactory( String 
sImplementationName ) {
    XSingleComponentFactory xFactory = null;

    if ( sImplementationName.equals( m_implementationName ) )
        xFactory = Factory.createComponentFactory(CMISContentProvider.class, 
m_serviceNames);
    return xFactory;
}

com.sun.star.lib.uno.helper.Factory is
main/javaunohelper/com/sun/star/lib/uno/helper/Factory.java

It is a factory helper to create instances of your component (set
a break point there and in
CentralRegistrationClass.__getComponentFactory() to see how things work
when your component is instantiated).

The problem is that this factory helper creates a new instance of your
component every time; it should create only one instance and return it
on later calls, mainly because you need to cache UCB contents. Try with
the following Basic code:


Sub Main
    Dim o1, o2, o3, o4
    o1 = CreateUnoService("org.apache.aoo.ucp.cmisucp.ucp.CMISContentProvider")
    o2 = CreateUnoService("org.apache.aoo.ucp.cmisucp.ucp.CMISContentProvider")
    MsgBox EqualUnoObjects( o1, o2 )
                    
    o3 = CreateUnoService("com.sun.star.comp.FTPContentProvider")
    o4 = CreateUnoService("com.sun.star.comp.FTPContentProvider")
    MsgBox EqualUnoObjects( o3, o4 )
End Sub

CreateUnoService will create an instance of the given component, given
its implementation/service name.

With your current implementation, you get a new instance every time.
Compare with the FTP content provider implementation: both objects
are the same instance.

Note that you could implement UCB contents caching by other means, but
a "createOneInstanceComponentFactory()" or the like is a nice to have.


Another nice-to-have: you are using
CMISContentProvider.__writeRegistryServiceInfo( XRegistryKey
xRegistryKey), this is obsolete, you can use the "Passive Component
Registration"
http://wiki.openoffice.org/wiki/Passive_Component_Registration


Leave nice-to-have things for the final touches, right now you have
other priorities, like implementing the CMIS UCB content.


Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina

Attachment: pgpYZdb7AbH3A.pgp
Description: PGP signature

Reply via email to