Create, integrate and publish projects

Download pxDoc Reference Guide in PDF and pxDoc Leaflet

Create, publish and launch projects

pxDoc comes with several features to help the development and integration of your generators:

 

  • A wizard for project creation
  • A wizard to launch a document generation from an object
  • pxGen tool to re-generate pxDoc runtime UI (change menu label and directory mode) or to add the generator Feature and Repository (update-site creation...)

 

Project creation

Create a new pxDoc project by choosing File ? New ? Project… from the main menu.



Set a valid Eclipse project name for your pxDoc project.



Choose Next to get into your new pxDoc project details:

Set a valid java class name for your generator (here "HelloWorld").



In the Enablers management section, you may specify an enabler, e.g. a connector dedicated to the environment from where the generation is launched (UML tool, Modeling environment...).

Refer to our Community site to see the enablers available and get more information about them.

In the Styles Management section, select how you want to use styles (refer to the dedicated section to learn more about styles):

    • Use variable styles
    • Use a stylesheet already deployed in your workspace
    • Use a new stylesheet, that will be available for other projects in your workspace

If you did not setup your pxDoc preferences yet, the selection combo box will remain empty. The Dirs... button opens the Stylesheets directories Preferences page. Once your stylesheet directories are set, you will be able to select dotx files in the combo box.

 

The two parameters Header height et Footer height are used by pxDoc to calculate automatically the maximum size of images. As pxDoc does not use Microsoft Word at all, it cannot know the size of the header and footer while generating the document.

As simple example, we will use the default Enabler and the EMFExampleStylesheet stylesheet (deployed in the EMF generic generator that is always available in pxDoc).

Select Finish.

Your pxDoc project will first open with an empty pxDoc generator (.pxdoc file), and should look like the following screenshot:

And after a little while, the UI project is generated (by the pxGen tool)

Launching the generation

To test or launch your generator:

    1. select Debug As or Run As -> Eclipse Application.

In Debug mode, the modifications made to your generator are automatically taken into account, so you just need to re-launch the generation in the 2nd Eclipse to see the result.

  1. Import your source model, data... in this 2nd Eclipse
  2. To enable the pxDoc menu, right click on a relevant object of this source (according to the command object defined in the root template of your Generator).

The launching wizard will pop up, with two possible configurations:

  • If a stylesheet is specified in the Generator, you only have to specify the target filename (or directory)
  • If variable styles are used, you also need to select a stylesheet to bind the styles of your Generator

Refer to 5min tutorial and to the 15 min tutorial to get a better view on generation launching!

pxGen

pxDoc comes with the pxGen feature which aims to:

  • Generate an UI project which controls the pxDoc menu and launching wizard and includes the required enabler
  • Generate Feature and/or Repository projects which will allow to publish your generator (optional).

pxGen is driven by the .pxgen file, located just below the Generator(.pxdoc file). It is automatically launched when a project is created to:

  • create the UI project
  • import some dependencies and implement some concepts (Diagram, Description Provider) when an enabler is selected and its associated common libraries are included. In the project created in the previous section, only enable EclipseUI is specified.

Fine-tune the Eclipse UI

You can modify the menu item label (that will appear in the pxDoc menu)

You can also specify that you want to select a Directory and not a File as target for the generation: this is the case when a Generator produces several documents. To do so, add the following instruction: selectionMode = "directory" in the EclipseUI block.

Here is an example of an EclipseUI with an EMF enabler and Directory mode selected:

You need to right-click in the file and select Run As -> Generate pxGen Artefacts each time you modify the pxGen file

Generate Eclipse Feature and Repository to publish the Generator

To publish your Generator as a runtime (plugin, update site...) for your end user: add the enable EclipseFeature and enable EclipseUpdateSite.
If you specify them, press [CTRL]-[SHIFT]-O to add the required import to the pxGen file (you may need to do this twice).

Remember to right-click in the file and select Run As -> Generate pxGen Artefacts each time you modify the pxGen file