Basic Information for Configuring Entities
To configure an entity, the framework requires information on the following entity properties:
name—Name of the entity. Entity name is always defined in camel case. For example, WindchillPart.
collectionName—Name of the entity collection. For example, Parts.
type—Type of entity. Set the value as wcType for entities that are backed by Windchill types. For other entities specify the value as basic.
wcType—This property must be set if type property is specified as wcType. The entity type is backed by Windchill types. For example, wt.part.WTPart.
* 
If you configure wctype as [domain].<Windchill_type> in the <Entity JSON> file, then [domain] is read as the internet domain, which is set for the exchange container. For example, if the internet domain for the exchange container is set to com.ptc and wctype for DynamicDocument is configured as:
"wcType": "[domain].DynamicDocument"
The wctype is read by clients as com.ptc.DynamicDocument.
description—Description of the entity type.
operations—List of CRUD operations that are permitted on entities. For wcType entities, the READ operation is permitted by default. The other operations that are permitted must be specified explicitly.
For basic entities, the operations that are permitted must be explicitly specified in the configuration file.
hasCommonProperties—Indicates if an entity contains Windchill attributes that are common for objects. For example, attributes such as, Name, Number, and so on. When the property is set to true for an entity, the UpdateableViaAction action is available in the domain. This action is used to edit the values of common attributes.
* 
If you specify hasCommonProperties as true, it is mandatory to specify at least one attribute as common. See the section Configuring Structural Properties, for more details.
Open Type serialization allows dynamic properties, those not explicitly defined in the Entity Data Model (EDM), to be included in serialized JSON responses. This feature enhances flexibility and extensibility in data handling.
* 
This enhancement applies only to structural properties. Navigation properties are not included in the scope.
rbInfoForDisplayName—This property must be set to return a custom display name for an entity type. It is defined as:
"rbInfoForDisplayName": "<rbinfo_ClassName>|<key>"
wcSearchTargetTypes—A setting for the entity configuration to restrict the object types searched and returned during a direct access GET requests to that entity set. However, this setting does not restrict the navigations, actions, functions, and other interactions with the entity that are set beyond a direct access GET request. Consider the following specifications:
The entity must be a Windchill entity (that is, the type must be wcType).
The entity must be exposed as an entity set (that is, includeInServiceDocument must be true).
The types listed in wcSearchTargetTypes must be subtypes of the base type specified in wcType.
A type must not be listed in both wcExcludedTypes and wcSearchTargetTypes.
* 
This setting does not affect the automatic generation of entity types for subtypes. When an entity inherits the subtypeable attributes, the generated entity types depend on the type definitions in the Type Manager, and the value of wcExcludedTypes. The wcSearchTargetTypes setting has no effect on this functionality.
In the example below, GET /MyDocuments will only return Reference Documents and Agendas. Making a request GET /MyDocuments(<id>), where <id> is a document that is neither a ReferenceDocument or an Agenda, will fail with a 400 status code:
{
"name": "MyDocument",
"collectionName": "MyDocuments",
"type": "wcType",
"wcType": "wt.doc.WTDocument",
"includeInServiceDocument": "true",
"hasCommonProperties": true,
"wcSearchTargetTypes": [
"com.ptc.ReferenceDocument",
"com.acme.Agenda"
],
"attributes": [
...
]
}
¿Fue esto útil?