LibreOffice / loeclipse

LibreOffice Eclipse plugin for extension development
https://libreoffice.github.io/loeclipse/
31 stars 25 forks source link

SDK no longer recognized since LibreOffice 7.5 #98

Open Hercle999 opened 1 year ago

Hercle999 commented 1 year ago

Hello.

My plugin running from Eclipse with LOEclipse properly. But it don't work when installed to LibreOffice,

Sorry but I just can say just above now. Please tell me how to investigate about this. Is any log output by LibreOffice?

==================================== I could install the plugin "oxt" file to LiblreOffice. (not from eclipse) It was indicated on menu on only Culc, (couldn't on Document, Writer) and worked only some function. (due to "Addons.xcu"?)

==================================== I installed ***.oxt in "dist" folder.

When I use "export > LibreOffice package", it occur below error. error: The RegistrationHandler.class is empty. exported .oxt extension will not properly.

==================================== excuse my poor English

Hercle999 commented 1 year ago

I could display the addon menu on also Writer and Impress.

Menu > View > User Interface > UI variants > Standard Toolbar.

But it still haven't worked.

smehrbrodt commented 1 year ago

So what's the content of RegistrationHandler.classes ?

Hercle999 commented 1 year ago

Thank you for your reply.

I got this code from SDK or sample package, and it was hardly changed.

RegistrationHandler.txt

smehrbrodt commented 1 year ago

There must be another file RegistrationHandler.classes in your project, what's the content of that file?

Hercle999 commented 1 year ago

Written:

example.example.ExtensionMainImpl

Hercle999 commented 1 year ago

Suddenly, even running LibreOffice from eclipse was unenabled.

eclipse_libre

Hercle999 commented 1 year ago

無題

Hercle999 commented 1 year ago

It was back to the state wrote at first comment after being resolved #99.

My plugin can work from eclipse, but don't work when install the plugin.

Hercle999 commented 1 year ago

A error is occur when I try to export a oxt file.

I updated LibreOffice and SDK today to version 7.5.1.

export error

RayCulp commented 1 year ago

I received an answer to my question on ask.libreoffice.org https://ask.libreoffice.org/t/sdk-is-missing-idl-folder/89549 and also to the bug I raised here https://bugs.documentfoundation.org/show_bug.cgi?id=154341

The bottom line appears to be that the SDK no longer includes an /idl folder. This breaks LOEclipse. See also #99

RayCulp commented 1 year ago

There appear to have been no updates to the code of LOEclipse in the last three years. Does this plugin have a future, or should we just move on to some other solution?

michaelmassee commented 1 year ago

Better, fix the code yourself, LOEclipse is no Rocket Science :-)

smehrbrodt commented 1 year ago

Thanks for investigating this! Pull requests more than welcome indeed.

Otherwise I will fix this in the next weeks and do a new release. Please use an older SDK until then.

RayCulp commented 1 year ago

I would absolutely love to get involved, but I don't have the skills yet. I have to learn pull requests, how to debug Eclipse and Eclipse plugins, and probably at least a little Java first.

smehrbrodt commented 1 year ago

Many thanks @michaelmassee for the fix! I published a new release with the fix, it should show up in Eclipse when checking for updates. Let me know if it works.

Hercle999 commented 1 year ago

I tried the latest LOEclipse, but the situation is the same.

My extension work normally when move from eclipse. But don't work when install to Libreoffice.

The same error is occured then eclipse menu > file > export. loeclipse

Why this thread was closed even if I couldn't resolve this issue?

michaelmassee commented 1 year ago

"Why this thread was closed even if I couldn't resolve this issue?" Very Simple ... Because you have an empty RegistrationHandle.classes file. This has nothing to do with adding a 7.5+ SDK ! See Topic Description Post your Contents of RegistrationHandle.classes file

Hercle999 commented 1 year ago

I've sent the content of RegistrationHandle.classes.

It is the content, one line text. example.example.ExtensionMainImpl

RegistrationHandler classes

michaelmassee commented 1 year ago

path/location of your RegistrationHandler.classes and RegistrationHandler.java files ?

Hercle999 commented 1 year ago

The path is below.

path

/project_name/source/example/example/RegistrationHandler.classes

michaelmassee commented 1 year ago

file location seems okay for me ....
The only location i found for this error msg is :

` public static void isFileEmpty(IUnoidlProject pProject) {

    if (checkFileEmpty) {
        PluginLogger.error(Messages.getString("RegistrationHelper.RegistrationHandlerEmptyClassError"));
        MessageDialog.openError(Display.getDefault().getActiveShell(), "Error",
            Messages.getString("RegistrationHelper.RegistrationHandlerEmptyClassError"));
    }

`

this checks IUnoidlProject, not RegistrationHandler.classes ??? i must do some debuging to understand what is going on here ...

Hercle999 commented 1 year ago

Thank you for dealing my issue.

As I said, my extension work from eclipse on Libreoffice, but couldn't export. I wonder this.

michaelmassee commented 1 year ago

` /**

michaelmassee commented 1 year ago

` @Override public IPath getImplementationPath() { String path = new String(mCompanyPrefix + "." + mOutputExtension).replace('.', '/'); //$NON-NLS-1$ return getSourcePath().append(path); }

`

Hercle999 commented 1 year ago

Sorry, but I don't know where is "implementation directory" and I don't know how to use the source you shown.

michaelmassee commented 1 year ago

your RegistrationHandler.classes is probably at the wrong place

check your .unoproject file

String path = new String(mCompanyPrefix + "." + mOutputExtension).replace('.', '/');

mOutputExtension = project.implementation = comp mCompanyPrefix = project.prefix = de.xxx.yyy

so the file RegistrationHandler.classes must be in de/xxx/yyy/comp

the empty error msg is also shown when the file ist not found

Hercle999 commented 1 year ago

Where is the path?

de/xxx/yyy/comp

======================================= The content of .unoproject is below.

UNO project configuration file

Thu Mar 23 12:55:01 JST 2023

project.prefix=org.libreoffice.example project.language=Java project.ooo=LibreOffice 7.5 #1 project.idl=/idl regclassname=example.example.RegistrationHandler project.implementation=comp project.build=build project.sdk=LibreOffice sdk 7.5.0.3 project.srcdir=/source javaversion=java5

michaelmassee commented 1 year ago

de/xxx/yyy/comp -> was an Example

so with your settings in .unoproject

project.prefix=org.libreoffice.example project.implementation=comp

the file RegistrationHandler.classes must be in the package org.libreoffice.example.comp -> folder -> org/libreoffice/example/comp

i did some changes in the error handling to give you some more information see pullrequest https://github.com/LibreOffice/loeclipse/pull/104

Hercle999 commented 1 year ago

The path is below. /project_name/source/example/example/RegistrationHandler.classes

So should I change the parameters like below?

project.prefix=source.example project.implementation=example

michaelmassee commented 1 year ago

/project_name/source/ -> is the base project directory ????

if you change project.prefix=source.example project.implementation=example

then the RegistrationHandler.classes file must be in the package source.example.example

show me your Package structure in Eclipse

Hercle999 commented 1 year ago

in the project folder "project_name".

231116029-dd9b882a-a2f8-4a35-ad46-83d92465350b

michaelmassee commented 1 year ago

okay :-)

change in .unoproject

project.prefix=example.example project.implementation=comp regclassname=example.example.comp.RegistrationHandler

create package example.example.comp move the files ExtensionMainImpl.java, RegistrationHandler.classes and RegistrationHandler.java to example.example.comp

michaelmassee commented 1 year ago

change in RegistrationHandler.classes

example.example.comp.ExtensionMainImpl

Hercle999 commented 1 year ago

Unfortunately, I failed to export again.

unoproject path handler

Hercle999 commented 1 year ago

I noticed the log was output in error log now.

Is something wrong about /build/urd?

urd

michaelmassee commented 1 year ago

okay, then wait for the project maintainer to merge my pull request to get some more info, and a better error message

michaelmassee commented 1 year ago

show me your output bin folder, are here the files in the correct place ? is the file RegistrationHandler.classes also in your bin folder ?

Hercle999 commented 1 year ago

This is bin folder contents generated automatically.

bin