Difference between revisions of "LRM Commands Reference"

From Lingoport Wiki
Jump to: navigation, search
(Working with Prep Kits)
Line 393: Line 393:
   
 
== Working with Prep Kits ==
 
== Working with Prep Kits ==
The first step you'll want to take with your new LRM Project is to make sure that LRM is finding all the resource files in your source code tree. We use the --project-inspect command to do this; LRM will search for all resources files described by your project's definitions, and create reports for each target locale, named ProjectInspect<locale>.xml, in your LRM Project's reports folder. Enter:
+
The first step you'll want to take with your new Lingoport Resource Manager Project is to make sure that LRM is finding all the resource files in your source code tree. We use the '''--project-inspect''' command to do this; LRM will search for all resources files described by your project's definitions, and create reports for each target locale, named ProjectInspect<locale>.xml, in your LRM Project's reports folder. The base locale
  +
  +
'''Base locale''': The starting locale which will be translated into the target locales.
  +
'''Target locale''': The resulting translations from the base locale. For example if the base locale is en_US (United States English) and a target locale is fr_FR (France french), the resource files will start in English and be translated into French.
  +
Enter:
   
 
<code>
 
<code>
Line 411: Line 415:
 
* The total number of resource files based on the number of base resource files
 
* The total number of resource files based on the number of base resource files
 
* A listing of each resource file. These files may not currently exist, but will be created once an LRM import is successful
 
* A listing of each resource file. These files may not currently exist, but will be created once an LRM import is successful
  +
  +
Be sure to check the default locale reports for any errors, including omissions and incorrect duplicate resource files. If you find problems, make sure you have the latest version of your LRM Project's Definition.xml file (use project-export command) and then modify it, possibly adding exclude and include folders to tailor LRM's search for resource files. Once your project-inspect reports are clean, you can run the project-update command to store the latest project definitions in the LRM Server database. The target locale reports will be a reflection of the base locale report, showing you the resource files that will be created for translation.

Revision as of 20:36, 22 April 2015

Introduction

To invoke a command, you must type java -jar <path-to-jarfile>command.jar -parameters For instance, on Linux, if the Lingoport Resource Manager Command Line Interface jar file is located under ~/lingoport/lrm-server-2.0 (the default location) and you want to list the Resource Manager projects, you would type:

 java -jar ~/lingoport/lrm-server-2.0/lrm-cli.jar --list-projects

Each command also has an abbreviation. The long version of each command starts with two dashes, --. The short version of each command starts with one dash, -.

For example, the previous example could have been written:

 java -jar ~/lingoport/lrm-server-2.0/lrm-cli.jar -lp

To Note

The help provides a list of all available commands. The debug and the verbose flags can be applied to all commands.

 -d,--debug                     Log4j Debug mode

 -v,--verbose                   Verbose (console logging)

 -h,--help                      Displays Help.
                              

Reference

This reference gives the short and the long version of each Resource Manager command and a usage example.


 -ak,--activate-kit             Activate a kit. Example: lrm-cli.jar -ak
                                --project-name MyProject --kit-version 2
 -au,--add-user                 Add a user. Example: lrm-cli.jar -au
                                --new-name MyName --new-password
                                MyPassword
 -cp,--create-project           Create a project from an xml file.
                                Example: lrm-cli.jar -cp -f
                                C:/MyLocation/Setup.xml
 -d,--debug                     Log4j Debug mode

 -dk,--deactivate-kit           Deactivate a specific kit. Example:
                                lrm-cli.jar -dk --project-name MyProject
                                --kit-version 2
 -dp,--delete-project           Delete a project. Example: lrm-cli.jar -dp
                                --project-name MyProject
 -dr,--dry-run                  Optional argument for --prep-kit. Runs
                                --prep-kit without altering the database.
 -ep,--export-project           Export the project into an xml file. If
                                option `-f` is not specified then the xml
                                file is saved to the default report
                                directory. Example: lrm-cli.jar -ep
 -f <string>                    Location of file (-f C:/MyLocation) or
                                file name with path (-f
                                C:/myfolder/myfile.xml)
 -h,--help                      Displays Help.

 -ii,--import-issues            Report on all the active import issues.
                                Example lrm-cli.jar -r -ii -pn
                                MyProjectName
 -ik,--import-kit               Import the translated kit. Example:
                                lrm-cli.jar -ik -pn MyProject -f
                                C:/KitLocation
 -ks,--kit-status               Report on all the incomplete and complete
                                kits. Example lrm-cli.jar -r -ks -pn
                                MyProjectName
 -ksi,--kit-status-incomplete   Report on all the incomplete kits. Example
                                lrm-cli.jar -r -ksi -pn MyProjectName
 -kv,--kit-version <number>     Specifies the kit version id when
                                activating or deactivating a kit.
 -lp,--list-projects            Lists all the projects to the console.
                                Example: lrm-cli.jar -lp
 -nn,--new-name <string>        Specifies either the new project name when
                                renaming a project (-rp) or the user name
                                when adding a user (-au).
 -np,--new-password <string>    Specifies the password when adding a user
                                (-au).
 -p,--password <string>         Optional argument used to log into the LRM
                                system as a different user than indicated
                                in the LrmUserConfig.xml file.
 -pi,--project-inspect          Report on all the files that were found
                                using the project definition for the
                                supplied project name. Example:
                                lrm-cli.jar -r -pi -pn MyProjectName
 -pk,--prep-kit                 Prep a kit. Example: lrm-cli.jar -pk
                                --project-name MyProject
 -pn,--project-name <string>    Specifies the project name.

 -ps,--project-status           Report on the productivity and status of
                                the supplied project name. Example
                                lrm-cli.jar -r -ps -pn MyProjectName
 -r,--report                    Run a report that is specified by an
                                additional option. If option `-f` is not
                                specified then the report is saved to the
                                default report directory.  Example:
                                lrm-cli.jar -r <report option>
 -rp,--rename-project           Rename a project. Example: lrm-cli.jar -rp
                                --project-name projectName --new-name
                                NewName
 -si,--source-issues            Report on the source issues for the
                                supplied project name. Example:
                                lrm-cli.jar -r -si -pn MyProjectName
 -u,--user <string>             Optional argument used to log into the LRM
                                system as a different user than indicated
                                in the LrmUserConfig.xml file.
 -up,--update-project           Update a project from an xml file.
                                Example: lrm-cli.jar -up -f
                                C:/MyLocation/Setup.xml
 -v,--verbose                   Verbose (console logging)



Commands to Know

There are a few commands which are useful for getting started and debugging issues.

To make things easier, set up an alias for the command. The examples below will be using the lrm alias

On Unix:

  alias lrm='java -jar ~/lingoport/lrm-server-2.0/lrm-cli.jar'
  lrm --version

In Windows:

  set "LRM=java -jar C:\Lingoport\LRM-Server-2.0\lrm-cli.jar"
  %LRM% --version

To get help, use the --help (or -h) option:

 java -jar ~/lingoport/lrm-server-2.0/lrm-cli.jar --help


Create a project

  lrm --create-project -f <path to proj.xml file> 

For example:

  lrm -cp -f projects/MyProject.xml 

The -f is the location of the project description file. The project description file must contain a <group-name> stanza and a <project-name> stanza otherwise the creation will fail. The <top-level-dir> is the path to the source code for this LRM Project.

       <project-name>MyProject</project-name>
       <group-name>Blue</group-name>
       <project-desc>This project contains resource files of all types for baseline testing</project-desc>
       <top-level-dir>Lingoport\test\MyProject\resources\</top-level-dir>
       <target-locales
               <locale>de_DE</locale>
               <locale>fr_FR</locale>
               <locale>zh_CN</locale>
       </target-locales>

To see if there are multiple groups:

  lrm --list-groups 

To create a project when there are multiple groups use the -gn option. The group name must match that in the MyProject.xml file.

  lrm -cp -f projects/MyProject.xml -gn <group-name> 

To verify that the project was created in a group. If there is only one group the -gn is optional:

  lrm -lp -gn <group-name>

Create a group

When creating a group, you must have the license associated with the group. Sometimes, the group is referred to as the company. These terms in Lingoport Resource Manager are interchangeable. If you do not have a license, contact support@lingoport.com. With the license you will have the following information:

  • The group name (-gn)
  • The number of licenses (-nl) - this determines how many projects you can create under this group.
  • The expiration date (-dt)
  • The license key (-lkey) - a 10-digit code provided by Lingoport

  lrm --create-group --group-name <group-name> --number-of-licenses <number of licenses> --date <expiration-date> -license-key <license key>

For example:

  lrm --create-group -gn Blue -nl 10 -dt 2016-12-31 -lkey 1234567890

To verify that the group was created successfully, use the --list-groups option. This will show the options used to create the group.

 lrm -lg
 Name     Max Project     Exp Date       Days Left
 Blue     10              2016-12-31     452
 Process completed successfully.

Update a license

If the expiration date for a license passes or there are more projects than the licensed number, a new license can be generated. Contact support@lingoport.com to get a new license. Just like when creating a new group, the following information is needed. The license key will be different than the one previously issued by Lingoport.

  • The group name (-gn)
  • The number of licenses (-nl) - this determines how many projects you can create under this group.
  • The expiration date (-dt)
  • The license key (-lkey) - a 10-digit code provided by Lingoport

  lrm --update-license --group-name <group-name> --number-of-licenses <number of licenses> -date <expiration date> --license-key <license key> 

For example:

  lrm -ul -gn Blue -nl 100 -dt 2016-12-31 -lkey 9987654321

To verify the change, use the --list-groups command

 lrm -lg
 Name     Max Project     Exp Date       Days Left
 Blue     100             2016-12-31     452
 Process completed successfully.

Update a project

After creating a project, there may be times when you want to change some of the LRM options and resources. To update the options:

  1. Export the project to create the ProjectDefinition.xml file
  2. Modify the ProjectDefinition.xml file
  3. Inspect the project to verify the changes.
  4. Update the project to use the new changes.

First, export the project. This will create a file ProjectDefinition.xml in the reports area. The default location for the reports directory is ~/Lingoport_Data/LRM/<group-name>/reports/<project>. The -f option can be used to create the ProjectDefinition.xml file in a different location. The --group-name is optional if there is only one group defined.

  lrm --export-project --project-name <project> --group-name <group-name>

For example:

  lrm -ep -pn MyProject -gn Blue
or
  lrm -ep -pn MyProject -f /var/tmp -gn Blue
 

Next, modify the ProjectDefinition.xml file. The file can be modified to detect or skip various errors, which target locales to create and define the resources and their extensions. The file can also be modified to exclude various files in the search.

To verify the changes, run a Project Inspection report. This creates ProjectInspect_xx_YY.xml (where xx_YY are locale identifiers) files in the default location at ~/Lingoport_Data/LRM/<group-name>/reports/<project>. The -f option can be used to create the ProjectInspect_xx_YY.xml files in a different location. The --group-name is optional if there is only one group defined.

  lrm --report --project-inspect --project-name <project> --group-name <group-name>

For example:

  lrm -r -pi -pn MyProject -gn Blue
or
  lrm  -r -pi -pn MyProject -f /var/tmp -gn Blue
 


Finally, update the project using the --update-project option.

  lrm --update-project -f <location of ProjectDefinition.xml>

For example:

  lrm -up -f Lingoport_Data/LRM/<group-name>/reports/<project>/ProjectDefinition.xml
or
  lrm -ep -pn MyProject -f /var/tmp/ProjectDefinition.xml

Delete project

A project can be deleted if no prep kits have been created. The -gn flag is optional if there is only one group defined.

  lrm --delete-project --project-name <Project> --group-name <group-name>

For example:

  lrm -dp -pn MyProject -gn Blue

Create reports

A number of LRM commands will create reports which can assist with creating prep kits and determining problems. Reports are run using the -r option followed by the report to be created in the default location at ~/Lingoport_Data/LRM/<group-name>/reports/<project>. The -f option can be used to create the report files in different locations. The --group-name is optional if there is only one group defined. Many of the reports created are the same reports used to populate the Lingoport Dashboard.

  lrm --report <report option> --project-name <Project> -group-name <group-name>


Files to Prep

Creates the FilesToPrep.xml file.

  lrm --report --files-to-prep --project-name <Project> --group-name <group-name>

For example:

  lrm -r -fp -pn MyProject -gn Blue

Import Issues

Creates the TranslationIssues.xml file for the active import issues.

  lrm --report --import-issues --project-name <Project> --group-name <group-name>

For example:

  lrm -r -ii -pn MyProject -gn Blue

Kit Status

Creates the PrepKitStatus.xml file.

  lrm --report --kit-status --project-name <Project> --group-name <group-name>

For example:

  lrm -r -ks -pn MyProject -gn Blue

Incomplete Kit Status

Creates the IncompletePrepKit.xml file.

  lrm --report --kit-status-incomplete --project-name <Project> --group-name <group-name>

For example:

  lrm -r -ksi -pn MyProject -gn Blue

Inspect Project

Creates the ProjectInspect_<locale>.xml files.

  lrm --report --project-inspect --project-name <Project> --group-name <group-name>

For example:

  lrm -r -pi -pn MyProject -gn Blue

Project Status

Creates the TranslationStatus.xml file.

  lrm --report --project-status --project-name <Project> --group-name <group-name>

For example:

  lrm -r -ps -pn MyProject -gn Blue

Source Issues

Creates the ResourceIssues.xml file.

  lrm --report --source-issues --project-name <Project> --group-name <group-name>

For example:

  lrm -r -si -pn MyProject -gn Blue

Working with Prep Kits

The first step you'll want to take with your new Lingoport Resource Manager Project is to make sure that LRM is finding all the resource files in your source code tree. We use the --project-inspect command to do this; LRM will search for all resources files described by your project's definitions, and create reports for each target locale, named ProjectInspect<locale>.xml, in your LRM Project's reports folder. The base locale

Base locale: The starting locale which will be translated into the target locales. Target locale: The resulting translations from the base locale. For example if the base locale is en_US (United States English) and a target locale is fr_FR (France french), the resource files will start in English and be translated into French. Enter:

  lrm --report --project-inspect -pn <project name>

For the base locale, the resulting ProjectInspect<baseLocale>.xml report contains:

  • The associated LRM project name and source path
  • The locale and whether it is the base locale
  • The total number of resource files found
  • A listing of each resource file

For each target locale, the resulting ProjectInspect<locale>.xml report contains:

  • The associated LRM project name and source path
  • The locale and whether it is the base locale
  • The total number of resource files based on the number of base resource files
  • A listing of each resource file. These files may not currently exist, but will be created once an LRM import is successful

Be sure to check the default locale reports for any errors, including omissions and incorrect duplicate resource files. If you find problems, make sure you have the latest version of your LRM Project's Definition.xml file (use project-export command) and then modify it, possibly adding exclude and include folders to tailor LRM's search for resource files. Once your project-inspect reports are clean, you can run the project-update command to store the latest project definitions in the LRM Server database. The target locale reports will be a reflection of the base locale report, showing you the resource files that will be created for translation.