1) We have two different output panel in existing component it is rendering the based on dataModel.isAttachment true or flase
Bobcat Category Hierarchy is a custom objecct
if(CmsBusinessProduct.isClassificationHierarchy){
dataModel.isAttachment = true;
}else{
dataModel.isAttachment = false;
}
Loading...
Loading...
Do we need to keep both panels
2) Currently I am using the new apex class.Do we need to use GUID?
I have gone through the existing logic for attachments specs. it is rendering based on the Bobcat Category Hierarchy is a custom object.
List categories = [select Id, Name, Label__c, Lifecycle_Status__c
from Bobcat_Category_Hierarchy__c
where Name = :categoryName
and Bobcat_CategoryHierarchyId__r.Name = 'Bobcat Offerings'
and AncestorId__r.Name = 'Attachments'
and (Visibility__c = 'Dealers' or Visibility__c = 'Public')
and (Lifecycle_Status__c = 'Active' or Lifecycle_Status__c = 'Discontinued')];
========================================================================================================
if(CmsBusinessProduct.isClassificationHierarchy) {
hw.isAttachment = true;
//Bobcat_Category_Hierarchy__c.Name ===> 'compactNAAugerAttachment'
hw.attachmentCategory = CmsBusinessProduct.getUniqueCode();
hw.productCode = '';
hw.productCategory = '';
} else {
hw.isAttachment = false;
hw.attachmentCategory = '';
if (currentModel != null) {
hw.productCode = currentModel.ProductCode + ':CompactNA';
hw.productCategory = currentModel.Contract_Code__r.GPIMContextCategory__c;
}
}
========================================================================================================
public static String getUniqueCode() {
if (isClassificationHierarchy) {
if (currentClassificationHierarchy != null) {
//ex. compactNAAugerAttachment - only value guaranteed unique
return currentClassificationHierarchy.Name;
}
} else {
if (currentProduct != null) {
//ex. M0285 - only value guaranteed unique
return currentProduct.ProductCode;
}
}
return null;
}
========================================================================================================
currentClassificationHierarchy = CmsDal.getAttachmentCategoryByName(CmsBusiness.routeParam);
if (currentClassificationHierarchy != null) {
resolvedModel = true;
isClassificationHierarchy = true;
return;
}
========================================================================================================
public static Bobcat_Category_Hierarchy__c getAttachmentCategoryByName(String categoryName) {
if (attachmentCategoryByName.containsKey(categoryName)) {
return attachmentCategoryByName.get(categoryName);
} else {
List categories = [select Id, Name, Label__c, Lifecycle_Status__c
from Bobcat_Category_Hierarchy__c
where Name = :categoryName
and Bobcat_CategoryHierarchyId__r.Name = 'Bobcat Offerings'
and AncestorId__r.Name = 'Attachments'
and (Visibility__c = 'Dealers' or Visibility__c = 'Public')
and (Lifecycle_Status__c = 'Active' or Lifecycle_Status__c = 'Discontinued')];
if (!categories.isEmpty()) {
attachmentCategoryByName.put(categoryName, categories[0]);
return categories[0];
}
}
return null;
}
========================================================================================================