Class Options
- java.lang.Object
-
- com.sodius.mdw.metamodel.integrity.io.Options
-
public class Options extends Object
Provides options available when reading or updating Integrity data.Most of the options are designed to be used in conjunction with the Integrity Application model reader, as illustrated in the snippet below:
MDWorkbench workbench = null; Model model = null; try { // configure connection on Integrity server Map<String, Object> options = new HashMap<String, Object>(); options.put(Options.OPTION_IGNORE_CONNECTOR_UI, true); options.put(Options.OPTION_INTEGRATION_POINT_KIND, IntegrationPointKind.SERVER); options.put(Options.OPTION_SERVER, "myserver"); options.put(Options.OPTION_PORT, "7001"); options.put(Options.OPTION_USER, "myUser"); options.put(Options.OPTION_PASSWORD, "myPassword"); // restrict content to one particular project DatabaseConfiguration configuration = new DatabaseConfiguration(); configuration.getProjects().add("/MyProject"); options.put(Options.OPTION_DATABASE_CONFIGURATION, configuration); // read the model model = workbench.getMetamodelManager().getMetamodel(IntegrityPackage.eINSTANCE).createModel(); model.read("Application", "", options); // get the database instance Database database = model.<Database>getInstances(IntegrityPackage.Literals.DATABASE).first(); // access on-demand the content of the database List<Type> types = database.getTypes(); ... } finally { // disposes the model if (model != null) { model.clear(); } if (workbench != null) { workbench.shutdown(); } }Options might also be set as a Java System property. For example, for an option named
"xyz", setting a value as a Java Virtual Machine argument is done this way:
-Dxyz=myValue
-
-
Field Summary
Fields Modifier and Type Field Description static StringOPTION_API_VERSIONThe API version to communicate to the Integrity server when contacting it.static StringOPTION_AS_NON_ADMINISTRATORDetermines whether the connection is performed in a non-administrator mode.static StringOPTION_ATTACHMENT_DIRECTORYDeprecated.static StringOPTION_ATTACHMENT_MAXIMUM_SIZEDetermines the maximum size (in bytes) of attachments.static StringOPTION_ATTACHMENT_RESOLVERAn instance of the interfaceAttachmentResolverthat determines the physical location of attachments to be written in Integrity, when using the Integrity Application model writer.static StringOPTION_COMMAND_LISTENERRegisters aCommandListenerinstance, to be notified of each Integrity command executed by the Integrity Application model reader.static StringOPTION_DATABASE_CONFIGURATIONDetermines the configuration of the database for reading, notably the list of projects of interest.static StringOPTION_DATABASE_PRELOADSpecifies an Integrity XMI file that contains the structure of an Integrity database (types, fields, states).static StringOPTION_DEBUGDetermines whether the connection is performed in debug mode.static StringOPTION_DEBUG_FILEDetermines the file is which debug information is written.static StringOPTION_IGNORE_ATTACHMENTSDetermines whether attachments should be ignored.static StringOPTION_IGNORE_CONNECTOR_UIDetermines whether the connector selection dialog should be avoided.static StringOPTION_IGNORE_DEFAULT_FIELD_VALUESDetermines whether aFieldshall be read if it's value equals the default value of theField.static StringOPTION_IGNORE_INCLUDE_VERSIONED_ITEMDetermines whether Versioned Items shall be read for an Item.static StringOPTION_IGNORE_ITEM_LABELSDetermines whether a label shall be read for an Item, even if field values are not yet available.static StringOPTION_IGNORE_QUERY_ITEMSDetermine whether Items shall be read on-demand whenQuery.getItems()is called.static StringOPTION_IGNORE_RICH_TEXTDetermines whether text formatting (bold, italic, etc.) is to be ignored when reading data.static StringOPTION_IGNORE_TYPE_ITEMSDetermine whether Items shall be read on-demand whenType.getItems()is called.static StringOPTION_INTEGRATION_POINT_KINDDetermines whether access to the Integrity database is performed on the Integrity server or using an Integrity local client.static StringOPTION_ITEM_LABEL_FIELDSDetermines the field names that can contain the label of an Item.static StringOPTION_PASSWORDThe name of the Integrity password to connect to the Integrity database.static StringOPTION_PORTThe port of the Integrity database.static StringOPTION_SECURE_PORTDetermines whether access to Integrity server is performed using a secure port (SSL connection).static StringOPTION_SERVERThe server of the Integrity database.static StringOPTION_USERThe name of the Integrity user to connect to the Integrity database.
-
-
-
Field Detail
-
OPTION_DATABASE_CONFIGURATION
public static final String OPTION_DATABASE_CONFIGURATION
Determines the configuration of the database for reading, notably the list of projects of interest.- See Also:
- Constant Field Values
-
OPTION_DATABASE_PRELOAD
public static final String OPTION_DATABASE_PRELOAD
Specifies an Integrity XMI file that contains the structure of an Integrity database (types, fields, states). This can be used to preload the content of an Integrity model, when using the Application model reader. It avoids the reader to fetch this information from the database, notably for cases where the user is not allowed to access such content (i.e. the user is not allowed to execute Integrity administraion commands).- See Also:
- Constant Field Values
-
OPTION_ATTACHMENT_RESOLVER
public static final String OPTION_ATTACHMENT_RESOLVER
An instance of the interfaceAttachmentResolverthat determines the physical location of attachments to be written in Integrity, when using the Integrity Application model writer.- See Also:
AttachmentResolver, Constant Field Values
-
OPTION_ATTACHMENT_DIRECTORY
@Deprecated public static final String OPTION_ATTACHMENT_DIRECTORY
Deprecated.Clients are advised not to use this field.- See Also:
- Constant Field Values
-
OPTION_INTEGRATION_POINT_KIND
public static final String OPTION_INTEGRATION_POINT_KIND
Determines whether access to the Integrity database is performed on the Integrity server or using an Integrity local client.When setting the connection mode to
SERVER, the following settings must also be configured:OPTION_SERVER- The server of the Integrity database.OPTION_PORT- The port of the Integrity database.OPTION_SECURE_PORT(optional) - Determines whether access to Integrity server is performed using a secure port (SSL connection). Default isfalseOPTION_USER- The name of the Integrity user to connect to the Integrity database.OPTION_PASSWORD- The name of the Integrity password to connect to the Integrity database.
OPTION_IGNORE_CONNECTOR_UIshould also be settruein such use case.- See Also:
IntegrationPointKind, Constant Field Values
-
OPTION_SERVER
public static final String OPTION_SERVER
The server of the Integrity database.
-
OPTION_PORT
public static final String OPTION_PORT
The port of the Integrity database. If the port is using a secure connection, theOPTION_SECURE_PORToption must also be set totrue.
-
OPTION_SECURE_PORT
public static final String OPTION_SECURE_PORT
Determines whether access to Integrity server is performed using a secure port (SSL connection).Default value is
false(meaning port is not using a secure connection).- Since:
- 1.10.0
- See Also:
OPTION_PORT, Constant Field Values
-
OPTION_USER
public static final String OPTION_USER
The name of the Integrity user to connect to the Integrity database.
-
OPTION_PASSWORD
public static final String OPTION_PASSWORD
The name of the Integrity password to connect to the Integrity database.
-
OPTION_API_VERSION
public static final String OPTION_API_VERSION
The API version to communicate to the Integrity server when contacting it. Default value is"4.10", which allows compatibility with all Integrity versions since 2009. Refer to PTC's Integrations Builder Guide for details on the possible values of API version and compatibility matrix.- Since:
- 1.12.2
- See Also:
- Constant Field Values
-
OPTION_IGNORE_CONNECTOR_UI
public static final String OPTION_IGNORE_CONNECTOR_UI
Determines whether the connector selection dialog should be avoided. When the connector is integrated in a Java program, this setting should be set totrue. Default value isfalse(meaning the connector UI is displayed).- See Also:
- Constant Field Values
-
OPTION_IGNORE_ATTACHMENTS
public static final String OPTION_IGNORE_ATTACHMENTS
Determines whether attachments should be ignored. Default value isfalse(meaning attachments are read and written).- See Also:
- Constant Field Values
-
OPTION_ATTACHMENT_MAXIMUM_SIZE
public static final String OPTION_ATTACHMENT_MAXIMUM_SIZE
Determines the maximum size (in bytes) of attachments. If one attachment is bigger than the specified size, a warning is logged and the attachment is skipped by the model writer.- See Also:
- Constant Field Values
-
OPTION_IGNORE_RICH_TEXT
public static final String OPTION_IGNORE_RICH_TEXT
Determines whether text formatting (bold, italic, etc.) is to be ignored when reading data. Default value isfalse(meaning rich text formatting is read).- See Also:
- Constant Field Values
-
OPTION_IGNORE_TYPE_ITEMS
public static final String OPTION_IGNORE_TYPE_ITEMS
Determine whether Items shall be read on-demand whenType.getItems()is called. Querying all items of a specific type can be time consuming and can hit a maximum number of items returned by a command, depending on your database configuration. It is recommended to use queries to retrieve Items. Default value istrue(meaning Items are not read on-demand in this context).
-
OPTION_IGNORE_DEFAULT_FIELD_VALUES
public static final String OPTION_IGNORE_DEFAULT_FIELD_VALUES
Determines whether aFieldshall be read if it's value equals the default value of theField.If no default value is defined for a
FieldValuethe Java default value will be used instead. For a Numeric field the default value is0.0, for a Boolean field the default value isfalse. For a String field, if the field is empty, it will be consider as null and Integrity will no return any value.Reading field with default value could increase significantly the size of the model read.
Default value is
true(meaningFieldwith default values are not read and not added to the model in this context).- Since:
- Version 1.7.0.
- See Also:
- Constant Field Values
-
OPTION_IGNORE_QUERY_ITEMS
public static final String OPTION_IGNORE_QUERY_ITEMS
Determine whether Items shall be read on-demand whenQuery.getItems()is called.Disabling queries execution can be interesting in two different use cases:
- You just want to get the list of available queries in the database, but you are not interested in Items.
- The model is loaded as a base to add new Item instances and then be written back to Integrity. If the created Items are not related to
existing Items, setting this property to
truemight improve the performances.
Default value is
false(meaning Items are read on-demand in this context).- See Also:
Query.getItems(), Constant Field Values
-
OPTION_IGNORE_ITEM_LABELS
public static final String OPTION_IGNORE_ITEM_LABELS
Determines whether a label shall be read for an Item, even if field values are not yet available.Items content is read only on-demand, when
Item.getValues()is called. The default behavior of the model reader is to read the label of an Item, even if its field values are not yet known, to be returned by thetoString()method.Default value is
false.- See Also:
OPTION_ITEM_LABEL_FIELDS, Constant Field Values
-
OPTION_ITEM_LABEL_FIELDS
public static final String OPTION_ITEM_LABEL_FIELDS
Determines the field names that can contain the label of an Item.Items content is read only on-demand, when
Item.getValues()is called. The default behavior of the model reader is to read the label of an Item, even if its field values are not yet known, to be returned by thetoString()method.Default label fields are:
Summary,Title,TextandShared TextThe value must a
Stringwith field names separated by'|'character.- See Also:
OPTION_IGNORE_ITEM_LABELS, Constant Field Values
-
OPTION_AS_NON_ADMINISTRATOR
public static final String OPTION_AS_NON_ADMINISTRATOR
Determines whether the connection is performed in a non-administrator mode.Some interactions with the Integrity database, like listing projects, require administrator access (i.e. the connected user must have
ViewAdminpermission in Integrity). Setting this option totrueenables retrieving a subset of the information for non administrators.Here are the differences when turning on this option:
Database.getProjects(): returns only projects the user has access to.Project.getPermittedAdministrators(): always returns an empty list.Project.getPermittedGroups(): always returns an empty list.Type.getConstraints(): always returnsfalse.Field.isReadOnly(): always returns an empty list.
Default value is
false(meaning the connection runs in administrator mode).- Since:
- 1.9.7
- See Also:
- Constant Field Values
-
OPTION_DEBUG
public static final String OPTION_DEBUG
Determines whether the connection is performed in debug mode. In this mode, a log of executed commands is written in the file specified using theOPTION_DEBUG_FILEoption. Default value isfalse(meaning no debug output is generated).- See Also:
OPTION_DEBUG_FILE, Constant Field Values
-
OPTION_DEBUG_FILE
public static final String OPTION_DEBUG_FILE
Determines the file is which debug information is written. The optionOPTION_DEBUGshould also be set totrue.- See Also:
OPTION_DEBUG, Constant Field Values
-
OPTION_COMMAND_LISTENER
public static final String OPTION_COMMAND_LISTENER
Registers aCommandListenerinstance, to be notified of each Integrity command executed by the Integrity Application model reader.- See Also:
CommandListener, Constant Field Values
-
OPTION_IGNORE_INCLUDE_VERSIONED_ITEM
public static final String OPTION_IGNORE_INCLUDE_VERSIONED_ITEM
Determines whether Versioned Items shall be read for an Item.Versioned Items have been implemented since the version 10.5 of PTC Integrity and is not supported by earlier versions of the product. In addition this option is automatically ignored if the Integrity server does not handle versioned items.
Default value is
false(meaning Versioned Items are read).- Since:
- Version 1.7.0.
- See Also:
- Constant Field Values
-
-