LSPS documentation logo
LSPS Documentation
Generating the LSPS Application

With LSPS repository installed, you can generate the LSPS Application

Before you generate or import an LSPS Application, make sure you have met the following requirements:

  • You have installed Maven.
  • You have added Maven to the classpath, for example:
    export M2_HOME="/Users/lsps/tools/apache-maven-3.6.3"
    export PATH=${PATH}:${M2_HOME}/bin
  • You have installed the lsps repo into the system repository (~/.m2/repository)
  • Your workspace has the M2_REPO classpath variable with the path to the LSPS Maven repository defined.

You can check the path to the LSPS Maven repository in <PDS_HOME>/tools/settings.xml. To create and set the M2_REPO variable, go to Window > Preferences; then Java > Build Path > Classpath Variables; click Add and define the M2_REPO variable.

msrepovar.png
M2_REPO variable set up
The Javadoc API documentation of the LSPS Application is available in the <PDS_HOME>/documentation/apidocs directory and in the newest minor version online.

Generating the LSPS Application from PDS

PDS allows you to generate the LSPS Application–sources of the Application User Interface that expose its API, an SDK Embedded Server, build and launch configurations, and the structure for your business model based on the resources of the LSPS Maven repository: You can modify the sources and check the changes using the SDK Embedded Server,

Important: The SDK Embedded Server with its generated run configuration <YOURAPP> Embedded Server Launcher; is a different server form the PDS Embedded Server.

To generate the application and resources in PDS, do the following:

  1. Extract the lsps-repo zip file to your system repository orto a location pointed to by the M2_REPO variable", for example, unzip lsps-repo-<VERSION>.zip ~/.m2/
  2. Go to File > New > Other
  3. In the New dialog box, select LSPS Application and click Next.
  4. In the updated dialog, enter the details of your application:
    • Maven properties: name, version, namespace, base java package name
    • Web properties: context root of the application url
    • Git properties: where to set up a git repository over the application and create an initial git commit with .gitignore and related sources (git must be installed on your computer)
      appdetailsdialog.png
      Application details
      generatedappsources.png
      Generated application sources
      Now you can customize the application and easily re-build it and check out the outcome on SDK Embedded Server.
launchingserver.png
Launching SDK Embedded Server with the LSPS Application

Generating the LSPS Application from the Command Line

  1. Install Maven.
  2. Create a directory for the application and models.
  3. Generate the lsps-app-archetype maven artifact.

    To get an example of the maven command, open PDS, go to File > New > Other and locate LSPS application in the popup. Note that the custom archetype is not available in the central maven repo: it is either in your local repo or in the LSPS maven repo depending on what maven repository location you defined during PDS installation.

    generatingAppMavenCommand.png
    Example command that generates the default LSPS Application

    $ ~/LSPS-Enterprise-3.3/tools/mvn.sh archetype:generate "-DarchetypeArtifactId=lsps-app-archetype" "-DarchetypeGroupId=com.whitestein.lsps.default-app" "-DarchetypeCatalog=local" "-DarchetypeVersion=\<VERSION\>" "-DinteractiveMode=false" "-DgroupId=sk.my" "-DartifactId=processapp" "-Dpackage=sk.my.processapp" "-Dversion=0.1-SNAPSHOT" "-Dlsps-version=\<VERSION\>" "-DcontextRoot-VAADIN=lsps-application"
  4. Put the directory under version control:
    1. Initialize the repository, for a git repository, enter the directory, and run git init.
    2. Consider adding .project to the .gitignore file in the application directory: The directories are generated by maven and differ depending on the environment. Note that is not the case for .project directories in modules: these are not generated by maven and must be under version control.
    3. Create an initial commit, for git, git add * and git commit -m "init":

      In the future, when migrating to a newer version of the application, you will apply all commits starting from the next commit on the new application version: this will allow you to use a new version of the application with your customization changes added on top (refer to Preparing Upgrade of the Minor or Major Version).

  5. Build the application: run $ ./mvn.sh clean install eclipse:eclipse.
  6. Import the application to PDS workspace.