First Add in On Linux

Java, C++, C#, Delphi... - Using the UNO bridges
Post Reply
saleem145
Posts: 130
Joined: Mon Jul 02, 2012 4:47 pm

First Add in On Linux

Post by saleem145 »

Hello,

I had developed an add-in on Mac. Now I am trying to port to Linux. Have everything compiling but functions don't work.

First question in the OXT the name of the folder should be Linux_86 or Linux_86_64?? In the manifest.xml file what should platform be set to

Code: Select all

         <manifest:file-entry manifest:media-type="application/vnd.sun.star.uno-components;platform=Linux_x86"
                manifest:full-path="CppComponent.components"/>
My XCU file is below

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<oor:component-data xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" oor:name="CalcAddIns" oor:package="org
.openoffice.Office">
<node oor:name="AddInInfo">
<node oor:name="my_module.my_sc_implementation.MyService1" oor:op="replace">
<node oor:name="AddInFunctions">

  <node oor:name="methodOne" oor:op="replace">
    <prop oor:name="DisplayName"><value xml:lang="en">methodOne</value></prop>
    <prop oor:name="Description"><value xml:lang="en">method One</value></prop>
    <prop oor:name="Category"><value>Add-In</value></prop>
    <node oor:name="Parameters">
      <node oor:name="val" oor:op="replace">
        <prop oor:name="DisplayName"><value xml:lang="en">val</value></prop>
        <prop oor:name="Description"><value xml:lang="en">String</value></prop>
      </node>
    </node>
  </node>

  <node oor:name="methodTwo" oor:op="replace">
    <prop oor:name="DisplayName"><value xml:lang="en">MethodTwo</value></prop>
    <prop oor:name="Description"><value xml:lang="en">Method Two</value></prop>
    <prop oor:name="Category"><value>Add-In</value></prop>
    <node oor:name="Parameters">
    </node>
  </node>

  <node oor:name="methodThree" oor:op="replace">
    <prop oor:name="DisplayName"><value xml:lang="en">MethodThree</value></prop>
    <prop oor:name="Description"><value xml:lang="en">Method Three</value></prop>
    <prop oor:name="Category"><value>Add-In</value></prop>
    <node oor:name="Parameters">
    </node>
  </node>

</node>
</node>
</node>
</oor:component-data>
If I go the function builder it sees the three methods. But it thinks methodOne does not take in an input argument???

My implementation of these is below

Code: Select all

OUString SAL_CALL MyService1Impl::methodOne( OUString const & str ) throw (RuntimeException)
{
  return str;
}

double SAL_CALL MyService1Impl::methodTwo() throw (RuntimeException) { return 2; } 
double SAL_CALL MyService1Impl::methodThree() throw (RuntimeException) { return 3; }
Calls to MethodTwo and MethodThree return NULL and MethodOne returns Err504.

My idl is below --

Code: Select all

module my_module
{
    interface XSomething
    {
      string methodOne( [in] string val );
      double methodTwo();
      double methodThree();
    };

    service MyService1 : XSomething;
};
Any help would be appreciated. Thanks.

Saleem
OpenOffice 3.4.0
Mac OS X 10.5.8
saleem145
Posts: 130
Joined: Mon Jul 02, 2012 4:47 pm

Re: First Add in On Linux

Post by saleem145 »

Not sure if this is a related issue. My TestComponent.cpp has the following code ....

Code: Select all

        Reference< XComponentContext > xContext( ::cppu::bootstrap() ); 
        fprintf(stdout, "\nconnected to a running office...\n");

        // create a new instance of MyService1
        Reference<my_module::XSomething> xSomething =
            my_module::MyService1::create(xContext);

        double res = xSomething->methodThree();
        fprintf(stdout,"\nCreate new instance of MyService1\nCall of XSomething.methThree at MyService1 = %f", res);
When I run it I get the following message

bash-3.2$ ./TestCppComponent

connected to a running office...

caught UNO exception: component context fails to supply service my_module.MyService1 of type my_module.XSomething
OpenOffice 3.4.0
Mac OS X 10.5.8
Post Reply