Adding GPC Drop-Downs for Editing Records in a Repository

Procedure

  1. For dependent drop-downs, add the following section to your catalog validation rulebase:
    <declare>
    <var>GPC_classification</var>
    	<link type="datasource">
    		<literal>GPC</literal>
    	</link>
    </declare>
    <constraint>
    	<name>GPC CODE</name>
    	<description>GPC CODE dropdown</description>
    	<usefor>
    		<var>GPC_SEGMENT_CODE</var>
    	</usefor>
    	<action>
    		<select novalue="option">
    			<table source="classification">
    				<literal>GPC_classification/SEGMENT_CODE</literal>
    				<literal>GPC_classification/SEGMENT_DESC</literal>
    			</table>
    		</select>
    	</action>
    </constraint>
    <constraint>
    	<name>FAMILY CODE</name>
    	<description>GPC Hierarchy Level 2 dropdown</description>
    	<usefor>
    		<var>GPC_FAMILY_CODE</var>
    	</usefor>
    	<condition>
    		<defined>
    			<var>GPC_SEGMENT_CODE</var>
    		</defined>
    	</condition>
    	<action>
    		<select novalue="default">
    			<table source="datasource">
    				<literal>GPC</literal>
    				<literal>FAMILY_CODE</literal>
    				<literal>FAMILY_DESC</literal>
    				<where>
    					<sql>
    						<eq>
    						        <literal>SEGMENT_CODE</literal>
    						        <const type="string">?</const>
    						</eq>
    					</sql>
    					<var>GPC_SEGMENT_CODE</var>
    				</where>
    			</table>
    		</select>
    	</action>
    </constraint>
    <constraint>
    	<name>CLASS CODE</name>
    	<description>GPC Hierarchy Level 3 dropdown</description>
    	<usefor>
    		<var>GPC_CLASS_CODE</var>
    	</usefor>
    	<condition>
    		<defined>
    			<var>GPC_FAMILY_CODE</var>
    		</defined>
    	</condition>
    	<action>
    		<select novalue="default">
    			<table source="datasource">
    				<literal>GPC</literal>
    				<literal>CLASS_CODE</literal>
    				<literal>CLASS_DESC</literal>
    				<where>
    					<sql>
    						<and>
    						<eq>
    						<literal>SEGMENT_CODE</literal>
    						<const type="string">?</const>
    						</eq>
    						<eq>
    							<literal>FAMILY_CODE</literal>
    							<const type="string">?</const>
    						</eq>
    						</and>
    					</sql>
    					<var>GPC_SEGMENT_CODE</var>
    					<var>GPC_FAMILY_CODE</var>
    				</where>
    			</table>
    		</select>
    	</action>
    </constraint>
    <constraint>
    	<name>BRICK CODE</name>
    	<description>GPC Hierarchy Level 4</description>
    	<usefor>
    		<var>ADDITIONAL_CLASS_CAT_CODE</var>
    	</usefor>
    	<condition>
    		<defined>
    			<var>GPC_CLASS_CODE</var>
    		</defined>
    	</condition>
    	<action>
    		<select novalue="default">
    			<table source="datasource">
    				<literal>GPC</literal>
    				<literal>BRICK_CODE</literal>
    				<literal>BRICK_DESC</literal>
    				<where>
    					<sql>
    						<and>
    						<eq>
    						          <literal>SEGMENT_CODE</literal>
    						          <const type="string">?</const>
    						</eq>
    						<eq>
    							<literal>FAMILY_CODE</literal>
    							<const type="string">?</const>
    						</eq>
    						<eq>
    							<literal>CLASS_CODE</literal>
    							<const type="string">?</const>
    						</eq>
    						</and>
    					</sql>
    					<var>GPC_SEGMENT_CODE</var>
    					<var>GPC_FAMILY_CODE</var>
    					<var>GPC_CLASS_CODE</var>
    				</where>
    			</table>
    		</select>
    	</action>
    </constraint>
  2. Save the catalog validation rulebase.