Skip to Content
2
Former Member
Jul 02, 2018 at 04:34 PM

Filtering Itemtype's Enum Returns and Getting Itemtype's Certain Attribute

452 Views

I have an itemtype called InoLocation,`http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="items.xsd">

 <enumtypes>
     <enumtype code="InoLocationType" >
         <value code="COUNTRY"></value>
         <value code="CITY"></value>
         <value code="COUNTY"></value>
     </enumtype>
 </enumtypes>

 <itemtypes>
     <itemtype generate="true"
               code="InoLocation"
               jaloclass="com.inomera.hybris.custom.location.jalo.InoLocation"
               extends="GenericItem"
               autocreate="true">
         <deployment table="ino_location" typecode="11115"/>

         <attributes>

             <attribute qualifier="code" type="java.lang.String">
                 <description>City's Plate Code</description>
                 <modifiers initial="true"/>
                 <persistence type="property"/>
             </attribute>

             <attribute qualifier="name" type="java.lang.String">
                 <description>Location Name</description>
                 <modifiers initial="true"/>
                 <persistence type="property"/>
             </attribute>

             <attribute qualifier="parent" type="InoLocation">
                 <description>Selected location's parent location</description>
                 <modifiers read="true" write="true" search="true"/>
                 <persistence type="property"/>
             </attribute>

             <attribute qualifier="type" type="InoLocationType">
                 <description>Location Type</description>
                 <modifiers initial="true"/>
                 <persistence type="property"/>
             </attribute>


         </attributes>

     </itemtype>
 </itemtypes>

`

In items.xml file, i extended Address itemtype and added an attribute called 'city' , its itemtype is InoLocation.

 <attribute qualifier="cities" type="InoLocation">
                         <persistence type="property" />
                         <modifiers read="true" write="true"/>
                         <description>It holds city information</description>
                     </attribute>


I am showing this attribute on backoffice with its wizard. Here is a quick look : https://i.stack.imgur.com/aoomV.jpg , https://i.stack.imgur.com/jW8qZ.jpg

city attribute returns all the enum types: country, city, county. I want to return only CITY enum type, also the return values are showing as models, i want to only show its name attribute values.

How should i achieve this?