use of org.broadleafcommerce.cms.page.domain.PageTemplateFieldGroupXref in project BroadleafCommerce by BroadleafCommerce.
the class PageTemplateCustomPersistenceHandler method getFieldGroups.
protected List<FieldGroup> getFieldGroups(Page page, PageTemplate template) {
List<PageTemplateFieldGroupXref> fieldGroupXrefs = null;
List<FieldGroup> fieldGroups = new ArrayList<FieldGroup>();
if (template != null) {
fieldGroupXrefs = template.getFieldGroupXrefs();
}
if (page.getPageTemplate() != null) {
fieldGroupXrefs = page.getPageTemplate().getFieldGroupXrefs();
}
if (fieldGroupXrefs != null) {
for (PageTemplateFieldGroupXref xref : fieldGroupXrefs) {
fieldGroups.add(xref.getFieldGroup());
}
}
return fieldGroups;
}
use of org.broadleafcommerce.cms.page.domain.PageTemplateFieldGroupXref in project BroadleafCommerce by BroadleafCommerce.
the class PageServiceUtility method getFieldDefinition.
protected FieldDefinition getFieldDefinition(Page page, String fieldKey) {
ExtensionResultHolder<FieldDefinition> erh = new ExtensionResultHolder<FieldDefinition>();
ExtensionResultStatusType result = extensionManager.getProxy().getFieldDefinition(erh, page, fieldKey);
if (result == ExtensionResultStatusType.HANDLED) {
return erh.getResult();
}
if (page.getPageTemplate() != null) {
for (PageTemplateFieldGroupXref fgXrefs : page.getPageTemplate().getFieldGroupXrefs()) {
for (FieldDefinition fd : fgXrefs.getFieldGroup().getFieldDefinitions()) {
if (fd.getName().equals(fieldKey)) {
return fd;
}
}
}
}
return null;
}
Aggregations