Hello Ariel,

for making the ucp return the same single component factory object, shall I
create a static single component factory object and return it if it is not
null and create a new one if it is null? By this way we can return the same
single component factory object.


Although, one thing I have not understood is what is the consequences of
returning different single component factory objects?


Thanks for ur support.


On Thu, Jun 13, 2013 at 2:03 PM, Rajath Shashidhara <
[email protected]> wrote:

> Hello Ariel,
>
>
>
> On Thu, Jun 13, 2013 at 1:22 PM, Ariel Constenla-Haile <[email protected]
> > wrote:
>
>> 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.
>>
>>
>>
>
> I clean built the project. Now the problem is solved. The problem was that
> the project-uno.properties was not being compiled after changes. After a
> clean, the changes were compiled.
>
>
>> > 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.
>>
>>
> I ran the basic code that you have given. I understand what you were
> trying to explain.
> But is it very important now? How do I approach to solve this problem? Is
> this a nice to have problem or a high riorty problem?
>
>
>> 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.
>>
>>
>> Now I have completed the basic service ResultSet implementation. I tried
> to test it and I have a problem. I have pushed the error test code(client
> application) - to this repo:
> https://github.com/rajaths589/CMISContentProviderTest.git
>
> I have see the implementation of result set of other ucps. they use helper
> classes which I'm not using. I need help. I need to know where I'm going
> wrong. Thanks.!
>
>
>
>>  Regards
>> --
>> Ariel Constenla-Haile
>> La Plata, Argentina
>>
>
>
>
> --
> Rajath S,
> M.Sc(Hons.) Physics,
> Birla Institute of Technology and Science - Pilani,
> Pilani
>



-- 
Rajath S,
M.Sc(Hons.) Physics,
Birla Institute of Technology and Science - Pilani,
Pilani

Reply via email to