Faktor-IPS Produktdaten in der Datenbank

Deployment der Produktdaten

Kommandozeilen-Client

Der Kommandozeilen-Client für das Produktdaten-Deployment wird mit dem Client im productdata-jpa-deployment-client-<version>.jar ausgeliefert. Mit einem einfachen Aufruf mit java -jar werden die verfügbaren Befehle angezeigt:

Usage: <command> <serviceURL> -n=<tocName> [Parameter...]
Commands:
  deploy  Deploys all product data referenced in a table of contents.
  status  Updates the status of a product data version.
  delete  Deletes a product data version.

Der Kommandozeilen-Client verwendet zum Auffinden der notewendigen Dateien den Java Classpath. Damit wird sichergestellt, dass alle benötigten Ressourcen gefunden werden. Außerdem können dadurch die Ressourcen sowohl in JAR/ZIP oder als Dateien vorliegen. Um einen spezifischen Classpath in Kombination mit dem Client-JAR zu verwenden, muss der Befehl wie folgt aussehen:

java -cp "./path/to/produkt.jar:./productdata-jpa-sample-product.jar" org.faktorips.runtime.productdata.jpa.deployment.client.ProductDataDeploymentClientCLI [...]

Die Befehle werden im folgenden genauer erläutert. Die Service-URL muss zur REST-API führen. Der ToC-Name kann frei gewählt werden und dient, zusammen mit Modell- und Produkt-Version, zur Identifikation der ToC-Version für weitere Befehle und den DbProductDataProvider.

deploy

Mit dem Befehl deploy werden alle in einem Table of Contents verzeichneten Produktdaten (Produktbausteine, Tabellen- und Aufzählungsinhalte) eingespielt. Die Parameter dazu müssen wie folgt angegeben werden:

Missing required options [-n=<tocName>, params[0]=<serviceURL>]
Usage: deploy [-c=<comment>] [-m=<modelVersion>] -n=<tocName>
              [-P=<deployPassword>] [-t=<tocPath>] [-u=<userName>]
              [-U=<deployUser>] [-v=<version>] <serviceURL>
Deploys all product data referenced in a table of contents.
      <serviceURL>            The URL to the REST API
  -u, --user=<userName>       [OPTIONAL] The name of the user deploying the
                                product data. Uses the current user as default.
                                Default: <current user>
  -c, --comment=<comment>     [OPTIONAL] A comment to distinguish the deployed
                                product data.
  -t, --tocPath=<tocPath>     The path (on the classpath) to the table of
                                contents xml file.
                              [REQUIRED] for deploy and when either
                                -m/--modelVersion or -v/--version are missing.
  -n, --name=<tocName>        The name of the product project to be used in the
                                database.
  -m, --modelVersion=<modelVersion>
                              The version of the model(s) the product data is
                                based on.
                              If this parameter is omitted, the model version
                                is read from the table of contents files of the
                                model(s), which must be on the classpath and
                                referenced in the <tocPath-without-xml>.model.
                                properties file.
  -v, --version=<version>     The version of the product data.
                              If this parameter is omitted, the version is read
                                from the table of contents file referenced with
                                the <tocPath>.
  -U, --deployUser=<deployUser>
                              The user used to authenticate against the
                                deployment service. Do not set this parameter
                                if there is no authentication configured.
  -P, --deployPassword=<deployPassword>
                              The password used to authenticate against the
                                deployment service.

Die Parameter entsprechen den für den Client-Builder definierten, sowie dem User und Kommentar des Client-Befehls createTocVersion. Wird der User nicht angegeben, verwendet das Kommandozeilen-Tool den Namen des am System angemeldeten Benutzers.

status

Der Befehl status entspricht dem Client-Befehl updateStatus und benötigt den Namen eines Status-Übergangs als Parameter:

Missing required options [-x=<statusTransition>, -n=<tocName>, params[0]=<serviceURL>]
Usage: status [-m=<modelVersion>] -n=<tocName> [-P=<deployPassword>]
              [-t=<tocPath>] [-U=<deployUser>] [-v=<version>]
              -x=<statusTransition> <serviceURL>
Updates the status of a product data version.
      <serviceURL>            The URL to the REST API
  -x, --transition=<statusTransition>
                              The change for a product version's status.
  -t, --tocPath=<tocPath>     The path (on the classpath) to the table of
                                contents xml file.
                              [REQUIRED] for deploy and when either
                                -m/--modelVersion or -v/--version are missing.
  -n, --name=<tocName>        The name of the product project to be used in the
                                database.
  -m, --modelVersion=<modelVersion>
                              The version of the model(s) the product data is
                                based on.
                              If this parameter is omitted, the model version
                                is read from the table of contents files of the
                                model(s), which must be on the classpath and
                                referenced in the <tocPath-without-xml>.model.
                                properties file.
                              May be wildcard '*' for status update or delete
  -v, --version=<version>     The version of the product data.
                              If this parameter is omitted, the version is read
                                from the table of contents file referenced with
                                the <tocPath>.
                              May be wildcard '*' for status update or delete
  -U, --deployUser=<deployUser>
                              The user used to authenticate against the
                                deployment service. Do not set this parameter
                                if there is no authentication configured.
  -P, --deployPassword=<deployPassword>
                              The password used to authenticate against the
                                deployment service.

delete

Der Befehl delete entspricht dem Client-Befehl delete:

Missing required options [-n=<tocName>, params[0]=<serviceURL>]
Usage: delete [-m=<modelVersion>] -n=<tocName> [-P=<deployPassword>]
              [-s=<status>] [-t=<tocPath>] [-U=<deployUser>] [-v=<version>]
              <serviceURL>
Deletes a product data version.
      <serviceURL>            The URL to the REST API
  -s, --status=<status>       [OPTIONAL] The status of the version(s) that
                                should be deleted.
  -t, --tocPath=<tocPath>     The path (on the classpath) to the table of
                                contents xml file.
                              [REQUIRED] for deploy and when either
                                -m/--modelVersion or -v/--version are missing.
  -n, --name=<tocName>        The name of the product project to be used in the
                                database.
  -m, --modelVersion=<modelVersion>
                              The version of the model(s) the product data is
                                based on.
                              If this parameter is omitted, the model version
                                is read from the table of contents files of the
                                model(s), which must be on the classpath and
                                referenced in the <tocPath-without-xml>.model.
                                properties file.
                              May be wildcard '*' for status update or delete
  -v, --version=<version>     The version of the product data.
                              If this parameter is omitted, the version is read
                                from the table of contents file referenced with
                                the <tocPath>.
                              May be wildcard '*' for status update or delete
  -U, --deployUser=<deployUser>
                              The user used to authenticate against the
                                deployment service. Do not set this parameter
                                if there is no authentication configured.
  -P, --deployPassword=<deployPassword>
                              The password used to authenticate against the
                                deployment service.

Exit Codes

Table 1. Table Exit Codes
Code Beschreibung

0

Alle Befehle wurden korrekt übertragen

1

Der Service ist unter der angegebenen URL nicht erreichbar

2

Beim Übertragen der Befehle ist ein Fehler aufgetreten. Das Log gibt weitere Informationen aus