Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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.
Code Block
languagejava
titleCUSTOMCRMDORentalType
collapsetrue
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

 

In entities metadata file:

  1. <csrexcluded> tag's value must be set to false. Keep in mind that <csrexcluded> default value is false, so in such cases, it can be omitted.
  2. <typeentityid><statusentityid> and <stateentityid> tags must be defined whenever a type, status and/or state entity exist. 

...

titleRestricted Entities

...

Image Added

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.

Code Block
titletype.xml
collapsetrue
<entities> <entity> <id>CUSTOMRENTALS</id> <name>key_rental</name> <description/> <tablename>TRN_RENTALS</tablename> <classname>com
.
crm
.
dataobject
.
rentals.CUSTOMCRMDORental</classname> <typeentityid>CUSTOMRENTALTYPES</typeentityid> <stateentityid>CUSTOMRENTALSTATES</stateentityid> <moduleid>CUSTOM_RENTALS</moduleid> <metadatafile>rentals</metadatafile> <csrexcluded>false</csrexcluded> </entity> <entity> <id>CUSTOMRENTALSTATES</id> <name>key_rental_state</name> <classname>com.crm.dataobject.rentals.CUSTOMRentalState</classname> <moduleid>CUSTOM_RENTALS</moduleid> <csrexcluded>true</csrexcluded> </entity> <entity> <id>CUSTOMRENTALTYPES</

<main>
	...
	<component>
		<id>cmpAllowedOrganisationalUnitsDrilldown</id>
		<name>key_
rental_type</name> <tablename>TRN_RENTALTYPES</tablename> <classname>com.crm.dataobject.rentals.CUSTOMCRMDORentalType</classname> <moduleid>CUSTOMRENTALS</moduleid> <metadatafile>rentaltypes</metadatafile> <csrexcluded>true</csrexcluded> </entity> ... </entities>

 

Image Removed

Type, Status and Life Cycle State options are built based on the values of type, status and state entities defined by <typeentityid>, <statusentityid> and <stateentityid> tags 

Image Removed

3. Fields Metadata file

In fields metadata file<csrexcluded> tag's value must be set to false for the fields that you want to be available for monitoring. Keep in mind that <csrexcluded> default value is false, so in such cases, it can be omitted.

<mainfield> <id>custom_number</id> <name>key_number</name> <xpath>number</xpath> <csrexcluded>true</csrexcluded> <plarexcluded>true</plarexcluded> <acrexcluded>true</acrexcluded> <audittrailexcluded>true</audittrailexcluded> </mainfield> <fields> <field> <id>custom_type<
allowed_organisational_units</name>
		<elements>
			<drilldown>
				<id>ddAllowedOrganisationalUnits</id>
			
<name>key_type</name> <relatedentityxpath>type</relatedentityxpath> <xpath>name</xpath>
	<tabid>tabAllowedUnits</tabid>
			</
field> <field>
drilldown>
		
<id>custom_account</id> <name>key_account</name> <relatedentityxpath>accountReceivable</relatedentityxpath> <xpath>name</xpath> </field> <field> <id>custom_state</id> <name>key_state</name> <xpath>state</xpath> </field> <field> <id>custom_effective_date</id> <name>key_effective_date</name> <xpath>effectiveDate</xpath> </field> ... </fields> <collections> <collection> <id>custom_items</id> <name>key_items</name> <relatedentityxpath/> <xpath>items</xpath> <csrexcluded>false</csrexcluded> <plarexcluded>true</plarexcluded> <acrexcluded>true</acrexcluded> <method> <ejbname>CUSTOMCRMUIRental</ejbname> <methodname>loadItemsTab</methodname> <parameters> <parameter> <xpath>[DTO]</xpath> </parameter> </parameters> </method> <mainfield> <id>custom_serialNumber</id> <name>key_serialNumber</name> <relatedentityxpath>installedItem</relatedentityxpath> <xpath>serialNumber</xpath> <audittrailexcluded>true</audittrailexcluded> </mainfield> <fields> <field> <id>custom_code</id> <name>key_product_code</name> <relatedentityxpath>installedItem</relatedentityxpath> <xpath>product/code</xpath> <audittrailexcluded>true</audittrailexcluded> </field> <field> <id>custom_type</id> <name>key_product_type</name> <relatedentityxpath>installedItem</relatedentityxpath> <xpath>product/type/name</xpath> <audittrailexcluded>true</audittrailexcluded> </field> </fields> </collection> </collections>  

 

Image Removed

 

Ui expand
titleRestricted Fields
Code Block
languagexml
titleentities.xml
collapsetrue

4. Modules Metadata File

In modules metadata file, define all the processes, common and additional, and printouts you want to be available for conditional security restriction under any feature of your entity's module.

Ui expand
titleRestricted Processes and Printouts
Code Block
titlemodules.xml
collapsetrue
<moduleconfig>
	<modules>
		<module>
			<moduleid>CUSTOM_RENTALS</moduleid>
			...
			<features>
				<feature>
					<featureid>CUSTOM_MANAGE_RENTALS</featureid>
					....
					<commonprocesses>
						<process>
							<id>CUSTOM_CREATE_RENTAL</id>
							<name>key_create_rental</name>
							<description>key_create_a_new_rental</description>
							<methods>
								<method>
									<ejbname>CUSTOMCRMUIRental</ejbname>
									<methodname>createButton</methodname>
								</method>
							</methods>
						</process>
						...
					</commonprocesses>
					<additionalprocesses>
						<process>
							<id>CUSTOM_SET_RENTAL_AS_EFFECTIVE</id>
							<name>key_set_rental_as_effective</name>
							<description>key_set_rental_as_effective</description>
							<methods>
								<method>
									<ejbname>CUSTOMCRMUIRental</ejbname>
									<methodname>setAsEffective</methodname>
								</method>
							</methods>
						</process>

						...

					</additionalprocesses>
					<printouts>
					</printouts>
				</feature>
				...
			</features>
		</module>
		...
	</modules>
</moduleconfig>							

 

Image Removed

 

 

...

</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.
Code Block
titletypelayout.xml
collapsetrue
<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>