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

Can I use M2DOC in the linux? #176

Closed
AlawnWong opened this issue Mar 15, 2017 · 24 comments
Closed

Can I use M2DOC in the linux? #176

AlawnWong opened this issue Mar 15, 2017 · 24 comments
Milestone

Comments

@AlawnWong
Copy link

Can I use M2DOC in the linux?

@ylussaud
Copy link
Collaborator

Yes you can. All the tests are passed under Linux by the CI. You can also use it inside Eclipse or in standalone if all your Java services are standalone. It make it possible to call M2Doc from a build process for instance.

See the next release (tomorrow) for more details.

@AlawnWong
Copy link
Author

AlawnWong commented Mar 15, 2017

How can i use the Source code to install the plug-ins?
When I use the Source code to run the eclipse application, some errors happened.
I think should some dependent plug-ins be not installed.
But, I don't know which dependent plug-ins should install.

@ylussaud
Copy link
Collaborator

If you install from the update site all dependencies should be installed.

If you want to use the sources in Eclipse you can use one of the target platforms:
https://github.com/ObeoNetwork/M2Doc/tree/master/releng/org.obeonetwork.m2doc.targetplatforms

This will set all dependencies as your target platform.

@AlawnWong
Copy link
Author

AlawnWong commented Mar 16, 2017

I dont know why this error happened in the linux.
java.lang.ClassNotFoundException: org.eclipse.xtext.ui.guice.AbstractGuiceAwareExecutableExtensionFactory cannot be found by org.eclipse.xtext.ui.shared_2.10.0.v201605250459
java.lang.NoClassDefFoundError: org/eclipse/xtext/ui/guice/AbstractGuiceAwareExecutableExtensionFactory

However, it is ok in the windows.

I install the M2Doc 0.9.9

@AlawnWong
Copy link
Author

Error information:
!ENTRY org.eclipse.jdt.core 4 2 2017-03-16 16:36:45.472
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jdt.core".
!STACK 1
org.eclipse.core.runtime.CoreException: Plug-in org.eclipse.xtext.ui.shared was unable to load class org.eclipse.xtext.ui.shared.internal.ExecutableExtensionFactory.
at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:194)

@ylussaud
Copy link
Collaborator

ylussaud commented Mar 16, 2017

Your stacks is related to XText but we don't use XText in M2Doc... So I don't know. May be try to get the Modeling packaging of Eclipse. It might help with XText.

http://www.eclipse.org/downloads/packages/eclipse-modeling-tools/neon2

Hope it'll help.

@AlawnWong AlawnWong reopened this Mar 17, 2017
@AlawnWong
Copy link
Author

@ylussaud
I use the linux 64-bit "eclipse-modeling-neon-2" in the ubuntu 14.04.
I install the M2Doc 0.9.9 in the Eclipse Help/Install new software/... menu.
Then, I create a "Ecore Modeling Project" and generate Model Code, Edit Code and Editor Code.
Then, I run as "Eclipse Application".
In the runtime-EclipseApplication, I create a java project and create a class.
Then, the error happened!

!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jdt.core".
!STACK 1
org.eclipse.core.runtime.CoreException: Plug-in org.eclipse.xtext.ui.shared was unable to load class org.eclipse.xtext.ui.shared.internal.ExecutableExtensionFactory.
at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:194)
at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:178)
at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)

@AlawnWong
Copy link
Author

@ylussaud
Copy link
Collaborator

For your XText problem https://www.eclipse.org/forums/index.php/t/1073549/ seems to be a good starting point.

To use M2Doc you have two options. Either you are using it and don't need to change the code of M2Doc so you can use update site and don't need to bother with the target platform. Either you plan to change the source code or debug it and then you need to import the source code from the githut repository in your workspace then use a target platform. To do so open the .target and in the right top corner you have "Set as Target Platform". It should start rebuilding your workspace then you're good to go.

@AlawnWong
Copy link
Author

@ylussaud
I installed the version 0.10.0 using update site.
Why cannot complete the install?

Cannot complete the install because one or more required items could not be found.
Software being installed: M2Doc 0.10.0.201703170819 (org.obeonetwork.m2doc.feature.feature.group 0.10.0.201703170819)
Missing requirement: M2Doc IDE UI 0.10.0.201703170819 (org.obeonetwork.m2doc.ide.ui 0.10.0.201703170819) requires 'bundle org.obeonetwork.m2doc.ide [0.10.0,0.11.0)' but it could not be found
Cannot satisfy dependency:
From: M2Doc 0.10.0.201703170819 (org.obeonetwork.m2doc.feature.feature.group 0.10.0.201703170819)
To: org.obeonetwork.m2doc.ide.ui [0.10.0.201703170819]

@ylussaud
Copy link
Collaborator

I forgot to include the plugin org.obeonetwork.m2doc.ide.ui in a feature. My bad... I let you know when a new build is ready.

@ylussaud
Copy link
Collaborator

There is a new release 0.10.2 the update site:
https://s3-eu-west-1.amazonaws.com/obeo-m2doc-releases/0.10.2/repository/

@AlawnWong
Copy link
Author

AlawnWong commented Mar 21, 2017

@ylussaud 3Q!
I have installed the 0.10.2 use this update site.
And I find some problems.

  1. In the windows, I use the template.docx to generate the document.docx.
    I could generate the right document.docx, but M2Doc also generate the document-error.docx.
    In the document-error.docx, there are some errors. Such as "Couldn't find the 'xxx' variable"
    However, in the right document.docx, there is not any error. The variable is replaced correctly.
    When I use 0.9.9, there is not this problem.

  2. In the Linux, I can not to generate the document.docx.
    The error is :
    !ENTRY org.obeonetwork.m2doc.ide.ui 4 4 2017-03-20 09:47:11.146
    !MESSAGE M2Doc : technical error : No valid entries or contents found, this is not a valid OOXML (Office Open XML) file
    !STACK 0
    org.apache.poi.openxml4j.exceptions.NotOfficeXmlFileException: No valid entries or contents found, this is not a valid OOXML (Office Open XML) file
    at org.apache.poi.openxml4j.opc.ZipPackage.getPartsImpl(ZipPackage.java:290)
    at org.apache.poi.openxml4j.opc.OPCPackage.getParts(OPCPackage.java:774)
    at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:344)
    at org.obeonetwork.m2doc.util.M2DocUtils.parse(M2DocUtils.java:314)
    at org.obeonetwork.m2doc.genconf.GenconfToDocumentGenerator.generate(GenconfToDocumentGenerator.java:141)
    at org.obeonetwork.m2doc.genconf.GenconfToDocumentGenerator.generate(GenconfToDocumentGenerator.java:93)
    at org.obeonetwork.m2doc.ide.ui.command.GenerateHandler.execute(GenerateHandler.java:66)
    at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:295)

In my linux, I have not install openoffice. Do you think it is the reason?
I use winscp to copy the template.docx to the linux. Is the file format changed?
I don't know the reason?

So can you tell me, how to use M2DOC in the linux?
And, In the Libre Office, Open Office ,how to use the {field}?
I am waiting for your help!

@ylussaud
Copy link
Collaborator

  1. More validation has been added to M2Doc. Now you need to declare EPackages nsURI and variables and their types in the custom properties of the .docx template. You can use the Dedicated pop-up editor to edit custom properties on your template to fix this problem.

  2. We are using apache POI to read .docx files. You should not need any thing else to use M2Doc. Maybe the file has been changed in the transfert. With scp I think it should not happen but with ftp it can happen if you didn't set the trasfert to binary. To quickly check that you can try to unzip the .docx file under linux. It will tell you if the .docx file is still a zip archive.

Unfortunately for the moment I don't know how to edit {field} with Libre Office. We are using MS Office to edit templates...

@AlawnWong
Copy link
Author

AlawnWong commented Mar 21, 2017

  1. If the template file is xxx.odt, can the M2Doc support to transform?
  2. I use the binary way to transfer the template.docx. But the error still happen. I cann't find the reason.
    I want to know, how to use the M2Doc in the linux? I want to try it.
    Our platform is linux, so this question is important for me. 3Q

@ylussaud
Copy link
Collaborator

  1. we only suppport .docx for the moment.
  2. Can you unzip the template.docx under Linux to check if it has been damaged ?

@AlawnWong
Copy link
Author

Your mean use unzip directly to the template.docx?
like this :
unzip template.docx
Archive: template.docx
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of template.docx or
template.docx.zip, and cannot find template.docx.ZIP, period.
Does this mean the file has been damaged ?

@AlawnWong
Copy link
Author

AlawnWong commented Mar 21, 2017

I think the file be not damaged.
I use 7z to compress the zip in the windows , and then uncompress it in the linux.
There is not any error.
I feel it is strange...
Do you have any suggestions to me?

@ylussaud
Copy link
Collaborator

ca you open the template.docx in MS Word without errors ? Basically It seems like POI is not able to load the document...

@AlawnWong
Copy link
Author

In the MS Word, the template.docx has not any errors , and the M2Doc can load and transform it.
But, in the linux , M2Doc can not load the template.docx. I try it in the ubuntu and redhat.
In your CI, could the file load ? Which OS is used the CI?

@AlawnWong
Copy link
Author

AlawnWong commented Mar 22, 2017

I download the m2doc-linux.gtk.x86_64.zip, and want to use it to transform the template.docx.
Why I can not to start by double-click the m2doc?
JVM terminated. Exit code=255
I use the command "./m2doc".
then, the error is
The command-line launcher to generate .docx from your models.
-consoleLog : Log messages in the console.
-data FOLDER : Specify the folder which will keep the workspace.
-genconfs INPUT : Specify the genconf model to use as inputs of the
generation. Relative paths might be used or absolute uris
(file://,http:/ or platform:/plugins/ for instance.)

Status ERROR: org.obeonetwork.m2doc.launcher.internal code=0 You must specify genconfs models. org.kohsuke.args4j.CmdLineException: You must specify genconfs models.

this mean, do I need a model and .docx ?

@AlawnWong
Copy link
Author

AlawnWong commented Mar 22, 2017

I find the reason that the template.docx can not be loaded.
the company security software problems. It encrypt the file.....
3Q for your help!

@ylussaud
Copy link
Collaborator

I'm developing and testing M2Doc under Linux so Linux (Ubuntu) so I think it's not the problem. Our CI use Linux also. Not sure about the distribution, we are using travis.

For the product you need to specify a genconf model that reference your variables, the template and the output flie.

./m2doc my.genconf

You can try with the tests genconf but you will probably need to set the template and output files before using it.

@AlawnWong
Copy link
Author

OK, 3Q!

@ylussaud ylussaud added this to the 2.0.0 milestone Dec 13, 2019
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

2 participants