Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDK no longer recognized since LibreOffice 7.5 #98

Open
Hercle999 opened this issue Mar 16, 2023 · 38 comments
Open

SDK no longer recognized since LibreOffice 7.5 #98

Hercle999 opened this issue Mar 16, 2023 · 38 comments

Comments

@Hercle999
Copy link

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
Copy link
Author

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
Copy link
Contributor

So what's the content of RegistrationHandler.classes ?

@Hercle999
Copy link
Author

Thank you for your reply.

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

RegistrationHandler.txt

@smehrbrodt
Copy link
Contributor

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

@Hercle999
Copy link
Author

Written:

example.example.ExtensionMainImpl

@Hercle999
Copy link
Author

Suddenly, even running LibreOffice from eclipse was unenabled.

eclipse_libre

@Hercle999
Copy link
Author

無題

@Hercle999
Copy link
Author

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
Copy link
Author

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
Copy link

RayCulp commented Mar 27, 2023

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
Copy link

RayCulp commented Mar 27, 2023

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
Copy link
Contributor

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

@smehrbrodt
Copy link
Contributor

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.

@smehrbrodt smehrbrodt changed the title Work from eclipse, but not work on LibreOffice SDK no longer recognized since LibreOffice 7.5 Mar 27, 2023
@RayCulp
Copy link

RayCulp commented Mar 27, 2023

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
Copy link
Contributor

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
Copy link
Author

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
Copy link
Contributor

"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
Copy link
Author

I've sent the content of RegistrationHandle.classes.

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

RegistrationHandler classes

@michaelmassee
Copy link
Contributor

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

@Hercle999
Copy link
Author

Hercle999 commented Apr 11, 2023

The path is below.

path

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

@michaelmassee
Copy link
Contributor

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
Copy link
Author

Thank you for dealing my issue.

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

@michaelmassee
Copy link
Contributor

`
/**
* Get the classes list file for the given UNO project.
*
* @param pProject the UNO project to get the list file from
*
* @return the implementation classes file of the project.
*/
private static IFile getClassesListFile(IUnoidlProject pProject) {
// Get the path where to place the class and the implementations list
IPath relPath = pProject.getImplementationPath();
IFolder dest = pProject.getFolder(relPath);

    return dest.getFile("RegistrationHandler.classes"); //$NON-NLS-1$
}

`
is the file "RegistrationHandler.classes" in your project implementation directory ?

@michaelmassee
Copy link
Contributor

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

`

@Hercle999
Copy link
Author

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

@michaelmassee
Copy link
Contributor

michaelmassee commented Apr 11, 2023

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
Copy link
Author

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
Copy link
Contributor

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 #104

@Hercle999
Copy link
Author

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
Copy link
Contributor

/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
Copy link
Author

in the project folder "project_name".

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

@michaelmassee
Copy link
Contributor

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
Copy link
Contributor

change in RegistrationHandler.classes

example.example.comp.ExtensionMainImpl

@Hercle999
Copy link
Author

Unfortunately, I failed to export again.

unoproject
path
handler

@Hercle999
Copy link
Author

I noticed the log was output in error log now.

Is something wrong about /build/urd?

urd

@michaelmassee
Copy link
Contributor

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

@michaelmassee
Copy link
Contributor

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
Copy link
Author

This is bin folder contents generated automatically.

bin

@smehrbrodt smehrbrodt reopened this Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants