on 2019 Feb 16 8:06 AM
Hello Experts,
This question already available in old posts,but those answers has been not cleared to me.
What is the use of Custom-properties in items.xml
Item type level
Attribute level.
If possible, please post with examples.
Thanks,
Nagarjuna.
Help others by sharing your knowledge.
AnswerRequest clarification before answering.
In simple terms, they are marker properties or metadata. It is important to note that they are set to the itemtype itself and not to a specific instance i.e. whether they are at the itemtype level or at the attribute level, they can not vary from instance to instance; they are same of all instances of the itemtype.
itemtype-level custom-properties: they are used to mark a specific behaviour of the itemtype itself e.g. the following custom-properties are used to make an itemtype catalog aware, so that it can be associated with a catalog and a catalog version.
<custom-properties>
<property name="catalogItemType"><value>java.lang.Boolean.TRUE</value></property>
<property name="catalogVersionAttributeQualifier"><value>"catalogVersion"</value></property>
<property name="uniqueKeyAttributeQualifier"><value>"id"</value></property>
</custom-properties>
You can use the following FS Query to view these fields in the result:
SELECT * FROM {ComposedType}
attribute-level custom-properties: they are used to mark a specific behaviour of the attribute e.g.
<attribute qualifier="internalURL" type="java.lang.String">
<custom-properties>
<property name="hiddenForUI">
<value>Boolean.TRUE</value>
</property>
</custom-properties>
<modifiers read="true" write="true" search="false" optional="true"/>
<persistence type="property">
<columntype>
<value>HYBRIS.LONG_STRING</value>
</columntype>
</persistence>
</attribute>
Due to the configuration of hiddenForUI, the attribute, internalURL of the itemtype, Media is not visible in the backoffice.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How would useful these attributes.?
These attributes (e.g. internalURL ) are as important as the attributes which are visible in backoffice but they do not make sense to a UI user and therefore they are better to remain hidden.
And can I use any name, as a property name ?
No; as of now, I do not know how to use a custom name. Unfortunately, Hybris documentation does not provide a list of custom-properties. There is also no documentation (accessible to customers or partners) about the classes which scan these values. So far, the only source I have referred for custom-properties is OOTB items.xml files. Once Hybris will publish a document about custom-properties, it will also be clear how we can create our own custom-properties.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.