Hitachi

JP1 Version 12 JP1/Navigation Platform Setup and Operations Guide


9.10 npimport command (import Operational Contents)

Description

This command imports Operational Contents and access permission settings (access permission groups or JP1 resource groups) that have been exported by a Navigation Platform command.

This command must be executed while the system is running after setup has been completed. Open the command prompt as an administrator.

When the npupdatesearchdata command is executed, the most recent Operational Contents that have been imported become subject to search processing. For details about the pupdatesearchdata command, see 9.20 npupdatesearchdata command (update search data).

If you use the npimport command to update Operational Contents, all versions of the Operational Contents, including versions that were published in the past, are updated. If you want to update only the contents of the Operational Content that are currently published, use the nppubimport command (import Published Versions of Operational Contents). For details about the nppubimport command, see 9.13 nppubimport command (import Published Versions of Operational Contents).

If the Search tab is set to be displayed in the Operational Content Execution Window, we recommend that you execute the npupdatesearchdata command (update search data) after you have executed this command (the npimport command).

Note

If you are using a directory server for user authentication, the access permissions for Operational Contents are determined by access permission groups and standard access permissions. On the other hand, if you are using JP1/Base for user authentication, the access permissions for Operational Contents are determine by JP1 resource group settings. Note that this command does not change JP1 resource group settings. To change JP1 resource group settings, use the Operational Content Editing Window.

Operational Contents to be imported will be added to existing Operational Contents by default. An error will occur if the Operational Contents being added has the same name as existing Operational Contents within the same group.

If you want to replace the existing data with the imported data, rather than adding imported data to the existing data, specify the -d option. To forcibly overwrite the existing data, specify the -f option. If there is no need to import access permission groups, you can import only the Operational Contents by specifying the -x option.

If you have exported all Operational Contents in an environment in which JP1/Base is not used for user authentication (executed the npexport command with the -c option omitted), ensure that you specify the -d, -f, or -x option during the import operation.

If you are using a directory server for user authentication, the standard access permissions are set for the imported Operational Contents if either of the conditions listed below is satisfied. Note that if Operational Contents with the same IDs are to be overwritten (with the -f option specified), the access permission settings for the existing Operational Contents take effect.

If you want to import Operational Contents that are waiting for publishing to start as being in published status, specify the -o option. You can use this option, for example, when you want to import Operational Contents waiting for publishing to start into a test environment (execution environment) to check the contents of the Operational Contents.

Format

npimportΔ[-d|--delete-force]Δ[-f]Δ[-x]Δ[-o]Δ[-lΔpath-of-import-list-filepath-of-file-to-be-imported

For the path of the file to be imported, specify an absolute path or a relative path. Specify a file that has been acquired by a Navigation Platform command; no other files can be specified.

Options

-d|--delete-force

Specifies that all Operational Contents and access permission settings are to be deleted before the import operation starts.

Specify this option when you want to replace the existing Operational Contents with the imported Operational Contents. When this option is not specified, the command adds the imported data to the existing data.

If the -d option is specified, the ucnp.base.server.command.import.delete.confirm.enable property setting in the user property file (ucnp_user.properties) will determine whether the delete confirmation message (KDCZ10156-Q) appears.

- If false is specified:

The confirmation message will not appear.

- If true is specified:

The confirmation message will appear. Answer either Y (Continue) or N (Cancel).

To prevent the confirmation message from being shown regardless of the ucnp.base.server.command.import.delete.confirm.enable property setting, specify the --delete-force option instead of the -d option.

Tip
  • If the file exported by the npexport command (export Operational Contents) with the -x option specified is imported by the command with this option specified, the standard access permissions are set to the added Operational Contents. The access permission settings for the Operational Contents that are overwritten remain unchanged.

  • If a file containing no Operational Content is imported by the command with this option specified, all registered Operational Contents are deleted. This is useful when you want to delete many Operational Contents in the batch mode.

-f

This option must be specified if the import destination contains an access permission group with the same name as one at the import source or contains an Operational Content with the same ID as one at the import source. This option specifies that the import destination is to be overridden by the access permission groups and Operational Contents from the import source (forced registration).

If you want to set access permission groups for the Operational Contents, specify the -d or the -f option.

An error occurs if the -f option is omitted when the import destination contains an access permission group that has the same name as one at the import source or contains an Operational Content that has the same ID as one at the import source; in such a case, the import operation will fail. Note that if the -d option is specified together with the -f option, the specification of -f (forced registration) is ignored.

If the -f option is specified together with the -x option, the access permission groups at the import destination are set for the Operational Contents. If the import destination contains no access permission group to be set for Operational Contents, the standard access permissions are set.

Tip

To execute the npimport command, you need to know not only the names of the Operational Contents but the IDs of the Operational Contents. You can use either of the following methods to check the IDs of Operational Contents:

  • Execute the npexport command with the -l option specified and check the output list file.

  • In the Operational Content Editing Window, select an Operational Content whose ID you want to check, and then click the Get ID menu in the menu area.

-x

Specifies that only Operational Contents are to be imported, without importing access permission groups. Specify this option when no access permission group is to be set for the Operational Contents.

For Operational Contents that have been imported with this option specified, the standard access permissions are set at the import destination regardless of the access permission group settings used at the import source. However, if the -f option is also specified to overwrite Operational Contents with the same IDs as at the import source, the access permission groups at the import destination will take effect.

If Operational Contents that have been exported by the npexport command with the -x option specified are imported, only the Operational Contents are imported regardless of whether the -x option is specified.

If the -d option is specified together with the -x option, the standard access permissions are set for all Operational Contents. In addition, all access permission groups are deleted and the definition for the standard access permissions is reset to the status at the time of setup.

If the -f option is specified together with the -x option, the access permission groups at the import destination are set for the Operational Contents. If the import destination contains no access permission group to be set for Operational Contents, the standard access permissions are set.

If the -x option is specified together with the -l option, access permission groups are not output to the import list file.

Note that if you are using JP1/Base for user authentication, this option is ignored, if specified.

-o

Specifies that Operational Contents waiting for publishing to start are to be imported as being in published status. This option is used, for example, when Operational Contents waiting for publishing to start are imported into a test environment (execution environment) to check the contents of the Operational Contents.

-l path-of-import-list-file

Specifies output of a list of added, updated, or deleted Operational Contents as a text file.

Specify an absolute path or a relative path for the path of the import list file.

Format of an import list file

Header information is output at the beginning of the file and then messages are output in the following format:

[result-type]<T>[Operational-Content-ID]<T>[Operational-Content-version-ID]<T>[update-date-and-time([time-zone])]<T>[published-date-and-time([time-zone])]<T>[publication-status]<T>[publishing-reservation-status]<T>[publishing-start-date-and-time([time-zone])]<T>[publishing-end-date-and-time([time-zone])]<T>[Operational-Content-name]<T>[group-name]<T>[access-permission-group-name-1-or-JP1-resource-group-name-1]<T>
...
[access-permission-group-name-10-or-JP1-resource-group-name-10]<CR><LF>
[result-type][access-permission-group-name-1]<T>[access-permission-group-ID-1]<CR><LF>
...
[result-type][access-permission-group-name-10]<T>[access-permission-group-ID-10]<CR><LF>

<T>: Tab character

<CR><LF>: Termination character (0x0D, 0x0A)

The following table provides the details of the messages.

Table 9‒5: Details of the messages that are output to import list files

Item

Description

result-type

Displays the execution result of the npimport command (import Operational Contents):

  • added

    New Operational Contents or access permission groups were added.

  • modified

    The contents of Operational Contents now being published were changed.#

    Access permission groups with the same name were overwritten or deleted due to the specification of the -d option, and then were imported.

  • merged

    The contents of all Operational Contents other than those now being published were changed.#

    Access permission groups with the same name were overwritten or deleted due to the specification of the -d option, and then were imported.

  • deleted

    Operational Contents or access permission groups were deleted.

Operational-Content-ID

Displays the ID of the Operational Content that was imported.

Operational-Content-version-ID

Displays the version ID of the Operational Content that was imported.

update-date-and-time

Displays the most recent date and time the imported Operational Content version was updated.

The date format depends on the following user property settings:

  • ucnp.base.client.dateformat

  • ucnp.base.client.timeformat.hmsm

This is the date and time the Operational Content was saved or editing was finished in the Operational Content Editing Window.

published-date-and-time

Displays the most recent date and time the imported Operational Content version was published.

The date format depends on the following user property settings:

  • ucnp.base.client.dateformat

  • ucnp.base.client.timeformat.hmsm

Note that even when the Operational Content was made private during import processing, the most recent date and time the Operational Content was published is still displayed. If the Operational Content has never been published, a single-byte hyphen (-) is displayed.

publication-status

Displays the publication status of the imported Operational Content. The two publication statuses are as follows:

Now being published

The most recent Published Version of the Operational Content that is now being published

Empty character string

Operational Content that does not satisfy the conditions for being published currently

publishing-reservation-status

Displays the publishing reservation status of Operational Contents.

Reserved

The Operational Content is waiting for publishing to start or waiting for publication to end.

Empty character string

The Operational Content is not reserved to be published.

publishing-start-date-and-time

Displays the date and time the imported Operational Content is to be published.

The date format depends on the following user property settings:

  • ucnp.base.client.dateformat

  • ucnp.base.client.timeformat.hmsm

If no publishing start date and time have been set, a single-byte hyphen (-) is displayed.

publishing-end-date-and-time

Displays the date and time publication of the imported Operational Contents is to end.

The date format depends on the following user property settings:

  • ucnp.base.client.dateformat

  • ucnp.base.client.timeformat.hmsm

If no publishing start date and time have been set, a single-byte hyphen (-) is displayed.

Operational-Content-name

Displays the name of the imported Operational Content.

group-name

Displays the group name of the imported Operational Content.

access-permission-group-name

Displays the access permission group name set for the imported Operational Content on the same line as the Operational Content name. The imported access permission group names are displayed on subsequent lines.

For the access permission groups, the standard access permissions are displayed first and then the access permission group names are displayed in ascending order of their names.

JP1-resource-group-name

Displays the JP1 resource group name set for the imported Operational Content on the same line as the Operational Content name.

access-permission-group-ID

Displays the imported access permission group ID.

#
  • If the -d option is specified, an Operational Content is deleted once and then imported, in which case the result type is modified or merged. Neither deleted nor added is displayed.

  • If only the following items are changed, the result type for an Operational Content is neither modified nor merged:

    Name of Operational Content

    Group name of Operational Contents

    Access permission groups (or JP1 resource groups) that are set for an Operational Content

  • The abbreviation of the time zone specified in the ucnp.base.client.timezone property in the user property file (ucnp_user.properties) is displayed for the time zone.

The following shows an output example of an import list file:

Result     Operational Content ID     Operational Content Version ID     Date Modified (JST)     Date published (JST)     Status     Publishing Reservation Status     Publishing Start Date and Time(JST)     Publishing End Date and Time(JST)     Operational Content Name     Group Name
modified     268e3592-0133-1000-8002-00000ad23cbb-0     fe6dcb35-0145-1000-8000-0000ac11510b     2014/05/15 14:49:39.524     -          Reserved     2016/04/01 08:00:00.000     2016/9/30 18:00:00.000     [sample01] Upgrading web application version     Sample contents
modified     268e3592-0133-1000-8002-00000ad23cbb-0     fe6db084-0145-1000-8000-0000ac11510b     2014/05/15 14:49:37.793     -          Reserved     2016/04/01 08:00:00.000     2016/9/30 18:00:00.000     [sample01] Upgrading web application version     Sample contents
modified     268e3592-0133-1000-8002-00000ad23cbb-0     fe6cfabc-0145-1000-8000-0000ac11510b     2014/05/15 14:48:48.979     2014/05/15 14:49:26.935     Now being published          -     -     [sample01] Upgrading web application version     Sample contents
modified     268e3592-0133-1000-8002-00000ad23cbb-0     fa07860b-0145-1000-8000-0000ac11510b     2012/08/21 14:15:56.940     2014/05/14 18:19:28.283               -     -     [sample01] Upgrading web application version     Sample contents
merged     357a2f3a-0133-1000-8001-00000ad23cbb-0     fe6cbed5-0145-1000-8000-0000ac11510b     2014/05/15 14:48:36.094     -               -     -     [Description of sample01] Upgrading web application version     Sample contents
merged     357a2f3a-0133-1000-8001-00000ad23cbb-0     fa078688-0145-1000-8000-0000ac11510b     2012/08/21 14:16:02.550     2014/05/14 18:19:28.408     Now being published     [Description of sample01] Upgrading web application version     Sample contents
deleted     fe6eb084-0145-1000-8000-0000ac11510b-0     fe6eb0c2-0145-1000-8000-0000ac11510b     2014/05/15 14:50:38.227     -               -     -     Newly joined     New procedure

Notes:

Return value

Return value

Description

0

The command terminated normally or terminated with a warning.

1

The command terminated abnormally.

2

A lock error occurred on the command.

9

An execution permission error occurred.

Note:

The return value is undefined if the command is terminated by a cause beyond the command's control (such as when the command is terminated forcibly by pressing the Ctrl key and the C key at the same time).

Example

Example 1

This example imports Operational Contents under the following conditions:

  • The path of the file to be imported is C:\work\repository.zip.

  • If access permission groups with the same name or Operational Contents with the same ID are stored at the import destination, forced registration is not to be performed.

> Navigation-Platform-installation-directory\bin\npimport C:\work\repository.zip
Example 2

This example imports Operational Contents under the following conditions:

  • The path of the file to be imported is C:\work\repository.zip.

  • If access permission groups with the same name or Operational Contents with the same ID are stored at the import destination, forced registration is to be performed.

> Navigation-Platform-installation-directory\bin\npimport -f C:\work\repository.zip
Example 3

This example imports Operational Contents under the following conditions:

  • The path of the file to be imported is C:\work\repository.zip.

  • All access permission groups and Operational Contents are to be deleted first and then imported.

  • Output a message confirming whether the Operational Contents can be deleted. In addition, if the ucnp.base.server.command.import.delete.confirm.enable property setting in the user property file (ucnp_user.properties) is set to true, the message will be output.

> Navigation-Platform-installation-directory\bin\npimport -d C:\work\repository.zip
Example 4

This example imports Operational Contents under the following conditions:

  • The path of the file to be imported is C:\work\repository.zip.

  • All access permission groups and Operational Contents are to be deleted first and then imported.

  • Do not output a message confirming whether the Operational Contents can be deleted.

> Navigation-Platform-installation-directory\bin\npimport --delete-force C:\work\repository.zip
Example 5

This example imports Operational Contents under the following conditions:

  • The path of the file to be imported is C:\work\repository.zip.

  • The path of the import list file that is to be output after the import operation is C:\work\list.txt.

> Navigation-Platform-installation-directory\bin\npimport -l C:\work\list.txt C:\work\repository.zip
Example 6

This example imports Operational Contents under the following conditions:

  • The path of the file to be imported is C:\work\repository.zip.

  • Access permission groups are not to be imported.

  • If Operational Contents with the same ID are stored at the import destination, forced registration is not to be performed.

> Navigation-Platform-installation-directory\bin\npimport -x C:\work\repository.zip