Mask Generation and Compilation Tools

The mask generation and compilation tools are server-side batch tools.

VPLMPosMaskGenerator and VPLMPosMaskCompiler are batch (shell, on UNIX) commands, located in:

INSTALL_PATH\server\win_b64\code\command (Windows)

INSTALL_PATH/server/scripts (UNIX)

The tools use the runtime view located in:

<ENOVIAPlatformServer_WEB-INF>

This runtime view must have been updated using the ematrixwarutil tool, prior using the mask tools.

VPLMPosMaskGenerator Syntax

The syntax is as follows:

VPLMPosMaskGenerator [-h]
	         [-m	       <mask_name>]
	         [-addpath 	<additional_mask_file_directory>]
	         [-d 	      <output_directory>]	
          <modeler>  <modeler> ...]
Keyword Description
-h Dumps help.
-m <mask_name> The name of the mask to generate (default is "DEFAULT").
-addpath <additional_mask_file_directory>] Specify an additional mask files absolute directory. "Inherited" mask files will be searched in this directory in priority, and then in standard resources path if not found. Note that mask files must be located in a vplm/mask/<mask_name> subdirectory of <additional_mask_file_directory>.
-d <output_directory> Specify the output location of generate.log and the generated .mask file(s). One mask file is generated per specified modeler (i.e. a .metadata file). If this option is not specified, the current path is used as output.
<modeler> [<modeler> ...] Modeler.

Role of VPLMPosMaskGenerator

Generates the mask file(s) associated to the given modeler(s), in line with metadata and mask inherited from parent modeler (if any).

The attributes of a modeler's entity are retrieved as follows.

If a mask was associated to the parent modeler:


  • the mask definition of inherited attributes (from the parent entity in the parent modeler) is retrieved as is
  • a mask definition is computed based on attributes local to the modeler's entity.

Otherwise, the mask definition of each modeler's entity is computed on all attributes (inherited or local)

Once generated, the mask file may have to be tuned to match your own requirements, for instance:


  • Add authorized values / set a default value
  • Change mandatory property (from N to Y)
  • Change editable property of attribute usage in the WRITE function
  • Change attribute order in a given function
  • Etc.

Finally, do not forget to copy generated mask files in the:

<ENOVIAPlatformServer_WEB-INF>/classes/vplm/mask/<mask_name>

directory before compilation.

Example:

VPLMPosMaskGenerator -d /tmp PLMProductDS

This command generates a file named PLMProductDS.mask in directory/tmp taking into account any existing mask definition for inherited attributes (the ones defined in the PRODUCTCFG.mask file) plus the attributes local to the PLMProductDS.metadata.

VPLMPosMaskCompiler Syntax

The syntax is as follows:

VPLMPosMaskCompiler [-h]
	         [-m	       <mask_name>]
	         [-addpath 	<additional_mask_file_directory>]
	         [-d 	      <output_directory>]
	         [-html     <html_directory>]

Keyword Description
-h Dumps help.
-m <mask_name> The name of the mask to generate (default is "DEFAULT").
-addpath <additional_mask_file_directory>] Specify an additional mask files absolute directory. "Inherited" mask files will be searched in this directory in priority, and then in standard resources path if not found. Note that mask files must be located in a vplm/mask/<mask_name> subdirectory of <additional_mask_file_directory>.
-d <output_directory> Specify the output location of result.log and the generated .SecurityMask file(s). If this option is not specified, the current path is used as output.
-html <html_directory>

Specify the directory where to dump HTML files for compilation report and GUI rendering.

If this option is not specified, no HTML file is generated.

The compilation report (result.log) lists all the mask instructions that do not comply with the metadata file, in particular when the IP protection rules are not observed.

There are several information levels, depending on error severity.

Fatal: when an unrecoverable error occurred; in that case, the mask file was either not generated, either partially generated (and unusable).

Error: when an error occurred, but the compiler either automatically fixed the error; either ignored it (action depends on the error); in that case, the mask file could be generated.

Warning: when a minor error occurred.

Role of VPLMPosMaskCompiler

Compiles all <mask_name> mask files located in:

<ENOVIAPlatformServer_WEB-INF>/classes/vplm/mask/<mask_name>

and generates a single <mask_name>.SecurityMask file.

The compilation result log is:

<output_directory>/result.log

This file contains:


  • a tree of modelers hierarchy, with the associated mask file
  • a summary of errors (sorted by modeler)
  • a summary of errors (sorted by category).

If a FATAL error occurrs, the .SecurityMask file CANNOT BE USED.

HTML files are generated in the <html_directory> (if the -html option is used):

_index.html File

This file lists all processed modelers, alphabetically sorted, with the number of fatal errors, errors, and warnings (if any). If the modeler has a mask, there is a link to see it.



Modeler Overview

This view shows:


  • the package hierarchy
  • the index of entities
  • an index table of errors, if some errors were encountered. A link to the highlighted source is provided
  • Per entity and function, the html-simulated rendering.

Here is an annotated example for PLMProductDS mask:



Note that the tool does not account for attribute aliases.

This is a colored version of the mask source file, with errors highlighted:



The following table lists detected errors, their severity level and possible cause:

Severity Message Comment and Action
Warning Unknown command [%0]

Command is ignored.

Check misspelling error.

Warning This Custo Package has no associated mask

Any CUSTO-type modeler must have a mask file.

Generate a mask file.

FATAL Expected mask name %0, not %1 Command should have been: MASK %0
FATAL Entity %0 does not belong to package %1

ENTITY command is ignored; consequently, all related commands (ATTR, etc.) will fail.

Check (a) misspelling error (b) valid metadata entity.

Error Entity %0: attribute %1 was not predefined by ATTR command Attribute referenced by a FATTR command must be declared first by an ATTR command.
FATAL Entity %0 has no %1 attribute

ATTR command is ignored.

Check (a) misspelling error (b) valid metadata attribute.

Error Entity %0, attribute %1: mandatory property cannot be N while it is Y in metadata Command should have been: ATTR %1;Y;…
FATAL Entity %0, attribute %1 : cannot use %2 value as an authorized value

An enumerated set of values is defined on attribute %1 in metadata; value %2 must be chosen in this set

(a) remove this VALUE command,

or (b) modify the enumerated set of values in metadata

Error Unexpected %0 function

FUNC command is ignored.

Check misspelling error.

FATAL Entity %0: external-type %1 attribute is not allowed in %2 function

IP Protection : external-type attributes cannot be set/modified in generic UI interfaces

(CREATE or WRITE functions)

Remove the corresponding FATTR command.

(Note: there are some accepted exception to that rule: they appear as Warnings)

Error Entity %0: MANDATORY %1 attribute cannot be set to NOT EDITABLE in CREATE function Command should have been : FATTR %1;Y
Error Entity %0: attribute %1 whose protection is Read-only cannot be modifed in WRITE function

IP Protection : external-type attribute cannot be modified in generic UI interfaces

Command should have been : FATTR %1;N

FATAL Unexpected boolean value %0 \: expected Y'or N Use either N either Y character, respectively for NO and YES
Error Entity %0: cannot use attribute %1 in mask, as its protection flag (%2) denies it

IP Protection : access to internal attributes is forbidden

Remove the ATTR command (and all related FATTR commands)

     

Examples

You have generated your mask file for the PLMProductDS modeler.

You have put this file in the:

docs/javaserver/vplm/mask/DEFAULT

directory of your runtime view. You will use one of the two following equivalent commands to compile the default mask files:


  • VPLMPosMaskCompiler
  • VPLMPosMaskCompiler -d <current_directory>

The DEFAULT.SecurityMask file is generated in <current_directory>.

Note: no -html option was specified, so no html file was generated.