Panel |
---|
|
This section describes how a conditional security restriction entity can be created What does this section cover? |
...
In order for an entity to be available to Conditional Security Restrictions Mechanism, it has to meet the following conditions:
1. Data Object Class
The entity's DO class must implement ICRMDOCSREntity interface and its six methods:
...
Ui expand |
---|
title | Entity and Organisational Conditions |
---|
|
Code Block |
---|
language | java |
---|
title | CUSTOMCRMDORental |
---|
collapse | true |
---|
| public class CUSTOMCRMDORental extends CRMDO implements ICRMDOCSREntity{
private CUSTOMCRMDORentalType type;
private CUSTOMRentalState state;
private CRMDOAccountReceivable accountReceivable;
private Date effectiveDate;
private Date expirationDate;
private Set<CUSTOMCRMDORentalItem> items;
public CUSTOMCRMDORentalType getType() {
return type;
}
public void setType(CUSTOMCRMDORentalType type) {
setChange("type", this.type, type);
this.type = type;
}
public CUSTOMRentalState getState() {
return state;
}
public void setState(CUSTOMRentalState state) {
setChange("state", this.state, state);
this.state = state;
}
public CRMDOAccountReceivable getAccountReceivable() {
return accountReceivable;
}
public void setAccountReceivable(CRMDOAccountReceivable accountReceivable) {
setChange("accountReceivable", this.accountReceivable, accountReceivable);
this.accountReceivable = accountReceivable;
}
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<CUSTOMCRMDORentalItem> getItems() {
return items;
}
public void setItems(Set<CUSTOMCRMDORentalItem> items) {
setChange("items", this.items, items);
this.items = items;
}
@Override
public Object getStatus() {
return null;
}
@Override
public Object getState() {
return null;
}
@Override
public CRMDOUnit getAssignedToUnit() {
return null;
}
@Override
public CRMDOUser getAssignedToUser() {
return null;
}
}
|
Type, Status, Life Cycle State and Privacy Level options are validated against the values returned by getType(), getStatus(), getState() and getPrivacyLevel() methods accordingly, to determine whether the Conditional Security Restriction is going to be applied.
Organisational Conditions are validated against the values returned by getAssignedToUser() and getAssignedToUnit() methods, to determine whether the Conditional Security Restriction is going to be applied.
|
2. Entities Metadata File
...
Ui expand |
---|
|
Code Block |
---|
language | xml |
---|
title | entities.xml |
---|
collapse | true |
---|
| <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</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> |
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
|
3. Fields Metadata
...
File
In fields metadata file, <csrexcluded> <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.
Ui expand |
---|
|
Code Block |
---|
language | xml |
---|
title | entitiesrentals.xml |
---|
collapse | true |
---|
| <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</id>
<name>key_type</name>
<relatedentityxpath>type</relatedentityxpath>
<xpath>name</xpath>
</field>
<field>
<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>
|
|
...