Bug 562554: [Model2Doc] The framework must an action to generate a pdf from the documentstructuretemplate
Change-Id: I5ecc4b2f8cb81abfdebca6e860a017c1b9c1e08b
Signed-off-by: Vincent Lorenzo <vincent.lorenzo@cea.fr>
diff --git a/features/org.eclipse.papyrus.model2doc.feature/feature.xml b/features/org.eclipse.papyrus.model2doc.feature/feature.xml
index 954468e..4b1d153 100755
--- a/features/org.eclipse.papyrus.model2doc.feature/feature.xml
+++ b/features/org.eclipse.papyrus.model2doc.feature/feature.xml
@@ -158,6 +158,13 @@
install-size="0"
version="0.0.0"
unpack="false"/>
+
+ <plugin
+ id="org.eclipse.papyrus.model2doc.odt.emf.template2pdf"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
<plugin
id="org.eclipse.papyrus.model2doc.odt.lib"
@@ -172,7 +179,7 @@
install-size="0"
version="0.0.0"
unpack="false"/>
-
+
<plugin
id="org.eclipse.papyrus.model2doc.emf.documentstructure"
download-size="0"
@@ -242,11 +249,25 @@
install-size="0"
version="0.0.0"
unpack="false"/>
-
+
<plugin
id="org.eclipse.papyrus.model2doc.doc"
download-size="0"
install-size="0"
version="0.0.0"/>
+ <plugin
+ id="org.eclipse.papyrus.model2doc.odt.emf.template2pdf"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.papyrus.model2doc.emf.template2document"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
</feature>
diff --git a/plugins/core/org.eclipse.papyrus.model2doc.core/src/org/eclipse/papyrus/model2doc/core/internal/transcriber/UMLTranscriber.java b/plugins/core/org.eclipse.papyrus.model2doc.core/src/org/eclipse/papyrus/model2doc/core/internal/transcriber/UMLTranscriber.java
index 11b6d70..b416079 100755
--- a/plugins/core/org.eclipse.papyrus.model2doc.core/src/org/eclipse/papyrus/model2doc/core/internal/transcriber/UMLTranscriber.java
+++ b/plugins/core/org.eclipse.papyrus.model2doc.core/src/org/eclipse/papyrus/model2doc/core/internal/transcriber/UMLTranscriber.java
@@ -78,7 +78,7 @@
* Read UML model and transcribe it.
*/
@Override
- public void transcribe() {
+ public String transcribe() {
// Transcribe label of root package how document main title
transcription.writeDocumentMainTitle(umlLabelInternationalization.getLabel(root));
@@ -165,7 +165,7 @@
transcription.refreshTablesOfIndexes();
// Save transcription
- transcription.save(umlLabelInternationalization.getLabel(root));
+ return transcription.save(umlLabelInternationalization.getLabel(root));
}
/**
diff --git a/plugins/core/org.eclipse.papyrus.model2doc.core/src/org/eclipse/papyrus/model2doc/core/transcriber/Transcriber.java b/plugins/core/org.eclipse.papyrus.model2doc.core/src/org/eclipse/papyrus/model2doc/core/transcriber/Transcriber.java
index 2ba9ef6..ae736ee 100755
--- a/plugins/core/org.eclipse.papyrus.model2doc.core/src/org/eclipse/papyrus/model2doc/core/transcriber/Transcriber.java
+++ b/plugins/core/org.eclipse.papyrus.model2doc.core/src/org/eclipse/papyrus/model2doc/core/transcriber/Transcriber.java
@@ -17,11 +17,11 @@
/**
* Transcriber Interface.
* The propose of this interface is to read any data source (e.g., UML model).
- *
+ *
*/
public interface Transcriber {
/**
* Transcribe.
*/
- public void transcribe();
+ public String transcribe();
}
diff --git a/plugins/core/org.eclipse.papyrus.model2doc.core/src/org/eclipse/papyrus/model2doc/core/transcription/Transcription.java b/plugins/core/org.eclipse.papyrus.model2doc.core/src/org/eclipse/papyrus/model2doc/core/transcription/Transcription.java
index afff76f..cd1f304 100755
--- a/plugins/core/org.eclipse.papyrus.model2doc.core/src/org/eclipse/papyrus/model2doc/core/transcription/Transcription.java
+++ b/plugins/core/org.eclipse.papyrus.model2doc.core/src/org/eclipse/papyrus/model2doc/core/transcription/Transcription.java
@@ -151,8 +151,12 @@
* Save transcription.
*
* @param label
+ * the name of the new document
+ * @return
+ * a string representing the path of the new document
+ * TODO : clarify the format of the returned string
*/
- public void save(String label);
+ public String save(String label);
/**
* Get configuration of document generation.
diff --git a/plugins/doc/org.eclipse.papyrus.model2doc.doc/src/site/mediawiki/images/userDoc/userDoc_009_GenerationFromDocumentStructureTemplate_Menu.png b/plugins/doc/org.eclipse.papyrus.model2doc.doc/src/site/mediawiki/images/userDoc/userDoc_009_GenerationFromDocumentStructureTemplate_Menu.png
new file mode 100755
index 0000000..29fa34e
--- /dev/null
+++ b/plugins/doc/org.eclipse.papyrus.model2doc.doc/src/site/mediawiki/images/userDoc/userDoc_009_GenerationFromDocumentStructureTemplate_Menu.png
Binary files differ
diff --git a/plugins/doc/org.eclipse.papyrus.model2doc.doc/src/site/mediawiki/model2doc-userDoc.mediawiki b/plugins/doc/org.eclipse.papyrus.model2doc.doc/src/site/mediawiki/model2doc-userDoc.mediawiki
index 9e38017..8021d92 100755
--- a/plugins/doc/org.eclipse.papyrus.model2doc.doc/src/site/mediawiki/model2doc-userDoc.mediawiki
+++ b/plugins/doc/org.eclipse.papyrus.model2doc.doc/src/site/mediawiki/model2doc-userDoc.mediawiki
@@ -150,6 +150,17 @@
That's all! The generator will ask the value of the column feature/property for each element represented in row to fill the the cell at the intersection of the row and the column.
+=Generation from the DocumentStructureTemplate=
+Model2Doc provides several generation menus, depending of what you want to do.
+All these menus are available in the ''Right-Click'' menu.
+
+[[Image:images/userDoc/userDoc_009_GenerationFromDocumentStructureTemplate_Menu.png]]
+
+
+* ''Generate Document Structure'': only the intermediate DocumentStructure ( '''*.pds''') file will be generated.
+* ''Generate All (Structure + xxx)'': the intermediate DocumentStructure ('''*.pds''') file and the final document. '''xxx''' is the name of the used generator. In the main case, it is '''ODT'''
+* ''Generate All + PDF'': here, the '''*.pds''' file, the document and a PDF version of this document are generated. Several menus exist for PDF generation, to support several PDF format. The used exporter in the LibreOffice one.
+
=How to generate the DocumentStructure from the DocumentTemplate?=
Once you finished the configuration of your '''DocumentTemplate''', you can generate your '''DocumentStructure'''. in the opened DocumentTemplate editor, ''Right-Click'' on the '''DocumentTemplate''', then ''Generate DocumentStructure''.
diff --git a/plugins/emf/org.eclipse.papyrus.model2doc.emf.structure2document/META-INF/MANIFEST.MF b/plugins/emf/org.eclipse.papyrus.model2doc.emf.structure2document/META-INF/MANIFEST.MF
index 2a68365..5317eae 100755
--- a/plugins/emf/org.eclipse.papyrus.model2doc.emf.structure2document/META-INF/MANIFEST.MF
+++ b/plugins/emf/org.eclipse.papyrus.model2doc.emf.structure2document/META-INF/MANIFEST.MF
@@ -1,6 +1,6 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
-Bundle-Name: Papyrus-Model2Doc - Structure2document (Incubation)
+Bundle-Name: Papyrus-Model2Doc - Structure2Document (Incubation)
Bundle-SymbolicName: org.eclipse.papyrus.model2doc.emf.structure2document;singleton:=true
Bundle-Version: 0.8.0.qualifier
Bundle-Activator: org.eclipse.papyrus.model2doc.emf.structure2document.Activator
diff --git a/plugins/emf/org.eclipse.papyrus.model2doc.emf.structure2document/src-api/org/eclipse/papyrus/model2doc/emf/structure2document/generator/IStructure2DocumentGenerator.java b/plugins/emf/org.eclipse.papyrus.model2doc.emf.structure2document/src-api/org/eclipse/papyrus/model2doc/emf/structure2document/generator/IStructure2DocumentGenerator.java
index c1fde17..222046c 100755
--- a/plugins/emf/org.eclipse.papyrus.model2doc.emf.structure2document/src-api/org/eclipse/papyrus/model2doc/emf/structure2document/generator/IStructure2DocumentGenerator.java
+++ b/plugins/emf/org.eclipse.papyrus.model2doc.emf.structure2document/src-api/org/eclipse/papyrus/model2doc/emf/structure2document/generator/IStructure2DocumentGenerator.java
@@ -72,4 +72,12 @@
*/
public String getGenerateMenuLabel();
+
+ /**
+ *
+ * @return
+ * the extension of the output file
+ */
+ public String getOutputFileExtension();
+
}
diff --git a/plugins/emf/org.eclipse.papyrus.model2doc.emf.template2document/META-INF/MANIFEST.MF b/plugins/emf/org.eclipse.papyrus.model2doc.emf.template2document/META-INF/MANIFEST.MF
index 18772db..d644f94 100755
--- a/plugins/emf/org.eclipse.papyrus.model2doc.emf.template2document/META-INF/MANIFEST.MF
+++ b/plugins/emf/org.eclipse.papyrus.model2doc.emf.template2document/META-INF/MANIFEST.MF
@@ -20,4 +20,5 @@
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Automatic-Module-Name: org.eclipse.papyrus.model2doc.emf.template2document
Bundle-ActivationPolicy: lazy
-Export-Package: org.eclipse.papyrus.model2doc.emf.template2document.internal.handler
+Export-Package: org.eclipse.papyrus.model2doc.emf.template2document.internal.handler;x-friends:="org.eclipse.papyrus.model2doc.odt.emf.template2pdf",
+ org.eclipse.papyrus.model2doc.emf.template2document.internal.menu;x-friends:="org.eclipse.papyrus.model2doc.odt.emf.template2pdf"
diff --git a/plugins/emf/org.eclipse.papyrus.model2doc.emf.template2document/src/org/eclipse/papyrus/model2doc/emf/template2document/internal/handler/GenerateStructureAndDocumentHandler.java b/plugins/emf/org.eclipse.papyrus.model2doc.emf.template2document/src/org/eclipse/papyrus/model2doc/emf/template2document/internal/handler/GenerateStructureAndDocumentHandler.java
index c466338..895eb73 100755
--- a/plugins/emf/org.eclipse.papyrus.model2doc.emf.template2document/src/org/eclipse/papyrus/model2doc/emf/template2document/internal/handler/GenerateStructureAndDocumentHandler.java
+++ b/plugins/emf/org.eclipse.papyrus.model2doc.emf.template2document/src/org/eclipse/papyrus/model2doc/emf/template2document/internal/handler/GenerateStructureAndDocumentHandler.java
@@ -15,7 +15,10 @@
package org.eclipse.papyrus.model2doc.emf.template2document.internal.handler;
+import java.util.ArrayList;
import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
@@ -33,7 +36,7 @@
import org.eclipse.papyrus.model2doc.emf.documentstructuretemplate.DocumentTemplate;
import org.eclipse.papyrus.model2doc.emf.structure2document.generator.IStructure2DocumentGenerator;
import org.eclipse.papyrus.model2doc.emf.structure2document.generator.Structure2DocumentRegistry;
-import org.eclipse.papyrus.model2doc.emf.template2document.internal.menu.MenuConstants;
+import org.eclipse.papyrus.model2doc.emf.template2document.internal.menu.Template2DocumentMenuConstants;
import org.eclipse.papyrus.model2doc.emf.template2document.internal.messages.Messages;
import org.eclipse.papyrus.model2doc.emf.template2structure.command.Template2StructureCommandFactory;
import org.eclipse.papyrus.model2doc.emf.template2structure.generator.ITemplate2StructureGenerator;
@@ -97,15 +100,27 @@
/**
* {@inheritDoc}
* This re-implementation allows to define the selected document template.
+ * This method can't be overrided, use {@link #computeEnable(Object)} instead
*
* @see org.eclipse.core.commands.AbstractHandler#setEnabled(java.lang.Object)
*/
@Override
- public void setEnabled(Object evaluationContext) {
+ public final void setEnabled(final Object evaluationContext) {
+ setBaseEnabled(computeEnable(evaluationContext));
+ }
+
+ /**
+ *
+ * @param evaluationContext
+ * the evaluation context
+ * @return
+ * <code>true</code> if the handler can be enable and false otherwise
+ */
+ protected boolean computeEnable(final Object evaluationContext) {
initFields();
boolean enable = null != this.domain && null != this.command && this.command.canExecute();
- String menuLabel = MenuConstants.NO_GENERATOR_ID;
+ String menuLabel = Template2DocumentMenuConstants.NO_GENERATOR_ID;
if (enable) {
enable = false;
final String s2docId = this.selectedDocumentTemplate.getDocumentStructureGeneratorConfiguration().getDocumentGeneratorId();
@@ -113,20 +128,38 @@
final IStructure2DocumentGenerator s2docGenerator = Structure2DocumentRegistry.INSTANCE.getGenerator(s2docId);
final ITemplate2StructureGenerator t2sGenerator = Template2StructureRegistry.INSTANCE.getGenerator(this.selectedDocumentTemplate);
if (s2docGenerator != null && t2sGenerator != null) {
- final StringBuilder builder = new StringBuilder();
- builder.append(t2sGenerator.getGenerateMenuLabel());
- builder.append(Messages.GenerateStructureAndDocumentHandler_PlusSymbole);
- builder.append(s2docGenerator.getGenerateMenuLabel());
- menuLabel = builder.toString();
+ final List<String> labels = new ArrayList<>();
+ labels.add(t2sGenerator.getGenerateMenuLabel());
+ labels.add(s2docGenerator.getGenerateMenuLabel());
+ menuLabel = createMenuLabel(labels);
enable = true;
}
}
}
if (evaluationContext instanceof IEvaluationContext) {
final IEvaluationContext iEvaluationContext = (IEvaluationContext) evaluationContext;
- iEvaluationContext.addVariable(MenuConstants.VARIABLE_GENERATOR_MENU_LABEL, menuLabel);
+ iEvaluationContext.addVariable(Template2DocumentMenuConstants.VARIABLE_GENERATOR_MENU_LABEL, menuLabel);
}
- setBaseEnabled(enable);
+ return enable;
+ }
+
+ /**
+ *
+ * @param labels
+ * the labels of the menu
+ * @return
+ * the created labels to use by the menu using the handler
+ */
+ protected String createMenuLabel(final List<String> labels) {
+ final StringBuilder builder = new StringBuilder();
+ final Iterator<String> iter = labels.iterator();
+ while (iter.hasNext()) {
+ builder.append(iter.next());
+ if (iter.hasNext()) {
+ builder.append(Messages.GenerateStructureAndDocumentHandler_PlusSymbole);
+ }
+ }
+ return builder.toString();
}
/**
diff --git a/plugins/emf/org.eclipse.papyrus.model2doc.emf.template2document/src/org/eclipse/papyrus/model2doc/emf/template2document/internal/menu/MenuConstants.java b/plugins/emf/org.eclipse.papyrus.model2doc.emf.template2document/src/org/eclipse/papyrus/model2doc/emf/template2document/internal/menu/Template2DocumentMenuConstants.java
similarity index 92%
rename from plugins/emf/org.eclipse.papyrus.model2doc.emf.template2document/src/org/eclipse/papyrus/model2doc/emf/template2document/internal/menu/MenuConstants.java
rename to plugins/emf/org.eclipse.papyrus.model2doc.emf.template2document/src/org/eclipse/papyrus/model2doc/emf/template2document/internal/menu/Template2DocumentMenuConstants.java
index 31b01c3..bb2b721 100755
--- a/plugins/emf/org.eclipse.papyrus.model2doc.emf.template2document/src/org/eclipse/papyrus/model2doc/emf/template2document/internal/menu/MenuConstants.java
+++ b/plugins/emf/org.eclipse.papyrus.model2doc.emf.template2document/src/org/eclipse/papyrus/model2doc/emf/template2document/internal/menu/Template2DocumentMenuConstants.java
@@ -18,9 +18,9 @@
/**
* The constants used in the menus
*/
-public final class MenuConstants {
+public final class Template2DocumentMenuConstants {
- private MenuConstants() {
+ private Template2DocumentMenuConstants() {
// to prevent instantication
}
diff --git a/plugins/emf/org.eclipse.papyrus.model2doc.emf.template2document/src/org/eclipse/papyrus/model2doc/emf/template2document/internal/menu/Template2DocumentMenuContributionItem.java b/plugins/emf/org.eclipse.papyrus.model2doc.emf.template2document/src/org/eclipse/papyrus/model2doc/emf/template2document/internal/menu/Template2DocumentMenuContributionItem.java
index 8db3a7c..037f46a 100755
--- a/plugins/emf/org.eclipse.papyrus.model2doc.emf.template2document/src/org/eclipse/papyrus/model2doc/emf/template2document/internal/menu/Template2DocumentMenuContributionItem.java
+++ b/plugins/emf/org.eclipse.papyrus.model2doc.emf.template2document/src/org/eclipse/papyrus/model2doc/emf/template2document/internal/menu/Template2DocumentMenuContributionItem.java
@@ -73,25 +73,25 @@
final ICommandService serv = getCommandService();
// 3. find the command
- final Command command = serv.getCommand(MenuConstants.GENERATE_STRUCTURE_AND_DOCUMENT_COMMAND);
+ final Command command = serv.getCommand(Template2DocumentMenuConstants.GENERATE_STRUCTURE_AND_DOCUMENT_COMMAND);
// 4. get the eclipse handler for this command
final IHandler handler = command.getHandler();
// 5. reset the menu label parameter (to be sure to detect its erasure)
// the call command.isEnabled() will edit this parameter
- ctx.set(MenuConstants.VARIABLE_GENERATOR_MENU_LABEL, MenuConstants.NO_GENERATOR_ID);
+ ctx.set(Template2DocumentMenuConstants.VARIABLE_GENERATOR_MENU_LABEL, Template2DocumentMenuConstants.NO_GENERATOR_ID);
if (command.isEnabled()) {
// required to call setEnable
// the handler#setEnable set a constant in the ctx to get the label of the generator
// we use this label in the created menu to get a better experience for the final user
- final String res = (String) ctx.get(MenuConstants.VARIABLE_GENERATOR_MENU_LABEL);
+ final String res = (String) ctx.get(Template2DocumentMenuConstants.VARIABLE_GENERATOR_MENU_LABEL);
final MenuItem item = new MenuItem(menu, SWT.PUSH, index);
final String menuName;
- if (res != null && !res.isEmpty() && !res.equals(MenuConstants.NO_GENERATOR_ID)) {
+ if (res != null && !res.isEmpty() && !res.equals(Template2DocumentMenuConstants.NO_GENERATOR_ID)) {
menuName = NLS.bind(Messages.Template2DocumentMenuContributionItem_GenerateAllWithParameterMenuLabel, res);
} else {
menuName = Messages.Template2DocumentMenuContributionItem_GenerateAllMenuLabel;
diff --git a/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.structure2document/src/org/eclipse/papyrus/model2doc/odt/emf/structure2document/internal/generators/TextDocumentToODTGenerator.java b/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.structure2document/src/org/eclipse/papyrus/model2doc/odt/emf/structure2document/internal/generators/TextDocumentToODTGenerator.java
index 6929ba2..76e80e9 100755
--- a/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.structure2document/src/org/eclipse/papyrus/model2doc/odt/emf/structure2document/internal/generators/TextDocumentToODTGenerator.java
+++ b/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.structure2document/src/org/eclipse/papyrus/model2doc/odt/emf/structure2document/internal/generators/TextDocumentToODTGenerator.java
@@ -86,4 +86,14 @@
return "ODT"; //$NON-NLS-1$
}
+ /**
+ * @see org.eclipse.papyrus.model2doc.emf.structure2document.generator.IStructure2DocumentGenerator#getOutputFileExtension()
+ *
+ * @return
+ */
+ @Override
+ public String getOutputFileExtension() {
+ return "odt"; //$NON-NLS-1$
+ }
+
}
diff --git a/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.structure2document/src/org/eclipse/papyrus/model2doc/odt/emf/structure2document/internal/handler/CreateODTFileFromTextDocumentHelper.java b/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.structure2document/src/org/eclipse/papyrus/model2doc/odt/emf/structure2document/internal/handler/CreateODTFileFromTextDocumentHelper.java
index 17ef7e3..3f94d1d 100755
--- a/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.structure2document/src/org/eclipse/papyrus/model2doc/odt/emf/structure2document/internal/handler/CreateODTFileFromTextDocumentHelper.java
+++ b/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.structure2document/src/org/eclipse/papyrus/model2doc/odt/emf/structure2document/internal/handler/CreateODTFileFromTextDocumentHelper.java
@@ -21,6 +21,7 @@
import org.eclipse.papyrus.model2doc.odt.emf.structure2document.Activator;
import org.eclipse.papyrus.model2doc.odt.emf.structure2document.internal.transcriber.StructureToODTTranscriber;
import org.eclipse.papyrus.model2doc.odt.internal.editor.DefaultStyleEditor;
+import org.eclipse.papyrus.model2doc.odt.internal.editor.ODTEditor;
import org.eclipse.papyrus.model2doc.odt.internal.transcription.ODTTranscription;
/**
@@ -48,18 +49,21 @@
/**
* This method generate the final odt document
+ *
+ * @return a string representing the path of the new document, starting with file:/
+ *
*/
- public void generate() {// TODO : must return the generated file
+ public String generate() {// TODO : must return the generated file
if (this.textDocument == null) {
Activator.log.warn("The TextDocument is null"); //$NON-NLS-1$
- return;
+ return null;
}
final IDocumentGeneratorConfiguration ddgc = textDocument.getDocumentGeneratorConfiguration();
final Transcription transcription = createTranscription(ddgc);
Transcriber t = createTranscriber(textDocument, transcription);
- t.transcribe();
+ return ODTEditor.convertToGenericFileURI(t.transcribe());
}
/**
diff --git a/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.structure2document/src/org/eclipse/papyrus/model2doc/odt/emf/structure2document/internal/transcriber/StructureToODTTranscriber.java b/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.structure2document/src/org/eclipse/papyrus/model2doc/odt/emf/structure2document/internal/transcriber/StructureToODTTranscriber.java
index 18bdcba..ca1805e 100755
--- a/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.structure2document/src/org/eclipse/papyrus/model2doc/odt/emf/structure2document/internal/transcriber/StructureToODTTranscriber.java
+++ b/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.structure2document/src/org/eclipse/papyrus/model2doc/odt/emf/structure2document/internal/transcriber/StructureToODTTranscriber.java
@@ -59,7 +59,7 @@
*
*/
@Override
- public void transcribe() {
+ public String transcribe() {
final String mainTitle = this.textDocument.getMainTitle();
if (mainTitle != null && !mainTitle.isEmpty()) {
this.transcription.writeDocumentMainTitle(mainTitle);
@@ -75,7 +75,8 @@
transcribe(iter.next());
}
this.transcription.refreshTablesOfIndexes();// TODO should be done directly by the transcriptor
- this.transcription.save(""); // TODO : remove this argument //$NON-NLS-1$
+
+ return this.transcription.save(""); // TODO : remove this argument //$NON-NLS-1$
}
/**
diff --git a/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.structure2document/src/org/eclipse/papyrus/model2doc/odt/emf/structure2document/internal/utils/GenerateODTFileUtils.java b/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.structure2document/src/org/eclipse/papyrus/model2doc/odt/emf/structure2document/internal/utils/GenerateODTFileUtils.java
index f502135..0dd6bc3 100644
--- a/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.structure2document/src/org/eclipse/papyrus/model2doc/odt/emf/structure2document/internal/utils/GenerateODTFileUtils.java
+++ b/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.structure2document/src/org/eclipse/papyrus/model2doc/odt/emf/structure2document/internal/utils/GenerateODTFileUtils.java
@@ -36,10 +36,13 @@
*
* @param textDocument
* The initial text from which one generate the ODT file.
+ *
+ * @return
+ * the path of the generated file
*/
- public static void generateODTFile(final TextDocument textDocument) {
+ public static String generateODTFile(final TextDocument textDocument) {
final CreateODTFileFromTextDocumentHelper helper = new CreateODTFileFromTextDocumentHelper(textDocument);
- helper.generate();
+ final String generatedFilePath = helper.generate();
// refresh workspace
String path = GeneratorConfigurationOperations.getDocumentFileLocalPath(textDocument.getDocumentGeneratorConfiguration(), "odt"); //$NON-NLS-1$
@@ -60,6 +63,7 @@
}
}
+ return generatedFilePath;
}
}
diff --git a/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/.classpath b/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/.classpath
new file mode 100755
index 0000000..eca7bdb
--- /dev/null
+++ b/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/.gitignore b/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/.gitignore
new file mode 100755
index 0000000..ae3c172
--- /dev/null
+++ b/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/.gitignore
@@ -0,0 +1 @@
+/bin/
diff --git a/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/.project b/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/.project
new file mode 100755
index 0000000..9b0da59
--- /dev/null
+++ b/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.model2doc.odt.emf.template2pdf</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/.settings/org.eclipse.core.resources.prefs b/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/.settings/org.eclipse.core.resources.prefs
new file mode 100755
index 0000000..896a9a5
--- /dev/null
+++ b/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
\ No newline at end of file
diff --git a/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/.settings/org.eclipse.core.runtime.prefs b/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/.settings/org.eclipse.core.runtime.prefs
new file mode 100755
index 0000000..5a0ad22
--- /dev/null
+++ b/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/.settings/org.eclipse.core.runtime.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/.settings/org.eclipse.jdt.core.prefs b/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/.settings/org.eclipse.jdt.core.prefs
new file mode 100755
index 0000000..74c6d08
--- /dev/null
+++ b/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,297 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.release=disabled
+org.eclipse.jdt.core.compiler.source=1.8
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
+org.eclipse.jdt.core.formatter.comment.line_length=260
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=false
+org.eclipse.jdt.core.formatter.join_wrapped_lines=false
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=260
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=tab
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_on_off_tags=false
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
diff --git a/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/.settings/org.eclipse.jdt.ui.prefs b/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/.settings/org.eclipse.jdt.ui.prefs
new file mode 100755
index 0000000..1a3bd02
--- /dev/null
+++ b/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,127 @@
+cleanup.add_default_serial_version_id=true
+cleanup.add_generated_serial_version_id=false
+cleanup.add_missing_annotations=true
+cleanup.add_missing_deprecated_annotations=true
+cleanup.add_missing_methods=false
+cleanup.add_missing_nls_tags=false
+cleanup.add_missing_override_annotations=true
+cleanup.add_missing_override_annotations_interface_methods=true
+cleanup.add_serial_version_id=false
+cleanup.always_use_blocks=true
+cleanup.always_use_parentheses_in_expressions=false
+cleanup.always_use_this_for_non_static_field_access=false
+cleanup.always_use_this_for_non_static_method_access=false
+cleanup.convert_functional_interfaces=false
+cleanup.convert_to_enhanced_for_loop=false
+cleanup.correct_indentation=false
+cleanup.format_source_code=false
+cleanup.format_source_code_changes_only=false
+cleanup.insert_inferred_type_arguments=false
+cleanup.make_local_variable_final=true
+cleanup.make_parameters_final=false
+cleanup.make_private_fields_final=true
+cleanup.make_type_abstract_if_missing_method=false
+cleanup.make_variable_declarations_final=false
+cleanup.never_use_blocks=false
+cleanup.never_use_parentheses_in_expressions=true
+cleanup.organize_imports=false
+cleanup.qualify_static_field_accesses_with_declaring_class=false
+cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+cleanup.qualify_static_member_accesses_with_declaring_class=true
+cleanup.qualify_static_method_accesses_with_declaring_class=false
+cleanup.remove_private_constructors=true
+cleanup.remove_redundant_type_arguments=true
+cleanup.remove_trailing_whitespaces=true
+cleanup.remove_trailing_whitespaces_all=true
+cleanup.remove_trailing_whitespaces_ignore_empty=false
+cleanup.remove_unnecessary_casts=true
+cleanup.remove_unnecessary_nls_tags=true
+cleanup.remove_unused_imports=true
+cleanup.remove_unused_local_variables=false
+cleanup.remove_unused_private_fields=true
+cleanup.remove_unused_private_members=false
+cleanup.remove_unused_private_methods=true
+cleanup.remove_unused_private_types=true
+cleanup.sort_members=false
+cleanup.sort_members_all=false
+cleanup.use_anonymous_class_creation=false
+cleanup.use_blocks=true
+cleanup.use_blocks_only_for_return_and_throw=false
+cleanup.use_lambda=true
+cleanup.use_parentheses_in_expressions=false
+cleanup.use_this_for_non_static_field_access=false
+cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+cleanup.use_this_for_non_static_method_access=false
+cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+cleanup.use_type_arguments=false
+cleanup_profile=_Papyrus
+cleanup_settings_version=2
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+formatter_profile=_Papyrus
+formatter_settings_version=12
+org.eclipse.jdt.ui.ignorelowercasenames=true
+org.eclipse.jdt.ui.importorder=java;javax;org;com;
+org.eclipse.jdt.ui.javadoc=true
+org.eclipse.jdt.ui.ondemandthreshold=99
+org.eclipse.jdt.ui.staticondemandthreshold=99
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="false" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * Constructor.\n *\n * ${tags}\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*****************************************************************************\n * Copyright (c) ${year} CEA LIST and others.\n * \n * All rights reserved. This program and the accompanying materials\n * are made available under the terms of the Eclipse Public License 2.0\n * which accompanies this distribution, and is available at\n * http\://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n *\n * Contributors\:\n * CEA LIST - Initial API and implementation\n * \n *****************************************************************************/\n</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n *\n * ${tags}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="false" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/**\n * ${see_to_overridden}\n *\n * ${tags}\n */</template><template autoinsert\="false" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${see_to_target}\n *\n * ${tags}\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_functional_interfaces=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=false
+sp_cleanup.format_source_code=true
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.insert_inferred_type_arguments=false
+sp_cleanup.make_local_variable_final=true
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=false
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=true
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_redundant_modifiers=false
+sp_cleanup.remove_redundant_type_arguments=true
+sp_cleanup.remove_trailing_whitespaces=true
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=true
+sp_cleanup.remove_unnecessary_nls_tags=true
+sp_cleanup.remove_unused_imports=true
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_anonymous_class_creation=false
+sp_cleanup.use_blocks=true
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_lambda=true
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
diff --git a/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/.settings/org.eclipse.pde.api.tools.prefs b/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/.settings/org.eclipse.pde.api.tools.prefs
new file mode 100755
index 0000000..b2260f8
--- /dev/null
+++ b/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/.settings/org.eclipse.pde.api.tools.prefs
@@ -0,0 +1,104 @@
+ANNOTATION_ELEMENT_TYPE_ADDED_FIELD=Error
+ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error
+ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Warning
+API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Warning
+API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error
+API_USE_SCAN_FIELD_SEVERITY=Error
+API_USE_SCAN_METHOD_SEVERITY=Error
+API_USE_SCAN_TYPE_SEVERITY=Error
+CLASS_ELEMENT_TYPE_ADDED_FIELD=Warning
+CLASS_ELEMENT_TYPE_ADDED_METHOD=Error
+CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
+CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error
+CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error
+CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error
+CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error
+CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
+CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error
+ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error
+ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error
+ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+FIELD_ELEMENT_TYPE_ADDED_VALUE=Warning
+FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error
+FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
+FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
+FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error
+FIELD_ELEMENT_TYPE_CHANGED_VALUE=Warning
+FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error
+FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error
+ILLEGAL_EXTEND=Warning
+ILLEGAL_IMPLEMENT=Warning
+ILLEGAL_INSTANTIATE=Warning
+ILLEGAL_OVERRIDE=Warning
+ILLEGAL_REFERENCE=Warning
+INTERFACE_ELEMENT_TYPE_ADDED_DEFAULT_METHOD=Warning
+INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Ignore
+INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error
+INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error
+INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+INVALID_ANNOTATION=Ignore
+INVALID_JAVADOC_TAG=Ignore
+INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Ignore
+LEAK_EXTEND=Warning
+LEAK_FIELD_DECL=Warning
+LEAK_IMPLEMENT=Warning
+LEAK_METHOD_PARAM=Warning
+LEAK_METHOD_RETURN_TYPE=Warning
+METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
+METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
+METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
+METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error
+METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+MISSING_EE_DESCRIPTIONS=Error
+TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error
+UNUSED_PROBLEM_FILTERS=Warning
+automatically_removed_unused_problem_filters=Enabled
+changed_execution_env=Warning
+eclipse.preferences.version=1
+incompatible_api_component_version=Warning
+incompatible_api_component_version_include_major_without_breaking_change=Disabled
+incompatible_api_component_version_include_minor_without_api_change=Disabled
+incompatible_api_component_version_report_major_without_breaking_change=Error
+incompatible_api_component_version_report_minor_without_api_change=Error
+invalid_since_tag_version=Error
+malformed_since_tag=Error
+missing_since_tag=Error
+report_api_breakage_when_major_version_incremented=Disabled
+report_resolution_errors_api_component=Warning
diff --git a/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/META-INF/MANIFEST.MF b/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/META-INF/MANIFEST.MF
new file mode 100755
index 0000000..04aef9c
--- /dev/null
+++ b/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/META-INF/MANIFEST.MF
@@ -0,0 +1,22 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Papyrus-Model2Doc - Structure2PDF (Incubation)
+Bundle-SymbolicName: org.eclipse.papyrus.model2doc.odt.emf.template2pdf;singleton:=true
+Bundle-Version: 0.8.0.qualifier
+Bundle-Activator: org.eclipse.papyrus.model2doc.odt.emf.template2pdf.Activator
+Bundle-Vendor: Eclipse Modeling Project
+Require-Bundle: org.eclipse.ui;bundle-version="[3.113.0,4.0.0)",
+ org.eclipse.core.runtime;bundle-version="[3.15.0,4.0.0)",
+ org.eclipse.e4.core.contexts;bundle-version="[1.8.0,2.0.0)",
+ org.eclipse.papyrus.infra.core.log;bundle-version="[1.2.0,2.0.0)",
+ org.eclipse.core.expressions;bundle-version="[3.6.0,4.0.0)",
+ org.eclipse.emf.transaction;bundle-version="[1.9.0,2.0.0)",
+ org.eclipse.papyrus.model2doc.emf.documentstructure;bundle-version="[0.7.0,1.0.0)",
+ org.eclipse.papyrus.model2doc.emf.structure2document;bundle-version="[0.7.0,1.0.0)",
+ org.eclipse.papyrus.model2doc.emf.documentstructuretemplate;bundle-version="[0.7.0,1.0.0)",
+ org.eclipse.papyrus.model2doc.odt;bundle-version="[0.7.0,1.0.0)",
+ org.eclipse.papyrus.model2doc.emf.template2document;bundle-version="[0.8.0,1.0.0)",
+ org.eclipse.ui.workbench;bundle-version="[3.0.0,4.0.0)"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Automatic-Module-Name: org.eclipse.papyrus.model2doc.odt.emf.template2pdf
+Bundle-ActivationPolicy: lazy
diff --git a/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/about.html b/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/about.html
new file mode 100755
index 0000000..ef2872f
--- /dev/null
+++ b/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>November 30, 2017</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 2.0 ("EPL"). A copy of the EPL is available
+at <a href="https://www.eclipse.org/legal/epl-2.0/">https://www.eclipse.org/legal/epl-2.0/</a>.
+For purposes of the EPL, "Program" will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party ("Redistributor") and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/build.properties b/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/build.properties
new file mode 100755
index 0000000..e5a949c
--- /dev/null
+++ b/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/build.properties
@@ -0,0 +1,7 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ about.html
+src.includes = about.html
diff --git a/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/plugin.xml b/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/plugin.xml
new file mode 100755
index 0000000..d1f8885
--- /dev/null
+++ b/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/plugin.xml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.ui.commands">
+ <command
+ id="org.eclipse.papyrus.model2doc.odt.emf.template2pdf.generateStructure_Document_PDF"
+ name="Generate Structure, Document and PDF">
+ <defaultHandler
+ class="org.eclipse.papyrus.model2doc.odt.emf.template2pdf.internal.handler.GenerateStructureDocumentAndPDFHandler">
+ <parameter
+ name="org.eclipse.papyrus.model2doc.odt.emf.template2pdf.pdfVersion"
+ value="default">
+ </parameter>
+ </defaultHandler>
+ </command>
+ <command
+ id="org.eclipse.papyrus.model2doc.odt.emf.template2pdf.generateStructure_Document_PDF_A1B"
+ name="Generate Structure, Document and PDF A-1B">
+ <defaultHandler
+ class="org.eclipse.papyrus.model2doc.odt.emf.template2pdf.internal.handler.GenerateStructureDocumentAndPDFHandler">
+ <parameter
+ name="org.eclipse.papyrus.model2doc.odt.emf.template2pdf.pdfVersion"
+ value="A-1B">
+ </parameter>
+ </defaultHandler>
+ </command>
+ <command
+ id="org.eclipse.papyrus.model2doc.odt.emf.template2pdf.generateStructure_Document_PDF_A2B"
+ name="Generate Structure, Document and PDF A-2B">
+ <defaultHandler
+ class="org.eclipse.papyrus.model2doc.odt.emf.template2pdf.internal.handler.GenerateStructureDocumentAndPDFHandler">
+ <parameter
+ name="org.eclipse.papyrus.model2doc.odt.emf.template2pdf.pdfVersion"
+ value="A-2B">
+ </parameter>
+ </defaultHandler>
+ </command>
+ </extension>
+ <extension
+ point="org.eclipse.ui.menus">
+ <menuContribution
+ allPopups="false"
+ locationURI="popup:org.eclipse.ui.popup.any">
+ <menu
+ label="Generate All + PDF">
+ <dynamic
+ class="org.eclipse.papyrus.model2doc.odt.emf.template2pdf.internal.menu.Template2PDFMenuContributionItem"
+ id="org.eclipse.papyrus.model2doc.odt.emf.template2pdf.dynamic2">
+ </dynamic>
+ </menu>
+ </menuContribution>
+ </extension>
+
+</plugin>
diff --git a/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/pom.xml b/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/pom.xml
new file mode 100755
index 0000000..0290851
--- /dev/null
+++ b/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/pom.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.eclipse.papyrus.model2doc.plugins-odt</groupId>
+ <artifactId>org.eclipse.papyrus.model2doc.plugins.odt</artifactId>
+ <version>0.7.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>org.eclipse.papyrus.model2doc.odt.emf.template2pdf</artifactId>
+ <version>0.8.0-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+
+</project>
diff --git a/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/src/org/eclipse/papyrus/model2doc/odt/emf/template2pdf/Activator.java b/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/src/org/eclipse/papyrus/model2doc/odt/emf/template2pdf/Activator.java
new file mode 100755
index 0000000..b586046
--- /dev/null
+++ b/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/src/org/eclipse/papyrus/model2doc/odt/emf/template2pdf/Activator.java
@@ -0,0 +1,47 @@
+package org.eclipse.papyrus.model2doc.odt.emf.template2pdf;
+
+import org.eclipse.papyrus.infra.core.log.LogHelper;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.papyrus.model2doc.odt.emf.template2pdf"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ public static LogHelper log;
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ log = new LogHelper(this);
+ }
+
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/src/org/eclipse/papyrus/model2doc/odt/emf/template2pdf/internal/handler/GenerateStructureDocumentAndPDFHandler.java b/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/src/org/eclipse/papyrus/model2doc/odt/emf/template2pdf/internal/handler/GenerateStructureDocumentAndPDFHandler.java
new file mode 100755
index 0000000..f01e53c
--- /dev/null
+++ b/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/src/org/eclipse/papyrus/model2doc/odt/emf/template2pdf/internal/handler/GenerateStructureDocumentAndPDFHandler.java
@@ -0,0 +1,117 @@
+/*****************************************************************************
+ * Copyright (c) 2020 CEA LIST and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.model2doc.odt.emf.template2pdf.internal.handler;
+
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.expressions.IEvaluationContext;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExecutableExtension;
+import org.eclipse.papyrus.model2doc.emf.template2document.internal.handler.GenerateStructureAndDocumentHandler;
+import org.eclipse.papyrus.model2doc.odt.emf.template2pdf.Activator;
+import org.eclipse.papyrus.model2doc.odt.emf.template2pdf.internal.menu.Template2PDFMenuConstants;
+import org.eclipse.papyrus.model2doc.odt.internal.pdf.PDFExporter;
+import org.eclipse.papyrus.model2doc.odt.internal.pdf.PDFVersion;
+
+/**
+ * This handler allows to generate the document structure and the final document
+ * in one step
+ */
+public class GenerateStructureDocumentAndPDFHandler extends GenerateStructureAndDocumentHandler
+ implements IExecutableExtension {
+
+ /**
+ * handler parameter ID to get the PDF version (defined in the plugin.xml and
+ * initialized by Eclipse with {@link #setInitializationData(IConfigurationElement, String, Object)})
+ */
+ private static final String HANDLER_PARAMETER_ID = "org.eclipse.papyrus.model2doc.odt.emf.template2pdf.pdfVersion"; //$NON-NLS-1$
+
+ /**
+ * the version of the pdf to use for the export
+ */
+ private PDFVersion pdfVersion = PDFVersion.PDF_DEFAULT;
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+ * @return the path of the generated file
+ */
+ @Override
+ public Object execute(final ExecutionEvent event) throws ExecutionException {
+ final Object result = super.execute(event);
+ if (result instanceof String) {
+ String generatedDocumentPath = (String) result;
+ PDFExporter exporter = new PDFExporter();
+ exporter.setPDFVersion(this.pdfVersion);
+ exporter.setOpenEndDialog(true);
+ try {
+ return exporter.exportToPDF(generatedDocumentPath);
+ } catch (Exception e) {
+ Activator.log.error(e);
+ }
+ }
+ return null;
+ }
+
+ /**
+ *
+ * @param evaluationContext
+ * @return
+ */
+ @Override
+ protected boolean computeEnable(Object evaluationContext) {
+ boolean enable = super.computeEnable(evaluationContext);
+ if (evaluationContext instanceof IEvaluationContext) {
+ final IEvaluationContext iEvaluationContext = (IEvaluationContext) evaluationContext;
+ iEvaluationContext.addVariable(Template2PDFMenuConstants.VARIABLE_PDF_VERSION_MENU_LABEL, this.pdfVersion.getName());
+ }
+ return enable;
+ }
+
+ /**
+ *
+ * @param labels
+ * @return
+ */
+ @Override
+ protected String createMenuLabel(final List<String> labels) {
+ labels.add(this.pdfVersion.getName());
+ return super.createMenuLabel(labels);
+ }
+
+ /**
+ * initialization of the pdf version to use for the export parameters for the
+ * handler is declared in the plugin.xml and this method is called by Eclipse
+ * framework
+ */
+ @Override
+ public void setInitializationData(final IConfigurationElement config, final String propertyName, final Object data)
+ throws CoreException {
+ if (data instanceof Map<?, ?> && HANDLER_PARAMETER_ID != null) {
+ this.pdfVersion = PDFVersion.getPDFVersionByString((String) ((Map<?, ?>) data).get(HANDLER_PARAMETER_ID));
+ }
+ if (this.pdfVersion == null) {
+ // should not be possible
+ this.pdfVersion = PDFVersion.PDF_DEFAULT;
+ }
+ }
+
+}
diff --git a/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/src/org/eclipse/papyrus/model2doc/odt/emf/template2pdf/internal/menu/Template2PDFMenuConstants.java b/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/src/org/eclipse/papyrus/model2doc/odt/emf/template2pdf/internal/menu/Template2PDFMenuConstants.java
new file mode 100755
index 0000000..b45b8b3
--- /dev/null
+++ b/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/src/org/eclipse/papyrus/model2doc/odt/emf/template2pdf/internal/menu/Template2PDFMenuConstants.java
@@ -0,0 +1,51 @@
+/*****************************************************************************
+ * Copyright (c) 2020 CEA LIST and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.model2doc.odt.emf.template2pdf.internal.menu;
+
+/**
+ * The constants used in the menus
+ */
+public final class Template2PDFMenuConstants {
+
+ private Template2PDFMenuConstants() {
+ // to prevent instantication
+ }
+
+ /**
+ * the command's id for document generation
+ */
+ public static final String GENERATE_STRUCTURE_DOCUMENT_AND_PDF_COMMAND = "org.eclipse.papyrus.model2doc.odt.emf.template2pdf.generateStructure_Document_PDF"; //$NON-NLS-1$
+
+ /**
+ * the command's id for document generation
+ */
+ public static final String GENERATE_STRUCTURE_DOCUMENT_AND_PDF_A1B_COMMAND = "org.eclipse.papyrus.model2doc.odt.emf.template2pdf.generateStructure_Document_PDF_A1B"; //$NON-NLS-1$
+
+ /**
+ * the command's id for document generation
+ */
+ public static final String GENERATE_STRUCTURE_DOCUMENT_AND_PDF_A2B_COMMAND = "org.eclipse.papyrus.model2doc.odt.emf.template2pdf.generateStructure_Document_PDF_A2B"; //$NON-NLS-1$
+
+ /**
+ * the variable's name used to get the pdf version in the menu label
+ */
+ public static final String VARIABLE_PDF_VERSION_MENU_LABEL = "pdfVersionMenuLabelId"; //$NON-NLS-1$
+
+ /**
+ * The PDF string
+ */
+ public static final String PDF = "PDF";//$NON-NLS-1$
+}
diff --git a/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/src/org/eclipse/papyrus/model2doc/odt/emf/template2pdf/internal/menu/Template2PDFMenuContributionItem.java b/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/src/org/eclipse/papyrus/model2doc/odt/emf/template2pdf/internal/menu/Template2PDFMenuContributionItem.java
new file mode 100755
index 0000000..538f3f6
--- /dev/null
+++ b/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/src/org/eclipse/papyrus/model2doc/odt/emf/template2pdf/internal/menu/Template2PDFMenuContributionItem.java
@@ -0,0 +1,168 @@
+/*****************************************************************************
+ * Copyright (c) 2020 CEA LIST and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.model2doc.odt.emf.template2pdf.internal.menu;
+
+import java.util.Collections;
+
+import org.eclipse.core.commands.Command;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.e4.core.contexts.IEclipseContext;
+import org.eclipse.jface.action.ContributionItem;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.papyrus.model2doc.emf.template2document.internal.menu.Template2DocumentMenuConstants;
+import org.eclipse.papyrus.model2doc.odt.emf.template2pdf.Activator;
+import org.eclipse.papyrus.model2doc.odt.emf.template2pdf.internal.messages.Messages;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.commands.ICommandService;
+
+
+public class Template2PDFMenuContributionItem extends ContributionItem {
+
+ /**
+ *
+ * Constructor.
+ *
+ */
+ public Template2PDFMenuContributionItem() {
+ // nothing to do
+ }
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param id
+ */
+ public Template2PDFMenuContributionItem(final String id) {
+ super(id);
+ // nothing to do
+ }
+
+ /**
+ *
+ * @see org.eclipse.jface.action.ContributionItem#fill(org.eclipse.swt.widgets.Menu, int)
+ *
+ * @param menu
+ * @param index
+ */
+ @Override
+ public void fill(Menu menu, int index) {
+ createMenuItem(Template2PDFMenuConstants.GENERATE_STRUCTURE_DOCUMENT_AND_PDF_COMMAND, menu, 0);
+ createMenuItem(Template2PDFMenuConstants.GENERATE_STRUCTURE_DOCUMENT_AND_PDF_A1B_COMMAND, menu, 1);
+ createMenuItem(Template2PDFMenuConstants.GENERATE_STRUCTURE_DOCUMENT_AND_PDF_A2B_COMMAND, menu, 2);
+ }
+
+ /**
+ *
+ * @param commandId
+ * the id of the command for which we create a menu item
+ * @param menu
+ * the menu owning the created item
+ * @param index
+ * the index of the item to create
+ */
+ protected void createMenuItem(final String commandId, final Menu menu, final int index) {
+ // 1. look for the IEclipseContext
+ final IEclipseContext ctx = getEclipseContext();
+
+ // 2. find the command service
+ final ICommandService serv = getCommandService();
+
+ // 3. find the command
+ final Command command = serv.getCommand(commandId);
+
+ // 4. get the eclipse handler for this command
+ final IHandler handler = command.getHandler();
+
+ // 5. reset the menu label parameter (to be sure to detect its erasure)
+ // the call command.isEnabled() will edit this parameter
+ ctx.set(Template2DocumentMenuConstants.VARIABLE_GENERATOR_MENU_LABEL, Template2DocumentMenuConstants.NO_GENERATOR_ID);
+
+ if (command.isEnabled()) {// required to call setEnable and defining the label of the menu to propose
+ final String res = (String) ctx.get(Template2DocumentMenuConstants.VARIABLE_GENERATOR_MENU_LABEL);
+ String pdfVersion = (String) ctx.get(Template2PDFMenuConstants.VARIABLE_PDF_VERSION_MENU_LABEL);
+ if (pdfVersion == null || pdfVersion.isEmpty()) {
+ pdfVersion = Template2PDFMenuConstants.PDF;
+ }
+
+ final MenuItem item = new MenuItem(menu, SWT.PUSH, index);
+
+ final String menuName;
+ if (res != null && !res.isEmpty() && !res.equals(Template2DocumentMenuConstants.NO_GENERATOR_ID)) {
+ menuName = NLS.bind(Messages.Template2PDFMenuContributionItem_GenerateAllWith2Parameters, pdfVersion, res);
+ } else {
+ menuName = NLS.bind(Messages.Template2PDFMenuContributionItem_GenerateAllWithOneParameter, pdfVersion);
+ }
+
+ item.setText(menuName);
+ item.addSelectionListener(new SelectionListener() {
+
+ @Override
+ public void widgetSelected(SelectionEvent arg0) {
+ try {
+ handler.execute(new ExecutionEvent(command, Collections.emptyMap(), null, null));
+ } catch (ExecutionException e) {
+ Activator.log.error(e);
+ }
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent arg0) {
+ // nothing to do
+ }
+ });
+ }
+ }
+
+ /**
+ *
+ * @return the EclipseContext or <code>null</code> if not found
+ */
+ private IEclipseContext getEclipseContext() {
+ final IWorkbench workbench = getWorkbench();
+ if (workbench != null) {
+ return workbench.getService(IEclipseContext.class);
+ }
+ return null;
+ }
+
+ /**
+ *
+ * @return the current {@link IWorkbench} or <code>null</code> if not found
+ */
+ private IWorkbench getWorkbench() {
+ return PlatformUI.getWorkbench();
+ }
+
+ /**
+ *
+ * @return the current {@link ICommandService} or <code>null</code> if not found
+ */
+ private ICommandService getCommandService() {
+ final IWorkbench workbench = getWorkbench();
+ if (workbench != null) {
+ return workbench.getService(ICommandService.class);
+ }
+ return null;
+ }
+}
diff --git a/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/src/org/eclipse/papyrus/model2doc/odt/emf/template2pdf/internal/messages/Messages.java b/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/src/org/eclipse/papyrus/model2doc/odt/emf/template2pdf/internal/messages/Messages.java
new file mode 100755
index 0000000..94d2b08
--- /dev/null
+++ b/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/src/org/eclipse/papyrus/model2doc/odt/emf/template2pdf/internal/messages/Messages.java
@@ -0,0 +1,31 @@
+/*****************************************************************************
+ * Copyright (c) 2020 CEA LIST and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.model2doc.odt.emf.template2pdf.internal.messages;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.papyrus.model2doc.odt.emf.template2pdf.internal.messages.messages"; //$NON-NLS-1$
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+
+ public static String Template2PDFMenuContributionItem_GenerateAllWith2Parameters;
+ public static String Template2PDFMenuContributionItem_GenerateAllWithOneParameter;
+}
diff --git a/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/src/org/eclipse/papyrus/model2doc/odt/emf/template2pdf/internal/messages/messages.properties b/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/src/org/eclipse/papyrus/model2doc/odt/emf/template2pdf/internal/messages/messages.properties
new file mode 100755
index 0000000..1fe4324
--- /dev/null
+++ b/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/src/org/eclipse/papyrus/model2doc/odt/emf/template2pdf/internal/messages/messages.properties
@@ -0,0 +1,2 @@
+Template2PDFMenuContributionItem_GenerateAllWith2Parameters=Generate All + {0} ({1})
+Template2PDFMenuContributionItem_GenerateAllWithOneParameter=Generate All + {0}
diff --git a/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/usecases.md b/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/usecases.md
new file mode 100755
index 0000000..a563105
--- /dev/null
+++ b/plugins/odt/org.eclipse.papyrus.model2doc.odt.emf.template2pdf/usecases.md
@@ -0,0 +1,2 @@
+#plugin org.eclipse.papyrus.model2doc.odt.emf.template2pdf
+* the user must be able to generate a pdf in one click from a DocumentStructureTemplate
\ No newline at end of file
diff --git a/plugins/odt/org.eclipse.papyrus.model2doc.odt/META-INF/MANIFEST.MF b/plugins/odt/org.eclipse.papyrus.model2doc.odt/META-INF/MANIFEST.MF
index 9c15d22..c19ee89 100755
--- a/plugins/odt/org.eclipse.papyrus.model2doc.odt/META-INF/MANIFEST.MF
+++ b/plugins/odt/org.eclipse.papyrus.model2doc.odt/META-INF/MANIFEST.MF
@@ -31,6 +31,7 @@
org.eclipse.papyrus.model2doc.odt.internal.editor;x-internal:=true,
org.eclipse.papyrus.model2doc.odt.internal.listener;x-internal:=true,
org.eclipse.papyrus.model2doc.odt.internal.onefile;x-internal:=true,
+ org.eclipse.papyrus.model2doc.odt.internal.pdf,
org.eclipse.papyrus.model2doc.odt.internal.service;x-internal:=true,
org.eclipse.papyrus.model2doc.odt.internal.transcription;x-internal:=true,
org.eclipse.papyrus.model2doc.odt.internal.util;x-internal:=true,
diff --git a/plugins/odt/org.eclipse.papyrus.model2doc.odt/src/org/eclipse/papyrus/model2doc/odt/internal/editor/ODTEditor.java b/plugins/odt/org.eclipse.papyrus.model2doc.odt/src/org/eclipse/papyrus/model2doc/odt/internal/editor/ODTEditor.java
index d71b606..b56946d 100755
--- a/plugins/odt/org.eclipse.papyrus.model2doc.odt/src/org/eclipse/papyrus/model2doc/odt/internal/editor/ODTEditor.java
+++ b/plugins/odt/org.eclipse.papyrus.model2doc.odt/src/org/eclipse/papyrus/model2doc/odt/internal/editor/ODTEditor.java
@@ -22,6 +22,7 @@
import org.eclipse.papyrus.model2doc.odt.internal.message.Messages;
import org.eclipse.papyrus.model2doc.odt.internal.util.ExtensionConstants;
import org.eclipse.papyrus.model2doc.odt.internal.util.LibreOfficeInstallationPathUtil;
+import org.eclipse.papyrus.model2doc.odt.internal.util.ODTFileIOUtil;
import org.eclipse.papyrus.model2doc.odt.service.ODTEditorService;
import org.eclipse.papyrus.model2doc.odt.service.ODTFileIOService;
import org.eclipse.papyrus.model2doc.odt.service.ODTFileIOServiceImpl;
@@ -63,12 +64,14 @@
*/
public class ODTEditor {
- private static final String LIBREOFFICE_FILE_PREFIX = "file:///"; //$NON-NLS-1$
+ public static final String LIBREOFFICE_FILE_PREFIX = "file:///"; //$NON-NLS-1$
private static final String STANDART_FILE_PREFIX = "file:/";//$NON-NLS-1$
private static final String ODT_FILE_EXTENSION = "odt"; //$NON-NLS-1$
+ public static final String LIBREOFFICE_FILE_SEPARATOR = "/"; //$NON-NLS-1$
+
private XComponentLoader officeLoader = null;
private XTextDocument xTextDocument = null;
private XDesktop xDesktop = null;
@@ -85,6 +88,12 @@
private ODTFileIOService fileIOService = null;
+ public ODTEditor() {
+ fileIOService = new ODTFileIOServiceImpl();
+ // Take LibreOffice Loader
+ loadOffice();
+ }
+
/**
* Constructor.
*
@@ -92,10 +101,9 @@
*
* @param generatorConfig
*/
+ @Deprecated
public ODTEditor(String projectFolder) {
- fileIOService = new ODTFileIOServiceImpl();
- // Take LibreOffice Loader
- loadOffice();
+ this();
}
/**
@@ -224,9 +232,9 @@
*
* @param fileName
*/
- public void save(String fileName) {
+ public String save(String fileName) {
// Save document
- saveAs(fileName, ODTEditorService.DOCUMENT_KIND); // $NON-NLS-1$
+ return saveAs(fileName, ODTEditorService.DOCUMENT_KIND); // $NON-NLS-1$
}
/**
@@ -272,6 +280,44 @@
}
/**
+ *
+ * @param inputFileURI
+ * the input file URI
+ * @param outputFileURI
+ * the output file URI
+ * @param storeProperties
+ * the configuration of the save represented by this array of {@link PropertyValue}
+ * @return
+ * the output file URI, or {@link NullPointerException} when it fails
+ * @throws Exception
+ */
+ public String saveAs(String inputFileURI, String outputFileURI, final PropertyValue[] storeProperties) throws Exception {
+ inputFileURI = convertToLibreOfficeFileURI(inputFileURI);
+ if (!inputFileURI.startsWith(ODTFileIOUtil.ODT_FILE_PREFIX)) {
+ throw new Exception("The fileURI is not conform to the expected one"); //$NON-NLS-1$
+ }
+ outputFileURI = convertToLibreOfficeFileURI(outputFileURI);
+ if (!outputFileURI.startsWith(ODTFileIOUtil.ODT_FILE_PREFIX)) {
+ throw new Exception("The fileURI is not conform to the expected one"); //$NON-NLS-1$
+ }
+ XComponent xComponent = getDocument(inputFileURI);
+ if (xComponent != null) {
+ this.xTextDocument = UnoRuntime.queryInterface(XTextDocument.class, xComponent);
+
+ XStorable store = UnoRuntime.queryInterface(XStorable.class, xTextDocument);
+
+ try {
+ store.storeToURL(outputFileURI, storeProperties);
+ Activator.log.info("Saving document: " + outputFileURI);//$NON-NLS-1$
+ return outputFileURI;
+ } catch (com.sun.star.io.IOException e) {
+ Activator.log.error(outputFileURI + " have not been saved: ", e); //$NON-NLS-1$
+ }
+ }
+ return null;
+ }
+
+ /**
* Get format by extension.
*
* @param extention
@@ -522,22 +568,23 @@
*
* @return
* the full URL of exported document (LibreOffice format, ex.: file:///C:/folder/projectName/document.pdf)
+ * TODO : improve me, to return a java file or URI?!
*/
private String saveDocument(String fileName, String extension) {
XStorable store = UnoRuntime.queryInterface(XStorable.class, xTextDocument);
- final String saveFileURL = convertToLibreOfficeFileURI(GeneratorConfigurationOperations.getDocumentFileLocalPath(configuration, ODT_FILE_EXTENSION));
+ final String saveFileURL = convertToLibreOfficeFileURI(GeneratorConfigurationOperations.getDocumentFileLocalPath(configuration, extension));
if (saveFileURL == null) {// not possible with the current implementation
return null;
}
PropertyValue[] storeProps = new PropertyValue[2];
storeProps[0] = new PropertyValue();
- storeProps[0].Name = "Overwrite"; //$NON-NLS-1$
+ storeProps[0].Name = StorePropertiesConstants.OVERWRITE;
storeProps[0].Value = true;
storeProps[1] = new PropertyValue();
- storeProps[1].Name = "FilterName"; //$NON-NLS-1$
+ storeProps[1].Name = StorePropertiesConstants.FILTER_NAME;
storeProps[1].Value = getFormat(extension);
try {
@@ -600,12 +647,20 @@
* @return
* a file url starting with file:///
*/
- private static final String convertToLibreOfficeFileURI(final String fileURL) {
- String newFileURL = fileURL;
- if (fileURL.startsWith(STANDART_FILE_PREFIX) && false == newFileURL.startsWith(LIBREOFFICE_FILE_PREFIX)) {
- newFileURL = newFileURL.replaceFirst(STANDART_FILE_PREFIX, LIBREOFFICE_FILE_PREFIX);
+ public static final String convertToLibreOfficeFileURI(final String fileURI) {
+ String newFileURI = fileURI;
+ if (fileURI.startsWith(STANDART_FILE_PREFIX) && false == newFileURI.startsWith(LIBREOFFICE_FILE_PREFIX)) {
+ newFileURI = newFileURI.replaceFirst(STANDART_FILE_PREFIX, LIBREOFFICE_FILE_PREFIX);
}
- return newFileURL;
+ return newFileURI;
+ }
+
+ public static final String convertToGenericFileURI(final String fileURI) {
+ String newFileURI = fileURI;
+ if (newFileURI.startsWith(LIBREOFFICE_FILE_PREFIX)) {
+ newFileURI = newFileURI.replaceFirst(LIBREOFFICE_FILE_PREFIX, STANDART_FILE_PREFIX);
+ }
+ return newFileURI;
}
/**
diff --git a/plugins/odt/org.eclipse.papyrus.model2doc.odt/src/org/eclipse/papyrus/model2doc/odt/internal/editor/ODTFilterName.java b/plugins/odt/org.eclipse.papyrus.model2doc.odt/src/org/eclipse/papyrus/model2doc/odt/internal/editor/ODTFilterName.java
new file mode 100755
index 0000000..176b0ee
--- /dev/null
+++ b/plugins/odt/org.eclipse.papyrus.model2doc.odt/src/org/eclipse/papyrus/model2doc/odt/internal/editor/ODTFilterName.java
@@ -0,0 +1,58 @@
+/*****************************************************************************
+ * Copyright (c) 2020 CEA LIST and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.model2doc.odt.internal.editor;
+
+/**
+ * Enumeration values for the {@link StorePropertiesConstants#FILTER_NAME}
+ *
+ * it exists many more possibilities than these provided here
+ */
+public enum ODTFilterName {
+
+ WRITER8("writer8"),
+
+ WRITER_PDF_EXPORT("writer_pdf_Export");
+
+
+ /**
+ * the name of the file
+ */
+ private String filterName;
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param name
+ * the name of the PDF version
+ * @param code
+ * the code to use to get the expected PDF format during the export
+ */
+ private ODTFilterName(final String name) {
+ this.filterName = name;
+ }
+
+
+ /**
+ *
+ * @return
+ * the name of the PDF version
+ */
+ public String getFilterName() {
+ return this.filterName;
+ }
+
+}
diff --git a/plugins/odt/org.eclipse.papyrus.model2doc.odt/src/org/eclipse/papyrus/model2doc/odt/internal/editor/StorePropertiesConstants.java b/plugins/odt/org.eclipse.papyrus.model2doc.odt/src/org/eclipse/papyrus/model2doc/odt/internal/editor/StorePropertiesConstants.java
new file mode 100755
index 0000000..020710d
--- /dev/null
+++ b/plugins/odt/org.eclipse.papyrus.model2doc.odt/src/org/eclipse/papyrus/model2doc/odt/internal/editor/StorePropertiesConstants.java
@@ -0,0 +1,53 @@
+/*****************************************************************************
+ * Copyright (c) 2020 CEA LIST and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.model2doc.odt.internal.editor;
+
+import com.sun.star.beans.PropertyValue;
+
+/**
+ * Name of properties ({@link PropertyValue}) used by the save action
+ */
+public final class StorePropertiesConstants {
+
+ /**
+ *
+ * Constructor.
+ *
+ */
+ private StorePropertiesConstants() {
+ // to prevent instanciation
+ }
+
+ /**
+ * Constant indicating if the save can overwrite or not an existing file
+ * (seem bugged setting it to false?!).
+ * The value type is {@link Boolean}
+ */
+ public static final String OVERWRITE = "Overwrite"; //$NON-NLS-1$
+
+ /**
+ * Constant indicating which method must be used to save the file
+ * The value type is a String (see {@link ODTFilterName})
+ */
+ public static final String FILTER_NAME = "FilterName"; //$NON-NLS-1$
+
+ /**
+ * Constant used to define parameters for the save, according to the save type (output file extension)
+ * The value type is an array of {@link PropertyValue}
+ */
+ public static final String FILTER_DATA = "FilterData"; //$NON-NLS-1$
+
+}
diff --git a/plugins/odt/org.eclipse.papyrus.model2doc.odt/src/org/eclipse/papyrus/model2doc/odt/internal/message/Messages.java b/plugins/odt/org.eclipse.papyrus.model2doc.odt/src/org/eclipse/papyrus/model2doc/odt/internal/message/Messages.java
index 2466dfe..1ae2d13 100755
--- a/plugins/odt/org.eclipse.papyrus.model2doc.odt/src/org/eclipse/papyrus/model2doc/odt/internal/message/Messages.java
+++ b/plugins/odt/org.eclipse.papyrus.model2doc.odt/src/org/eclipse/papyrus/model2doc/odt/internal/message/Messages.java
@@ -31,6 +31,10 @@
public static String ODTEditor_SendMail;
public static String ODTEditor_MailClientWasNotFound;
+
+ public static String PDFExporter_GeneratePDF;
+
+ public static String PDFExporter_PDFHasBeenGenerated;
static {
// initialize resource bundle
diff --git a/plugins/odt/org.eclipse.papyrus.model2doc.odt/src/org/eclipse/papyrus/model2doc/odt/internal/message/messages.properties b/plugins/odt/org.eclipse.papyrus.model2doc.odt/src/org/eclipse/papyrus/model2doc/odt/internal/message/messages.properties
index 18c9947..2443fbb 100755
--- a/plugins/odt/org.eclipse.papyrus.model2doc.odt/src/org/eclipse/papyrus/model2doc/odt/internal/message/messages.properties
+++ b/plugins/odt/org.eclipse.papyrus.model2doc.odt/src/org/eclipse/papyrus/model2doc/odt/internal/message/messages.properties
@@ -1,4 +1,6 @@
ODTEditor_LibreOfficeDocumentGenerator_ErrorMessage=The document creation failed. We propose you 2 solutions:\n - The LibreOffice installation path is wrong. you can change it relaunching a generation.\n - LibreOffice 6 is not installed.
ODTEditor_LibreOfficeDocumentGenerator_ErrorTitle=LibreOffice document generator
ODTEditor_SendMail=Send Mail
-ODTEditor_MailClientWasNotFound=Mail Client was not found.
\ No newline at end of file
+ODTEditor_MailClientWasNotFound=Mail Client was not found.
+PDFExporter_GeneratePDF=Generate PDF
+PDFExporter_PDFHasBeenGenerated=The pdf has been generated in {0}
diff --git a/plugins/odt/org.eclipse.papyrus.model2doc.odt/src/org/eclipse/papyrus/model2doc/odt/internal/pdf/PDFExporter.java b/plugins/odt/org.eclipse.papyrus.model2doc.odt/src/org/eclipse/papyrus/model2doc/odt/internal/pdf/PDFExporter.java
new file mode 100755
index 0000000..a818064
--- /dev/null
+++ b/plugins/odt/org.eclipse.papyrus.model2doc.odt/src/org/eclipse/papyrus/model2doc/odt/internal/pdf/PDFExporter.java
@@ -0,0 +1,203 @@
+/*****************************************************************************
+ * Copyright (c) 2020 CEA LIST and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.model2doc.odt.internal.pdf;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.papyrus.model2doc.odt.Activator;
+import org.eclipse.papyrus.model2doc.odt.internal.editor.ODTFilterName;
+import org.eclipse.papyrus.model2doc.odt.internal.editor.ODTEditor;
+import org.eclipse.papyrus.model2doc.odt.internal.editor.StorePropertiesConstants;
+import org.eclipse.papyrus.model2doc.odt.internal.message.Messages;
+import org.eclipse.swt.widgets.Display;
+
+import com.sun.star.beans.PropertyValue;
+
+/**
+ * look https://forum.openoffice.org/en/forum/viewtopic.php?f=44&t=1804&start=0 for more example about the export to PDF
+ */
+public final class PDFExporter {
+
+ /**
+ * the pdf version to use to do the save
+ */
+ private PDFVersion pdfVersion = PDFVersion.PDF_DEFAULT;
+
+ /**
+ * boolean indicating if we must override an existing file during the save or not
+ */
+ private boolean overwrite = true;
+
+ private static final String DOT = "."; //$NON-NLS-1$
+
+ private static final String PDF_EXTENSION = "pdf"; //$NON-NLS-1$
+
+ private boolean openEndDialog = false;
+
+ /**
+ *
+ * Constructor.
+ *
+ */
+ public PDFExporter() {
+ // nothing to do
+ }
+
+ /**
+ *
+ * @param inputFileURI
+ * the uri of the file to export. The uri must starts with file:/// or file:/
+ * @return
+ * the uri of the generated file or <code>null</code>. The returned URI will start with file:///
+ * @throws Exception
+ */
+ public String exportToPDF(final String inputFileURI) throws Exception {
+ int lastDot = inputFileURI.lastIndexOf(DOT);
+ final String filePathWithoutExtension = inputFileURI.substring(0, lastDot);
+ final StringBuilder outputFilePathBuilder = new StringBuilder(filePathWithoutExtension);
+ outputFilePathBuilder.append(DOT);
+ outputFilePathBuilder.append(PDF_EXTENSION);
+
+ return saveFile(inputFileURI, outputFilePathBuilder.toString());
+ }
+
+ /**
+ *
+ * @param inputFileURI
+ * @param outputFolderURI
+ * @return
+ */
+ public String exportToPDF(final String inputFileURI, final String outputFolderURI) throws Exception {
+ final int lastSeparator = inputFileURI.lastIndexOf(ODTEditor.LIBREOFFICE_FILE_SEPARATOR);
+ final String outputFileName = inputFileURI.substring(lastSeparator + 1, inputFileURI.lastIndexOf(DOT));
+ final StringBuffer outputFilePathBuilder = new StringBuffer(outputFolderURI);
+ if (!outputFolderURI.endsWith(ODTEditor.LIBREOFFICE_FILE_SEPARATOR)) {
+ outputFilePathBuilder.append(ODTEditor.LIBREOFFICE_FILE_SEPARATOR);
+ }
+ outputFilePathBuilder.append(outputFileName);
+ outputFilePathBuilder.append(DOT);
+ outputFilePathBuilder.append(PDF_EXTENSION);
+
+ return saveFile(inputFileURI, outputFilePathBuilder.toString());
+ }
+
+
+
+ public String exportToPDF(final String inputFileURI, final String outputFolderURI, final String outputFileName) throws Exception {
+ if (outputFileName.contains(DOT)) {
+ throw new Exception("The fileURI is not conform to the expected one"); //$NON-NLS-1$
+ }
+ final StringBuffer outputFilePathBuilder = new StringBuffer(outputFolderURI);
+ if (!outputFolderURI.endsWith(ODTEditor.LIBREOFFICE_FILE_SEPARATOR)) {
+ outputFilePathBuilder.append(ODTEditor.LIBREOFFICE_FILE_SEPARATOR);
+ }
+ outputFilePathBuilder.append(outputFileName);
+ outputFilePathBuilder.append(DOT);
+ outputFilePathBuilder.append(PDF_EXTENSION);
+
+ return saveFile(inputFileURI, outputFilePathBuilder.toString());
+
+ }
+
+ protected final String saveFile(final String inputFileURI, final String outputFileURI) {
+ final ODTEditor odtEditor = new ODTEditor();
+ final PropertyValue[] storeProperties = createStoreProperties();
+ String savedFilePath = null;
+ try {
+ savedFilePath = odtEditor.saveAs(inputFileURI, outputFileURI, storeProperties);
+ if (this.openEndDialog) {
+ openEndDialog(savedFilePath.replaceAll(ODTEditor.LIBREOFFICE_FILE_PREFIX, "")); //$NON-NLS-1$
+ }
+ return savedFilePath;
+ } catch (Exception e) {
+ Activator.log.error(e);
+ }
+ return null;
+ }
+
+ private void openEndDialog(final String generatedFilePath) {
+ MessageDialog.openInformation(Display.getDefault().getActiveShell(), Messages.PDFExporter_GeneratePDF, NLS.bind(Messages.PDFExporter_PDFHasBeenGenerated, generatedFilePath));
+ }
+
+
+ /**
+ * @param pdfVersion
+ * the pdfVersion to set
+ */
+ public void setPDFVersion(PDFVersion pdfVersion) {
+ this.pdfVersion = pdfVersion;
+ }
+
+ /**
+ * @param overwrite
+ * the overwrite to set
+ */
+ public void setOverwrite(boolean overwrite) {
+ this.overwrite = overwrite;
+ }
+
+ /**
+ * @param openEndDialog
+ * the openEndDialog to set
+ */
+ public void setOpenEndDialog(boolean openEndDialog) {
+ this.openEndDialog = openEndDialog;
+ }
+
+ private final PropertyValue[] createStoreProperties() {
+ final List<PropertyValue> values = doCreateStoreProperties();
+ return values.toArray(new PropertyValue[values.size()]);
+ }
+
+ protected List<PropertyValue> doCreateStoreProperties() {
+ final List<PropertyValue> values = new ArrayList<>();
+ PropertyValue storeProps = new PropertyValue();
+ values.add(storeProps);
+ storeProps = new PropertyValue();
+ storeProps.Name = StorePropertiesConstants.OVERWRITE;
+ storeProps.Value = this.overwrite;
+
+ storeProps = new PropertyValue();
+ values.add(storeProps);
+ storeProps.Name = StorePropertiesConstants.FILTER_NAME; // $NON-NLS-1$
+ storeProps.Value = ODTFilterName.WRITER_PDF_EXPORT.getFilterName();
+
+ storeProps = new PropertyValue();
+ values.add(storeProps);
+ storeProps.Name = StorePropertiesConstants.FILTER_DATA;
+ storeProps.Value = createFilterData();
+ return values;
+ }
+
+ private final PropertyValue[] createFilterData() {
+ final List<PropertyValue> values = doCreateFilterData();
+ return values.toArray(new PropertyValue[values.size()]);
+ }
+
+ protected List<PropertyValue> doCreateFilterData() {
+ final List<PropertyValue> values = new ArrayList<>();
+ PropertyValue storeProps = new PropertyValue();
+ values.add(storeProps);
+ storeProps.Name = PDFFilterDataConstants.SELECT_PDF_VERSION;
+ storeProps.Value = this.pdfVersion.getCode();
+ return values;
+ }
+
+
+}
diff --git a/plugins/odt/org.eclipse.papyrus.model2doc.odt/src/org/eclipse/papyrus/model2doc/odt/internal/pdf/PDFFilterDataConstants.java b/plugins/odt/org.eclipse.papyrus.model2doc.odt/src/org/eclipse/papyrus/model2doc/odt/internal/pdf/PDFFilterDataConstants.java
new file mode 100755
index 0000000..4d2cb9a
--- /dev/null
+++ b/plugins/odt/org.eclipse.papyrus.model2doc.odt/src/org/eclipse/papyrus/model2doc/odt/internal/pdf/PDFFilterDataConstants.java
@@ -0,0 +1,33 @@
+/*****************************************************************************
+ * Copyright (c) 2020 CEA LIST and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.model2doc.odt.internal.pdf;
+
+/**
+ * Constants for FilterData
+ * many more constants exist, more details on https://forum.openoffice.org/en/forum/viewtopic.php?f=44&t=1804&start=0
+ */
+public final class PDFFilterDataConstants {
+
+ private PDFFilterDataConstants() {
+ // to prevent instantiation
+ }
+
+ /**
+ * value is an Integer (provided by {@link PDFVersion}
+ */
+ public static final String SELECT_PDF_VERSION = "SelectPdfVersion"; //$NON-NLS-1$
+
+}
diff --git a/plugins/odt/org.eclipse.papyrus.model2doc.odt/src/org/eclipse/papyrus/model2doc/odt/internal/pdf/PDFVersion.java b/plugins/odt/org.eclipse.papyrus.model2doc.odt/src/org/eclipse/papyrus/model2doc/odt/internal/pdf/PDFVersion.java
new file mode 100755
index 0000000..547559a
--- /dev/null
+++ b/plugins/odt/org.eclipse.papyrus.model2doc.odt/src/org/eclipse/papyrus/model2doc/odt/internal/pdf/PDFVersion.java
@@ -0,0 +1,95 @@
+/*****************************************************************************
+ * Copyright (c) 2020 CEA LIST and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.model2doc.odt.internal.pdf;
+
+/**
+ * This enumeration describes the PDF version available with the code to use in the PropertyValue
+ * for the PDF creation (associated to the key {@link PDFFilterDataConstants#SELECT_PDF_VERSION}
+ */
+public enum PDFVersion {
+
+ /**
+ * default case for LibreOffice, not idea about what is change really
+ */
+ PDF_DEFAULT("PDF", 0), //$NON-NLS-1$
+
+ /**
+ * PDF version A-1B
+ */
+ PDF_A_1B("PDF/A-1B", 1), //$NON-NLS-1$
+
+
+ /**
+ * PDF version A-2B
+ */
+ PDF_A_2B("PDF/A-2B", 2); //$NON-NLS-1$
+
+ /**
+ * the name of the PDF version
+ */
+ private String name;
+
+ /**
+ * the code to use to get the expected PDF format during the export
+ */
+ private Integer code;
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param name
+ * the name of the PDF version
+ * @param code
+ * the code to use to get the expected PDF format during the export
+ */
+ private PDFVersion(final String name, final int code) {
+ this.name = name;
+ this.code = Integer.valueOf(code);
+ }
+
+ /**
+ *
+ * @return
+ * the code to use to get the expected PDF format during the export
+ */
+ public Integer getCode() {
+ return this.code;
+ }
+
+ /**
+ *
+ * @return
+ * the name of the PDF version
+ */
+ public String getName() {
+ return this.name;
+ }
+
+ public static final PDFVersion getPDFVersionByString(final String str) {
+ switch (str) {
+ case "A-1B": //$NON-NLS-1$
+ return PDFVersion.PDF_A_1B;
+ case "A-2B": //$NON-NLS-1$
+ return PDFVersion.PDF_A_2B;
+ case "default": //$NON-NLS-1$
+ return PDF_DEFAULT;
+ default:
+ return null;
+ }
+ }
+
+}
diff --git a/plugins/odt/org.eclipse.papyrus.model2doc.odt/src/org/eclipse/papyrus/model2doc/odt/internal/transcription/ODTTranscription.java b/plugins/odt/org.eclipse.papyrus.model2doc.odt/src/org/eclipse/papyrus/model2doc/odt/internal/transcription/ODTTranscription.java
index 5d0454c..75db94a 100755
--- a/plugins/odt/org.eclipse.papyrus.model2doc.odt/src/org/eclipse/papyrus/model2doc/odt/internal/transcription/ODTTranscription.java
+++ b/plugins/odt/org.eclipse.papyrus.model2doc.odt/src/org/eclipse/papyrus/model2doc/odt/internal/transcription/ODTTranscription.java
@@ -302,13 +302,12 @@
}
@Override
- public void save(String label) {
-
+ public String save(String label) {
String documentName = odtGeneratorConfig.getDocumentName();
if ((documentName != null) && (!documentName.isEmpty())) {
- odtEditor.save(documentName);
+ return odtEditor.save(documentName);
} else {
- odtEditor.save(label);
+ return odtEditor.save(label);
}
}
diff --git a/plugins/odt/pom.xml b/plugins/odt/pom.xml
index cf61b9b..2754b7a 100755
--- a/plugins/odt/pom.xml
+++ b/plugins/odt/pom.xml
@@ -21,7 +21,9 @@
<module>org.eclipse.papyrus.model2doc.odt</module>
<module>org.eclipse.papyrus.model2doc.odt.architecture</module>
<module>org.eclipse.papyrus.model2doc.odt.emf.structure2document</module>
+ <module>org.eclipse.papyrus.model2doc.odt.emf.template2pdf</module>
<module>org.eclipse.papyrus.model2doc.odt.lib</module>
<module>org.eclipse.papyrus.model2doc.odt.ui</module>
+
</modules>
</project>