Attributes
Generic Properties
Property | Description |
---|---|
id | Attribute id - used internally by PDX. Attribute id can not be blank and can only contain alphanumeric characters, plus specific special characters: “ -_#:” (including space). |
externalId | Attribute external id - can be used in adapter in order when the “real” attribute id is required (i.e. when original attribute id has to be escaped due to the main id restrictions). |
name | Attribute name visible in the PDX UI. Can not be blank. |
description | Attribute description visible in attribute details in PDX UI. Not mandatory. |
multiValue | Defines attribute as a multivalue attributes, meaning it can have multiple values. |
disableSubmitInStates | Controls when attribute should be disabled - described in more details here: Datastandard implementation | Attributes with disableSubmitInStates |
readOnlyCondition | Controls when attribute is read only - described in more details here: Datastandard implementation | Attributes with readOnlyCondition |
groupIds | Ids of the attribute groups where attribute belongs to. Attribute groups are visible in the PDX UI and are used to organize attributes. Attribute groups have to be defined in attributeGroups section of datastandard. Attribute groups are described in more details here: Categories and Attribute groups | Attribute groups. Notice that SDK is using AttributeGroup object. |
access | Defines if attribute should be hidden from the PDX UI (set with withHidden builder method). By default all attributes are public. |
displaySequence | Controls attributes order in the UI - both in the grid and product details page. |
Code Examples:
{
"id" : "PRODUCT_DESCRIPTION",
"externalId" : "PRODUCT.DESCRIPTION/1",
"name" : "Product description",
"description" : "Detailed attribute description.",
"type" : {
"id" : "string",
"restriction" : { },
"isFamily" : true,
"multiValue" : true,
"languages" : {
"enabled" : true
}
},
"access" : "HIDDEN",
"groupIds" : [ "__LISTVIEW", "__ATTRIBUTE_FILTER", "OTHER" ],
"disableSubmitInStates" : [ "one", "two", "three" ],
"readOnlyCondition" : "true",
"displaySequence" : 1.2
}
Attribute attribute = AttributeBuilder
.stringAttribute("PRODUCT_DESCRIPTION", "Product description")
.withDescription("Detailed attribute description.")
.withDisableInSubmitStates(List.of("one", "two"))
.withDisableInSubmitState("three")
.withExternalId("PRODUCT.DESCRIPTION/1")
.withGroups(List.of(AttributeGroupBuilder.listViewAttributeGroup().build(),
AttributeGroupBuilder.attributeFilterAttributeGroup().build()))
.withGroup(AttributeGroupBuilder.regularAttributeGroup("OTHER", "Other").build())
.withHidden(true)
.withIsFamily(true)
.withLanguagesEnabled()
.withMultiValue(true)
.withReadOnly()
.withDisplaySequence(1.2)
.build();
Updated over 1 year ago