Create a Controlled Selection Access Entity

This section describes how a controlled selection access entity can be created

What does this section cover?

Create a Controlled Selection Access Entity

In order for an entity to be available to Controlled Selection Access Mechanism, it has to meet the following conditions:

1. Data Object Class

The entity's DO class must:

  1. Implement ICRMDOControlledSelectableEntity interface and its two methods: 
    1. getOrganisationalUnits()
    2. setOrganisationalUnits(Set<CRMDOControlSelectOrganisationalUnit> organisationalUnits)
  2. Define organisationalUnits set.
CUSTOMCRMDORentalType
public class CUSTOMCRMDORentalType extends CRMDO implements ICRMDOControlledSelectableEntity {

	private Date effectiveDate;
	private Date expirationDate;
	
	private Set<CUSTOMCRMDORentalTypeProduct> allowedProducts;
	private Set<CRMDOControlSelectOrganisationalUnit> organisationalUnits;
	
	public Date getEffectiveDate() {
		return effectiveDate;
	}
	public void setEffectiveDate(Date effectiveDate) {
		setChange("effectiveDate", this.effectiveDate, effectiveDate);
		this.effectiveDate = effectiveDate;
	}
	public Date getExpirationDate() {
		return expirationDate;
	}
	public void setExpirationDate(Date expirationDate) {
		setChange("expirationDate", this.expirationDate, expirationDate);
		this.expirationDate = expirationDate;
	}
	public Set<CUSTOMCRMDORentalTypeProduct> getAllowedProducts() {
		return allowedProducts;
	}
	public void setAllowedProducts(Set<CUSTOMCRMDORentalTypeProduct> allowedProducts) {
		setChange("allowedProducts", this.allowedProducts, allowedProducts);
		this.allowedProducts = allowedProducts;
	}
	@Override
	public Set<CRMDOControlSelectOrganisationalUnit> getOrganisationalUnits() {
		return organisationalUnits;
	}
	@Override
	public void setOrganisationalUnits(Set<CRMDOControlSelectOrganisationalUnit> organisationalUnits) {
		setChange("organisationalUnits", this.organisationalUnits, organisationalUnits);
		this.organisationalUnits = organisationalUnits;
	}
}

2. Data Entry Page

a. Definition File

Data entry page definition file must include a component with a single drilldown element having tabAllowedUnits as its <tabid>. tabAllowedUnits is the tabid of the generic component that will be used in this case.

type.xml
...
<main>
	...
	<component>
		<id>cmpAllowedOrganisationalUnitsDrilldown</id>
		<name>key_allowed_organisational_units</name>
		<elements>
			<drilldown>
				<id>ddAllowedOrganisationalUnits</id>
				<tabid>tabAllowedUnits</tabid>
			</drilldown>
		</elements>
	</component>
	...
</main>
...

b. Layout File

Data entry page layout file must include:

  1. The component defined in data entry definition page including the allowed organisational units drilldown element.
  2. The allowed organisational units tab definition in the details section, which is implemented as a generic component.
typelayout.xml
<page>
	...
	<sections>
		...
		<section>
			<id>secAllowedProducts</id>
			<name>key_allowed_products</name>
			<disable>false</disable>
			<left>
				<components>
					<component><id>cmpAllowedProductsDrilldown</id></component>
				</components>
			</left>
		</section>
		...
	</sections>
	<details>
		<tabs>
			<tab>
				<id>file:networkmanagement/allowedOrgUnits.xml</id>
				<disable>true</disable>
				<preload>true</preload>
				<showheader>false</showheader>
				<components>
					<component><id>cmpSelect</id></component>
					<component><id>cmpCommunity</id></component>
					<component><id>cmpGroup</id></component>
					<component><id>cmpUnit</id></component>
				</components>
			</tab>
			...
		</tabs>
	</details>
</page>